| @@ -13,10 +13,11 @@ | ||
| 13 | 13 | * |
| 14 | 14 | * @return void |
| 15 | 15 | */ |
| 16 | 16 | public static function menu() { |
| 17 | - $label = __( 'Applications', 'formidable' ); | |
| 18 | - $cap = self::get_required_capability(); | |
| 17 | + $label = __( 'Applications', 'formidable' ); | |
| 18 | + $new_pill = '<span class="frm-new-pill">NEW</span>'; | |
| 19 | + $cap = self::get_required_capability(); | |
| 19 | 20 | |
| 20 | 21 | if ( ! current_user_can( $cap ) && is_callable( 'FrmProApplicationsHelper::get_custom_applications_capability' ) ) { |
| 21 | 22 | $custom_applications_cap = FrmProApplicationsHelper::get_custom_applications_capability(); |
| 22 | 23 | if ( current_user_can( $custom_applications_cap ) ) { |
| @@ -30,9 +31,9 @@ | ||
| 30 | 31 | $slug = 'formidable-applications'; |
| 31 | 32 | $callback = array( __CLASS__, 'landing_page' ); |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | - add_submenu_page( 'formidable', 'Formidable | ' . $label, $label, $cap, $slug, $callback ); | |
| 35 | + add_submenu_page( 'formidable', 'Formidable | ' . $label, $label . $new_pill, $cap, $slug, $callback ); | |
| 35 | 36 | } |
| 36 | 37 | |
| 37 | 38 | /** |
| 38 | 39 | * Get the required capability for accessing the Applications dashboard. |
| @@ -71,11 +72,8 @@ | ||
| 71 | 72 | * |
| 72 | 73 | * @return void |
| 73 | 74 | */ |
| 74 | 75 | public static function get_applications_data() { |
| 75 | - FrmAppHelper::permission_check( 'frm_view_forms' ); | |
| 76 | - check_ajax_referer( 'frm_ajax', 'nonce' ); | |
| 77 | - | |
| 78 | 76 | $view = FrmAppHelper::get_param( 'view', '', 'get', 'sanitize_text_field' ); |
| 79 | 77 | $data = array(); |
| 80 | 78 | |
| 81 | 79 | if ( 'applications' !== $view ) { |
| @@ -107,14 +105,9 @@ | ||
| 107 | 105 | $applications = array_filter( $applications, 'is_array' ); |
| 108 | 106 | |
| 109 | 107 | $unlocked_templates = array(); |
| 110 | 108 | $locked_templates = array(); |
| 111 | - foreach ( $applications as $key => $application ) { | |
| 112 | - if ( ! is_numeric( $key ) ) { | |
| 113 | - // Skip "error" or any other non-numeric key. | |
| 114 | - continue; | |
| 115 | - } | |
| 116 | - | |
| 109 | + foreach ( $applications as $application ) { | |
| 117 | 110 | if ( ! empty( $application['url'] ) ) { |
| 118 | 111 | $unlocked_templates[] = $application; |
| 119 | 112 | } else { |
| 120 | 113 | $locked_templates[] = $application; |
| @@ -172,9 +165,8 @@ | ||
| 172 | 165 | wp_enqueue_style( 'formidable-grids' ); |
| 173 | 166 | |
| 174 | 167 | $js_dependencies = array( |
| 175 | 168 | 'wp-i18n', |
| 176 | - 'wp-hooks', // This prevents a console error "wp.hooks is undefined" in WP versions older than 5.7. | |
| 177 | 169 | 'formidable_dom', |
| 178 | 170 | ); |
| 179 | 171 | wp_register_script( 'formidable_applications', $plugin_url . '/js/admin/applications.js', $js_dependencies, $version, true ); |
| 180 | 172 | wp_register_style( 'formidable_applications', $plugin_url . '/css/admin/applications.css', array(), $version ); |
| @@ -206,8 +198,7 @@ | ||
| 206 | 198 | * @param string $context values include 'index', 'list', and 'edit'. |
| 207 | 199 | * @return void |
| 208 | 200 | */ |
| 209 | 201 | public static function render_applications_header( $title, $context ) { |
| 210 | - FrmAppHelper::print_admin_banner( true ); | |
| 211 | 202 | require self::get_view_path() . 'header.php'; |
| 212 | 203 | } |
| 213 | 204 | } |