@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | <div class="update-nag frm-update-to-pro"> |
139 | 139 | <?php echo FrmAppHelper::kses( $tip['tip'] ) ?> |
140 | 140 | <span><?php echo FrmAppHelper::kses( $tip['call'] ) ?></span> |
141 | - <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidableforms.com?banner=1&tip=' . absint( $tip['num'] ) ) ) ?>" class="button">Upgrade to Pro</a> |
|
141 | + <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com?banner=1&tip=' . absint( $tip['num'] ) ) ) ?>" class="button">Upgrade to Pro</a> |
|
142 | 142 | </div> |
143 | 143 | <?php |
144 | 144 | } |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | } |
371 | 371 | |
372 | 372 | public static function uninstall() { |
373 | - FrmAppHelper::permission_check('administrator'); |
|
373 | + FrmAppHelper::permission_check( 'administrator' ); |
|
374 | 374 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
375 | 375 | |
376 | 376 | $frmdb = new FrmDb(); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | } |
406 | 406 | |
407 | 407 | public static function deauthorize() { |
408 | - FrmAppHelper::permission_check('frm_change_settings'); |
|
408 | + FrmAppHelper::permission_check( 'frm_change_settings' ); |
|
409 | 409 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
410 | 410 | |
411 | 411 | delete_option( 'frmpro-credentials' ); |
@@ -3,14 +3,14 @@ discard block |
||
3 | 3 | class FrmAppController { |
4 | 4 | |
5 | 5 | public static function menu() { |
6 | - FrmAppHelper::maybe_add_permissions(); |
|
7 | - if ( ! current_user_can( 'frm_view_forms' ) ) { |
|
8 | - return; |
|
9 | - } |
|
6 | + FrmAppHelper::maybe_add_permissions(); |
|
7 | + if ( ! current_user_can( 'frm_view_forms' ) ) { |
|
8 | + return; |
|
9 | + } |
|
10 | 10 | |
11 | 11 | $menu_name = FrmAppHelper::get_menu_name(); |
12 | 12 | add_menu_page( 'Formidable', $menu_name, 'frm_view_forms', 'formidable', 'FrmFormsController::route', '', self::get_menu_position() ); |
13 | - } |
|
13 | + } |
|
14 | 14 | |
15 | 15 | private static function get_menu_position() { |
16 | 16 | $count = count( get_post_types( array( 'show_ui' => true, '_builtin' => false, 'show_in_menu' => true ) ) ); |
@@ -19,15 +19,15 @@ discard block |
||
19 | 19 | return $pos; |
20 | 20 | } |
21 | 21 | |
22 | - public static function load_wp_admin_style() { |
|
23 | - FrmAppHelper::load_font_style(); |
|
24 | - } |
|
22 | + public static function load_wp_admin_style() { |
|
23 | + FrmAppHelper::load_font_style(); |
|
24 | + } |
|
25 | 25 | |
26 | 26 | public static function get_form_nav( $form, $show_nav = false, $title = 'show' ) { |
27 | 27 | $show_nav = FrmAppHelper::get_param( 'show_nav', $show_nav, 'get', 'absint' ); |
28 | - if ( empty( $show_nav ) || ! $form ) { |
|
29 | - return; |
|
30 | - } |
|
28 | + if ( empty( $show_nav ) || ! $form ) { |
|
29 | + return; |
|
30 | + } |
|
31 | 31 | |
32 | 32 | FrmForm::maybe_get_form( $form ); |
33 | 33 | if ( ! is_object( $form ) ) { |
@@ -85,28 +85,28 @@ discard block |
||
85 | 85 | return $nav_items; |
86 | 86 | } |
87 | 87 | |
88 | - // Adds a settings link to the plugins page |
|
89 | - public static function settings_link( $links ) { |
|
88 | + // Adds a settings link to the plugins page |
|
89 | + public static function settings_link( $links ) { |
|
90 | 90 | $settings = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-settings' ) ) . '">' . __( 'Settings', 'formidable' ) . '</a>'; |
91 | - array_unshift( $links, $settings ); |
|
91 | + array_unshift( $links, $settings ); |
|
92 | 92 | |
93 | - return $links; |
|
94 | - } |
|
93 | + return $links; |
|
94 | + } |
|
95 | 95 | |
96 | - public static function pro_get_started_headline() { |
|
96 | + public static function pro_get_started_headline() { |
|
97 | 97 | self::maybe_show_upgrade_bar(); |
98 | 98 | |
99 | - // Don't display this error as we're upgrading the thing, or if the user shouldn't see the message |
|
100 | - if ( 'upgrade-plugin' == FrmAppHelper::simple_get( 'action', 'sanitize_title' ) || ! current_user_can( 'update_plugins' ) ) { |
|
101 | - return; |
|
102 | - } |
|
99 | + // Don't display this error as we're upgrading the thing, or if the user shouldn't see the message |
|
100 | + if ( 'upgrade-plugin' == FrmAppHelper::simple_get( 'action', 'sanitize_title' ) || ! current_user_can( 'update_plugins' ) ) { |
|
101 | + return; |
|
102 | + } |
|
103 | 103 | |
104 | 104 | if ( get_site_option( 'frmpro-authorized' ) && ! file_exists( FrmAppHelper::plugin_path() . '/pro/formidable-pro.php' ) ) { |
105 | - FrmAppHelper::load_admin_wide_js(); |
|
105 | + FrmAppHelper::load_admin_wide_js(); |
|
106 | 106 | |
107 | - // user is authorized, but running free version |
|
108 | - $inst_install_url = 'https://formidableforms.com/knowledgebase/install-formidable-forms/'; |
|
109 | - ?> |
|
107 | + // user is authorized, but running free version |
|
108 | + $inst_install_url = 'https://formidableforms.com/knowledgebase/install-formidable-forms/'; |
|
109 | + ?> |
|
110 | 110 | <div class="error" class="frm_previous_install"> |
111 | 111 | <?php |
112 | 112 | echo wp_kses_post( apply_filters( 'frm_pro_update_msg', |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | ) ); ?> |
119 | 119 | </div> |
120 | 120 | <?php |
121 | - } |
|
122 | - } |
|
121 | + } |
|
122 | + } |
|
123 | 123 | |
124 | 124 | private static function maybe_show_upgrade_bar() { |
125 | 125 | $page = FrmAppHelper::simple_get( 'page', 'sanitize_title' ); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | } |
225 | 225 | } |
226 | 226 | |
227 | - public static function admin_js() { |
|
227 | + public static function admin_js() { |
|
228 | 228 | $version = FrmAppHelper::plugin_version(); |
229 | 229 | FrmAppHelper::load_admin_wide_js( false ); |
230 | 230 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | 'bootstrap_tooltip', 'bootstrap-multiselect', |
236 | 236 | ), $version, true ); |
237 | 237 | wp_register_style( 'formidable-admin', FrmAppHelper::plugin_url() . '/css/frm_admin.css', array(), $version ); |
238 | - wp_register_script( 'bootstrap_tooltip', FrmAppHelper::plugin_url() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.4' ); |
|
238 | + wp_register_script( 'bootstrap_tooltip', FrmAppHelper::plugin_url() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.4' ); |
|
239 | 239 | wp_register_style( 'formidable-grids', FrmAppHelper::plugin_url() . '/css/frm_grids.css', array(), $version ); |
240 | 240 | |
241 | 241 | // load multselect js |
@@ -247,54 +247,54 @@ discard block |
||
247 | 247 | global $pagenow; |
248 | 248 | if ( strpos( $page, 'formidable' ) === 0 || ( $pagenow == 'edit.php' && $post_type == 'frm_display' ) ) { |
249 | 249 | |
250 | - wp_enqueue_script( 'admin-widgets' ); |
|
251 | - wp_enqueue_style( 'widgets' ); |
|
252 | - wp_enqueue_script( 'formidable' ); |
|
253 | - wp_enqueue_script( 'formidable_admin' ); |
|
250 | + wp_enqueue_script( 'admin-widgets' ); |
|
251 | + wp_enqueue_style( 'widgets' ); |
|
252 | + wp_enqueue_script( 'formidable' ); |
|
253 | + wp_enqueue_script( 'formidable_admin' ); |
|
254 | 254 | FrmAppHelper::localize_script( 'admin' ); |
255 | 255 | |
256 | - wp_enqueue_style( 'formidable-admin' ); |
|
256 | + wp_enqueue_style( 'formidable-admin' ); |
|
257 | 257 | wp_enqueue_style( 'formidable-grids' ); |
258 | 258 | wp_enqueue_style( 'formidable-dropzone' ); |
259 | - add_thickbox(); |
|
259 | + add_thickbox(); |
|
260 | 260 | |
261 | - wp_register_script( 'formidable-editinplace', FrmAppHelper::plugin_url() . '/js/jquery/jquery.editinplace.packed.js', array( 'jquery' ), '2.3.0' ); |
|
261 | + wp_register_script( 'formidable-editinplace', FrmAppHelper::plugin_url() . '/js/jquery/jquery.editinplace.packed.js', array( 'jquery' ), '2.3.0' ); |
|
262 | 262 | |
263 | - } else if ( $pagenow == 'post.php' || ( $pagenow == 'post-new.php' && $post_type == 'frm_display' ) ) { |
|
264 | - if ( isset( $_REQUEST['post_type'] ) ) { |
|
265 | - $post_type = sanitize_title( $_REQUEST['post_type'] ); |
|
263 | + } else if ( $pagenow == 'post.php' || ( $pagenow == 'post-new.php' && $post_type == 'frm_display' ) ) { |
|
264 | + if ( isset( $_REQUEST['post_type'] ) ) { |
|
265 | + $post_type = sanitize_title( $_REQUEST['post_type'] ); |
|
266 | 266 | } else if ( isset( $_REQUEST['post'] ) && absint( $_REQUEST['post'] ) ) { |
267 | 267 | $post = get_post( absint( $_REQUEST['post'] ) ); |
268 | - if ( ! $post ) { |
|
269 | - return; |
|
270 | - } |
|
271 | - $post_type = $post->post_type; |
|
272 | - } else { |
|
273 | - return; |
|
274 | - } |
|
275 | - |
|
276 | - if ( $post_type == 'frm_display' ) { |
|
277 | - wp_enqueue_script( 'jquery-ui-draggable' ); |
|
278 | - wp_enqueue_script( 'formidable_admin' ); |
|
279 | - wp_enqueue_style( 'formidable-admin' ); |
|
268 | + if ( ! $post ) { |
|
269 | + return; |
|
270 | + } |
|
271 | + $post_type = $post->post_type; |
|
272 | + } else { |
|
273 | + return; |
|
274 | + } |
|
275 | + |
|
276 | + if ( $post_type == 'frm_display' ) { |
|
277 | + wp_enqueue_script( 'jquery-ui-draggable' ); |
|
278 | + wp_enqueue_script( 'formidable_admin' ); |
|
279 | + wp_enqueue_style( 'formidable-admin' ); |
|
280 | 280 | FrmAppHelper::localize_script( 'admin' ); |
281 | - } |
|
282 | - } else if ( $pagenow == 'widgets.php' ) { |
|
283 | - FrmAppHelper::load_admin_wide_js(); |
|
284 | - } |
|
285 | - } |
|
286 | - |
|
287 | - public static function load_lang() { |
|
288 | - load_plugin_textdomain( 'formidable', false, FrmAppHelper::plugin_folder() . '/languages/' ); |
|
289 | - } |
|
290 | - |
|
291 | - /** |
|
292 | - * Filter shortcodes in text widgets |
|
293 | - */ |
|
294 | - public static function widget_text_filter( $content ) { |
|
295 | - $regex = '/\[\s*(formidable|display-frm-data|frm-stats|frm-graph|frm-entry-links|formresults|frm-search)\s+.*\]/'; |
|
296 | - return preg_replace_callback( $regex, 'FrmAppHelper::widget_text_filter_callback', $content ); |
|
297 | - } |
|
281 | + } |
|
282 | + } else if ( $pagenow == 'widgets.php' ) { |
|
283 | + FrmAppHelper::load_admin_wide_js(); |
|
284 | + } |
|
285 | + } |
|
286 | + |
|
287 | + public static function load_lang() { |
|
288 | + load_plugin_textdomain( 'formidable', false, FrmAppHelper::plugin_folder() . '/languages/' ); |
|
289 | + } |
|
290 | + |
|
291 | + /** |
|
292 | + * Filter shortcodes in text widgets |
|
293 | + */ |
|
294 | + public static function widget_text_filter( $content ) { |
|
295 | + $regex = '/\[\s*(formidable|display-frm-data|frm-stats|frm-graph|frm-entry-links|formresults|frm-search)\s+.*\]/'; |
|
296 | + return preg_replace_callback( $regex, 'FrmAppHelper::widget_text_filter_callback', $content ); |
|
297 | + } |
|
298 | 298 | |
299 | 299 | /** |
300 | 300 | * Deprecated in favor of wpmu_upgrade_site |
@@ -359,20 +359,20 @@ discard block |
||
359 | 359 | wp_die(); |
360 | 360 | } |
361 | 361 | |
362 | - public static function activation_install() { |
|
363 | - FrmAppHelper::delete_cache_and_transient( 'frm_plugin_version' ); |
|
364 | - FrmFormActionsController::actions_init(); |
|
365 | - self::install(); |
|
366 | - } |
|
362 | + public static function activation_install() { |
|
363 | + FrmAppHelper::delete_cache_and_transient( 'frm_plugin_version' ); |
|
364 | + FrmFormActionsController::actions_init(); |
|
365 | + self::install(); |
|
366 | + } |
|
367 | 367 | |
368 | - public static function install( $old_db_version = false ) { |
|
369 | - $frmdb = new FrmDb(); |
|
370 | - $frmdb->upgrade( $old_db_version ); |
|
371 | - } |
|
368 | + public static function install( $old_db_version = false ) { |
|
369 | + $frmdb = new FrmDb(); |
|
370 | + $frmdb->upgrade( $old_db_version ); |
|
371 | + } |
|
372 | 372 | |
373 | - public static function uninstall() { |
|
373 | + public static function uninstall() { |
|
374 | 374 | FrmAppHelper::permission_check('administrator'); |
375 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
375 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
376 | 376 | |
377 | 377 | $frmdb = new FrmDb(); |
378 | 378 | $frmdb->uninstall(); |
@@ -381,43 +381,43 @@ discard block |
||
381 | 381 | deactivate_plugins( FrmAppHelper::plugin_folder() . '/formidable.php', false, false ); |
382 | 382 | echo esc_url_raw( admin_url( 'plugins.php?deactivate=true' ) ); |
383 | 383 | |
384 | - wp_die(); |
|
385 | - } |
|
384 | + wp_die(); |
|
385 | + } |
|
386 | 386 | |
387 | - public static function drop_tables( $tables ) { |
|
388 | - global $wpdb; |
|
389 | - $tables[] = $wpdb->prefix . 'frm_fields'; |
|
390 | - $tables[] = $wpdb->prefix . 'frm_forms'; |
|
391 | - $tables[] = $wpdb->prefix . 'frm_items'; |
|
392 | - $tables[] = $wpdb->prefix . 'frm_item_metas'; |
|
393 | - return $tables; |
|
394 | - } |
|
387 | + public static function drop_tables( $tables ) { |
|
388 | + global $wpdb; |
|
389 | + $tables[] = $wpdb->prefix . 'frm_fields'; |
|
390 | + $tables[] = $wpdb->prefix . 'frm_forms'; |
|
391 | + $tables[] = $wpdb->prefix . 'frm_items'; |
|
392 | + $tables[] = $wpdb->prefix . 'frm_item_metas'; |
|
393 | + return $tables; |
|
394 | + } |
|
395 | 395 | |
396 | - // Routes for wordpress pages -- we're just replacing content here folks. |
|
397 | - public static function page_route( $content ) { |
|
398 | - global $post; |
|
396 | + // Routes for wordpress pages -- we're just replacing content here folks. |
|
397 | + public static function page_route( $content ) { |
|
398 | + global $post; |
|
399 | 399 | |
400 | - $frm_settings = FrmAppHelper::get_settings(); |
|
401 | - if ( $post && $post->ID == $frm_settings->preview_page_id && isset( $_GET['form'] ) ) { |
|
402 | - $content = FrmFormsController::page_preview(); |
|
403 | - } |
|
400 | + $frm_settings = FrmAppHelper::get_settings(); |
|
401 | + if ( $post && $post->ID == $frm_settings->preview_page_id && isset( $_GET['form'] ) ) { |
|
402 | + $content = FrmFormsController::page_preview(); |
|
403 | + } |
|
404 | 404 | |
405 | - return $content; |
|
406 | - } |
|
405 | + return $content; |
|
406 | + } |
|
407 | 407 | |
408 | - public static function deauthorize() { |
|
408 | + public static function deauthorize() { |
|
409 | 409 | FrmAppHelper::permission_check('frm_change_settings'); |
410 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
411 | - |
|
412 | - delete_option( 'frmpro-credentials' ); |
|
413 | - delete_option( 'frmpro-authorized' ); |
|
414 | - delete_site_option( 'frmpro-credentials' ); |
|
415 | - delete_site_option( 'frmpro-authorized' ); |
|
416 | - wp_die(); |
|
417 | - } |
|
418 | - |
|
419 | - public static function get_form_shortcode( $atts ) { |
|
420 | - _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form_shortcode()' ); |
|
421 | - return FrmFormsController::get_form_shortcode( $atts ); |
|
422 | - } |
|
410 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
411 | + |
|
412 | + delete_option( 'frmpro-credentials' ); |
|
413 | + delete_option( 'frmpro-authorized' ); |
|
414 | + delete_site_option( 'frmpro-credentials' ); |
|
415 | + delete_site_option( 'frmpro-authorized' ); |
|
416 | + wp_die(); |
|
417 | + } |
|
418 | + |
|
419 | + public static function get_form_shortcode( $atts ) { |
|
420 | + _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form_shortcode()' ); |
|
421 | + return FrmFormsController::get_form_shortcode( $atts ); |
|
422 | + } |
|
423 | 423 | } |
@@ -58,9 +58,9 @@ |
||
58 | 58 | <tr> |
59 | 59 | <th>Included AddOns</th> |
60 | 60 | <td>None</td> |
61 | - <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidableforms.com/pricing/#addon-lists') ) ?>" target="_blank">Premium Addons</a></td> |
|
62 | - <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidableforms.com/pricing/#addon-lists') ) ?>" target="_blank">Advanced Addons</a></td> |
|
63 | - <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidableforms.com/pricing/#addon-lists') ) ?>" target="_blank">Enterprise Addons</a></td> |
|
61 | + <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/pricing/#addon-lists' ) ) ?>" target="_blank">Premium Addons</a></td> |
|
62 | + <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/pricing/#addon-lists' ) ) ?>" target="_blank">Advanced Addons</a></td> |
|
63 | + <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/pricing/#addon-lists' ) ) ?>" target="_blank">Enterprise Addons</a></td> |
|
64 | 64 | </tr> |
65 | 65 | </tbody> |
66 | 66 | </table> |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <div class="frmcenter frm_no_entries_form"> |
2 | 2 | <?php |
3 | -if ( $form && isset($form->options['no_save']) && $form->options['no_save'] ) { ?> |
|
3 | +if ( $form && isset( $form->options['no_save'] ) && $form->options['no_save'] ) { ?> |
|
4 | 4 | <h3><?php _e( 'This form is not set to save any entries.', 'formidable' ) ?></h3> |
5 | 5 | <p>If you would like entries in this form to be saved, go to the <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable' ) . '&frm_action=settings&id=' . $form->id ) ?>">form Settings</a> page and uncheck the "Do not store any entries submitted from this form" box.</p> |
6 | 6 | <?php |
7 | 7 | } else if ( $form ) { |
8 | 8 | ?> |
9 | -<div class="frm_no_entries_header"><?php printf(__( 'No Entries for form: %s', 'formidable' ), $form->name); ?></div> |
|
10 | -<p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthe docs%2$s or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidableforms.com/knowledgebase/publish-your-forms/" target="_blank">', '</a> <br/>', '<a href="' . esc_url( admin_url('admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p> |
|
9 | +<div class="frm_no_entries_header"><?php printf( __( 'No Entries for form: %s', 'formidable' ), $form->name ); ?></div> |
|
10 | +<p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthe docs%2$s or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidableforms.com/knowledgebase/publish-your-forms/" target="_blank">', '</a> <br/>', '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p> |
|
11 | 11 | <?php |
12 | 12 | } else { |
13 | 13 | ?> |
@@ -14,44 +14,44 @@ |
||
14 | 14 | <div class="inside"> |
15 | 15 | <table class="form-table"><tbody> |
16 | 16 | <?php |
17 | - $first_h3 = 'frm_first_h3'; |
|
18 | - foreach ( $fields as $field ) { |
|
17 | + $first_h3 = 'frm_first_h3'; |
|
18 | + foreach ( $fields as $field ) { |
|
19 | 19 | if ( in_array( $field->type, array( 'captcha', 'html', 'end_divider', 'form' ) ) ) { |
20 | - continue; |
|
21 | - } |
|
20 | + continue; |
|
21 | + } |
|
22 | 22 | |
23 | - if ( in_array($field->type, array( 'break', 'divider' ) ) ) { |
|
24 | - ?> |
|
23 | + if ( in_array($field->type, array( 'break', 'divider' ) ) ) { |
|
24 | + ?> |
|
25 | 25 | </tbody></table> |
26 | 26 | <br/><h3 class="<?php echo esc_attr( $first_h3 ) ?>"><?php echo esc_html( $field->name ) ?></h3> |
27 | 27 | <table class="form-table"><tbody> |
28 | 28 | <?php |
29 | - $first_h3 = ''; |
|
30 | - } else { |
|
31 | - ?> |
|
29 | + $first_h3 = ''; |
|
30 | + } else { |
|
31 | + ?> |
|
32 | 32 | <tr> |
33 | 33 | <th scope="row"><?php echo esc_html( $field->name ) ?>:</th> |
34 | 34 | <td> |
35 | 35 | <?php |
36 | 36 | $embedded_field_id = ( $entry->form_id != $field->form_id ) ? 'form' . $field->form_id : 0; |
37 | - $atts = array( |
|
38 | - 'type' => $field->type, 'post_id' => $entry->post_id, |
|
39 | - 'show_filename' => true, 'show_icon' => true, 'entry_id' => $entry->id, |
|
40 | - 'embedded_field_id' => $embedded_field_id, |
|
41 | - ); |
|
37 | + $atts = array( |
|
38 | + 'type' => $field->type, 'post_id' => $entry->post_id, |
|
39 | + 'show_filename' => true, 'show_icon' => true, 'entry_id' => $entry->id, |
|
40 | + 'embedded_field_id' => $embedded_field_id, |
|
41 | + ); |
|
42 | 42 | $display_value = FrmEntriesHelper::prepare_display_value( $entry, $field, $atts ); |
43 | 43 | echo $display_value; |
44 | 44 | |
45 | - if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) { |
|
46 | - $to_emails[] = $display_value; |
|
47 | - } |
|
48 | - ?> |
|
45 | + if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) { |
|
46 | + $to_emails[] = $display_value; |
|
47 | + } |
|
48 | + ?> |
|
49 | 49 | </td> |
50 | 50 | </tr> |
51 | 51 | <?php } |
52 | - } |
|
52 | + } |
|
53 | 53 | |
54 | - ?> |
|
54 | + ?> |
|
55 | 55 | |
56 | 56 | <?php if ( $entry->parent_item_id ) { ?> |
57 | 57 | <tr><th><?php _e( 'Parent Entry ID', 'formidable' ) ?>:</th> |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <div id="form_show_entry_page" class="wrap"> |
2 | 2 | <h2 class="frm_no_print"><?php _e( 'View Entry', 'formidable' ) ?> |
3 | - <?php do_action('frm_entry_inside_h2', $entry->form_id); ?> |
|
3 | + <?php do_action( 'frm_entry_inside_h2', $entry->form_id ); ?> |
|
4 | 4 | </h2> |
5 | 5 | |
6 | 6 | <div class="frm_forms"> |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | <div id="poststuff"> |
9 | 9 | <div id="post-body" class="metabox-holder columns-2"> |
10 | 10 | <div id="post-body-content"> |
11 | - <?php FrmAppController::get_form_nav($entry->form_id, true); ?> |
|
11 | + <?php FrmAppController::get_form_nav( $entry->form_id, true ); ?> |
|
12 | 12 | <div class="postbox"> |
13 | 13 | <h3 class="hndle"><span><?php _e( 'Entry', 'formidable' ) ?></span></h3> |
14 | 14 | <div class="inside"> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | continue; |
21 | 21 | } |
22 | 22 | |
23 | - if ( in_array($field->type, array( 'break', 'divider' ) ) ) { |
|
23 | + if ( in_array( $field->type, array( 'break', 'divider' ) ) ) { |
|
24 | 24 | ?> |
25 | 25 | </tbody></table> |
26 | 26 | <br/><h3 class="<?php echo esc_attr( $first_h3 ) ?>"><?php echo esc_html( $field->name ) ?></h3> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $display_value = FrmEntriesHelper::prepare_display_value( $entry, $field, $atts ); |
43 | 43 | echo $display_value; |
44 | 44 | |
45 | - if ( is_email($display_value) && ! in_array($display_value, $to_emails) ) { |
|
45 | + if ( is_email( $display_value ) && ! in_array( $display_value, $to_emails ) ) { |
|
46 | 46 | $to_emails[] = $display_value; |
47 | 47 | } |
48 | 48 | ?> |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | </td></tr> |
60 | 60 | <?php } ?> |
61 | 61 | </tbody></table> |
62 | - <?php do_action('frm_show_entry', $entry); ?> |
|
62 | + <?php do_action( 'frm_show_entry', $entry ); ?> |
|
63 | 63 | </div> |
64 | 64 | </div> |
65 | 65 | |
66 | - <?php do_action('frm_after_show_entry', $entry); ?> |
|
66 | + <?php do_action( 'frm_after_show_entry', $entry ); ?> |
|
67 | 67 | |
68 | 68 | </div> |
69 | 69 | <?php require( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/sidebar-show.php' ); ?> |
@@ -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 | if ( ! isset( $action_control->action_options['event'] ) ) { |
16 | 16 | $events = 'create'; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | if ( count( $action_control->action_options['event'] ) == 1 || $action_control->action_options['force_event'] ) { |
24 | 24 | foreach ( $action_control->action_options['event'] as $e ) { ?> |
25 | - <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" value="<?php echo esc_attr( $e ) ?>" /> |
|
25 | + <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" value="<?php echo esc_attr( $e ) ?>" /> |
|
26 | 26 | <?php |
27 | 27 | } |
28 | 28 | } else { |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | <h3><?php _e( 'Action Triggers', 'formidable' ); ?></h3> |
31 | 31 | <p> |
32 | 32 | <label class="frm_left_label"><?php _e( 'Trigger this action after', 'formidable' ) ?></label> |
33 | - <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') ) ?>"> |
|
33 | + <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' ) ) ?>"> |
|
34 | 34 | <?php |
35 | 35 | |
36 | 36 | $event_labels = FrmFormAction::trigger_labels(); |
37 | 37 | foreach ( $action_control->action_options['event'] as $event ) { ?> |
38 | - <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> |
|
38 | + <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> |
|
39 | 39 | <?php |
40 | 40 | }?> |
41 | 41 | </select> |
@@ -47,5 +47,5 @@ discard block |
||
47 | 47 | do_action( 'frm_additional_action_settings', $form_action, $pass_args ); |
48 | 48 | |
49 | 49 | ?> |
50 | -<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> |
|
50 | +<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> |
|
51 | 51 | <div style="clear:both;"></div> |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | 'swanky-purse' => 'Swanky Purse', |
30 | 30 | ); |
31 | 31 | |
32 | - $themes = apply_filters('frm_jquery_themes', $themes); |
|
32 | + $themes = apply_filters( 'frm_jquery_themes', $themes ); |
|
33 | 33 | return $themes; |
34 | 34 | } |
35 | 35 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | |
41 | 41 | if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
42 | 42 | $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
43 | - } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
43 | + } else if ( preg_match( '/^http.?:\/\/.*\..*$/', $theme_css ) ) { |
|
44 | 44 | $css_file = $theme_css; |
45 | 45 | } else { |
46 | 46 | $uploads = self::get_upload_base(); |
47 | 47 | $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css'; |
48 | - if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
48 | + if ( file_exists( $uploads['basedir'] . $file_path ) ) { |
|
49 | 49 | $css_file = $uploads['baseurl'] . $file_path; |
50 | 50 | } else { |
51 | 51 | $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $form = self::get_form_for_page(); |
60 | 60 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
61 | 61 | if ( $theme_css != -1 ) { |
62 | - wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
62 | + wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() ); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | |
80 | 80 | public static function get_upload_base() { |
81 | 81 | $uploads = wp_upload_dir(); |
82 | - if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
83 | - $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
82 | + if ( is_ssl() && ! preg_match( '/^https:\/\/.*\..*$/', $uploads['baseurl'] ) ) { |
|
83 | + $uploads['baseurl'] = str_replace( 'http://', 'https://', $uploads['baseurl'] ); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | return $uploads; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | <h2 class="nav-tab-wrapper"> |
92 | 92 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles' ) ) ?>" class="nav-tab <?php echo ( '' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Edit Styles', 'formidable' ) ?></a> |
93 | 93 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=manage' ) ) ?>" class="nav-tab <?php echo ( 'manage' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Manage Form Styles', 'formidable' ) ?></a> |
94 | - <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Custom CSS', 'formidable' ) ?></a> |
|
94 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Custom CSS', 'formidable' ) ?></a> |
|
95 | 95 | </h2> |
96 | 96 | <?php |
97 | 97 | } |
@@ -130,15 +130,15 @@ discard block |
||
130 | 130 | * @return The class for this icon |
131 | 131 | */ |
132 | 132 | public static function icon_key_to_class( $key, $icon = '+', $type = 'arrow' ) { |
133 | - if ( 'arrow' == $type && is_numeric($key) ) { |
|
133 | + if ( 'arrow' == $type && is_numeric( $key ) ) { |
|
134 | 134 | //frm_arrowup6_icon |
135 | 135 | $arrow = array( '-' => 'down', '+' => 'up' ); |
136 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
136 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
137 | 137 | } else { |
138 | 138 | //frm_minus1_icon |
139 | - $key = str_replace('p', '', $key); |
|
139 | + $key = str_replace( 'p', '', $key ); |
|
140 | 140 | $plus = array( '-' => 'minus', '+' => 'plus' ); |
141 | - $class = 'frm_' . $plus[ $icon ]; |
|
141 | + $class = 'frm_' . $plus[$icon]; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | if ( $key ) { |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | |
157 | 157 | $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
158 | 158 | ?> |
159 | - <select name="<?php echo esc_attr( $frm_style->get_field_name($name) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
|
159 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
|
160 | 160 | <?php foreach ( $icons as $key => $icon ) { ?> |
161 | - <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $style->post_content[ $name ], $key ) ?>> |
|
161 | + <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $style->post_content[$name], $key ) ?>> |
|
162 | 162 | <?php echo '' . $icon['+'] . '; ' . $icon['-'] . ';'; ?> |
163 | 163 | </option> |
164 | 164 | <?php } ?> |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | |
167 | 167 | <div class="btn-group hide-if-no-js" id="frm_<?php echo esc_attr( $name ) ?>_select"> |
168 | 168 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
169 | - <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ) ?>"></i> |
|
170 | - <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ) ?>"></i> |
|
169 | + <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[$name], '+', $type ) ) ?>"></i> |
|
170 | + <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[$name], '-', $type ) ) ?>"></i> |
|
171 | 171 | <b class="caret"></b> |
172 | 172 | </button> |
173 | 173 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -190,9 +190,9 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | public static function hex2rgb( $hex ) { |
193 | - $hex = str_replace('#', '', $hex); |
|
193 | + $hex = str_replace( '#', '', $hex ); |
|
194 | 194 | |
195 | - if ( strlen($hex) == 3 ) { |
|
195 | + if ( strlen( $hex ) == 3 ) { |
|
196 | 196 | $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); |
197 | 197 | $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); |
198 | 198 | $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $b = hexdec( substr( $hex, 4, 2 ) ); |
203 | 203 | } |
204 | 204 | $rgb = array( $r, $g, $b ); |
205 | - return implode(',', $rgb); // returns the rgb values separated by commas |
|
205 | + return implode( ',', $rgb ); // returns the rgb values separated by commas |
|
206 | 206 | //return $rgb; // returns an array with the rgb values |
207 | 207 | } |
208 | 208 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @since 2.3 |
213 | 213 | */ |
214 | 214 | public static function adjust_brightness( $hex, $steps ) { |
215 | - $steps = max( -255, min( 255, $steps ) ); |
|
215 | + $steps = max( - 255, min( 255, $steps ) ); |
|
216 | 216 | |
217 | 217 | // Normalize into a six character long hex string |
218 | 218 | $hex = str_replace( '#', '', $hex ); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | foreach ( $color_parts as $color ) { |
230 | 230 | $color = hexdec( $color ); // Convert to decimal |
231 | - $color = max( 0,min( 255,$color + $steps ) ); // Adjust color |
|
231 | + $color = max( 0, min( 255, $color + $steps ) ); // Adjust color |
|
232 | 232 | $return .= str_pad( dechex( $color ), 2, '0', STR_PAD_LEFT ); // Make two char hex code |
233 | 233 | } |
234 | 234 | |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | |
264 | 264 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
265 | 265 | foreach ( $checkbox_opts as $opt ) { |
266 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
267 | - $settings[ $opt ] = 0; |
|
266 | + if ( ! isset( $settings[$opt] ) ) { |
|
267 | + $settings[$opt] = 0; |
|
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $colors = self::allow_color_override(); |
281 | 281 | foreach ( $colors as $css => $opts ) { |
282 | 282 | foreach ( $opts as $opt ) { |
283 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
283 | + self::get_color_output( $css, $settings[$opt] ); |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 | } |
@@ -1,67 +1,67 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | class FrmStylesHelper { |
3 | 3 | |
4 | - public static function jquery_themes() { |
|
5 | - $themes = array( |
|
6 | - 'ui-lightness' => 'UI Lightness', |
|
7 | - 'ui-darkness' => 'UI Darkness', |
|
8 | - 'smoothness' => 'Smoothness', |
|
9 | - 'start' => 'Start', |
|
10 | - 'redmond' => 'Redmond', |
|
11 | - 'sunny' => 'Sunny', |
|
12 | - 'overcast' => 'Overcast', |
|
13 | - 'le-frog' => 'Le Frog', |
|
14 | - 'flick' => 'Flick', |
|
4 | + public static function jquery_themes() { |
|
5 | + $themes = array( |
|
6 | + 'ui-lightness' => 'UI Lightness', |
|
7 | + 'ui-darkness' => 'UI Darkness', |
|
8 | + 'smoothness' => 'Smoothness', |
|
9 | + 'start' => 'Start', |
|
10 | + 'redmond' => 'Redmond', |
|
11 | + 'sunny' => 'Sunny', |
|
12 | + 'overcast' => 'Overcast', |
|
13 | + 'le-frog' => 'Le Frog', |
|
14 | + 'flick' => 'Flick', |
|
15 | 15 | 'pepper-grinder' => 'Pepper Grinder', |
16 | - 'eggplant' => 'Eggplant', |
|
17 | - 'dark-hive' => 'Dark Hive', |
|
18 | - 'cupertino' => 'Cupertino', |
|
19 | - 'south-street' => 'South Street', |
|
20 | - 'blitzer' => 'Blitzer', |
|
21 | - 'humanity' => 'Humanity', |
|
22 | - 'hot-sneaks' => 'Hot Sneaks', |
|
23 | - 'excite-bike' => 'Excite Bike', |
|
24 | - 'vader' => 'Vader', |
|
25 | - 'dot-luv' => 'Dot Luv', |
|
26 | - 'mint-choc' => 'Mint Choc', |
|
27 | - 'black-tie' => 'Black Tie', |
|
28 | - 'trontastic' => 'Trontastic', |
|
29 | - 'swanky-purse' => 'Swanky Purse', |
|
30 | - ); |
|
31 | - |
|
32 | - $themes = apply_filters('frm_jquery_themes', $themes); |
|
33 | - return $themes; |
|
34 | - } |
|
16 | + 'eggplant' => 'Eggplant', |
|
17 | + 'dark-hive' => 'Dark Hive', |
|
18 | + 'cupertino' => 'Cupertino', |
|
19 | + 'south-street' => 'South Street', |
|
20 | + 'blitzer' => 'Blitzer', |
|
21 | + 'humanity' => 'Humanity', |
|
22 | + 'hot-sneaks' => 'Hot Sneaks', |
|
23 | + 'excite-bike' => 'Excite Bike', |
|
24 | + 'vader' => 'Vader', |
|
25 | + 'dot-luv' => 'Dot Luv', |
|
26 | + 'mint-choc' => 'Mint Choc', |
|
27 | + 'black-tie' => 'Black Tie', |
|
28 | + 'trontastic' => 'Trontastic', |
|
29 | + 'swanky-purse' => 'Swanky Purse', |
|
30 | + ); |
|
31 | + |
|
32 | + $themes = apply_filters('frm_jquery_themes', $themes); |
|
33 | + return $themes; |
|
34 | + } |
|
35 | 35 | |
36 | 36 | public static function jquery_css_url( $theme_css ) { |
37 | - if ( $theme_css == -1 ) { |
|
38 | - return; |
|
39 | - } |
|
40 | - |
|
41 | - if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
42 | - $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
43 | - } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
44 | - $css_file = $theme_css; |
|
45 | - } else { |
|
46 | - $uploads = self::get_upload_base(); |
|
37 | + if ( $theme_css == -1 ) { |
|
38 | + return; |
|
39 | + } |
|
40 | + |
|
41 | + if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
42 | + $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
43 | + } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
44 | + $css_file = $theme_css; |
|
45 | + } else { |
|
46 | + $uploads = self::get_upload_base(); |
|
47 | 47 | $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css'; |
48 | - if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
49 | - $css_file = $uploads['baseurl'] . $file_path; |
|
50 | - } else { |
|
48 | + if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
49 | + $css_file = $uploads['baseurl'] . $file_path; |
|
50 | + } else { |
|
51 | 51 | $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css'; |
52 | - } |
|
53 | - } |
|
52 | + } |
|
53 | + } |
|
54 | 54 | |
55 | - return $css_file; |
|
56 | - } |
|
55 | + return $css_file; |
|
56 | + } |
|
57 | 57 | |
58 | - public static function enqueue_jquery_css() { |
|
58 | + public static function enqueue_jquery_css() { |
|
59 | 59 | $form = self::get_form_for_page(); |
60 | 60 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
61 | - if ( $theme_css != -1 ) { |
|
62 | - wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
63 | - } |
|
64 | - } |
|
61 | + if ( $theme_css != -1 ) { |
|
62 | + wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
63 | + } |
|
64 | + } |
|
65 | 65 | |
66 | 66 | public static function get_form_for_page() { |
67 | 67 | global $frm_vars; |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | return $form_id; |
78 | 78 | } |
79 | 79 | |
80 | - public static function get_upload_base() { |
|
81 | - $uploads = wp_upload_dir(); |
|
82 | - if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
83 | - $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
84 | - } |
|
80 | + public static function get_upload_base() { |
|
81 | + $uploads = wp_upload_dir(); |
|
82 | + if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
83 | + $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
84 | + } |
|
85 | 85 | |
86 | - return $uploads; |
|
87 | - } |
|
86 | + return $uploads; |
|
87 | + } |
|
88 | 88 | |
89 | 89 | public static function style_menu( $active = '' ) { |
90 | 90 | ?> |
@@ -94,22 +94,22 @@ discard block |
||
94 | 94 | <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Custom CSS', 'formidable' ) ?></a> |
95 | 95 | </h2> |
96 | 96 | <?php |
97 | - } |
|
97 | + } |
|
98 | 98 | |
99 | - public static function minus_icons() { |
|
100 | - return array( |
|
99 | + public static function minus_icons() { |
|
100 | + return array( |
|
101 | 101 | 0 => array( '-' => '62e', '+' => '62f' ), |
102 | 102 | 1 => array( '-' => '600', '+' => '602' ), |
103 | 103 | 2 => array( '-' => '604', '+' => '603' ), |
104 | 104 | 3 => array( '-' => '633', '+' => '632' ), |
105 | 105 | 4 => array( '-' => '613', '+' => '60f' ), |
106 | - ); |
|
107 | - } |
|
106 | + ); |
|
107 | + } |
|
108 | 108 | |
109 | - public static function arrow_icons() { |
|
110 | - $minus_icons = self::minus_icons(); |
|
109 | + public static function arrow_icons() { |
|
110 | + $minus_icons = self::minus_icons(); |
|
111 | 111 | |
112 | - return array( |
|
112 | + return array( |
|
113 | 113 | 6 => array( '-' => '62d', '+' => '62a' ), |
114 | 114 | 0 => array( '-' => '60d', '+' => '609' ), |
115 | 115 | 1 => array( '-' => '60e', '+' => '60c' ), |
@@ -117,44 +117,44 @@ discard block |
||
117 | 117 | 3 => array( '-' => '62b', '+' => '628' ), |
118 | 118 | 4 => array( '-' => '62c', '+' => '629' ), |
119 | 119 | 5 => array( '-' => '635', '+' => '634' ), |
120 | - 'p0' => $minus_icons[0], |
|
121 | - 'p1' => $minus_icons[1], |
|
122 | - 'p2' => $minus_icons[2], |
|
123 | - 'p3' => $minus_icons[3], |
|
124 | - 'p4' => $minus_icons[4], |
|
125 | - ); |
|
126 | - } |
|
127 | - |
|
128 | - /** |
|
129 | - * @since 2.0 |
|
130 | - * @return The class for this icon |
|
131 | - */ |
|
120 | + 'p0' => $minus_icons[0], |
|
121 | + 'p1' => $minus_icons[1], |
|
122 | + 'p2' => $minus_icons[2], |
|
123 | + 'p3' => $minus_icons[3], |
|
124 | + 'p4' => $minus_icons[4], |
|
125 | + ); |
|
126 | + } |
|
127 | + |
|
128 | + /** |
|
129 | + * @since 2.0 |
|
130 | + * @return The class for this icon |
|
131 | + */ |
|
132 | 132 | public static function icon_key_to_class( $key, $icon = '+', $type = 'arrow' ) { |
133 | - if ( 'arrow' == $type && is_numeric($key) ) { |
|
134 | - //frm_arrowup6_icon |
|
133 | + if ( 'arrow' == $type && is_numeric($key) ) { |
|
134 | + //frm_arrowup6_icon |
|
135 | 135 | $arrow = array( '-' => 'down', '+' => 'up' ); |
136 | 136 | $class = 'frm_arrow' . $arrow[ $icon ]; |
137 | - } else { |
|
138 | - //frm_minus1_icon |
|
139 | - $key = str_replace('p', '', $key); |
|
137 | + } else { |
|
138 | + //frm_minus1_icon |
|
139 | + $key = str_replace('p', '', $key); |
|
140 | 140 | $plus = array( '-' => 'minus', '+' => 'plus' ); |
141 | 141 | $class = 'frm_' . $plus[ $icon ]; |
142 | - } |
|
142 | + } |
|
143 | 143 | |
144 | - if ( $key ) { |
|
145 | - $class .= $key; |
|
146 | - } |
|
147 | - $class .= '_icon'; |
|
144 | + if ( $key ) { |
|
145 | + $class .= $key; |
|
146 | + } |
|
147 | + $class .= '_icon'; |
|
148 | 148 | |
149 | - return $class; |
|
150 | - } |
|
149 | + return $class; |
|
150 | + } |
|
151 | 151 | |
152 | 152 | public static function bs_icon_select( $style, $frm_style, $type = 'arrow' ) { |
153 | 153 | $function_name = $type . '_icons'; |
154 | 154 | $icons = self::$function_name(); |
155 | 155 | unset( $function_name ); |
156 | 156 | |
157 | - $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
|
157 | + $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
|
158 | 158 | ?> |
159 | 159 | <select name="<?php echo esc_attr( $frm_style->get_field_name($name) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
160 | 160 | <?php foreach ( $icons as $key => $icon ) { ?> |
@@ -187,24 +187,24 @@ discard block |
||
187 | 187 | </ul> |
188 | 188 | </div> |
189 | 189 | <?php |
190 | - } |
|
190 | + } |
|
191 | 191 | |
192 | 192 | public static function hex2rgb( $hex ) { |
193 | - $hex = str_replace('#', '', $hex); |
|
193 | + $hex = str_replace('#', '', $hex); |
|
194 | 194 | |
195 | - if ( strlen($hex) == 3 ) { |
|
195 | + if ( strlen($hex) == 3 ) { |
|
196 | 196 | $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); |
197 | 197 | $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); |
198 | 198 | $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); |
199 | - } else { |
|
199 | + } else { |
|
200 | 200 | $r = hexdec( substr( $hex, 0, 2 ) ); |
201 | 201 | $g = hexdec( substr( $hex, 2, 2 ) ); |
202 | 202 | $b = hexdec( substr( $hex, 4, 2 ) ); |
203 | - } |
|
203 | + } |
|
204 | 204 | $rgb = array( $r, $g, $b ); |
205 | - return implode(',', $rgb); // returns the rgb values separated by commas |
|
206 | - //return $rgb; // returns an array with the rgb values |
|
207 | - } |
|
205 | + return implode(',', $rgb); // returns the rgb values separated by commas |
|
206 | + //return $rgb; // returns an array with the rgb values |
|
207 | + } |
|
208 | 208 | |
209 | 209 | /** |
210 | 210 | * @param $hex string - The original color in hex format #ffffff |
@@ -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,120 +92,120 @@ 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 | add_action( 'wp_ajax_frm_settings_tab', 'FrmSettingsController::load_settings_tab' ); |
126 | 126 | |
127 | - // Styles Controller |
|
128 | - add_action( 'admin_menu', 'FrmStylesController::menu', 14 ); |
|
129 | - add_action( 'admin_init', 'FrmStylesController::admin_init' ); |
|
127 | + // Styles Controller |
|
128 | + add_action( 'admin_menu', 'FrmStylesController::menu', 14 ); |
|
129 | + add_action( 'admin_init', 'FrmStylesController::admin_init' ); |
|
130 | 130 | |
131 | - // XML Controller |
|
132 | - add_action( 'admin_menu', 'FrmXMLController::menu', 41 ); |
|
133 | - } |
|
131 | + // XML Controller |
|
132 | + add_action( 'admin_menu', 'FrmXMLController::menu', 41 ); |
|
133 | + } |
|
134 | 134 | |
135 | 135 | public static function load_ajax_hooks() { |
136 | 136 | add_action( 'wp_ajax_frm_silent_upgrade', 'FrmAppController::ajax_install' ); |
137 | 137 | add_action( 'wp_ajax_nopriv_frm_silent_upgrade', 'FrmAppController::ajax_install' ); |
138 | 138 | add_action( 'wp_ajax_frm_install', 'FrmAppController::ajax_install' ); |
139 | - add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' ); |
|
140 | - add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' ); |
|
139 | + add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' ); |
|
140 | + add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' ); |
|
141 | 141 | |
142 | 142 | // Addons |
143 | 143 | add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' ); |
144 | 144 | add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' ); |
145 | 145 | add_action( 'wp_ajax_frm_fill_licenses', 'FrmAddonsController::get_licenses' ); |
146 | 146 | |
147 | - // Fields Controller |
|
148 | - add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' ); |
|
149 | - add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' ); |
|
150 | - add_action( 'wp_ajax_frm_field_name_in_place_edit', 'FrmFieldsController::edit_name' ); |
|
151 | - add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' ); |
|
152 | - add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' ); |
|
153 | - add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' ); |
|
154 | - add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' ); |
|
155 | - add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' ); |
|
156 | - add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' ); |
|
157 | - add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' ); |
|
158 | - |
|
159 | - // Form Actions Controller |
|
160 | - add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' ); |
|
161 | - add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' ); |
|
162 | - |
|
163 | - // Forms Controller |
|
147 | + // Fields Controller |
|
148 | + add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' ); |
|
149 | + add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' ); |
|
150 | + add_action( 'wp_ajax_frm_field_name_in_place_edit', 'FrmFieldsController::edit_name' ); |
|
151 | + add_action( 'wp_ajax_frm_update_ajax_option', 'FrmFieldsController::update_ajax_option' ); |
|
152 | + add_action( 'wp_ajax_frm_duplicate_field', 'FrmFieldsController::duplicate' ); |
|
153 | + add_action( 'wp_ajax_frm_delete_field', 'FrmFieldsController::destroy' ); |
|
154 | + add_action( 'wp_ajax_frm_add_field_option', 'FrmFieldsController::add_option' ); |
|
155 | + add_action( 'wp_ajax_frm_import_choices', 'FrmFieldsController::import_choices' ); |
|
156 | + add_action( 'wp_ajax_frm_import_options', 'FrmFieldsController::import_options' ); |
|
157 | + add_action( 'wp_ajax_frm_update_field_order', 'FrmFieldsController::update_order' ); |
|
158 | + |
|
159 | + // Form Actions Controller |
|
160 | + add_action( 'wp_ajax_frm_add_form_action', 'FrmFormActionsController::add_form_action' ); |
|
161 | + add_action( 'wp_ajax_frm_form_action_fill', 'FrmFormActionsController::fill_action' ); |
|
162 | + |
|
163 | + // Forms Controller |
|
164 | 164 | add_action( 'wp_ajax_frm_create_from_template', 'FrmFormsController::_create_from_template' ); |
165 | 165 | add_action( 'wp_ajax_frm_save_form', 'FrmFormsController::route' ); |
166 | 166 | add_action( 'wp_ajax_frm_form_key_in_place_edit', 'FrmFormsController::edit_key' ); |
167 | 167 | add_action( 'wp_ajax_frm_form_desc_in_place_edit', 'FrmFormsController::edit_description' ); |
168 | - add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' ); |
|
169 | - add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' ); |
|
170 | - add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' ); |
|
171 | - add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' ); |
|
172 | - |
|
173 | - // Styles Controller |
|
174 | - add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' ); |
|
175 | - add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' ); |
|
176 | - add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' ); |
|
177 | - add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' ); |
|
168 | + add_action( 'wp_ajax_frm_get_default_html', 'FrmFormsController::get_email_html' ); |
|
169 | + add_action( 'wp_ajax_frm_get_shortcode_opts', 'FrmFormsController::get_shortcode_opts' ); |
|
170 | + add_action( 'wp_ajax_frm_forms_preview', 'FrmFormsController::preview' ); |
|
171 | + add_action( 'wp_ajax_nopriv_frm_forms_preview', 'FrmFormsController::preview' ); |
|
172 | + |
|
173 | + // Styles Controller |
|
174 | + add_action( 'wp_ajax_frm_settings_reset', 'FrmStylesController::reset_styling' ); |
|
175 | + add_action( 'wp_ajax_frm_change_styling', 'FrmStylesController::change_styling' ); |
|
176 | + add_action( 'wp_ajax_frmpro_load_css', 'FrmStylesController::load_css' ); |
|
177 | + add_action( 'wp_ajax_nopriv_frmpro_load_css', 'FrmStylesController::load_css' ); |
|
178 | 178 | add_action( 'wp_ajax_frmpro_css', 'FrmStylesController::load_saved_css' ); |
179 | 179 | add_action( 'wp_ajax_nopriv_frmpro_css', 'FrmStylesController::load_saved_css' ); |
180 | 180 | |
181 | - // XML Controller |
|
181 | + // XML Controller |
|
182 | 182 | add_action( 'wp_ajax_frm_entries_csv', 'FrmXMLController::csv' ); |
183 | 183 | add_action( 'wp_ajax_nopriv_frm_entries_csv', 'FrmXMLController::csv' ); |
184 | - add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' ); |
|
185 | - } |
|
184 | + add_action( 'wp_ajax_frm_export_xml', 'FrmXMLController::export_xml' ); |
|
185 | + } |
|
186 | 186 | |
187 | 187 | public static function load_form_hooks() { |
188 | - // Fields Controller |
|
189 | - add_filter( 'frm_field_type', 'FrmFieldsController::change_type' ); |
|
190 | - add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' ); |
|
191 | - add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 ); |
|
192 | - add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' ); |
|
188 | + // Fields Controller |
|
189 | + add_filter( 'frm_field_type', 'FrmFieldsController::change_type' ); |
|
190 | + add_action( 'frm_field_input_html', 'FrmFieldsController::input_html' ); |
|
191 | + add_filter( 'frm_field_value_saved', 'FrmFieldsController::check_value', 50, 3 ); |
|
192 | + add_filter( 'frm_field_label_seen', 'FrmFieldsController::check_label' ); |
|
193 | 193 | |
194 | 194 | // Forms Controller |
195 | 195 | add_filter( 'frm_form_classes', 'FrmFormsController::form_classes' ); |
196 | 196 | |
197 | - // Styles Controller |
|
198 | - add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 ); |
|
199 | - } |
|
197 | + // Styles Controller |
|
198 | + add_filter( 'frm_use_important_width', 'FrmStylesController::important_style', 10, 2 ); |
|
199 | + } |
|
200 | 200 | |
201 | 201 | public static function load_view_hooks() { |
202 | - // Hooks go here when a view is loaded |
|
203 | - } |
|
202 | + // Hooks go here when a view is loaded |
|
203 | + } |
|
204 | 204 | |
205 | 205 | public static function load_multisite_hooks() { |
206 | 206 | add_action( 'wpmu_upgrade_site', 'FrmAppController::network_upgrade_site' ); |
207 | 207 | |
208 | - // drop tables when mu site is deleted |
|
209 | - add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' ); |
|
210 | - } |
|
208 | + // drop tables when mu site is deleted |
|
209 | + add_filter( 'wpmu_drop_tables', 'FrmAppController::drop_tables' ); |
|
210 | + } |
|
211 | 211 | } |
@@ -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 | } ?> |