| @@ -118,13 +118,13 @@ | ||
| 118 | 118 | $sections['licenses'] = array( |
| 119 | 119 | 'class' => 'FrmAddonsController', |
| 120 | 120 | 'function' => 'license_settings', |
| 121 | 121 | 'name' => __( 'Plugin Licenses', 'formidable' ), |
| 122 | - 'icon' => 'frm_icon_font frm_keyalt_icon', | |
| 122 | + 'icon' => 'frmfont frm_key_icon', | |
| 123 | 123 | 'ajax' => true, |
| 124 | 124 | ); |
| 125 | 125 | } |
| 126 | - } | |
| 126 | + }//end if | |
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | 129 | * @param array<array> $sections |
| 130 | 130 | */ |
| @@ -158,9 +158,9 @@ | ||
| 158 | 158 | $section['function'] = $original; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | $sections[ $key ] = $section; |
| 162 | - } | |
| 162 | + }//end foreach | |
| 163 | 163 | |
| 164 | 164 | return $sections; |
| 165 | 165 | } |
| 166 | 166 | |
| @@ -184,17 +184,38 @@ | ||
| 184 | 184 | wp_die(); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | /** |
| 188 | + * Render the general global settings section. | |
| 189 | + * | |
| 188 | 190 | * @since 4.0 |
| 191 | + * | |
| 192 | + * @return void | |
| 189 | 193 | */ |
| 190 | 194 | public static function general_settings() { |
| 191 | 195 | $frm_settings = FrmAppHelper::get_settings(); |
| 196 | + $uploads = wp_upload_dir(); | |
| 197 | + $target_path = $uploads['basedir'] . '/formidable/css'; | |
| 192 | 198 | |
| 193 | - $uploads = wp_upload_dir(); | |
| 194 | - $target_path = $uploads['basedir'] . '/formidable/css'; | |
| 199 | + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/general.php'; | |
| 200 | + } | |
| 195 | 201 | |
| 196 | - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/general.php' ); | |
| 202 | + /** | |
| 203 | + * Render the global currency selector if Pro is up to date. | |
| 204 | + * | |
| 205 | + * @param FrmSettings $frm_settings | |
| 206 | + * @param string $more_html | |
| 207 | + * @return void | |
| 208 | + */ | |
| 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. | |
| 213 | + return; | |
| 214 | + } | |
| 215 | + | |
| 216 | + $currencies = FrmCurrencyHelper::get_currencies(); | |
| 217 | + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/_currency.php'; | |
| 197 | 218 | } |
| 198 | 219 | |
| 199 | 220 | /** |
| 200 | 221 | * @since 4.0 |
| @@ -247,9 +268,15 @@ | ||
| 247 | 268 | $frm_settings = FrmAppHelper::get_settings(); |
| 248 | 269 | $process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' ); |
| 249 | 270 | |
| 250 | 271 | if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) { |
| 251 | - wp_die( esc_html( $frm_settings->admin_permission ) ); | |
| 272 | + $error_args = array( | |
| 273 | + 'title' => __( 'Verification failed', 'formidable' ), | |
| 274 | + 'body' => $frm_settings->admin_permission, | |
| 275 | + 'cancel_text' => __( 'Cancel', 'formidable' ), | |
| 276 | + ); | |
| 277 | + FrmAppController::show_error_modal( $error_args ); | |
| 278 | + return; | |
| 252 | 279 | } |
| 253 | 280 | |
| 254 | 281 | $errors = array(); |
| 255 | 282 | $message = ''; |
| @@ -334,8 +361,9 @@ | ||
| 334 | 361 | * |
| 335 | 362 | * @since 3.04.02 |
| 336 | 363 | */ |
| 337 | 364 | public static function settings_cta_dismiss() { |
| 365 | + check_ajax_referer( 'frm_ajax', 'nonce' ); | |
| 338 | 366 | FrmAppHelper::permission_check( 'frm_change_settings' ); |
| 339 | 367 | |
| 340 | 368 | update_option( 'frm_lite_settings_upgrade', time(), 'no' ); |
| 341 | 369 | |