@@ -1,16 +1,16 @@ discard block |
||
1 | -<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('post_excerpt', '') ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" /> |
|
2 | -<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('ID', '') ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" /> |
|
1 | +<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'post_excerpt', '' ) ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" /> |
|
2 | +<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" /> |
|
3 | 3 | |
4 | 4 | <table class="form-table"> |
5 | 5 | <tr> |
6 | 6 | <th> |
7 | - <label <?php FrmAppHelper::maybe_add_tooltip('action_title') ?>><?php _e( 'Label', 'formidable' ) ?></label> |
|
7 | + <label <?php FrmAppHelper::maybe_add_tooltip( 'action_title' ) ?>><?php _e( 'Label', 'formidable' ) ?></label> |
|
8 | 8 | </th> |
9 | - <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name('post_title', '') ) ?>" value="<?php echo esc_attr($form_action->post_title); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip('action_title', 'open') ?>" id="<?php echo esc_attr( $action_control->get_field_id('action_post_title') ) ?>" /> |
|
9 | + <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name( 'post_title', '' ) ) ?>" value="<?php echo esc_attr( $form_action->post_title ); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip( 'action_title', 'open' ) ?>" id="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ) ?>" /> |
|
10 | 10 | </td> |
11 | 11 | </tr> |
12 | 12 | </table> |
13 | -<?php $action_control->form($form_action, compact('form', 'action_key', 'values')); ?> |
|
13 | +<?php $action_control->form( $form_action, compact( 'form', 'action_key', 'values' ) ); ?> |
|
14 | 14 | |
15 | 15 | <table class="form-table frm-no-margin"> |
16 | 16 | <tr><td> |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | if ( count( $action_control->action_options['event'] ) == 1 || $action_control->action_options['force_event'] ) { |
27 | 27 | foreach ( $action_control->action_options['event'] as $e ) { ?> |
28 | - <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" value="<?php echo esc_attr( $e ) ?>" /> |
|
28 | + <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" value="<?php echo esc_attr( $e ) ?>" /> |
|
29 | 29 | <?php |
30 | 30 | } |
31 | 31 | } else { |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | <tr> |
37 | 37 | <td> |
38 | 38 | <label class="frm_left_label"><?php _e( 'Trigger this action after', 'formidable' ) ?></label> |
39 | - <select name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id('event') ) ?>"> |
|
39 | + <select name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id( 'event' ) ) ?>"> |
|
40 | 40 | <?php |
41 | 41 | |
42 | 42 | $event_labels = FrmFormAction::trigger_labels(); |
43 | 43 | foreach ( $action_control->action_options['event'] as $event ) { ?> |
44 | - <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?></option> |
|
44 | + <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[$event] ) ? $event_labels[$event] : $event; ?></option> |
|
45 | 45 | <?php |
46 | 46 | } |
47 | 47 | ?> </select> |
@@ -56,6 +56,6 @@ discard block |
||
56 | 56 | do_action( 'frm_additional_action_settings', $form_action, $pass_args ); |
57 | 57 | |
58 | 58 | ?> |
59 | - <span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID); ?></span> |
|
59 | + <span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID ); ?></span> |
|
60 | 60 | </td></tr> |
61 | 61 | </table> |
@@ -2,26 +2,26 @@ discard block |
||
2 | 2 | |
3 | 3 | class FrmSettingsController { |
4 | 4 | |
5 | - public static function menu() { |
|
5 | + public static function menu() { |
|
6 | 6 | // Make sure admins can see the menu items |
7 | 7 | FrmAppHelper::force_capability( 'frm_change_settings' ); |
8 | 8 | |
9 | - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' ); |
|
10 | - } |
|
9 | + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' ); |
|
10 | + } |
|
11 | 11 | |
12 | - public static function license_box() { |
|
12 | + public static function license_box() { |
|
13 | 13 | $a = FrmAppHelper::simple_get( 't', 'sanitize_title', 'general_settings' ); |
14 | - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' ); |
|
15 | - } |
|
14 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' ); |
|
15 | + } |
|
16 | 16 | |
17 | - public static function display_form( $errors = array(), $message = '' ) { |
|
18 | - global $frm_vars; |
|
17 | + public static function display_form( $errors = array(), $message = '' ) { |
|
18 | + global $frm_vars; |
|
19 | 19 | |
20 | - $frm_settings = FrmAppHelper::get_settings(); |
|
21 | - $frm_roles = FrmAppHelper::frm_capabilities(); |
|
20 | + $frm_settings = FrmAppHelper::get_settings(); |
|
21 | + $frm_roles = FrmAppHelper::frm_capabilities(); |
|
22 | 22 | |
23 | - $uploads = wp_upload_dir(); |
|
24 | - $target_path = $uploads['basedir'] . '/formidable/css'; |
|
23 | + $uploads = wp_upload_dir(); |
|
24 | + $target_path = $uploads['basedir'] . '/formidable/css'; |
|
25 | 25 | |
26 | 26 | $sections = array(); |
27 | 27 | if ( apply_filters( 'frm_include_addon_page', false ) ) { |
@@ -30,55 +30,55 @@ discard block |
||
30 | 30 | 'name' => __( 'Plugin Licenses', 'formidable' ), |
31 | 31 | ); |
32 | 32 | } |
33 | - $sections = apply_filters( 'frm_add_settings_section', $sections ); |
|
33 | + $sections = apply_filters( 'frm_add_settings_section', $sections ); |
|
34 | 34 | |
35 | - $captcha_lang = FrmAppHelper::locales( 'captcha' ); |
|
35 | + $captcha_lang = FrmAppHelper::locales( 'captcha' ); |
|
36 | 36 | |
37 | - require( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php' ); |
|
38 | - } |
|
37 | + require( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php' ); |
|
38 | + } |
|
39 | 39 | |
40 | - public static function process_form( $stop_load = false ) { |
|
41 | - global $frm_vars; |
|
40 | + public static function process_form( $stop_load = false ) { |
|
41 | + global $frm_vars; |
|
42 | 42 | |
43 | - $frm_settings = FrmAppHelper::get_settings(); |
|
43 | + $frm_settings = FrmAppHelper::get_settings(); |
|
44 | 44 | |
45 | 45 | $process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' ); |
46 | 46 | if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) { |
47 | - wp_die( $frm_settings->admin_permission ); |
|
48 | - } |
|
47 | + wp_die( $frm_settings->admin_permission ); |
|
48 | + } |
|
49 | 49 | |
50 | - $errors = array(); |
|
51 | - $message = ''; |
|
50 | + $errors = array(); |
|
51 | + $message = ''; |
|
52 | 52 | |
53 | - if ( ! isset( $frm_vars['settings_routed'] ) || ! $frm_vars['settings_routed'] ) { |
|
54 | - //$errors = $frm_settings->validate($_POST,array()); |
|
55 | - $errors = apply_filters( 'frm_get_global_settings_errors', $errors ); |
|
53 | + if ( ! isset( $frm_vars['settings_routed'] ) || ! $frm_vars['settings_routed'] ) { |
|
54 | + //$errors = $frm_settings->validate($_POST,array()); |
|
55 | + $errors = apply_filters( 'frm_get_global_settings_errors', $errors ); |
|
56 | 56 | |
57 | - $frm_settings->update( stripslashes_deep( $_POST ) ); |
|
57 | + $frm_settings->update( stripslashes_deep( $_POST ) ); |
|
58 | 58 | |
59 | - if ( empty( $errors ) ) { |
|
60 | - $frm_settings->store(); |
|
61 | - $message = __( 'Settings Saved', 'formidable' ); |
|
62 | - } |
|
63 | - } else { |
|
64 | - $message = __( 'Settings Saved', 'formidable' ); |
|
65 | - } |
|
59 | + if ( empty( $errors ) ) { |
|
60 | + $frm_settings->store(); |
|
61 | + $message = __( 'Settings Saved', 'formidable' ); |
|
62 | + } |
|
63 | + } else { |
|
64 | + $message = __( 'Settings Saved', 'formidable' ); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | if ( $stop_load == 'stop_load' ) { |
68 | - $frm_vars['settings_routed'] = true; |
|
69 | - return; |
|
70 | - } |
|
68 | + $frm_vars['settings_routed'] = true; |
|
69 | + return; |
|
70 | + } |
|
71 | 71 | |
72 | - self::display_form( $errors, $message ); |
|
73 | - } |
|
72 | + self::display_form( $errors, $message ); |
|
73 | + } |
|
74 | 74 | |
75 | - public static function route( $stop_load = false ) { |
|
76 | - $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
|
75 | + public static function route( $stop_load = false ) { |
|
76 | + $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
|
77 | 77 | $action = FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ); |
78 | - if ( $action == 'process-form' ) { |
|
78 | + if ( $action == 'process-form' ) { |
|
79 | 79 | self::process_form( $stop_load ); |
80 | - } else if ( $stop_load != 'stop_load' ) { |
|
80 | + } else if ( $stop_load != 'stop_load' ) { |
|
81 | 81 | self::display_form(); |
82 | - } |
|
83 | - } |
|
82 | + } |
|
83 | + } |
|
84 | 84 | } |