@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
86 | - * @param $column |
|
86 | + * @param string $column |
|
87 | 87 | * |
88 | 88 | * @return string|array |
89 | 89 | */ |
@@ -239,6 +239,9 @@ discard block |
||
239 | 239 | return $this->alter_builder_classes( $classes ); |
240 | 240 | } |
241 | 241 | |
242 | + /** |
|
243 | + * @param string $classes |
|
244 | + */ |
|
242 | 245 | protected function alter_builder_classes( $classes ) { |
243 | 246 | return $classes; |
244 | 247 | } |
@@ -187,7 +187,7 @@ |
||
187 | 187 | |
188 | 188 | protected function html_id( $plus = '' ) { |
189 | 189 | return apply_filters( 'frm_field_get_html_id', 'field_' . $this->get_field_column('field_key') . $plus, $this->field ); |
190 | - } |
|
190 | + } |
|
191 | 191 | |
192 | 192 | public function display_field_settings() { |
193 | 193 | $default_settings = $this->default_field_settings(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | protected function set_type( $type ) { |
77 | 77 | if ( empty( $this->type ) ) { |
78 | - $this->type = $this->get_field_column('type'); |
|
78 | + $this->type = $this->get_field_column( 'type' ); |
|
79 | 79 | if ( empty( $this->type ) && ! empty( $type ) ) { |
80 | 80 | $this->type = $type; |
81 | 81 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | $field_val = ''; |
92 | 92 | if ( is_object( $this->field ) ) { |
93 | 93 | $field_val = $this->field->{$column}; |
94 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
95 | - $field_val = $this->field[ $column ]; |
|
94 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
95 | + $field_val = $this->field[$column]; |
|
96 | 96 | } |
97 | 97 | return $field_val; |
98 | 98 | } |
@@ -177,16 +177,16 @@ discard block |
||
177 | 177 | } |
178 | 178 | |
179 | 179 | protected function builder_text_field() { |
180 | - return '<input type="text" name="' . esc_attr( $this->html_name() ) . '" id="' . esc_attr( $this->html_id() ) . '" value="' . esc_attr( $this->get_field_column('default_value') ) . '" class="dyn_default_value" />'; |
|
180 | + return '<input type="text" name="' . esc_attr( $this->html_name() ) . '" id="' . esc_attr( $this->html_id() ) . '" value="' . esc_attr( $this->get_field_column( 'default_value' ) ) . '" class="dyn_default_value" />'; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | protected function html_name( $name = '' ) { |
184 | 184 | $prefix = empty( $name ) ? 'item_meta' : $name; |
185 | - return $prefix . '[' . $this->get_field_column('id') . ']'; |
|
185 | + return $prefix . '[' . $this->get_field_column( 'id' ) . ']'; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | protected function html_id( $plus = '' ) { |
189 | - return apply_filters( 'frm_field_get_html_id', 'field_' . $this->get_field_column('field_key') . $plus, $this->field ); |
|
189 | + return apply_filters( 'frm_field_get_html_id', 'field_' . $this->get_field_column( 'field_key' ) . $plus, $this->field ); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | public function display_field_settings() { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | } |
277 | 277 | |
278 | 278 | protected function default_invalid_msg() { |
279 | - $field_name = $this->get_field_column('name'); |
|
279 | + $field_name = $this->get_field_column( 'name' ); |
|
280 | 280 | if ( $field_name == '' ) { |
281 | 281 | $invalid = __( 'This field is invalid', 'formidable' ); |
282 | 282 | } else { |
@@ -292,8 +292,8 @@ discard block |
||
292 | 292 | $fields = FrmField::field_selection(); |
293 | 293 | $fields = array_merge( $fields, FrmField::pro_field_selection() ); |
294 | 294 | |
295 | - if ( isset( $fields[ $this->type ] ) ) { |
|
296 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
295 | + if ( isset( $fields[$this->type] ) ) { |
|
296 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | return $name; |
@@ -387,23 +387,23 @@ discard block |
||
387 | 387 | |
388 | 388 | protected function replace_input_shortcode( $args, &$html ) { |
389 | 389 | unset( $args['field'] ); |
390 | - preg_match_all("/\[(input)\b(.*?)(?:(\/))?\]/s", $html, $shortcodes, PREG_PATTERN_ORDER); |
|
390 | + preg_match_all( "/\[(input)\b(.*?)(?:(\/))?\]/s", $html, $shortcodes, PREG_PATTERN_ORDER ); |
|
391 | 391 | |
392 | 392 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
393 | 393 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, array( 'conditional' => false, 'conditional_check' => false ) ); |
394 | 394 | if ( $tag == 'input' ) { |
395 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
395 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
396 | 396 | $this->field['shortcodes'] = $this->prepare_input_shortcode_atts( $shortcode_atts ); |
397 | 397 | $input = $this->include_front_field_input( $args, $shortcode_atts ); |
398 | 398 | |
399 | - $html = str_replace( $shortcodes[0][ $short_key ], $input, $html ); |
|
399 | + $html = str_replace( $shortcodes[0][$short_key], $input, $html ); |
|
400 | 400 | } |
401 | 401 | } |
402 | 402 | } |
403 | 403 | |
404 | 404 | protected function prepare_input_shortcode_atts( $shortcode_atts ) { |
405 | 405 | if ( isset( $shortcode_atts['opt'] ) ) { |
406 | - $shortcode_atts['opt']--; |
|
406 | + $shortcode_atts['opt'] --; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | $this->field['input_class'] = isset( $shortcode_atts['class'] ) ? $shortcode_atts['class'] : ''; |
@@ -466,8 +466,8 @@ discard block |
||
466 | 466 | |
467 | 467 | protected function fill_display_field_values( $args = array() ) { |
468 | 468 | $defaults = array( |
469 | - 'field_name' => 'item_meta[' . $this->get_field_column('id') . ']', |
|
470 | - 'field_id' => $this->get_field_column('id'), |
|
469 | + 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
|
470 | + 'field_id' => $this->get_field_column( 'id' ), |
|
471 | 471 | 'field_plus_id' => '', |
472 | 472 | 'section_id' => '', |
473 | 473 | ); |
@@ -504,8 +504,8 @@ discard block |
||
504 | 504 | $value = $this->prepare_display_value( $value, $atts ); |
505 | 505 | |
506 | 506 | if ( is_array( $value ) ) { |
507 | - if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) { |
|
508 | - $value = $value[ $atts['show'] ]; |
|
507 | + if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) { |
|
508 | + $value = $value[$atts['show']]; |
|
509 | 509 | } elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) { |
510 | 510 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
511 | 511 | $value = implode( $sep, $value ); |
@@ -564,8 +564,8 @@ discard block |
||
564 | 564 | $saved_entries = $atts['ids']; |
565 | 565 | $new_value = array(); |
566 | 566 | foreach ( (array) $value as $old_child_id ) { |
567 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
568 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
567 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
568 | + $new_value[] = $saved_entries[$old_child_id]; |
|
569 | 569 | } |
570 | 570 | } |
571 | 571 |
@@ -75,7 +75,6 @@ discard block |
||
75 | 75 | * @since 3.0 |
76 | 76 | * |
77 | 77 | * @param array $file_names And array of file paths |
78 | - * @param string $new_location The path for the file to be saved |
|
79 | 78 | */ |
80 | 79 | public function combine_files( $file_names ) { |
81 | 80 | if ( $this->has_permission ) { |
@@ -125,6 +124,9 @@ discard block |
||
125 | 124 | } |
126 | 125 | } |
127 | 126 | |
127 | + /** |
|
128 | + * @param boolean $dirs_exist |
|
129 | + */ |
|
128 | 130 | private function create_directories( &$dirs_exist ) { |
129 | 131 | global $wp_filesystem; |
130 | 132 |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | $this->error_message = isset( $atts['error_message'] ) ? $atts['error_message'] : ''; |
22 | 22 | $this->uploads = wp_upload_dir(); |
23 | 23 | $this->set_new_file_path( $atts ); |
24 | - $this->chmod_dir = defined('FS_CHMOD_DIR') ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
|
25 | - $this->chmod_file = defined('FS_CHMOD_FILE') ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
|
24 | + $this->chmod_dir = defined( 'FS_CHMOD_DIR' ) ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
|
25 | + $this->chmod_file = defined( 'FS_CHMOD_FILE' ) ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
|
26 | 26 | |
27 | 27 | $this->check_permission(); |
28 | 28 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | private function get_creds() { |
157 | - if ( ! function_exists('get_filesystem_method') ) { |
|
157 | + if ( ! function_exists( 'get_filesystem_method' ) ) { |
|
158 | 158 | include_once( ABSPATH . 'wp-admin/includes/file.php' ); |
159 | 159 | } |
160 | 160 | |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | private function get_ftp_creds( $type ) { |
171 | 171 | $credentials = get_option( 'ftp_credentials', array( 'hostname' => '', 'username' => '' ) ); |
172 | 172 | |
173 | - $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : $credentials['hostname']; |
|
174 | - $credentials['username'] = defined('FTP_USER') ? FTP_USER : $credentials['username']; |
|
175 | - $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : ''; |
|
173 | + $credentials['hostname'] = defined( 'FTP_HOST' ) ? FTP_HOST : $credentials['hostname']; |
|
174 | + $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : $credentials['username']; |
|
175 | + $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : ''; |
|
176 | 176 | |
177 | 177 | // Check to see if we are setting the public/private keys for ssh |
178 | - $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : ''; |
|
179 | - $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : ''; |
|
178 | + $credentials['public_key'] = defined( 'FTP_PUBKEY' ) ? FTP_PUBKEY : ''; |
|
179 | + $credentials['private_key'] = defined( 'FTP_PRIKEY' ) ? FTP_PRIKEY : ''; |
|
180 | 180 | |
181 | 181 | // Sanitize the hostname, Some people might pass in odd-data: |
182 | 182 | $credentials['hostname'] = preg_replace( '|\w+://|', '', $credentials['hostname'] ); //Strip any schemes off |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | function load_formidable_forms() { |
26 | 26 | global $frm_vars; |
27 | 27 | $frm_vars = array( |
28 | - 'load_css' => false, 'forms_loaded' => array(), |
|
29 | - 'created_entries' => array(), |
|
30 | - 'pro_is_authorized' => false, |
|
28 | + 'load_css' => false, 'forms_loaded' => array(), |
|
29 | + 'created_entries' => array(), |
|
30 | + 'pro_is_authorized' => false, |
|
31 | 31 | ); |
32 | 32 | |
33 | 33 | require_once( dirname( __FILE__ ) . '/classes/controllers/FrmHooksController.php' ); |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | |
43 | 43 | // if __autoload is active, put it on the spl_autoload stack |
44 | 44 | if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions() ) ) { |
45 | - spl_autoload_register('__autoload'); |
|
45 | + spl_autoload_register('__autoload'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | // Add the autoloader |
49 | 49 | spl_autoload_register('frm_forms_autoloader'); |
50 | 50 | |
51 | 51 | function frm_forms_autoloader( $class_name ) { |
52 | - // Only load Frm classes here |
|
52 | + // Only load Frm classes here |
|
53 | 53 | if ( ! preg_match( '/^Frm.+$/', $class_name ) || preg_match( '/^FrmPro.+$/', $class_name ) ) { |
54 | - return; |
|
55 | - } |
|
54 | + return; |
|
55 | + } |
|
56 | 56 | |
57 | 57 | FrmHooksController::autoloader( $class_name, dirname( __FILE__ ) ); |
58 | 58 | } |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | |
33 | 33 | require_once( dirname( __FILE__ ) . '/classes/controllers/FrmHooksController.php' ); |
34 | 34 | |
35 | - $frm_path = dirname(__FILE__); |
|
36 | - if ( file_exists($frm_path . '/pro/formidable-pro.php') ) { |
|
35 | + $frm_path = dirname( __FILE__ ); |
|
36 | + if ( file_exists( $frm_path . '/pro/formidable-pro.php' ) ) { |
|
37 | 37 | include( $frm_path . '/pro/formidable-pro.php' ); |
38 | 38 | } |
39 | 39 | |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | |
43 | 43 | // if __autoload is active, put it on the spl_autoload stack |
44 | 44 | if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions() ) ) { |
45 | - spl_autoload_register('__autoload'); |
|
45 | + spl_autoload_register( '__autoload' ); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | // Add the autoloader |
49 | -spl_autoload_register('frm_forms_autoloader'); |
|
49 | +spl_autoload_register( 'frm_forms_autoloader' ); |
|
50 | 50 | |
51 | 51 | function frm_forms_autoloader( $class_name ) { |
52 | 52 | // Only load Frm classes here |
@@ -37,7 +37,7 @@ |
||
37 | 37 | ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
38 | 38 | } |
39 | 39 | |
40 | - ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php |
|
40 | + ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action( 'frm_field_input_html', $field ) ?> /><?php |
|
41 | 41 | |
42 | 42 | if ( ! isset( $shortcode_atts ) || ! isset( $shortcode_atts['label'] ) || $shortcode_atts['label'] ) { |
43 | 43 | echo ' ' . $opt . '</label>'; |
@@ -18,14 +18,14 @@ |
||
18 | 18 | if ( ! isset( $shortcode_atts ) || ! isset( $shortcode_atts['label'] ) || $shortcode_atts['label'] ) { |
19 | 19 | ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
20 | 20 | } |
21 | - $checked = FrmAppHelper::check_selected($field['value'], $field_val) ? 'checked="checked" ' : ' '; |
|
21 | + $checked = FrmAppHelper::check_selected( $field['value'], $field_val ) ? 'checked="checked" ' : ' '; |
|
22 | 22 | |
23 | 23 | $other_opt = false; |
24 | 24 | $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field_name', 'opt_key', 'field' ), $other_opt, $checked ); |
25 | 25 | ?> |
26 | 26 | <input type="radio" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php |
27 | 27 | echo $checked; |
28 | - do_action('frm_field_input_html', $field); |
|
28 | + do_action( 'frm_field_input_html', $field ); |
|
29 | 29 | ?>/><?php |
30 | 30 | |
31 | 31 | if ( ! isset( $shortcode_atts ) || ! isset( $shortcode_atts['label'] ) || $shortcode_atts['label'] ) { |
@@ -3,7 +3,7 @@ |
||
3 | 3 | if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) { |
4 | 4 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
5 | 5 | } else { |
6 | - do_action( 'frm_add_multiple_opts_labels', $field ); ?> |
|
6 | + do_action( 'frm_add_multiple_opts_labels', $field ); ?> |
|
7 | 7 | <ul id="frm_field_<?php echo esc_attr( $field['id'] ) ?>_opts" class="frm_sortable_field_opts frm_clear<?php echo ( count( $field['options'] ) > 10 ) ? ' frm_field_opts_list' : ''; ?>"> |
8 | 8 | <?php FrmFieldsHelper::show_single_option( $field ); ?> |
9 | 9 | </ul> |
@@ -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'] ) ?>" |
@@ -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 | } ?> |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | $frm_settings = FrmAppHelper::get_settings(); |
3 | 3 | if ( empty( $frm_settings->pubkey ) ) { ?> |
4 | - <div class="howto frm_no_captcha_text"><?php printf(__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Secret Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>') ?></div> |
|
4 | + <div class="howto frm_no_captcha_text"><?php printf( __( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Secret Keys', 'formidable' ), '<a href="?page=formidable-settings">', '</a>' ) ?></div> |
|
5 | 5 | <?php |
6 | 6 | } ?> |
7 | 7 | <img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/recaptcha.png' ) ?>" class="recaptcha_placeholder" alt="reCaptcha"/> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | if ( ! isset( $values['doing_ajax'] ) ) { |
4 | - $li_classes .= ' ui-state-default widgets-holder-wrap'; ?> |
|
4 | + $li_classes .= ' ui-state-default widgets-holder-wrap'; ?> |
|
5 | 5 | <li id="frm_field_id_<?php echo esc_attr( $field['id'] ); ?>" class="<?php echo esc_attr( $li_classes ) ?>" data-fid="<?php echo esc_attr( $field['id'] ) ?>" data-formid="<?php echo esc_attr( 'divider' == $field['type'] ? $field['form_select'] : $field['form_id'] ); ?>" data-ftype="<?php echo esc_attr( $display['type'] ) ?>"> |
6 | 6 | <?php |
7 | 7 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | </span> |
24 | 24 | <?php } |
25 | 25 | |
26 | - ?> |
|
26 | + ?> |
|
27 | 27 | <label class="<?php echo ( $field['type'] == 'end_divider' ) ? '' : 'frm_ipe_field_label'; ?> frm_primary_label <?php echo ( $field['type'] == 'break' ) ? 'button': ''; ?>" id="field_label_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ( $field['name'] == '' ) ? __( '(no label)', 'formidable' ) : force_balance_tags( $field['name'] ); ?></label> |
28 | 28 | |
29 | 29 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ( in_array( $field['type'], array( 'select', 'radio', 'checkbox' ) ) ) { ?> |
72 | 72 | <div class="frm-show-click frm_small_top_margin"><?php |
73 | 73 | |
74 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
74 | + if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
75 | 75 | echo '<p class="howto">' . FrmFieldsHelper::get_term_link( $field['taxonomy'] ) . '</p>'; |
76 | 76 | } else if ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) { |
77 | 77 | ?> |
@@ -83,16 +83,16 @@ discard block |
||
83 | 83 | <a href="javascript:void(0);" id="other_button_<?php echo esc_attr( $field['id'] ); ?>" data-opttype="other" data-ftype="<?php echo esc_attr( $field['type'] ) ?>" class="button frm_cb_button frm_add_opt<?php echo ( in_array( $field['type'], array( 'radio', 'select' ) ) && $field['other'] == true ? ' frm_hidden' : '' ); ?>"><?php _e( 'Add "Other"', 'formidable' ) ?></a> |
84 | 84 | <input type="hidden" value="<?php echo esc_attr( $field['other'] ); ?>" id="other_input_<?php echo esc_attr( $field['id'] ); ?>" name="field_options[other_<?php echo esc_attr( $field['id'] ); ?>]"> |
85 | 85 | <?php |
86 | - } |
|
86 | + } |
|
87 | 87 | |
88 | - if ( ! isset($field['post_field']) || $field['post_field'] != 'post_category' ) { ?> |
|
88 | + if ( ! isset($field['post_field']) || $field['post_field'] != 'post_category' ) { ?> |
|
89 | 89 | <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=frm_import_choices&field_id=' . $field['id'] . '&TB_iframe=1' ) ) ?>" title="<?php echo esc_attr( FrmAppHelper::truncate( strip_tags( str_replace( '"', '"', $field['name'] ) ), 20 ) . ' ' . __( 'Field Choices', 'formidable' ) ); ?>" class="thickbox frm_orange"> |
90 | 90 | <?php _e( 'Bulk Edit Options', 'formidable' ) ?> |
91 | 91 | </a> |
92 | 92 | <?php } ?> |
93 | 93 | </div> |
94 | 94 | <?php |
95 | - } |
|
95 | + } |
|
96 | 96 | ?> |
97 | 97 | </div> |
98 | 98 | <?php |
@@ -127,31 +127,31 @@ discard block |
||
127 | 127 | <?php _e( 'Required', 'formidable' ) ?> |
128 | 128 | </label> |
129 | 129 | <?php |
130 | - } |
|
130 | + } |
|
131 | 131 | |
132 | 132 | if ( $display['unique'] ) { |
133 | - if ( ! isset( $field['unique'] ) ) { |
|
134 | - $field['unique'] = false; |
|
135 | - } |
|
136 | - ?> |
|
133 | + if ( ! isset( $field['unique'] ) ) { |
|
134 | + $field['unique'] = false; |
|
135 | + } |
|
136 | + ?> |
|
137 | 137 | <label for="frm_uniq_field_<?php echo esc_attr( $field['id'] ) ?>" class="frm_inline_label frm_help" title="<?php esc_attr_e( 'Unique: Do not allow the same response multiple times. For example, if one user enters \'Joe\', then no one else will be allowed to enter the same name.', 'formidable' ) ?>"><input type="checkbox" name="field_options[unique_<?php echo esc_attr( $field['id'] ) ?>]" id="frm_uniq_field_<?php echo esc_attr( $field['id'] ) ?>" value="1" <?php checked( $field['unique'], 1 ); ?> class="frm_mark_unique" /> <?php _e( 'Unique', 'formidable' ) ?></label> |
138 | 138 | <?php |
139 | - } |
|
139 | + } |
|
140 | 140 | |
141 | 141 | if ( $display['read_only'] ) { |
142 | - if ( ! isset( $field['read_only'] ) ) { |
|
143 | - $field['read_only'] = false; |
|
142 | + if ( ! isset( $field['read_only'] ) ) { |
|
143 | + $field['read_only'] = false; |
|
144 | 144 | } |
145 | - ?> |
|
145 | + ?> |
|
146 | 146 | <label for="frm_read_only_field_<?php echo esc_attr( $field['id'] ) ?>" class="frm_inline_label frm_help" title="<?php esc_attr_e( 'Read Only: Show this field but do not allow the field value to be edited from the front-end.', 'formidable' ) ?>" > |
147 | 147 | <input type="checkbox" id="frm_read_only_field_<?php echo esc_attr( $field['id'] ) ?>" name="field_options[read_only_<?php echo esc_attr( $field['id'] ) ?>]" value="1" <?php checked( $field['read_only'], 1 ) ?>/> |
148 | 148 | <?php _e( 'Read Only', 'formidable' ) ?> |
149 | 149 | </label> |
150 | 150 | <?php } |
151 | 151 | |
152 | - do_action('frm_field_options_form_top', $field, $display, $values); |
|
152 | + do_action('frm_field_options_form_top', $field, $display, $values); |
|
153 | 153 | |
154 | - ?> |
|
154 | + ?> |
|
155 | 155 | <?php |
156 | 156 | if ( $display['required'] ) { ?> |
157 | 157 | <div class="frm_required_details<?php echo esc_attr( $field['id'] . ( $field['required'] ? '' : ' frm_hidden' ) ); ?>"> |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | do_action( 'frm_' . $field['type'] . '_field_options_form', $field, $display, $values ); |
256 | 256 | do_action( 'frm_field_options_form', $field, $display, $values ); |
257 | 257 | |
258 | - if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?> |
|
258 | + if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?> |
|
259 | 259 | <tr class="frm_validation_msg <?php echo ($display['invalid'] || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' ) ) ? '' : 'frm_hidden'; ?>"> |
260 | 260 | <td colspan="2"> |
261 | 261 | <div class="menu-settings"> |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | <input type="text" name="field_options[blank_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['blank'] ); ?>" /> |
269 | 269 | </p> |
270 | 270 | <?php |
271 | - } |
|
271 | + } |
|
272 | 272 | |
273 | 273 | if ( $display['invalid'] ) { ?> |
274 | 274 | <p><label><?php _e( 'Invalid Format', 'formidable' ) ?></label> |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | <input type="text" name="field_options[unique_msg_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['unique_msg'] ); ?>" /> |
284 | 284 | </p> |
285 | 285 | <?php |
286 | - } |
|
286 | + } |
|
287 | 287 | |
288 | 288 | if ( $display['conf_field'] ) { ?> |
289 | 289 | <p class="frm_conf_details<?php echo esc_attr( $field['id'] . ( $field['conf_field'] ? '' : ' frm_hidden' ) ); ?>"> |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | <input type="text" name="field_options[conf_msg_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['conf_msg'] ); ?>" /> |
292 | 292 | </p> |
293 | 293 | <?php |
294 | - } ?> |
|
294 | + } ?> |
|
295 | 295 | </div> |
296 | 296 | </div> |
297 | 297 | </td> |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | <a href="javascript:void(0);" class="frm_bstooltip alignright frm-show-hover frm-move frm-hover-icon frm_icon_font frm_move_icon" title="<?php esc_attr_e( 'Move Field', 'formidable' ) ?>"> </a> |
16 | 16 | <a href="#" class="frm_bstooltip alignright frm-show-hover frm-hover-icon frm_icon_font frm_delete_icon frm_delete_field" title="<?php esc_attr_e( 'Delete Field', 'formidable' ) ?>"> </a> |
17 | 17 | <a href="#" class="frm_bstooltip alignright frm-show-hover frm-hover-icon frm_icon_font frm_duplicate_icon" title="<?php ( $field['type'] == 'divider' ) ? esc_attr_e( 'Duplicate Section', 'formidable' ) : esc_attr_e( 'Duplicate Field', 'formidable' ) ?>"> </a> |
18 | - <input type="hidden" name="frm_fields_submitted[]" value="<?php echo esc_attr($field['id']) ?>" /> |
|
19 | - <?php do_action('frm_extra_field_actions', $field['id']); ?> |
|
18 | + <input type="hidden" name="frm_fields_submitted[]" value="<?php echo esc_attr( $field['id'] ) ?>" /> |
|
19 | + <?php do_action( 'frm_extra_field_actions', $field['id'] ); ?> |
|
20 | 20 | <?php if ( $display['required'] ) { ?> |
21 | 21 | <span id="require_field_<?php echo esc_attr( $field['id'] ); ?>"> |
22 | 22 | <a href="javascript:void(0);" class="frm_req_field frm_action_icon frm_required_icon frm_icon_font alignleft frm_required<?php echo (int) $field['required'] ?>" id="req_field_<?php echo esc_attr( $field['id'] ); ?>" title="Click to Mark as <?php echo FrmField::is_required( $field ) ? 'not ' : ''; ?>Required"></a> |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | <?php } |
25 | 25 | |
26 | 26 | ?> |
27 | - <label class="<?php echo ( $field['type'] == 'end_divider' ) ? '' : 'frm_ipe_field_label'; ?> frm_primary_label <?php echo ( $field['type'] == 'break' ) ? 'button': ''; ?>" id="field_label_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ( $field['name'] == '' ) ? __( '(no label)', 'formidable' ) : force_balance_tags( $field['name'] ); ?></label> |
|
27 | + <label class="<?php echo ( $field['type'] == 'end_divider' ) ? '' : 'frm_ipe_field_label'; ?> frm_primary_label <?php echo ( $field['type'] == 'break' ) ? 'button' : ''; ?>" id="field_label_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ( $field['name'] == '' ) ? __( '(no label)', 'formidable' ) : force_balance_tags( $field['name'] ); ?></label> |
|
28 | 28 | |
29 | 29 | |
30 | 30 | <div id="field_<?php echo esc_attr( $field['id'] ) ?>_inner_container" class="frm_inner_field_container"> |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | </div> |
44 | 44 | <?php |
45 | 45 | if ( $display['description'] ) { ?> |
46 | - <div class="frm_ipe_field_desc description <?php echo ($field['description'] == '') ? 'frm-show-click' : '' ?>" id="field_description_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ($field['description'] == '') ? __( '(Click to add description)', 'formidable' ) : force_balance_tags( $field['description'] ); ?></div> |
|
46 | + <div class="frm_ipe_field_desc description <?php echo ( $field['description'] == '' ) ? 'frm-show-click' : '' ?>" id="field_description_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ( $field['description'] == '' ) ? __( '(Click to add description)', 'formidable' ) : force_balance_tags( $field['description'] ); ?></div> |
|
47 | 47 | <input type="hidden" name="field_options[description_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['description'] ); ?>" /> |
48 | 48 | |
49 | 49 | <?php } ?> |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | <div class="frm_form_fields"> |
56 | 56 | <input type="text" id="conf_field_<?php echo esc_attr( $field['field_key'] ) ?>" name="field_options[conf_input_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['conf_input'] ); ?>" class="dyn_default_value" /> |
57 | 57 | </div> |
58 | - <div id="conf_field_description_<?php echo esc_attr( $field['id'] ) ?>" class="frm_ipe_field_conf_desc description <?php echo ($field['conf_desc'] == '') ? 'frm-show-click' : '' ?>"><?php |
|
59 | - echo ($field['conf_desc'] == '') ? __( '(Click to add description)', 'formidable' ) : force_balance_tags($field['conf_desc']); ?></div> |
|
58 | + <div id="conf_field_description_<?php echo esc_attr( $field['id'] ) ?>" class="frm_ipe_field_conf_desc description <?php echo ( $field['conf_desc'] == '' ) ? 'frm-show-click' : '' ?>"><?php |
|
59 | + echo ( $field['conf_desc'] == '' ) ? __( '(Click to add description)', 'formidable' ) : force_balance_tags( $field['conf_desc'] ); ?></div> |
|
60 | 60 | <input type="hidden" name="field_options[conf_desc_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['conf_desc'] ); ?>" /> |
61 | 61 | </div> |
62 | 62 | <?php if ( $display['clear_on_focus'] ) { ?> |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ( in_array( $field['type'], array( 'select', 'radio', 'checkbox' ) ) ) { ?> |
72 | 72 | <div class="frm-show-click frm_small_top_margin"><?php |
73 | 73 | |
74 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
74 | + if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) { |
|
75 | 75 | echo '<p class="howto">' . FrmFieldsHelper::get_term_link( $field['taxonomy'] ) . '</p>'; |
76 | 76 | } else if ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) { |
77 | 77 | ?> |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | <?php |
86 | 86 | } |
87 | 87 | |
88 | - if ( ! isset($field['post_field']) || $field['post_field'] != 'post_category' ) { ?> |
|
88 | + if ( ! isset( $field['post_field'] ) || $field['post_field'] != 'post_category' ) { ?> |
|
89 | 89 | <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=frm_import_choices&field_id=' . $field['id'] . '&TB_iframe=1' ) ) ?>" title="<?php echo esc_attr( FrmAppHelper::truncate( strip_tags( str_replace( '"', '"', $field['name'] ) ), 20 ) . ' ' . __( 'Field Choices', 'formidable' ) ); ?>" class="thickbox frm_orange"> |
90 | 90 | <?php _e( 'Bulk Edit Options', 'formidable' ) ?> |
91 | 91 | </a> |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | <?php |
99 | 99 | } |
100 | 100 | |
101 | -do_action('frm_before_field_options', $field); |
|
101 | +do_action( 'frm_before_field_options', $field ); |
|
102 | 102 | |
103 | 103 | if ( $display['options'] ) { ?> |
104 | 104 | <div class="widget"> |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | </div> |
109 | 109 | <div class="widget-inside"> |
110 | 110 | <table class="form-table frm_clear_none"> |
111 | - <?php $field_types = FrmFieldsHelper::get_field_types($field['type']); ?> |
|
111 | + <?php $field_types = FrmFieldsHelper::get_field_types( $field['type'] ); ?> |
|
112 | 112 | <tr><td class="frm_150_width"><label><?php _e( 'Field Type', 'formidable' ) ?></label></td> |
113 | 113 | <td> |
114 | - <select <?php if ( count($field_types) == 1 ) { ?>disabled="disabled"<?php } else { ?>name="field_options[type_<?php echo esc_attr( $field['id'] ) ?>]"<?php } ?>> |
|
114 | + <select <?php if ( count( $field_types ) == 1 ) { ?>disabled="disabled"<?php } else { ?>name="field_options[type_<?php echo esc_attr( $field['id'] ) ?>]"<?php } ?>> |
|
115 | 115 | <?php |
116 | 116 | foreach ( $field_types as $fkey => $ftype ) { ?> |
117 | - <option value="<?php echo esc_attr( $fkey ) ?>" <?php echo ( $fkey == $field['type'] ) ? ' selected="selected"' : ''; ?> <?php echo array_key_exists($fkey, $disabled_fields ) ? 'disabled="disabled"' : ''; ?>><?php echo is_array($ftype) ? $ftype['name'] : $ftype ?> </option> |
|
117 | + <option value="<?php echo esc_attr( $fkey ) ?>" <?php echo ( $fkey == $field['type'] ) ? ' selected="selected"' : ''; ?> <?php echo array_key_exists( $fkey, $disabled_fields ) ? 'disabled="disabled"' : ''; ?>><?php echo is_array( $ftype ) ? $ftype['name'] : $ftype ?> </option> |
|
118 | 118 | <?php |
119 | 119 | unset( $fkey, $ftype ); |
120 | 120 | } ?> |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | </label> |
150 | 150 | <?php } |
151 | 151 | |
152 | - do_action('frm_field_options_form_top', $field, $display, $values); |
|
152 | + do_action( 'frm_field_options_form_top', $field, $display, $values ); |
|
153 | 153 | |
154 | 154 | ?> |
155 | 155 | <?php |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | <td class="frm_150_width"><label><?php _e( 'Label Position', 'formidable' ) ?></label></td> |
189 | 189 | <td> |
190 | 190 | <select name="field_options[label_<?php echo esc_attr( $field['id'] ) ?>]"> |
191 | - <option value=""<?php selected($field['label'], ''); ?>> |
|
191 | + <option value=""<?php selected( $field['label'], '' ); ?>> |
|
192 | 192 | <?php _e( 'Default', 'formidable' ) ?> |
193 | 193 | </option> |
194 | 194 | <?php foreach ( FrmStylesHelper::get_sigle_label_postitions() as $pos => $pos_label ) { ?> |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | do_action( 'frm_field_options_form', $field, $display, $values ); |
257 | 257 | |
258 | 258 | if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?> |
259 | - <tr class="frm_validation_msg <?php echo ($display['invalid'] || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' ) ) ? '' : 'frm_hidden'; ?>"> |
|
259 | + <tr class="frm_validation_msg <?php echo ( $display['invalid'] || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' ) ) ? '' : 'frm_hidden'; ?>"> |
|
260 | 260 | <td colspan="2"> |
261 | 261 | <div class="menu-settings"> |
262 | 262 | <h3 class="frm_no_bg"><?php _e( 'Validation', 'formidable' ) ?></h3> |