PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmDashboardController.php +14 -14 6.28 → trunk View file →
@@ -70,11 +70,10 @@
70 70 *
71 71 * @return FrmDashboardHelper
72 72 */
73 73 public static function get_dashboard_helper() {
74 - $latest_available_form = FrmForm::get_latest_form();
75 - $total_payments = self::view_args_payments();
76 - $counters_value = array(
74 + $total_payments = self::view_args_payments();
75 + $counters_value = array(
77 76 'forms' => FrmForm::get_forms_count(),
78 77 'entries' => FrmEntry::get_entries_count(),
79 78 );
80 79
@@ -80,9 +79,9 @@
80 79
81 80 return new FrmDashboardHelper(
82 81 array(
83 82 'counters' => array(
84 - 'counters' => self::view_args_counters( $latest_available_form, $counters_value ),
83 + 'counters' => self::view_args_counters( FrmForm::get_latest_form(), $counters_value ),
85 84 ),
86 85 'license' => array(),
87 86 'get_free_templates' => array(),
88 87 'inbox' => self::view_args_inbox(),
@@ -96,9 +95,9 @@
96 95 'count' => $counters_value['entries'],
97 96 'placeholder' => self::view_args_entries_placeholder( $counters_value['forms'] ),
98 97 ),
99 98 'payments' => array(
100 - 'show-placeholder' => empty( $total_payments ),
99 + 'show-placeholder' => ! $total_payments,
101 100 'placeholder' => array(
102 101 'copy' => __( 'You don\'t have a payment form setup yet.', 'formidable' ),
103 102 'cta' => array(
104 103 'link' => admin_url( 'admin.php?page=formidable-form-templates' ),
@@ -270,9 +269,9 @@
270 269
271 270 $copy = sprintf(
272 271 /* translators: %1$s: HTML start of a tag, %2$s: HTML close a tag */
273 272 __( 'See the %1$sform documentation%2$s for instructions on publishing a form. Once vou have at least one entry you\'ll see it here.', 'formidable' ),
274 - '<a target="_blank" href="' . FrmAppHelper::admin_upgrade_link( '', 'knowledgebase/publish-a-form/' ) . '">',
273 + '<a target="_blank" href="' . esc_url( FrmAppHelper::admin_upgrade_link( '', 'knowledgebase/publish-a-form/' ) ) . '">',
275 274 '</a>'
276 275 );
277 276 return array(
278 277 'background' => 'entries-placeholder',
@@ -358,11 +357,10 @@
358 357 *
359 358 * @return bool
360 359 */
361 360 public static function welcome_banner_has_closed() {
362 - $user_id = get_current_user_id();
363 361 $banner_closed_by_users = self::get_closed_welcome_banner_user_ids();
364 - return $banner_closed_by_users && in_array( $user_id, $banner_closed_by_users, true );
362 + return $banner_closed_by_users && in_array( get_current_user_id(), $banner_closed_by_users, true );
365 363 }
366 364
367 365 /**
368 366 * Check if is dashboard page.
@@ -380,10 +378,9 @@
380 378 *
381 379 * @return bool
382 380 */
383 381 public static function email_is_subscribed( $email ) {
384 - $subscribed_emails = self::get_subscribed_emails();
385 - return in_array( $email, $subscribed_emails, true );
382 + return in_array( $email, self::get_subscribed_emails(), true );
386 383 }
387 384
388 385 /**
389 386 * Register controller assets.
@@ -427,14 +424,17 @@
427 424 * @return array
428 425 */
429 426 private static function inbox_prepare_messages( $data ) {
430 427 foreach ( $data as $key => $messages ) {
431 - if ( in_array( $key, array( 'unread', 'dismissed' ), true ) ) {
432 - foreach ( $messages as $key_msg => $message ) {
433 - $data[ $key ][ $key_msg ]['cta'] = self::inbox_clean_messages_cta( $message['cta'] );
434 - }
428 + if ( ! in_array( $key, array( 'unread', 'dismissed' ), true ) ) {
429 + continue;
435 430 }
431 +
432 + foreach ( $messages as $key_msg => $message ) {
433 + $data[ $key ][ $key_msg ]['cta'] = self::inbox_clean_messages_cta( $message['cta'] );
434 + }
436 435 }
436 +
437 437 return $data;
438 438 }
439 439
440 440 /**