@@ -139,8 +139,8 @@ |
||
| 139 | 139 | add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' ); |
| 140 | 140 | |
| 141 | 141 | // Addons |
| 142 | - add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' ); |
|
| 143 | - add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' ); |
|
| 142 | + add_action( 'wp_ajax_frm_addon_activate', 'FrmAddon::activate' ); |
|
| 143 | + add_action( 'wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' ); |
|
| 144 | 144 | add_action( 'wp_ajax_frm_fill_licenses', 'FrmAddonsController::get_licenses' ); |
| 145 | 145 | |
| 146 | 146 | // Fields Controller |
@@ -1,89 +1,89 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class FrmHooksController { |
| 4 | - /** |
|
| 5 | - * Trigger plugin-wide hook loading |
|
| 6 | - */ |
|
| 7 | - public static function trigger_load_hook( $hooks = 'load_hooks' ) { |
|
| 8 | - $controllers = apply_filters( 'frm_load_controllers', array( 'FrmHooksController' ) ); |
|
| 9 | - |
|
| 10 | - $trigger_hooks = $hooks; |
|
| 11 | - $hooks = (array) $hooks; |
|
| 12 | - |
|
| 13 | - if ( 'load_hooks' == $trigger_hooks ) { |
|
| 14 | - if ( is_admin() ) { |
|
| 15 | - $hooks[] = 'load_admin_hooks'; |
|
| 16 | - if ( defined( 'DOING_AJAX' ) ) { |
|
| 17 | - $hooks[] = 'load_ajax_hooks'; |
|
| 18 | - $hooks[] = 'load_form_hooks'; |
|
| 19 | - } |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - if ( is_multisite() ) { |
|
| 23 | - $hooks[] = 'load_multisite_hooks'; |
|
| 24 | - } |
|
| 25 | - } else { |
|
| 26 | - // Make sure the hooks are only triggered once |
|
| 27 | - add_filter( 'frm' . str_replace( 'load', '', $trigger_hooks ) . '_loaded', '__return_true' ); |
|
| 28 | - } |
|
| 29 | - unset( $trigger_hooks ); |
|
| 30 | - |
|
| 31 | - // Instansiate Controllers |
|
| 32 | - foreach ( $controllers as $c ) { |
|
| 33 | - foreach ( $hooks as $hook ) { |
|
| 4 | + /** |
|
| 5 | + * Trigger plugin-wide hook loading |
|
| 6 | + */ |
|
| 7 | + public static function trigger_load_hook( $hooks = 'load_hooks' ) { |
|
| 8 | + $controllers = apply_filters( 'frm_load_controllers', array( 'FrmHooksController' ) ); |
|
| 9 | + |
|
| 10 | + $trigger_hooks = $hooks; |
|
| 11 | + $hooks = (array) $hooks; |
|
| 12 | + |
|
| 13 | + if ( 'load_hooks' == $trigger_hooks ) { |
|
| 14 | + if ( is_admin() ) { |
|
| 15 | + $hooks[] = 'load_admin_hooks'; |
|
| 16 | + if ( defined( 'DOING_AJAX' ) ) { |
|
| 17 | + $hooks[] = 'load_ajax_hooks'; |
|
| 18 | + $hooks[] = 'load_form_hooks'; |
|
| 19 | + } |
|
| 20 | + } |
|
| 21 | + |
|
| 22 | + if ( is_multisite() ) { |
|
| 23 | + $hooks[] = 'load_multisite_hooks'; |
|
| 24 | + } |
|
| 25 | + } else { |
|
| 26 | + // Make sure the hooks are only triggered once |
|
| 27 | + add_filter( 'frm' . str_replace( 'load', '', $trigger_hooks ) . '_loaded', '__return_true' ); |
|
| 28 | + } |
|
| 29 | + unset( $trigger_hooks ); |
|
| 30 | + |
|
| 31 | + // Instansiate Controllers |
|
| 32 | + foreach ( $controllers as $c ) { |
|
| 33 | + foreach ( $hooks as $hook ) { |
|
| 34 | 34 | call_user_func( array( $c, $hook ) ); |
| 35 | 35 | unset( $hook ); |
| 36 | - } |
|
| 36 | + } |
|
| 37 | 37 | unset( $c ); |
| 38 | - } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - } |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - public static function trigger_load_form_hooks() { |
|
| 43 | - self::trigger_load_hook( 'load_form_hooks' ); |
|
| 44 | - } |
|
| 42 | + public static function trigger_load_form_hooks() { |
|
| 43 | + self::trigger_load_hook( 'load_form_hooks' ); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | 46 | public static function load_hooks() { |
| 47 | - if ( ! is_admin() ) { |
|
| 48 | - add_filter( 'the_content', 'FrmAppController::page_route', 10 ); |
|
| 49 | - } |
|
| 47 | + if ( ! is_admin() ) { |
|
| 48 | + add_filter( 'the_content', 'FrmAppController::page_route', 10 ); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - add_action( 'plugins_loaded', 'FrmAppController::load_lang' ); |
|
| 52 | - add_filter( 'widget_text', 'FrmAppController::widget_text_filter', 8 ); |
|
| 51 | + add_action( 'plugins_loaded', 'FrmAppController::load_lang' ); |
|
| 52 | + add_filter( 'widget_text', 'FrmAppController::widget_text_filter', 8 ); |
|
| 53 | 53 | |
| 54 | - // Entries controller |
|
| 55 | - add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 ); |
|
| 56 | - add_filter( 'frm_redirect_url', 'FrmEntriesController::delete_entry_before_redirect', 50, 3 ); |
|
| 57 | - add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 ); |
|
| 54 | + // Entries controller |
|
| 55 | + add_action( 'wp_loaded', 'FrmEntriesController::process_entry', 10, 0 ); |
|
| 56 | + add_filter( 'frm_redirect_url', 'FrmEntriesController::delete_entry_before_redirect', 50, 3 ); |
|
| 57 | + add_action( 'frm_after_entry_processed', 'FrmEntriesController::delete_entry_after_save', 100 ); |
|
| 58 | 58 | |
| 59 | - // Form Actions Controller |
|
| 60 | - add_action( 'init', 'FrmFormActionsController::register_post_types', 1 ); |
|
| 59 | + // Form Actions Controller |
|
| 60 | + add_action( 'init', 'FrmFormActionsController::register_post_types', 1 ); |
|
| 61 | 61 | add_action( 'frm_after_create_entry', 'FrmFormActionsController::trigger_create_actions', 20, 3 ); |
| 62 | 62 | |
| 63 | - // Forms Controller |
|
| 64 | - add_action( 'widgets_init', 'FrmFormsController::register_widgets' ); |
|
| 63 | + // Forms Controller |
|
| 64 | + add_action( 'widgets_init', 'FrmFormsController::register_widgets' ); |
|
| 65 | 65 | add_action( 'init', 'FrmFormsController::front_head' ); |
| 66 | - add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 ); |
|
| 67 | - add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 ); |
|
| 68 | - add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' ); |
|
| 66 | + add_filter( 'frm_content', 'FrmFormsController::filter_content', 10, 3 ); |
|
| 67 | + add_filter( 'frm_replace_content_shortcodes', 'FrmFormsController::replace_content_shortcodes', 20, 3 ); |
|
| 68 | + add_action( 'admin_bar_init', 'FrmFormsController::admin_bar_css' ); |
|
| 69 | 69 | add_action( 'wp_footer', 'FrmFormsController::footer_js', 1, 0 ); |
| 70 | 70 | |
| 71 | 71 | add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' ); |
| 72 | 72 | |
| 73 | - // Form Shortcodes |
|
| 74 | - add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' ); |
|
| 73 | + // Form Shortcodes |
|
| 74 | + add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' ); |
|
| 75 | 75 | |
| 76 | - // Styles Controller |
|
| 77 | - add_action( 'init', 'FrmStylesController::register_post_types', 0 ); |
|
| 78 | - add_filter( 'frm_get_style_opts', 'FrmStylesController::get_style_opts' ); |
|
| 79 | - add_filter( 'frm_add_form_style_class', 'FrmStylesController::get_form_style_class', 10, 2 ); |
|
| 80 | - add_filter( 'frm_show_entry_styles', 'FrmStylesController::show_entry_styles' ); |
|
| 81 | - } |
|
| 76 | + // Styles Controller |
|
| 77 | + add_action( 'init', 'FrmStylesController::register_post_types', 0 ); |
|
| 78 | + add_filter( 'frm_get_style_opts', 'FrmStylesController::get_style_opts' ); |
|
| 79 | + add_filter( 'frm_add_form_style_class', 'FrmStylesController::get_form_style_class', 10, 2 ); |
|
| 80 | + add_filter( 'frm_show_entry_styles', 'FrmStylesController::show_entry_styles' ); |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | 83 | public static function load_admin_hooks() { |
| 84 | - add_action( 'admin_menu', 'FrmAppController::menu', 1 ); |
|
| 85 | - add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' ); |
|
| 86 | - add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' ); |
|
| 84 | + add_action( 'admin_menu', 'FrmAppController::menu', 1 ); |
|
| 85 | + add_action( 'admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style' ); |
|
| 86 | + add_action( 'admin_notices', 'FrmAppController::pro_get_started_headline' ); |
|
| 87 | 87 | add_action( 'admin_init', 'FrmAppController::admin_init', 11 ); |
| 88 | 88 | add_filter( 'plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link' ); |
| 89 | 89 | register_activation_hook( FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::activation_install' ); |
@@ -92,119 +92,119 @@ discard block |
||
| 92 | 92 | add_action( 'admin_menu', 'FrmAddonsController::menu', 100 ); |
| 93 | 93 | add_filter( 'upgrader_pre_download', 'FrmAddonsController::add_shorten_edd_filename_filter', 10, 4 ); |
| 94 | 94 | |
| 95 | - // Entries Controller |
|
| 96 | - add_action( 'admin_menu', 'FrmEntriesController::menu', 12 ); |
|
| 97 | - add_filter( 'contextual_help', 'FrmEntriesController::contextual_help', 10, 3 ); |
|
| 98 | - add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 ); |
|
| 99 | - add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 ); |
|
| 100 | - add_action( 'updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4 ); |
|
| 95 | + // Entries Controller |
|
| 96 | + add_action( 'admin_menu', 'FrmEntriesController::menu', 12 ); |
|
| 97 | + add_filter( 'contextual_help', 'FrmEntriesController::contextual_help', 10, 3 ); |
|
| 98 | + add_filter( 'set-screen-option', 'FrmEntriesController::save_per_page', 10, 3 ); |
|
| 99 | + add_filter( 'update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5 ); |
|
| 100 | + add_action( 'updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4 ); |
|
| 101 | 101 | |
| 102 | - // Fields Controller |
|
| 103 | - add_filter( 'frm_display_field_options', 'FrmFieldsController::display_field_options' ); |
|
| 102 | + // Fields Controller |
|
| 103 | + add_filter( 'frm_display_field_options', 'FrmFieldsController::display_field_options' ); |
|
| 104 | 104 | |
| 105 | - // Form Actions Controller |
|
| 106 | - if ( FrmAppHelper::is_admin_page( 'formidable' ) ) { |
|
| 107 | - add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' ); |
|
| 108 | - } |
|
| 109 | - add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 ); |
|
| 105 | + // Form Actions Controller |
|
| 106 | + if ( FrmAppHelper::is_admin_page( 'formidable' ) ) { |
|
| 107 | + add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' ); |
|
| 108 | + } |
|
| 109 | + add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 ); |
|
| 110 | 110 | |
| 111 | - // Forms Controller |
|
| 112 | - add_action( 'admin_menu', 'FrmFormsController::menu', 10 ); |
|
| 113 | - add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' ); |
|
| 111 | + // Forms Controller |
|
| 112 | + add_action( 'admin_menu', 'FrmFormsController::menu', 10 ); |
|
| 113 | + add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' ); |
|
| 114 | 114 | |
| 115 | - add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 ); |
|
| 116 | - add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' ); |
|
| 115 | + add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 ); |
|
| 116 | + add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' ); |
|
| 117 | 117 | add_action( 'media_buttons', 'FrmFormsController::insert_form_button' ); |
| 118 | 118 | |
| 119 | - // Forms Model |
|
| 120 | - add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 ); |
|
| 119 | + // Forms Model |
|
| 120 | + add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 ); |
|
| 121 | 121 | |
| 122 | - // Settings Controller |
|
| 123 | - add_action( 'admin_menu', 'FrmSettingsController::menu', 45 ); |
|
| 124 | - add_action( 'frm_before_settings', 'FrmSettingsController::license_box' ); |
|
| 122 | + // Settings Controller |
|
| 123 | + add_action( 'admin_menu', 'FrmSettingsController::menu', 45 ); |
|
| 124 | + add_action( 'frm_before_settings', 'FrmSettingsController::license_box' ); |
|
| 125 | 125 | |
| 126 | - // Styles Controller |
|
| 127 | - add_action( 'admin_menu', 'FrmStylesController::menu', 14 ); |
|
| 128 | - add_action( 'admin_init', 'FrmStylesController::admin_init' ); |
|
| 126 | + // Styles Controller |
|
| 127 | + add_action( 'admin_menu', 'FrmStylesController::menu', 14 ); |
|
| 128 | + add_action( 'admin_init', 'FrmStylesController::admin_init' ); |
|
| 129 | 129 | |
| 130 | - // XML Controller |
|
| 131 | - add_action( 'admin_menu', 'FrmXMLController::menu', 41 ); |
|
| 132 | - } |
|
| 130 | + // XML Controller |
|
| 131 | + add_action( 'admin_menu', 'FrmXMLController::menu', 41 ); |
|
| 132 | + } |
|
| 133 | 133 | |
| 134 | 134 | public static function load_ajax_hooks() { |
| 135 | 135 | add_action( 'wp_ajax_frm_silent_upgrade', 'FrmAppController::ajax_install' ); |
| 136 | 136 | add_action( 'wp_ajax_nopriv_frm_silent_upgrade', 'FrmAppController::ajax_install' ); |
| 137 | 137 | add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' ); |
| 138 | - add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' ); |
|
| 139 | - add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' ); |
|
| 138 | + add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' ); |
|
| 139 | + add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' ); |
|
| 140 | 140 | |
| 141 | 141 | // Addons |
| 142 | 142 | add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' ); |
| 143 | 143 | add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' ); |
| 144 | 144 | add_action( 'wp_ajax_frm_fill_licenses', 'FrmAddonsController::get_licenses' ); |
| 145 | 145 | |
| 146 | - // Fields Controller |
|
| 147 | - add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' ); |
|
| 148 | - add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' ); |
|
| 149 | - add_action( 'wp_ajax_frm_field_name_in_place_edit', 'FrmFieldsController::edit_name' ); |
|
| 150 | - add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' ); |
|
| 151 | - add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' ); |
|
| 152 | - add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' ); |
|
| 153 | - add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' ); |
|
| 154 | - add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' ); |
|
| 155 | - add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' ); |
|
| 156 | - add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' ); |
|
| 157 | - |
|
| 158 | - // Form Actions Controller |
|
| 159 | - add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' ); |
|
| 160 | - add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' ); |
|
| 161 | - |
|
| 162 | - // Forms Controller |
|
| 146 | + // Fields Controller |
|
| 147 | + add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' ); |
|
| 148 | + add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' ); |
|
| 149 | + add_action( 'wp_ajax_frm_field_name_in_place_edit', 'FrmFieldsController::edit_name' ); |
|
| 150 | + add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' ); |
|
| 151 | + add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' ); |
|
| 152 | + add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' ); |
|
| 153 | + add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' ); |
|
| 154 | + add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' ); |
|
| 155 | + add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' ); |
|
| 156 | + add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' ); |
|
| 157 | + |
|
| 158 | + // Form Actions Controller |
|
| 159 | + add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' ); |
|
| 160 | + add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' ); |
|
| 161 | + |
|
| 162 | + // Forms Controller |
|
| 163 | 163 | add_action( 'wp_ajax_frm_create_from_template', 'FrmFormsController::_create_from_template' ); |
| 164 | 164 | add_action( 'wp_ajax_frm_save_form', 'FrmFormsController::route' ); |
| 165 | 165 | add_action( 'wp_ajax_frm_form_key_in_place_edit', 'FrmFormsController::edit_key' ); |
| 166 | 166 | add_action( 'wp_ajax_frm_form_desc_in_place_edit', 'FrmFormsController::edit_description' ); |
| 167 | - add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' ); |
|
| 168 | - add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' ); |
|
| 169 | - add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' ); |
|
| 170 | - add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' ); |
|
| 171 | - |
|
| 172 | - // Styles Controller |
|
| 173 | - add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' ); |
|
| 174 | - add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' ); |
|
| 175 | - add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' ); |
|
| 176 | - add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' ); |
|
| 167 | + add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' ); |
|
| 168 | + add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' ); |
|
| 169 | + add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' ); |
|
| 170 | + add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' ); |
|
| 171 | + |
|
| 172 | + // Styles Controller |
|
| 173 | + add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' ); |
|
| 174 | + add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' ); |
|
| 175 | + add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' ); |
|
| 176 | + add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' ); |
|
| 177 | 177 | add_action( 'wp_ajax_frmpro_css', 'FrmStylesController::load_saved_css' ); |
| 178 | 178 | add_action( 'wp_ajax_nopriv_frmpro_css', 'FrmStylesController::load_saved_css' ); |
| 179 | 179 | |
| 180 | - // XML Controller |
|
| 180 | + // XML Controller |
|
| 181 | 181 | add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' ); |
| 182 | 182 | add_action( 'wp_ajax_nopriv_frm_entries_csv', 'FrmXMLController::csv' ); |
| 183 | - add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' ); |
|
| 184 | - } |
|
| 183 | + add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' ); |
|
| 184 | + } |
|
| 185 | 185 | |
| 186 | 186 | public static function load_form_hooks() { |
| 187 | - // Fields Controller |
|
| 188 | - add_filter( 'frm_field_type', 'FrmFieldsController::change_type' ); |
|
| 189 | - add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' ); |
|
| 190 | - add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 ); |
|
| 191 | - add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' ); |
|
| 187 | + // Fields Controller |
|
| 188 | + add_filter( 'frm_field_type', 'FrmFieldsController::change_type' ); |
|
| 189 | + add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' ); |
|
| 190 | + add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 ); |
|
| 191 | + add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' ); |
|
| 192 | 192 | |
| 193 | 193 | // Forms Controller |
| 194 | 194 | add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' ); |
| 195 | 195 | |
| 196 | - // Styles Controller |
|
| 197 | - add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 ); |
|
| 198 | - } |
|
| 196 | + // Styles Controller |
|
| 197 | + add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 ); |
|
| 198 | + } |
|
| 199 | 199 | |
| 200 | 200 | public static function load_view_hooks() { |
| 201 | - // Hooks go here when a view is loaded |
|
| 202 | - } |
|
| 201 | + // Hooks go here when a view is loaded |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | 204 | public static function load_multisite_hooks() { |
| 205 | 205 | add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' ); |
| 206 | 206 | |
| 207 | - // drop tables when mu site is deleted |
|
| 208 | - add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' ); |
|
| 209 | - } |
|
| 207 | + // drop tables when mu site is deleted |
|
| 208 | + add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' ); |
|
| 209 | + } |
|
| 210 | 210 | } |
@@ -8,12 +8,12 @@ discard block |
||
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | public function widget( $args, $instance ) { |
| 11 | - if ( empty($instance['title']) ) { |
|
| 12 | - $title = FrmForm::getName( $instance['form'] ); |
|
| 13 | - } else { |
|
| 14 | - $title = $instance['title']; |
|
| 15 | - } |
|
| 16 | - $title = apply_filters('widget_title', $title); |
|
| 11 | + if ( empty($instance['title']) ) { |
|
| 12 | + $title = FrmForm::getName( $instance['form'] ); |
|
| 13 | + } else { |
|
| 14 | + $title = $instance['title']; |
|
| 15 | + } |
|
| 16 | + $title = apply_filters('widget_title', $title); |
|
| 17 | 17 | |
| 18 | 18 | echo $args['before_widget']; |
| 19 | 19 | |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function form( $instance ) { |
| 42 | - //Defaults |
|
| 42 | + //Defaults |
|
| 43 | 43 | $instance = wp_parse_args( (array) $instance, array( |
| 44 | - 'title' => false, 'form' => false, 'description' => false, |
|
| 44 | + 'title' => false, 'form' => false, 'description' => false, |
|
| 45 | 45 | ) ); |
| 46 | 46 | ?> |
| 47 | 47 | <p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | <p><label for="<?php echo esc_attr( $this->get_field_id('form') ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
| 51 | 51 | <?php |
| 52 | - FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
| 53 | - 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
| 54 | - 'class' => 'widefat', |
|
| 55 | - ) ); |
|
| 52 | + FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
| 53 | + 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
| 54 | + 'class' => 'widefat', |
|
| 55 | + ) ); |
|
| 56 | 56 | ?> |
| 57 | 57 | </p> |
| 58 | 58 | |
@@ -4,22 +4,22 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | public function __construct() { |
| 6 | 6 | $widget_ops = array( 'description' => __( 'Display a Formidable Form', 'formidable' ) ); |
| 7 | - parent::__construct('frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops); |
|
| 7 | + parent::__construct( 'frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops ); |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | public function widget( $args, $instance ) { |
| 11 | - if ( empty($instance['title']) ) { |
|
| 11 | + if ( empty( $instance['title'] ) ) { |
|
| 12 | 12 | $title = FrmForm::getName( $instance['form'] ); |
| 13 | 13 | } else { |
| 14 | 14 | $title = $instance['title']; |
| 15 | 15 | } |
| 16 | - $title = apply_filters('widget_title', $title); |
|
| 16 | + $title = apply_filters( 'widget_title', $title ); |
|
| 17 | 17 | |
| 18 | 18 | echo $args['before_widget']; |
| 19 | 19 | |
| 20 | 20 | echo '<div class="frm_form_widget">'; |
| 21 | 21 | if ( $title ) { |
| 22 | - echo $args['before_title'] . stripslashes($title) . $args['after_title']; |
|
| 22 | + echo $args['before_title'] . stripslashes( $title ) . $args['after_title']; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | $form_atts = array( |
@@ -44,19 +44,19 @@ discard block |
||
| 44 | 44 | 'title' => false, 'form' => false, 'description' => false, |
| 45 | 45 | ) ); |
| 46 | 46 | ?> |
| 47 | - <p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
|
| 48 | - <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" value="<?php echo esc_attr( stripslashes($instance['title']) ); ?>" /></p> |
|
| 47 | + <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
|
| 48 | + <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( stripslashes( $instance['title'] ) ); ?>" /></p> |
|
| 49 | 49 | |
| 50 | - <p><label for="<?php echo esc_attr( $this->get_field_id('form') ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
|
| 50 | + <p><label for="<?php echo esc_attr( $this->get_field_id( 'form' ) ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
|
| 51 | 51 | <?php |
| 52 | - FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
| 53 | - 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
| 52 | + FrmFormsHelper::forms_dropdown( $this->get_field_name( 'form' ), $instance['form'], array( |
|
| 53 | + 'blank' => false, 'field_id' => $this->get_field_id( 'form' ), |
|
| 54 | 54 | 'class' => 'widefat', |
| 55 | 55 | ) ); |
| 56 | 56 | ?> |
| 57 | 57 | </p> |
| 58 | 58 | |
| 59 | - <p><label for="<?php echo esc_attr( $this->get_field_id('description') ); ?>"><input class="checkbox" type="checkbox" <?php checked($instance['description'], true) ?> id="<?php echo esc_attr( $this->get_field_id('description') ); ?>" name="<?php echo esc_attr( $this->get_field_name('description') ); ?>" value="1" /> |
|
| 59 | + <p><label for="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>"><input class="checkbox" type="checkbox" <?php checked( $instance['description'], true ) ?> id="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'description' ) ); ?>" value="1" /> |
|
| 60 | 60 | <?php _e( 'Show Description', 'formidable' ) ?></label></p> |
| 61 | 61 | <?php |
| 62 | 62 | } |
@@ -1,17 +1,17 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $read_only = false; |
| 4 | -if ( isset($field['post_field']) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed() ) { |
|
| 4 | +if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed() ) { |
|
| 5 | 5 | echo FrmProPost::get_category_dropdown( $field, array( 'location' => 'front', 'name' => $field_name, 'id' => $html_id ) ); |
| 6 | 6 | } else { |
| 7 | 7 | if ( FrmAppHelper::pro_is_installed() && FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) { |
| 8 | 8 | $read_only = true; |
| 9 | 9 | |
| 10 | 10 | echo FrmProDropdownFieldsController::get_hidden_fields_with_readonly_values( $field, $field_name, $html_id ); ?> |
| 11 | - <select <?php do_action('frm_field_input_html', $field) ?>> <?php |
|
| 11 | + <select <?php do_action( 'frm_field_input_html', $field ) ?>> <?php |
|
| 12 | 12 | |
| 13 | 13 | } else { ?> |
| 14 | - <select name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" <?php do_action('frm_field_input_html', $field) ?>> |
|
| 14 | + <select name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" <?php do_action( 'frm_field_input_html', $field ) ?>> |
|
| 15 | 15 | <?php } |
| 16 | 16 | |
| 17 | 17 | $other_opt = false; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | ?> |
| 30 | - <option value="<?php echo esc_attr($field_val) ?>" <?php echo $selected ? ' selected="selected"' : ''; ?><?php echo ( FrmFieldsHelper::is_other_opt( $opt_key ) ) ? ' class="frm_other_trigger"' : '';?>><?php echo esc_html( $opt == '' ? ' ' : $opt ); ?></option> |
|
| 30 | + <option value="<?php echo esc_attr( $field_val ) ?>" <?php echo $selected ? ' selected="selected"' : ''; ?><?php echo ( FrmFieldsHelper::is_other_opt( $opt_key ) ) ? ' class="frm_other_trigger"' : ''; ?>><?php echo esc_html( $opt == '' ? ' ' : $opt ); ?></option> |
|
| 31 | 31 | <?php |
| 32 | 32 | } ?> |
| 33 | 33 | </select> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( isset($field['post_field']) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed() ) { |
|
| 3 | +if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed() ) { |
|
| 4 | 4 | echo FrmProPost::get_category_dropdown( $field, array( 'name' => $field_name, 'id' => 'placeholder_id', 'location' => 'form_builder' ) ); |
| 5 | 5 | } else { ?> |
| 6 | 6 | <select id="frm_dropdown_<?php echo esc_attr( $field['id'] ) ?>" |
@@ -8,8 +8,8 @@ discard block |
||
| 8 | 8 | echo FrmField::is_option_true( $field, 'size' ) ? 'class="auto_width"' : ''; |
| 9 | 9 | echo FrmField::is_option_true( $field, 'multiple' ) ? ' multiple="multiple"' : ''; ?> > |
| 10 | 10 | <?php foreach ( $field['options'] as $opt_key => $opt ) { |
| 11 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
| 12 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); |
|
| 11 | + $field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field ); |
|
| 12 | + $opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field ); |
|
| 13 | 13 | $selected = ( $field['default_value'] == $field_val || FrmFieldsHelper::get_other_val( array( 'opt_key', 'field' ) ) ) ? ' selected="selected"' : ''; ?> |
| 14 | 14 | <option value="<?php echo esc_attr( $field_val ) ?>"<?php echo $selected ?>><?php echo esc_html( $opt ) ?> </option> |
| 15 | 15 | <?php } ?> |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | <?php |
| 28 | 28 | |
| 29 | 29 | if ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) { ?> |
| 30 | - <?php do_action('frm_add_multiple_opts_labels', $field); ?> |
|
| 31 | - <ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts<?php echo ( count($field['options']) > 10 ) ? ' frm_field_opts_list' : ''; ?>"> |
|
| 32 | - <?php FrmFieldsHelper::show_single_option($field); ?> |
|
| 30 | + <?php do_action( 'frm_add_multiple_opts_labels', $field ); ?> |
|
| 31 | + <ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts<?php echo ( count( $field['options'] ) > 10 ) ? ' frm_field_opts_list' : ''; ?>"> |
|
| 32 | + <?php FrmFieldsHelper::show_single_option( $field ); ?> |
|
| 33 | 33 | </ul> |
| 34 | 34 | <?php |
| 35 | 35 | } ?> |
@@ -65,18 +65,18 @@ discard block |
||
| 65 | 65 | </ul> |
| 66 | 66 | </li> |
| 67 | 67 | <?php |
| 68 | - } else { |
|
| 69 | - $field_label = $field_type; |
|
| 70 | - ?> |
|
| 68 | + } else { |
|
| 69 | + $field_label = $field_type; |
|
| 70 | + ?> |
|
| 71 | 71 | <li class="frmbutton button <?php echo esc_attr( $col_class . ' ' . $no_allow_class . ' frm_t' . $field_key ) ?>" id="<?php echo esc_attr( $field_key ) ?>"> |
| 72 | 72 | <?php echo apply_filters( 'frmpro_field_links', $field_label, $id, $field_key ) ?> |
| 73 | 73 | </li> |
| 74 | 74 | <?php |
| 75 | - } |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - $col_class = empty($col_class) ? 'frm_col_one' : ''; |
|
| 78 | - unset($field_key, $field_type, $field_label); |
|
| 79 | - } ?> |
|
| 77 | + $col_class = empty($col_class) ? 'frm_col_one' : ''; |
|
| 78 | + unset($field_key, $field_type, $field_label); |
|
| 79 | + } ?> |
|
| 80 | 80 | </ul> |
| 81 | 81 | <div class="clear"></div> |
| 82 | 82 | </div> |
@@ -87,33 +87,33 @@ discard block |
||
| 87 | 87 | <?php _e( '2. This box will activate and you can click to insert classes.', 'formidable' ) ?></p> |
| 88 | 88 | <ul class="frm_code_list"> |
| 89 | 89 | <?php $classes = array( |
| 90 | - 'frm_first' => array( |
|
| 91 | - 'label' => __( 'First', 'formidable' ), |
|
| 92 | - 'title' => __( 'Add this to the first field in each row along with a width. ie frm_first frm_third', 'formidable' ), |
|
| 93 | - ), |
|
| 94 | - 'frm_half' => __( '1/2', 'formidable' ), |
|
| 95 | - 'frm_third' => __( '1/3', 'formidable' ), |
|
| 96 | - 'frm_two_thirds' => __( '2/3', 'formidable' ), |
|
| 97 | - 'frm_fourth' => __( '1/4', 'formidable' ), |
|
| 90 | + 'frm_first' => array( |
|
| 91 | + 'label' => __( 'First', 'formidable' ), |
|
| 92 | + 'title' => __( 'Add this to the first field in each row along with a width. ie frm_first frm_third', 'formidable' ), |
|
| 93 | + ), |
|
| 94 | + 'frm_half' => __( '1/2', 'formidable' ), |
|
| 95 | + 'frm_third' => __( '1/3', 'formidable' ), |
|
| 96 | + 'frm_two_thirds' => __( '2/3', 'formidable' ), |
|
| 97 | + 'frm_fourth' => __( '1/4', 'formidable' ), |
|
| 98 | 98 | 'frm_three_fourths' => __( '3/4', 'formidable' ), |
| 99 | - 'frm_fifth' => __( '1/5', 'formidable' ), |
|
| 99 | + 'frm_fifth' => __( '1/5', 'formidable' ), |
|
| 100 | 100 | 'frm_two_fifths' => __( '2/5', 'formidable' ), |
| 101 | - 'frm_sixth' => __( '1/6', 'formidable' ), |
|
| 102 | - 'frm_seventh' => __( '1/7', 'formidable' ), |
|
| 101 | + 'frm_sixth' => __( '1/6', 'formidable' ), |
|
| 102 | + 'frm_seventh' => __( '1/7', 'formidable' ), |
|
| 103 | 103 | 'frm_eighth' => __( '1/8', 'formidable' ), |
| 104 | 104 | 'frm_alignright' => __( 'Right', 'formidable' ), |
| 105 | - 'frm_inline' => array( |
|
| 106 | - 'label' => __( 'Inline', 'formidable' ), |
|
| 105 | + 'frm_inline' => array( |
|
| 106 | + 'label' => __( 'Inline', 'formidable' ), |
|
| 107 | 107 | 'title' => __( 'Align fields in a row without a specific width.', 'formidable' ), |
| 108 | - ), |
|
| 108 | + ), |
|
| 109 | 109 | |
| 110 | - 'frm_full' => array( |
|
| 111 | - 'label' => __( '100% width', 'formidable' ), |
|
| 110 | + 'frm_full' => array( |
|
| 111 | + 'label' => __( '100% width', 'formidable' ), |
|
| 112 | 112 | 'title' => __( 'Force the field to fill the full space with 100% width.', 'formidable' ), |
| 113 | - ), |
|
| 114 | - 'frm_grid_first' => __( 'First Grid Row', 'formidable' ), |
|
| 115 | - 'frm_grid' => __( 'Even Grid Row', 'formidable' ), |
|
| 116 | - 'frm_grid_odd' => __( 'Odd Grid Row', 'formidable' ), |
|
| 113 | + ), |
|
| 114 | + 'frm_grid_first' => __( 'First Grid Row', 'formidable' ), |
|
| 115 | + 'frm_grid' => __( 'Even Grid Row', 'formidable' ), |
|
| 116 | + 'frm_grid_odd' => __( 'Odd Grid Row', 'formidable' ), |
|
| 117 | 117 | 'frm_two_col' => array( 'label' => __( '2 Col Options', 'formidable' ), 'title' => __( 'Put your radio button or checkbox options into two columns.', 'formidable' ) ), |
| 118 | 118 | 'frm_three_col' => array( 'label' => __( '3 Col Options', 'formidable' ), 'title' => __( 'Put your radio button or checkbox options into three columns.', 'formidable' ) ), |
| 119 | 119 | 'frm_four_col' => array( 'label' => __( '4 Col Options', 'formidable' ), 'title' => __( 'Put your radio button or checkbox options into four columns.', 'formidable' ) ), |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | 'frm_scroll_box' => array( 'label' => __( 'Scroll Box', 'formidable' ), 'title' => __( 'If you have many checkbox or radio button options, you may add this class to allow your user to easily scroll through the options.', 'formidable' ) ), |
| 122 | 122 | 'frm_text_block' => array( 'label' => __( 'Align Option Text', 'formidable' ), 'title' => __( 'If you have a large amount of text in a checkbox or radio button field, use this class to align all the text in a block.', 'formidable' ) ), |
| 123 | 123 | 'frm_capitalize' => array( 'label' => __( 'Capitalize', 'formidable' ), 'title' => __( 'Automatically capitalize the first letter in each word.', 'formidable' ) ), |
| 124 | - ); |
|
| 124 | + ); |
|
| 125 | 125 | |
| 126 | 126 | $classes = apply_filters( 'frm_layout_classes', $classes ); |
| 127 | 127 | $col = 'one'; |
@@ -138,11 +138,11 @@ discard block |
||
| 138 | 138 | } ?>> |
| 139 | 139 | <?php |
| 140 | 140 | if ( empty( $d ) ) { |
| 141 | - echo $c; |
|
| 141 | + echo $c; |
|
| 142 | 142 | } else if ( ! is_array( $d ) ) { |
| 143 | - echo $d; |
|
| 143 | + echo $d; |
|
| 144 | 144 | } else if ( isset( $d['label'] ) ) { |
| 145 | - echo $d['label']; |
|
| 145 | + echo $d['label']; |
|
| 146 | 146 | } |
| 147 | 147 | ?> |
| 148 | 148 | </a> |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | <ul id="category-tabs" class="category-tabs frm-category-tabs"> |
| 18 | 18 | <li class="tabs" ><a href="#frm-insert-fields" id="frm_insert_fields_tab"><?php _e( 'Fields', 'formidable' ); ?></a></li> |
| 19 | 19 | <li class="hide-if-no-js"><a href="#frm-layout-classes" id="frm_layout_classes_tab" class="frm_help" title="<?php esc_attr_e( 'Open the Field Options and click on the CSS Layout Classes option to enable this tab', 'formidable' ) ?>"><?php _e( 'Layout', 'formidable' ); ?></a></li> |
| 20 | -<?php do_action('frm_extra_form_instruction_tabs'); ?> |
|
| 20 | +<?php do_action( 'frm_extra_form_instruction_tabs' ); ?> |
|
| 21 | 21 | </ul> |
| 22 | 22 | |
| 23 | 23 | <div id="frm-insert-fields" class="tabs-panel"> |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | <?php |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $col_class = empty($col_class) ? 'frm_col_one' : ''; |
|
| 78 | - unset($field_key, $field_type, $field_label); |
|
| 77 | + $col_class = empty( $col_class ) ? 'frm_col_one' : ''; |
|
| 78 | + unset( $field_key, $field_type, $field_label ); |
|
| 79 | 79 | } ?> |
| 80 | 80 | </ul> |
| 81 | 81 | <div class="clear"></div> |
| 82 | 82 | </div> |
| 83 | - <?php do_action('frm_extra_form_instructions'); ?> |
|
| 83 | + <?php do_action( 'frm_extra_form_instructions' ); ?> |
|
| 84 | 84 | |
| 85 | 85 | <div id="frm-layout-classes" class="tabs-panel"> |
| 86 | 86 | <p class="howto"><?php _e( '1. Click inside the "CSS layout classes" field option in any field.', 'formidable' ) ?><br/> |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | <a href="javascript:void(0);" class="frmbutton frm_insert_code button show_frm_classes<?php |
| 133 | 133 | if ( ! empty( $title ) ) { |
| 134 | 134 | echo ' frm_help'; |
| 135 | - } ?>" data-code="<?php echo esc_attr($c) ?>" <?php |
|
| 135 | + } ?>" data-code="<?php echo esc_attr( $c ) ?>" <?php |
|
| 136 | 136 | if ( ! empty( $title ) ) { |
| 137 | - ?>title="<?php echo esc_attr($title); ?>"<?php |
|
| 137 | + ?>title="<?php echo esc_attr( $title ); ?>"<?php |
|
| 138 | 138 | } ?>> |
| 139 | 139 | <?php |
| 140 | 140 | if ( empty( $d ) ) { |
@@ -159,14 +159,14 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | <div class="submitbox" id="major-publishing-actions"> |
| 161 | 161 | <div id="delete-action"> |
| 162 | - <?php echo FrmFormsHelper::delete_trash_link($id, $values['status']); ?> |
|
| 162 | + <?php echo FrmFormsHelper::delete_trash_link( $id, $values['status'] ); ?> |
|
| 163 | 163 | </div> |
| 164 | 164 | |
| 165 | 165 | <div id="publishing-action"> |
| 166 | 166 | <form method="post" id="frm_js_build_form"> |
| 167 | 167 | <span class="spinner"></span> |
| 168 | 168 | <input type="hidden" id="frm_compact_fields" name="frm_compact_fields" value="" /> |
| 169 | - <input type="button" value="<?php echo esc_attr($button) ?>" class="frm_submit_form frm_submit_<?php echo ( isset($values['ajax_load']) && $values['ajax_load'] ) ? '': 'no_'; ?>ajax button-primary button-large" id="frm_submit_side" /> |
|
| 169 | + <input type="button" value="<?php echo esc_attr( $button ) ?>" class="frm_submit_form frm_submit_<?php echo ( isset( $values['ajax_load'] ) && $values['ajax_load'] ) ? '' : 'no_'; ?>ajax button-primary button-large" id="frm_submit_side" /> |
|
| 170 | 170 | </form> |
| 171 | 171 | </div> |
| 172 | 172 | <div class="clear"></div> |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | FrmAppController::get_form_nav( $id, true, 'hide' ); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - ?> |
|
| 22 | + ?> |
|
| 23 | 23 | <div class="frm_form_builder with_frm_style"> |
| 24 | 24 | |
| 25 | 25 | <p class="frm_hidden frm-no-margin"> |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <div class="wrap"> |
| 2 | - <h2><?php echo ( $form->is_template ? __( 'Templates', 'formidable' ) : __( 'Build', 'formidable' )); ?> |
|
| 2 | + <h2><?php echo ( $form->is_template ? __( 'Templates', 'formidable' ) : __( 'Build', 'formidable' ) ); ?> |
|
| 3 | 3 | <a href="?page=formidable&frm_action=new" class="add-new-h2"><?php _e( 'Add New', 'formidable' ); ?></a> |
| 4 | 4 | </h2> |
| 5 | 5 | |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <div class="posttypediv"> |
| 2 | 2 | <ul class="posttype-tabs add-menu-item-tabs"> |
| 3 | 3 | <li <?php echo ( 'default' == $current_tab ? ' class="tabs"' : '' ); ?>> |
| 4 | - <a href="<?php echo esc_url('?page=formidable-styles&page-tab=default#tabs-panel-success-msg') ?>" class="nav-tab-link" data-type="tabs-panel-success-msg" ><?php _e( 'Success', 'formidable' ) ?></a> |
|
| 4 | + <a href="<?php echo esc_url( '?page=formidable-styles&page-tab=default#tabs-panel-success-msg' ) ?>" class="nav-tab-link" data-type="tabs-panel-success-msg" ><?php _e( 'Success', 'formidable' ) ?></a> |
|
| 5 | 5 | </li> |
| 6 | 6 | <li <?php echo ( 'error-msg' == $current_tab ? ' class="tabs"' : '' ); ?>> |
| 7 | - <a href="<?php echo esc_url('?page=formidable-styles&page-tab=error-msge#page-error-msg') ?>" class="nav-tab-link" data-type="tabs-panel-error-msg" ><?php _e( 'Error', 'formidable' ) ?></a> |
|
| 7 | + <a href="<?php echo esc_url( '?page=formidable-styles&page-tab=error-msge#page-error-msg' ) ?>" class="nav-tab-link" data-type="tabs-panel-error-msg" ><?php _e( 'Error', 'formidable' ) ?></a> |
|
| 8 | 8 | </li> |
| 9 | 9 | </ul><!-- .posttype-tabs --> |
| 10 | 10 | |
@@ -14,19 +14,19 @@ discard block |
||
| 14 | 14 | <div class="field-group field-group-border clearfix"> |
| 15 | 15 | <label><?php _e( 'BG color', 'formidable' ) ?></label> |
| 16 | 16 | <div class="hasPicker"> |
| 17 | - <input name="<?php echo esc_attr( $frm_style->get_field_name('success_bg_color') ) ?>" id="frm_success_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['success_bg_color'] ) ?>" type="text" /></div> |
|
| 17 | + <input name="<?php echo esc_attr( $frm_style->get_field_name( 'success_bg_color' ) ) ?>" id="frm_success_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['success_bg_color'] ) ?>" type="text" /></div> |
|
| 18 | 18 | </div> |
| 19 | 19 | <div class="field-group clearfix"> |
| 20 | 20 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
| 21 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('success_border_color') ) ?>" id="frm_success_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['success_border_color'] ) ?>" /> |
|
| 21 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'success_border_color' ) ) ?>" id="frm_success_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['success_border_color'] ) ?>" /> |
|
| 22 | 22 | </div> |
| 23 | 23 | <div class="field-group clearfix"> |
| 24 | 24 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
| 25 | - <input name="<?php echo esc_attr( $frm_style->get_field_name('success_text_color') ) ?>" id="frm_success_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['success_text_color'] ) ?>" type="text" /> |
|
| 25 | + <input name="<?php echo esc_attr( $frm_style->get_field_name( 'success_text_color' ) ) ?>" id="frm_success_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['success_text_color'] ) ?>" type="text" /> |
|
| 26 | 26 | </div> |
| 27 | 27 | <div class="field-group clearfix"> |
| 28 | 28 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
| 29 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('success_font_size') ) ?>" id="frm_success_font_size" value="<?php echo esc_attr( $style->post_content['success_font_size'] ) ?>" size="3" /> |
|
| 29 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'success_font_size' ) ) ?>" id="frm_success_font_size" value="<?php echo esc_attr( $style->post_content['success_font_size'] ) ?>" size="3" /> |
|
| 30 | 30 | </div> |
| 31 | 31 | <div class="clear"></div> |
| 32 | 32 | </div><!-- /.tabs-panel --> |
@@ -37,21 +37,21 @@ discard block |
||
| 37 | 37 | <div class="field-group field-group-border clearfix"> |
| 38 | 38 | <label><?php _e( 'BG color', 'formidable' ) ?></label> |
| 39 | 39 | <div class="hasPicker"> |
| 40 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('error_bg') ) ?>" id="frm_error_bg" class="hex" value="<?php echo esc_attr($style->post_content['error_bg']) ?>" /></div> |
|
| 40 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'error_bg' ) ) ?>" id="frm_error_bg" class="hex" value="<?php echo esc_attr( $style->post_content['error_bg'] ) ?>" /></div> |
|
| 41 | 41 | </div> |
| 42 | 42 | <div class="field-group clearfix"> |
| 43 | 43 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
| 44 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('error_border') ) ?>" id="frm_error_border" class="hex" value="<?php echo esc_attr( $style->post_content['error_border'] ) ?>" /> |
|
| 44 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'error_border' ) ) ?>" id="frm_error_border" class="hex" value="<?php echo esc_attr( $style->post_content['error_border'] ) ?>" /> |
|
| 45 | 45 | </div> |
| 46 | 46 | <div class="field-group clearfix"> |
| 47 | 47 | |
| 48 | 48 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
| 49 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('error_text') ) ?>" id="frm_error_text" class="hex" value="<?php echo esc_attr( $style->post_content['error_text'] ) ?>" /> |
|
| 49 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'error_text' ) ) ?>" id="frm_error_text" class="hex" value="<?php echo esc_attr( $style->post_content['error_text'] ) ?>" /> |
|
| 50 | 50 | </div> |
| 51 | 51 | |
| 52 | 52 | <div class="field-group clearfix"> |
| 53 | 53 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
| 54 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('error_font_size') ) ?>" id="frm_error_font_size" value="<?php echo esc_attr( $style->post_content['error_font_size'] ) ?>" size="3" /> |
|
| 54 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'error_font_size' ) ) ?>" id="frm_error_font_size" value="<?php echo esc_attr( $style->post_content['error_font_size'] ) ?>" size="3" /> |
|
| 55 | 55 | </div> |
| 56 | 56 | <div class="clear"></div> |
| 57 | 57 | </div><!-- /.tabs-panel --> |
@@ -1,42 +1,42 @@ |
||
| 1 | 1 | <div class="field-group clearfix frm-first-row"> |
| 2 | 2 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
| 3 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_font_size') ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" /> |
|
| 3 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_font_size' ) ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" /> |
|
| 4 | 4 | </div> |
| 5 | 5 | |
| 6 | 6 | <div class="field-group clearfix frm-first-row"> |
| 7 | 7 | <label><?php _e( 'Height', 'formidable' ) ?></label> |
| 8 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_height') ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" /> |
|
| 8 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_height' ) ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" /> |
|
| 9 | 9 | </div> |
| 10 | 10 | |
| 11 | 11 | <div class="field-group clearfix frm-first-row"> |
| 12 | 12 | <label><?php _e( 'Width', 'formidable' ) ?></label> |
| 13 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_width') ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" /> |
|
| 13 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_width' ) ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" /> |
|
| 14 | 14 | </div> |
| 15 | 15 | |
| 16 | 16 | <div class="clear"></div> |
| 17 | 17 | <p class="frm_no_bottom_margin"> |
| 18 | - <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('auto_width') ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> /> |
|
| 18 | + <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'auto_width' ) ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> /> |
|
| 19 | 19 | <?php _e( 'Automatic Width for drop-down fields', 'formidable' ) ?></label> |
| 20 | 20 | </p> |
| 21 | 21 | |
| 22 | 22 | <div class="field-group clearfix"> |
| 23 | 23 | <label><?php _e( 'Padding', 'formidable' ) ?></label> |
| 24 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_pad') ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" /> |
|
| 24 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_pad' ) ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" /> |
|
| 25 | 25 | </div> |
| 26 | 26 | |
| 27 | 27 | <div class="field-group clearfix"> |
| 28 | 28 | <label><?php _e( 'Margin', 'formidable' ) ?></label> |
| 29 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_margin') ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" /> |
|
| 29 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_margin' ) ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" /> |
|
| 30 | 30 | </div> |
| 31 | 31 | |
| 32 | 32 | <div class="field-group clearfix"> |
| 33 | 33 | <label><?php _e( 'Corners', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Formidable uses CSS3 border-radius for corner rounding, which is not currently supported by Internet Explorer.', 'formidable' ) ?>" ></span></label> |
| 34 | - <input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name('border_radius') ) ?>" id="frm_border_radius" /> |
|
| 34 | + <input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_radius' ) ) ?>" id="frm_border_radius" /> |
|
| 35 | 35 | </div> |
| 36 | 36 | |
| 37 | 37 | <div class="field-group clearfix frm-first-row"> |
| 38 | 38 | <label><?php _e( 'Weight', 'formidable' ) ?></label> |
| 39 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('field_weight') ) ?>" id="frm_field_weight"> |
|
| 39 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_weight' ) ) ?>" id="frm_field_weight"> |
|
| 40 | 40 | <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?> |
| 41 | 41 | <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['field_weight'], $value ) ?>><?php echo esc_attr( $name ) ?></option> |
| 42 | 42 | <?php } ?> |
@@ -1,26 +1,26 @@ discard block |
||
| 1 | 1 | <div class="field-group clearfix frm-half frm-first-row"> |
| 2 | 2 | <label><?php _e( 'Radio', 'formidable' ) ?></label> |
| 3 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('radio_align') ) ?>" id="frm_radio_align"> |
|
| 4 | - <option value="block" <?php selected($style->post_content['radio_align'], 'block') ?>><?php _e( 'Multiple Rows' , 'formidable' ) ?></option> |
|
| 5 | - <option value="inline" <?php selected($style->post_content['radio_align'], 'inline') ?>><?php _e( 'Single Row' , 'formidable' ) ?></option> |
|
| 3 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'radio_align' ) ) ?>" id="frm_radio_align"> |
|
| 4 | + <option value="block" <?php selected( $style->post_content['radio_align'], 'block' ) ?>><?php _e( 'Multiple Rows', 'formidable' ) ?></option> |
|
| 5 | + <option value="inline" <?php selected( $style->post_content['radio_align'], 'inline' ) ?>><?php _e( 'Single Row', 'formidable' ) ?></option> |
|
| 6 | 6 | </select> |
| 7 | 7 | </div> |
| 8 | 8 | |
| 9 | 9 | <div class="field-group clearfix frm-half frm-first-row"> |
| 10 | 10 | <label><?php _e( 'Check Box', 'formidable' ) ?></label> |
| 11 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('check_align') ) ?>" id="frm_check_align"> |
|
| 12 | - <option value="block" <?php selected($style->post_content['check_align'], 'block') ?>><?php _e( 'Multiple Rows' , 'formidable' ) ?></option> |
|
| 13 | - <option value="inline" <?php selected($style->post_content['check_align'], 'inline') ?>><?php _e( 'Single Row' , 'formidable' ) ?></option> |
|
| 11 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'check_align' ) ) ?>" id="frm_check_align"> |
|
| 12 | + <option value="block" <?php selected( $style->post_content['check_align'], 'block' ) ?>><?php _e( 'Multiple Rows', 'formidable' ) ?></option> |
|
| 13 | + <option value="inline" <?php selected( $style->post_content['check_align'], 'inline' ) ?>><?php _e( 'Single Row', 'formidable' ) ?></option> |
|
| 14 | 14 | </select> |
| 15 | 15 | </div> |
| 16 | 16 | |
| 17 | 17 | <div class="field-group field-group-background clearfix"> |
| 18 | 18 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
| 19 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('check_label_color') ) ?>" id="frm_check_label_color" class="hex" value="<?php echo esc_attr( $style->post_content['check_label_color'] ) ?>" /> |
|
| 19 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'check_label_color' ) ) ?>" id="frm_check_label_color" class="hex" value="<?php echo esc_attr( $style->post_content['check_label_color'] ) ?>" /> |
|
| 20 | 20 | </div> |
| 21 | 21 | <div class="field-group clearfix"> |
| 22 | 22 | <label><?php _e( 'Weight', 'formidable' ) ?></label> |
| 23 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('check_weight') ) ?>" id="frm_check_weight"> |
|
| 23 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'check_weight' ) ) ?>" id="frm_check_weight"> |
|
| 24 | 24 | <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?> |
| 25 | 25 | <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['check_weight'], $value ) ?>><?php echo esc_html( $name ) ?></option> |
| 26 | 26 | <?php } ?> |
@@ -28,5 +28,5 @@ discard block |
||
| 28 | 28 | </div> |
| 29 | 29 | <div class="field-group clearfix"> |
| 30 | 30 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
| 31 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('check_font_size') ) ?>" id="frm_check_font_size" value="<?php echo esc_attr( $style->post_content['check_font_size'] ) ?>" size="3" /> |
|
| 31 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'check_font_size' ) ) ?>" id="frm_check_font_size" value="<?php echo esc_attr( $style->post_content['check_font_size'] ) ?>" size="3" /> |
|
| 32 | 32 | </div> |