| @@ -4,25 +4,13 @@ | ||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | class FrmSettingsController { |
| 7 | 7 | |
| 8 | - /** | |
| 9 | - * Payments sections are removed from the top level and added to a payments section. | |
| 10 | - * | |
| 11 | - * @since 6.22.1 | |
| 12 | - * | |
| 13 | - * @var array | |
| 14 | - */ | |
| 15 | - private static $removed_payments_sections = array(); | |
| 16 | - | |
| 17 | - /** | |
| 18 | - * @return void | |
| 19 | - */ | |
| 20 | 8 | public static function menu() { |
| 21 | 9 | // Make sure admins can see the menu items |
| 22 | 10 | FrmAppHelper::force_capability( 'frm_change_settings' ); |
| 23 | 11 | |
| 24 | - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong | |
| 12 | + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' ); | |
| 25 | 13 | } |
| 26 | 14 | |
| 27 | 15 | /** |
| 28 | 16 | * Include license box template on demand. |
| @@ -32,31 +20,23 @@ | ||
| 32 | 20 | public static function license_box() { |
| 33 | 21 | if ( ! current_user_can( 'activate_plugins' ) ) { |
| 34 | 22 | return; |
| 35 | 23 | } |
| 36 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php'; | |
| 24 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' ); | |
| 37 | 25 | } |
| 38 | 26 | |
| 39 | - /** | |
| 40 | - * @param array $errors | |
| 41 | - * @param string $message | |
| 42 | - * | |
| 43 | - * @return void | |
| 44 | - */ | |
| 45 | 27 | public static function display_form( $errors = array(), $message = '' ) { |
| 46 | 28 | global $frm_vars; |
| 47 | 29 | |
| 48 | 30 | $frm_settings = FrmAppHelper::get_settings(); |
| 49 | - $uploads = wp_upload_dir(); | |
| 50 | - $target_path = $uploads['basedir'] . '/formidable/css'; | |
| 51 | - $sections = self::get_settings_tabs(); | |
| 52 | - $current = FrmAppHelper::simple_get( 't', 'sanitize_title', 'general_settings' ); | |
| 53 | 31 | |
| 54 | - if ( in_array( $current, array( 'stripe_settings', 'square_settings', 'authorize_net_settings', 'paypal_settings' ), true ) ) { | |
| 55 | - $current = 'payments_settings'; | |
| 56 | - } | |
| 32 | + $uploads = wp_upload_dir(); | |
| 33 | + $target_path = $uploads['basedir'] . '/formidable/css'; | |
| 57 | 34 | |
| 58 | - require FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php'; | |
| 35 | + $sections = self::get_settings_tabs(); | |
| 36 | + $current = FrmAppHelper::simple_get( 't', 'sanitize_title', 'general_settings' ); | |
| 37 | + | |
| 38 | + require( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php' ); | |
| 59 | 39 | } |
| 60 | 40 | |
| 61 | 41 | /** |
| 62 | 42 | * Get sections to use for Global Settings. |
| @@ -64,76 +44,62 @@ | ||
| 64 | 44 | * @return array<array> |
| 65 | 45 | */ |
| 66 | 46 | private static function get_settings_tabs() { |
| 67 | 47 | $sections = array( |
| 68 | - 'general' => array( | |
| 69 | - 'class' => self::class, | |
| 48 | + 'general' => array( | |
| 49 | + 'class' => __CLASS__, | |
| 70 | 50 | 'function' => 'general_settings', |
| 71 | 51 | 'name' => __( 'General Settings', 'formidable' ), |
| 72 | - 'icon' => 'frmfont frm_settings_icon', | |
| 52 | + 'icon' => 'frm_icon_font frm_settings_icon', | |
| 73 | 53 | ), |
| 74 | - 'messages' => array( | |
| 75 | - 'class' => self::class, | |
| 54 | + 'messages' => array( | |
| 55 | + 'class' => __CLASS__, | |
| 76 | 56 | 'function' => 'message_settings', |
| 77 | 57 | 'name' => __( 'Message Defaults', 'formidable' ), |
| 78 | - 'icon' => 'frmfont frm_stamp_icon', | |
| 58 | + 'icon' => 'frm_icon_font frm_stamp_icon', | |
| 79 | 59 | ), |
| 80 | - 'permissions' => array( | |
| 81 | - 'class' => self::class, | |
| 60 | + 'permissions' => array( | |
| 61 | + 'class' => __CLASS__, | |
| 82 | 62 | 'function' => 'permission_settings', |
| 83 | 63 | 'name' => __( 'Permissions', 'formidable' ), |
| 84 | - 'icon' => 'frmfont frm_lock_icon', | |
| 64 | + 'icon' => 'frm_icon_font frm_lock_icon', | |
| 85 | 65 | ), |
| 86 | - 'payments' => array( | |
| 87 | - 'name' => __( 'Payments', 'formidable' ), | |
| 88 | - 'icon' => 'frmfont frm_simple_cc_icon', | |
| 89 | - 'class' => self::class, | |
| 90 | - 'function' => 'payments_settings', | |
| 91 | - ), | |
| 92 | - 'custom_css' => array( | |
| 66 | + 'custom_css' => array( | |
| 93 | 67 | 'class' => 'FrmStylesController', |
| 94 | 68 | 'function' => 'custom_css', |
| 95 | 69 | 'name' => __( 'Custom CSS', 'formidable' ), |
| 96 | - 'icon' => 'frmfont frm_code_icon', | |
| 70 | + 'icon' => 'frm_icon_font frm_code_icon', | |
| 97 | 71 | ), |
| 98 | 72 | 'manage_styles' => array( |
| 99 | 73 | 'class' => 'FrmStylesController', |
| 100 | 74 | 'function' => 'manage', |
| 101 | 75 | 'name' => __( 'Manage Styles', 'formidable' ), |
| 102 | - 'icon' => 'frmfont frm_pallet_icon', | |
| 76 | + 'icon' => 'frm_icon_font frm_pallet_icon', | |
| 103 | 77 | ), |
| 104 | - 'captcha' => array( | |
| 105 | - 'class' => self::class, | |
| 78 | + 'captcha' => array( | |
| 79 | + 'class' => __CLASS__, | |
| 106 | 80 | 'function' => 'captcha_settings', |
| 107 | - 'name' => __( 'Captcha/Spam', 'formidable' ), | |
| 108 | - 'icon' => 'frmfont frm_shield_check_icon', | |
| 81 | + 'name' => __( 'Captcha', 'formidable' ), | |
| 82 | + 'icon' => 'frm_icon_font frm_shield_check_icon', | |
| 109 | 83 | ), |
| 110 | - 'email' => array( | |
| 111 | - 'class' => self::class, | |
| 112 | - 'function' => 'email_settings', | |
| 113 | - 'name' => __( 'Email', 'formidable' ), | |
| 114 | - 'icon' => 'frmfont frm_email_icon', | |
| 115 | - ), | |
| 116 | - 'white_label' => array( | |
| 84 | + 'white_label' => array( | |
| 117 | 85 | 'name' => __( 'White Labeling', 'formidable' ), |
| 118 | - 'icon' => 'frmfont frm_ghost_icon', | |
| 86 | + 'icon' => 'frm_icon_font frm_ghost_icon', | |
| 119 | 87 | 'html_class' => 'frm_show_upgrade_tab frm_noallow', |
| 120 | 88 | 'data' => array( |
| 121 | 89 | 'medium' => 'white-label', |
| 122 | 90 | 'upgrade' => __( 'White labeling options', 'formidable' ), |
| 123 | 91 | 'screenshot' => 'white-label.png', |
| 124 | - 'learn-more' => FrmAppHelper::get_doc_url( 'features/white-label-form-builder-wordpress', 'white-labeling-global-settings', false ), | |
| 125 | 92 | ), |
| 126 | 93 | ), |
| 127 | - 'inbox' => array( | |
| 94 | + 'inbox' => array( | |
| 128 | 95 | 'name' => __( 'Inbox', 'formidable' ), |
| 129 | - 'icon' => 'frmfont frm_email_icon', | |
| 96 | + 'icon' => 'frm_icon_font frm_email_icon', | |
| 130 | 97 | 'html_class' => 'frm_show_upgrade_tab frm_noallow', |
| 131 | 98 | 'data' => array( |
| 132 | 99 | 'medium' => 'inbox-settings', |
| 133 | 100 | 'upgrade' => __( 'Inbox settings', 'formidable' ), |
| 134 | 101 | 'screenshot' => 'inbox.png', |
| 135 | - 'learn-more' => FrmAppHelper::get_doc_url( 'global-settings-overview/#kb-inbox', 'inbox-global-settings' ), | |
| 136 | 102 | ), |
| 137 | 103 | ), |
| 138 | 104 | ); |
| 139 | 105 | |
| @@ -140,11 +106,10 @@ | ||
| 140 | 106 | if ( apply_filters( 'frm_include_addon_page', false ) ) { |
| 141 | 107 | // If no addons need a license, skip this page |
| 142 | 108 | $show_licenses = false; |
| 143 | 109 | $installed_addons = apply_filters( 'frm_installed_addons', array() ); |
| 144 | - | |
| 145 | 110 | foreach ( $installed_addons as $installed_addon ) { |
| 146 | - if ( ! $installed_addon->is_parent_licence && $installed_addon->plugin_name !== 'Formidable Pro' && $installed_addon->needs_license ) { | |
| 111 | + if ( ! $installed_addon->is_parent_licence && $installed_addon->plugin_name != 'Formidable Pro' && $installed_addon->needs_license ) { | |
| 147 | 112 | $show_licenses = true; |
| 148 | 113 | break; |
| 149 | 114 | } |
| 150 | 115 | } |
| @@ -153,24 +118,23 @@ | ||
| 153 | 118 | $sections['licenses'] = array( |
| 154 | 119 | 'class' => 'FrmAddonsController', |
| 155 | 120 | 'function' => 'license_settings', |
| 156 | 121 | 'name' => __( 'Plugin Licenses', 'formidable' ), |
| 157 | - 'icon' => 'frmfont frm_key_icon', | |
| 122 | + 'icon' => 'frm_icon_font frm_keyalt_icon', | |
| 158 | 123 | 'ajax' => true, |
| 159 | 124 | ); |
| 160 | 125 | } |
| 161 | - }//end if | |
| 126 | + } | |
| 162 | 127 | |
| 163 | 128 | /** |
| 164 | 129 | * @param array<array> $sections |
| 165 | 130 | */ |
| 166 | 131 | $sections = apply_filters( 'frm_add_settings_section', $sections ); |
| 167 | - self::remove_payments_sections( $sections ); | |
| 168 | 132 | |
| 169 | 133 | $sections['misc'] = array( |
| 170 | 134 | 'name' => __( 'Miscellaneous', 'formidable' ), |
| 171 | - 'icon' => 'frmfont frm_shuffle_icon', | |
| 172 | - 'class' => self::class, | |
| 135 | + 'icon' => 'frm_icon_font frm_shuffle_icon', | |
| 136 | + 'class' => __CLASS__, | |
| 173 | 137 | 'function' => 'misc_settings', |
| 174 | 138 | ); |
| 175 | 139 | |
| 176 | 140 | foreach ( $sections as $key => $section ) { |
| @@ -177,9 +141,9 @@ | ||
| 177 | 141 | $original = $section; |
| 178 | 142 | $defaults = array( |
| 179 | 143 | 'html_class' => '', |
| 180 | 144 | 'name' => ucfirst( $key ), |
| 181 | - 'icon' => 'frmfont frm_settings_icon', | |
| 145 | + 'icon' => 'frm_icon_font frm_settings_icon', | |
| 182 | 146 | 'anchor' => $key . '_settings', |
| 183 | 147 | 'data' => array(), |
| 184 | 148 | ); |
| 185 | 149 | |
| @@ -194,60 +158,13 @@ | ||
| 194 | 158 | $section['function'] = $original; |
| 195 | 159 | } |
| 196 | 160 | |
| 197 | 161 | $sections[ $key ] = $section; |
| 198 | - }//end foreach | |
| 162 | + } | |
| 199 | 163 | |
| 200 | 164 | return $sections; |
| 201 | 165 | } |
| 202 | 166 | |
| 203 | - /** | |
| 204 | - * Remove the payments sections (PayPal, Square, Stripe, Authorize.Net) | |
| 205 | - * and show them all on the payments section in separate tabs. | |
| 206 | - * | |
| 207 | - * @since 6.22.1 | |
| 208 | - * | |
| 209 | - * @param array $sections | |
| 210 | - * | |
| 211 | - * @return void | |
| 212 | - */ | |
| 213 | - private static function remove_payments_sections( &$sections ) { | |
| 214 | - $payment_section_keys = array( 'paypal', 'square', 'stripe', 'authorize_net' ); | |
| 215 | - | |
| 216 | - foreach ( $sections as $key => $section ) { | |
| 217 | - if ( ! in_array( $key, $payment_section_keys, true ) ) { | |
| 218 | - continue; | |
| 219 | - } | |
| 220 | - | |
| 221 | - self::$removed_payments_sections[ $key ] = $section; | |
| 222 | - unset( $sections[ $key ] ); | |
| 223 | - } | |
| 224 | - | |
| 225 | - uksort( self::$removed_payments_sections, array( self::class, 'payment_sections_sort_callback' ) ); | |
| 226 | - } | |
| 227 | - | |
| 228 | - /** | |
| 229 | - * Sort the payments sections (PayPal, Square, Stripe, Authorize.Net) | |
| 230 | - * | |
| 231 | - * @since 6.22.1 | |
| 232 | - * | |
| 233 | - * @param string $a | |
| 234 | - * @param string $b | |
| 235 | - * | |
| 236 | - * @return int | |
| 237 | - */ | |
| 238 | - private static function payment_sections_sort_callback( $a, $b ) { | |
| 239 | - $order = array( 'stripe', 'square', 'paypal', 'authorize_net' ); | |
| 240 | - $first_key = array_search( $a, $order, true ); | |
| 241 | - $second_key = array_search( $b, $order, true ); | |
| 242 | - | |
| 243 | - if ( false === $first_key || false === $second_key ) { | |
| 244 | - return 0; | |
| 245 | - } | |
| 246 | - | |
| 247 | - return $first_key - $second_key; | |
| 248 | - } | |
| 249 | - | |
| 250 | 167 | public static function load_settings_tab() { |
| 251 | 168 | FrmAppHelper::permission_check( 'frm_change_settings' ); |
| 252 | 169 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 253 | 170 | |
| @@ -252,9 +169,8 @@ | ||
| 252 | 169 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 253 | 170 | |
| 254 | 171 | $section = FrmAppHelper::get_post_param( 'tab', '', 'sanitize_text_field' ); |
| 255 | 172 | $sections = self::get_settings_tabs(); |
| 256 | - | |
| 257 | 173 | if ( ! isset( $sections[ $section ] ) ) { |
| 258 | 174 | wp_die(); |
| 259 | 175 | } |
| 260 | 176 | |
| @@ -262,11 +178,10 @@ | ||
| 262 | 178 | |
| 263 | 179 | if ( isset( $section['class'] ) ) { |
| 264 | 180 | call_user_func( array( $section['class'], $section['function'] ) ); |
| 265 | 181 | } else { |
| 266 | - call_user_func( $section['function'] ?? $section ); | |
| 182 | + call_user_func( ( isset( $section['function'] ) ? $section['function'] : $section ) ); | |
| 267 | 183 | } |
| 268 | - | |
| 269 | 184 | wp_die(); |
| 270 | 185 | } |
| 271 | 186 | |
| 272 | 187 | /** |
| @@ -287,14 +202,15 @@ | ||
| 287 | 202 | /** |
| 288 | 203 | * Render the global currency selector if Pro is up to date. |
| 289 | 204 | * |
| 290 | 205 | * @param FrmSettings $frm_settings |
| 291 | - * | |
| 206 | + * @param string $more_html | |
| 292 | 207 | * @return void |
| 293 | 208 | */ |
| 294 | - public static function maybe_render_currency_selector( $frm_settings ) { | |
| 295 | - if ( is_callable( 'FrmProSettingsController::add_currency_settings' ) ) { | |
| 296 | - FrmProSettingsController::add_currency_settings(); | |
| 209 | + public static function maybe_render_currency_selector( $frm_settings, $more_html ) { | |
| 210 | + if ( false !== strpos( $more_html, 'id="frm_currency"' ) ) { | |
| 211 | + // Avoid rendering the Currency setting if it gets rendered from the frm_settings_form hook. | |
| 212 | + // This is for backward compatibility. If Pro is outdated there won't be two currency dropdowns. | |
| 297 | 213 | return; |
| 298 | 214 | } |
| 299 | 215 | |
| 300 | 216 | $currencies = FrmCurrencyHelper::get_currencies(); |
| @@ -302,82 +218,48 @@ | ||
| 302 | 218 | } |
| 303 | 219 | |
| 304 | 220 | /** |
| 305 | 221 | * @since 4.0 |
| 306 | - * | |
| 307 | - * @return void | |
| 308 | 222 | */ |
| 309 | 223 | public static function message_settings() { |
| 310 | 224 | $frm_settings = FrmAppHelper::get_settings(); |
| 311 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/messages.php'; | |
| 225 | + | |
| 226 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/messages.php' ); | |
| 312 | 227 | } |
| 313 | 228 | |
| 314 | 229 | /** |
| 315 | 230 | * @since 4.0 |
| 316 | - * | |
| 317 | - * @return void | |
| 318 | 231 | */ |
| 319 | 232 | public static function captcha_settings() { |
| 320 | 233 | $frm_settings = FrmAppHelper::get_settings(); |
| 321 | 234 | $captcha_lang = FrmAppHelper::locales( 'captcha' ); |
| 322 | 235 | |
| 323 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/captcha.php'; | |
| 236 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/captcha.php' ); | |
| 324 | 237 | } |
| 325 | 238 | |
| 326 | 239 | /** |
| 327 | - * Shows email settings. | |
| 328 | - * | |
| 329 | - * @since 6.25 | |
| 330 | - * | |
| 331 | - * @return void | |
| 332 | - */ | |
| 333 | - public static function email_settings() { | |
| 334 | - $frm_settings = FrmAppHelper::get_settings(); | |
| 335 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/email/email-styles.php'; | |
| 336 | - } | |
| 337 | - | |
| 338 | - /** | |
| 339 | 240 | * @since 4.0 |
| 340 | - * | |
| 341 | - * @return void | |
| 342 | 241 | */ |
| 343 | 242 | public static function permission_settings() { |
| 344 | 243 | $frm_settings = FrmAppHelper::get_settings(); |
| 345 | 244 | $frm_roles = FrmAppHelper::frm_capabilities(); |
| 346 | 245 | |
| 347 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/permissions.php'; | |
| 246 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/permissions.php' ); | |
| 348 | 247 | } |
| 349 | 248 | |
| 350 | 249 | /** |
| 351 | - * @return void | |
| 352 | - */ | |
| 353 | - public static function payments_settings() { | |
| 354 | - $payment_sections = self::$removed_payments_sections; | |
| 355 | - $tab = FrmAppHelper::simple_get( 't', 'sanitize_title', 'general_settings' ); | |
| 356 | - | |
| 357 | - if ( $tab && in_array( $tab, array( 'stripe_settings', 'square_settings', 'authorize_net_settings', 'paypal_settings' ), true ) ) { | |
| 358 | - $tab = str_replace( '_settings', '', $tab ); | |
| 359 | - } else { | |
| 360 | - $tab = 'stripe'; | |
| 361 | - } | |
| 362 | - | |
| 363 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/payments.php'; | |
| 364 | - } | |
| 365 | - | |
| 366 | - /** | |
| 367 | 250 | * @since 4.0 |
| 368 | - * | |
| 369 | - * @return void | |
| 370 | 251 | */ |
| 371 | 252 | public static function misc_settings() { |
| 372 | 253 | $frm_settings = FrmAppHelper::get_settings(); |
| 373 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/misc.php'; | |
| 254 | + | |
| 255 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/misc.php' ); | |
| 374 | 256 | } |
| 375 | 257 | |
| 376 | 258 | /** |
| 377 | 259 | * Save form data submitted from the Global settings page. |
| 378 | 260 | * |
| 379 | - * @param bool|string $stop_load | |
| 261 | + * @param string|bool $stop_load | |
| 380 | 262 | * |
| 381 | 263 | * @return void |
| 382 | 264 | */ |
| 383 | 265 | public static function process_form( $stop_load = false ) { |
| @@ -386,15 +268,9 @@ | ||
| 386 | 268 | $frm_settings = FrmAppHelper::get_settings(); |
| 387 | 269 | $process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' ); |
| 388 | 270 | |
| 389 | 271 | if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) { |
| 390 | - $error_args = array( | |
| 391 | - 'title' => __( 'Verification failed', 'formidable' ), | |
| 392 | - 'body' => $frm_settings->admin_permission, | |
| 393 | - 'cancel_text' => __( 'Cancel', 'formidable' ), | |
| 394 | - ); | |
| 395 | - FrmAppController::show_error_modal( $error_args ); | |
| 396 | - return; | |
| 272 | + wp_die( esc_html( $frm_settings->admin_permission ) ); | |
| 397 | 273 | } |
| 398 | 274 | |
| 399 | 275 | $errors = array(); |
| 400 | 276 | $message = ''; |
| @@ -423,10 +299,8 @@ | ||
| 423 | 299 | /** |
| 424 | 300 | * Include the Update button on the global settings page. |
| 425 | 301 | * |
| 426 | 302 | * @since 4.0.02 |
| 427 | - * | |
| 428 | - * @return void | |
| 429 | 303 | */ |
| 430 | 304 | public static function save_button() { |
| 431 | 305 | echo '<input class="button-primary frm-button-primary" type="submit" |
| 432 | 306 | value="' . esc_attr__( 'Update', 'formidable' ) . '"/>'; |
| @@ -431,21 +305,16 @@ | ||
| 431 | 305 | echo '<input class="button-primary frm-button-primary" type="submit" |
| 432 | 306 | value="' . esc_attr__( 'Update', 'formidable' ) . '"/>'; |
| 433 | 307 | } |
| 434 | 308 | |
| 435 | - /** | |
| 436 | - * @param bool|string $stop_load | |
| 437 | - * | |
| 438 | - * @return void | |
| 439 | - */ | |
| 440 | 309 | public static function route( $stop_load = false ) { |
| 441 | 310 | $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
| 442 | 311 | $action = FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ); |
| 443 | 312 | FrmAppHelper::include_svg(); |
| 444 | 313 | |
| 445 | - if ( $action === 'process-form' ) { | |
| 314 | + if ( $action == 'process-form' ) { | |
| 446 | 315 | self::process_form( $stop_load ); |
| 447 | - } elseif ( $stop_load !== 'stop_load' ) { | |
| 316 | + } elseif ( $stop_load != 'stop_load' ) { | |
| 448 | 317 | self::display_form(); |
| 449 | 318 | } |
| 450 | 319 | } |
| 451 | 320 | |
| @@ -452,17 +321,34 @@ | ||
| 452 | 321 | /** |
| 453 | 322 | * Add CTA to the bottom on the plugin settings pages. |
| 454 | 323 | * |
| 455 | 324 | * @since 3.04.02 |
| 456 | - * | |
| 457 | - * @return void | |
| 458 | 325 | */ |
| 459 | - public static function settings_cta() { | |
| 326 | + public static function settings_cta( $view ) { | |
| 327 | + | |
| 460 | 328 | if ( get_option( 'frm_lite_settings_upgrade', false ) ) { |
| 461 | 329 | return; |
| 462 | 330 | } |
| 463 | 331 | |
| 464 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/settings_cta.php'; | |
| 332 | + $features = array( | |
| 333 | + __( 'Extra form features like file uploads, pagination, etc', 'formidable' ), | |
| 334 | + __( 'Repeaters & cascading fields for advanced forms', 'formidable' ), | |
| 335 | + __( 'Flexibly view, search, edit, and delete entries anywhere', 'formidable' ), | |
| 336 | + __( 'Display entries with virtually limitless Formidable views', 'formidable' ), | |
| 337 | + __( 'Create surveys & polls', 'formidable' ), | |
| 338 | + __( 'WordPress user registration and login forms', 'formidable' ), | |
| 339 | + __( 'Create Stripe, PayPal or Authorize.net payment forms', 'formidable' ), | |
| 340 | + __( 'Powerful conditional logic for smart forms', 'formidable' ), | |
| 341 | + __( 'Integrations with 1000+ marketing & payment services', 'formidable' ), | |
| 342 | + __( 'Collect digital signatures', 'formidable' ), | |
| 343 | + __( 'Accept user-submitted content with Post submissions', 'formidable' ), | |
| 344 | + __( 'Email routing', 'formidable' ), | |
| 345 | + __( 'Create calculator forms', 'formidable' ), | |
| 346 | + __( 'Save draft entries and return later', 'formidable' ), | |
| 347 | + __( 'Analyze form data with graphs & stats', 'formidable' ), | |
| 348 | + ); | |
| 349 | + | |
| 350 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/settings_cta.php' ); | |
| 465 | 351 | } |
| 466 | 352 | |
| 467 | 353 | /** |
| 468 | 354 | * Dismiss upgrade notice at the bottom on the plugin settings pages. |
| @@ -469,12 +355,11 @@ | ||
| 469 | 355 | * |
| 470 | 356 | * @since 3.04.02 |
| 471 | 357 | */ |
| 472 | 358 | public static function settings_cta_dismiss() { |
| 473 | - check_ajax_referer( 'frm_ajax', 'nonce' ); | |
| 474 | 359 | FrmAppHelper::permission_check( 'frm_change_settings' ); |
| 475 | 360 | |
| 476 | - update_option( 'frm_lite_settings_upgrade', time(), false ); | |
| 361 | + update_option( 'frm_lite_settings_upgrade', time(), 'no' ); | |
| 477 | 362 | |
| 478 | 363 | wp_send_json_success(); |
| 479 | 364 | } |
| 480 | 365 | |
| @@ -488,9 +373,9 @@ | ||
| 488 | 373 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 489 | 374 | |
| 490 | 375 | global $wpdb; |
| 491 | 376 | |
| 492 | - $term = FrmAppHelper::get_param( 'term', '', 'get', 'sanitize_text_field' ); | |
| 377 | + $term = FrmAppHelper::get_param( 'term', '', 'get', 'sanitize_text_field' ); | |
| 493 | 378 | $post_type = FrmAppHelper::get_param( 'post_type', 'page', 'get', 'sanitize_text_field' ); |
| 494 | 379 | |
| 495 | 380 | $where = array( |
| 496 | 381 | 'post_status' => 'publish', |
| @@ -502,11 +387,11 @@ | ||
| 502 | 387 | 'limit' => 25, |
| 503 | 388 | 'order_by' => 'post_title', |
| 504 | 389 | ); |
| 505 | 390 | |
| 506 | - $pages = FrmDb::get_results( $wpdb->posts, $where, 'ID, post_title', $atts ); | |
| 391 | + $pages = FrmDb::get_results( $wpdb->posts, $where, 'ID, post_title', $atts ); | |
| 392 | + | |
| 507 | 393 | $results = array(); |
| 508 | - | |
| 509 | 394 | foreach ( $pages as $page ) { |
| 510 | 395 | $results[] = array( |
| 511 | 396 | 'value' => $page->ID, |
| 512 | 397 | 'label' => $page->post_title, |
| @@ -516,22 +401,11 @@ | ||
| 516 | 401 | wp_send_json( $results ); |
| 517 | 402 | } |
| 518 | 403 | |
| 519 | 404 | /** |
| 520 | - * Shows a fake color picker. | |
| 521 | - * | |
| 522 | - * @since 6.25 | |
| 523 | - * | |
| 524 | - * @param string $color Color value. | |
| 525 | - * | |
| 526 | - * @return void | |
| 405 | + * @deprecated 6.0 use FrmSettingsController::captcha_settings(). | |
| 527 | 406 | */ |
| 528 | - public static function fake_color_picker( $color ) { | |
| 529 | - ?> | |
| 530 | - <div class="wp-picker-container"> | |
| 531 | - <button type="button" class="button wp-color-result" aria-expanded="false" aria-disabled="true" tabindex="-1" style="background-color:<?php echo esc_attr( $color ); ?>;"><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?> | |
| 532 | - <span class="wp-color-result-text" style="color:#a7aaad;"><?php esc_html_e( 'Select Color', 'formidable' ); ?></span> | |
| 533 | - </button> | |
| 534 | - </div> | |
| 535 | - <?php | |
| 407 | + public static function recaptcha_settings() { | |
| 408 | + _deprecated_function( __FUNCTION__, '6.0', 'FrmSettingsController::captcha_settings()' ); | |
| 409 | + self::captcha_settings(); | |
| 536 | 410 | } |
| 537 | 411 | } |