@@ -15,7 +15,7 @@ |
||
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | - $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
18 | + $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
19 | 19 | |
20 | 20 | ?> |
21 | 21 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" /> |
@@ -8,17 +8,17 @@ |
||
8 | 8 | $this->render_input(); |
9 | 9 | } |
10 | 10 | |
11 | - function render_input( $override_input = null ) { |
|
11 | + function render_input($override_input = null) { |
|
12 | 12 | |
13 | - if( isset( $override_input ) ) { |
|
13 | + if (isset($override_input)) { |
|
14 | 14 | echo $override_input; |
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | - $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
18 | + $class = !empty($this->field['class']) ? $this->field['class'] : 'widefat'; |
|
19 | 19 | |
20 | 20 | ?> |
21 | - <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" /> |
|
21 | + <input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr($this->value); ?>" class="<?php echo esc_attr($class); ?>" /> |
|
22 | 22 | <?php |
23 | 23 | } |
24 | 24 |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | * number input type |
4 | 4 | */ |
5 | 5 | |
6 | -if( !class_exists('GravityView_FieldType_text') ) { |
|
7 | - include_once( GRAVITYVIEW_DIR . 'includes/admin/field-types/type_text.php' ); |
|
6 | +if (!class_exists('GravityView_FieldType_text')) { |
|
7 | + include_once(GRAVITYVIEW_DIR.'includes/admin/field-types/type_text.php'); |
|
8 | 8 | } |
9 | 9 | class GravityView_FieldType_number extends GravityView_FieldType_text { |
10 | 10 | |
11 | - function render_input( $override_input = null ) { |
|
12 | - if( isset( $override_input ) ) { |
|
11 | + function render_input($override_input = null) { |
|
12 | + if (isset($override_input)) { |
|
13 | 13 | echo $override_input; |
14 | 14 | return; |
15 | 15 | } |
@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | |
19 | 19 | $show_mt = $this->show_merge_tags(); |
20 | 20 | |
21 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
21 | + if ($show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force') { |
|
22 | 22 | $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
23 | 23 | } |
24 | - $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
24 | + $class .= !empty($this->field['class']) ? $this->field['class'] : 'widefat'; |
|
25 | 25 | |
26 | 26 | ?> |
27 | - <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="number" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>"> |
|
27 | + <input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" type="number" value="<?php echo esc_attr($this->value); ?>" class="<?php echo esc_attr($class); ?>"> |
|
28 | 28 | <?php |
29 | 29 | } |
30 | 30 |
@@ -28,10 +28,10 @@ |
||
28 | 28 | |
29 | 29 | $show_mt = $this->show_merge_tags(); |
30 | 30 | |
31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
32 | - $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
|
33 | - } |
|
34 | - $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
31 | + if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
32 | + $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
|
33 | + } |
|
34 | + $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
35 | 35 | |
36 | 36 | ?> |
37 | 37 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>"> |
@@ -18,15 +18,15 @@ |
||
18 | 18 | |
19 | 19 | } |
20 | 20 | |
21 | - function render_input( $override_input = null ) { |
|
22 | - if( isset( $override_input ) ) { |
|
21 | + function render_input($override_input = null) { |
|
22 | + if (isset($override_input)) { |
|
23 | 23 | echo $override_input; |
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | - foreach( $this->field['options'] as $value => $label ) : ?> |
|
27 | + foreach ($this->field['options'] as $value => $label) : ?> |
|
28 | 28 | <label class="<?php echo $this->get_label_class(); ?>"> |
29 | - <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr( $value ); ?>" type="radio" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value, $this->value, true ); ?> /> <?php echo esc_html( $label ); ?> |
|
29 | + <input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr($value); ?>" type="radio" value="<?php echo esc_attr($value); ?>" <?php checked($value, $this->value, true); ?> /> <?php echo esc_html($label); ?> |
|
30 | 30 | </label> |
31 | 31 | <?php |
32 | 32 | endforeach; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | echo '<span class="gv-label">'.$this->get_field_label().'</span>'; |
12 | 12 | |
13 | - echo $this->get_tooltip() . $this->get_field_desc(); |
|
13 | + echo $this->get_tooltip().$this->get_field_desc(); |
|
14 | 14 | |
15 | 15 | $this->render_input(); |
16 | 16 | |
@@ -19,15 +19,15 @@ discard block |
||
19 | 19 | <?php |
20 | 20 | } |
21 | 21 | |
22 | - function render_input( $override_input = null ) { |
|
23 | - if( isset( $override_input ) ) { |
|
22 | + function render_input($override_input = null) { |
|
23 | + if (isset($override_input)) { |
|
24 | 24 | echo $override_input; |
25 | 25 | return; |
26 | 26 | } |
27 | 27 | ?> |
28 | - <select name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>"> |
|
29 | - <?php foreach( $this->field['options'] as $value => $label ) : ?> |
|
30 | - <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->value, true ); ?>><?php echo esc_html( $label ); ?></option> |
|
28 | + <select name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>"> |
|
29 | + <?php foreach ($this->field['options'] as $value => $label) : ?> |
|
30 | + <option value="<?php echo esc_attr($value); ?>" <?php selected($value, $this->value, true); ?>><?php echo esc_html($label); ?></option> |
|
31 | 31 | <?php endforeach; ?> |
32 | 32 | </select> |
33 | 33 | <?php |
@@ -28,10 +28,10 @@ |
||
28 | 28 | |
29 | 29 | $show_mt = $this->show_merge_tags(); |
30 | 30 | |
31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
32 | - $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
|
33 | - } |
|
34 | - $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
31 | + if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
32 | + $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
|
33 | + } |
|
34 | + $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
35 | 35 | |
36 | 36 | ?> |
37 | 37 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>"> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | <label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php |
10 | 10 | |
11 | 11 | echo '<span class="gv-label">'.$this->get_field_label().'</span>'; |
12 | - echo $this->get_tooltip() . $this->get_field_desc(); |
|
12 | + echo $this->get_tooltip().$this->get_field_desc(); |
|
13 | 13 | ?><div> |
14 | 14 | <?php $this->render_input(); ?> |
15 | 15 | </div> |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | <?php |
18 | 18 | } |
19 | 19 | |
20 | - function render_input( $override_input = null ) { |
|
20 | + function render_input($override_input = null) { |
|
21 | 21 | |
22 | - if( isset( $override_input ) ) { |
|
22 | + if (isset($override_input)) { |
|
23 | 23 | echo $override_input; |
24 | 24 | return; |
25 | 25 | } |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | |
29 | 29 | $show_mt = $this->show_merge_tags(); |
30 | 30 | |
31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
31 | + if ($show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force') { |
|
32 | 32 | $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
33 | 33 | } |
34 | - $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
34 | + $class .= !empty($this->field['class']) ? $this->field['class'] : 'widefat'; |
|
35 | 35 | |
36 | 36 | ?> |
37 | - <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>"> |
|
37 | + <input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr($this->value); ?>" class="<?php echo esc_attr($class); ?>"> |
|
38 | 38 | <?php |
39 | 39 | } |
40 | 40 |
@@ -28,14 +28,14 @@ |
||
28 | 28 | |
29 | 29 | $show_mt = $this->show_merge_tags(); |
30 | 30 | |
31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
32 | - $class = ' merge-tag-support mt-position-right '; |
|
33 | - |
|
34 | - if( empty( $this->field['show_all_fields'] ) ) { |
|
35 | - $class .= ' mt-hide_all_fields'; |
|
36 | - } |
|
37 | - } |
|
38 | - $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat'; |
|
31 | + if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
32 | + $class = ' merge-tag-support mt-position-right '; |
|
33 | + |
|
34 | + if( empty( $this->field['show_all_fields'] ) ) { |
|
35 | + $class .= ' mt-hide_all_fields'; |
|
36 | + } |
|
37 | + } |
|
38 | + $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat'; |
|
39 | 39 | |
40 | 40 | ?> |
41 | 41 | <textarea name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr( $class ); ?>" rows="5"><?php echo esc_textarea( $this->value ); ?></textarea> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | <label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php |
11 | 11 | |
12 | 12 | echo '<span class="gv-label">'.$this->get_field_label().'</span>'; |
13 | - echo $this->get_tooltip() . $this->get_field_desc(); |
|
13 | + echo $this->get_tooltip().$this->get_field_desc(); |
|
14 | 14 | ?><div> |
15 | 15 | <?php $this->render_input(); ?> |
16 | 16 | </div> |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | <?php |
19 | 19 | } |
20 | 20 | |
21 | - function render_input( $override_input = null ) { |
|
22 | - if( isset( $override_input ) ) { |
|
21 | + function render_input($override_input = null) { |
|
22 | + if (isset($override_input)) { |
|
23 | 23 | echo $override_input; |
24 | 24 | return; |
25 | 25 | } |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | |
29 | 29 | $show_mt = $this->show_merge_tags(); |
30 | 30 | |
31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
31 | + if ($show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force') { |
|
32 | 32 | $class = ' merge-tag-support mt-position-right '; |
33 | 33 | |
34 | - if( empty( $this->field['show_all_fields'] ) ) { |
|
34 | + if (empty($this->field['show_all_fields'])) { |
|
35 | 35 | $class .= ' mt-hide_all_fields'; |
36 | 36 | } |
37 | 37 | } |
38 | - $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat'; |
|
38 | + $class .= !empty($this->field['class']) ? 'widefat '.$this->field['class'] : 'widefat'; |
|
39 | 39 | |
40 | 40 | ?> |
41 | - <textarea name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr( $class ); ?>" rows="5"><?php echo esc_textarea( $this->value ); ?></textarea> |
|
41 | + <textarea name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr($class); ?>" rows="5"><?php echo esc_textarea($this->value); ?></textarea> |
|
42 | 42 | <?php |
43 | 43 | } |
44 | 44 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | if( !GravityView_Compatibility::is_valid() ) { return; } |
16 | 16 | |
17 | - self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/'; |
|
17 | + self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/'; |
|
18 | 18 | |
19 | 19 | include_once self::$metaboxes_dir . 'class-gravityview-metabox-tab.php'; |
20 | 20 | |
@@ -228,13 +228,13 @@ discard block |
||
228 | 228 | $get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL; |
229 | 229 | |
230 | 230 | if( isset( $form['id'] ) ) { |
231 | - $form_script = 'var form = ' . GFCommon::json_encode($form) . ';'; |
|
231 | + $form_script = 'var form = ' . GFCommon::json_encode($form) . ';'; |
|
232 | 232 | |
233 | - // The `gf_vars()` method needs a $_GET[id] variable set with the form ID. |
|
234 | - $_GET['id'] = $form['id']; |
|
233 | + // The `gf_vars()` method needs a $_GET[id] variable set with the form ID. |
|
234 | + $_GET['id'] = $form['id']; |
|
235 | 235 | |
236 | 236 | } else { |
237 | - $form_script = 'var form = new Form();'; |
|
237 | + $form_script = 'var form = new Form();'; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | $output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>'; |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function __construct() { |
19 | 19 | |
20 | - if( !GravityView_Compatibility::is_valid() ) { return; } |
|
20 | + if (!GravityView_Compatibility::is_valid()) { return; } |
|
21 | 21 | |
22 | - self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/'; |
|
22 | + self::$metaboxes_dir = GRAVITYVIEW_DIR.'includes/admin/metaboxes/'; |
|
23 | 23 | |
24 | - include_once self::$metaboxes_dir . 'class-gravityview-metabox-tab.php'; |
|
24 | + include_once self::$metaboxes_dir.'class-gravityview-metabox-tab.php'; |
|
25 | 25 | |
26 | - include_once self::$metaboxes_dir . 'class-gravityview-metabox-tabs.php'; |
|
26 | + include_once self::$metaboxes_dir.'class-gravityview-metabox-tabs.php'; |
|
27 | 27 | |
28 | 28 | $this->initialize(); |
29 | 29 | |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function initialize() { |
37 | 37 | |
38 | - add_action( 'add_meta_boxes', array( $this, 'register_metaboxes' )); |
|
38 | + add_action('add_meta_boxes', array($this, 'register_metaboxes')); |
|
39 | 39 | |
40 | - add_action( 'add_meta_boxes_gravityview' , array( $this, 'update_priority' ) ); |
|
40 | + add_action('add_meta_boxes_gravityview', array($this, 'update_priority')); |
|
41 | 41 | |
42 | 42 | // information box |
43 | - add_action( 'post_submitbox_misc_actions', array( $this, 'render_shortcode_hint' ) ); |
|
43 | + add_action('post_submitbox_misc_actions', array($this, 'render_shortcode_hint')); |
|
44 | 44 | |
45 | 45 | } |
46 | 46 | |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | function update_priority() { |
52 | 52 | global $wp_meta_boxes; |
53 | 53 | |
54 | - if( ! empty( $wp_meta_boxes['gravityview'] ) ) { |
|
55 | - foreach( array( 'high', 'core', 'low' ) as $position ) { |
|
56 | - if( isset( $wp_meta_boxes['gravityview']['normal'][ $position ] ) ) { |
|
57 | - foreach( $wp_meta_boxes['gravityview']['normal'][ $position ] as $key => $meta_box ) { |
|
58 | - if( ! preg_match( '/^gravityview_/ism', $key ) ) { |
|
59 | - $wp_meta_boxes['gravityview']['advanced'][ $position ][ $key ] = $meta_box; |
|
60 | - unset( $wp_meta_boxes['gravityview']['normal'][ $position ][ $key ] ); |
|
54 | + if (!empty($wp_meta_boxes['gravityview'])) { |
|
55 | + foreach (array('high', 'core', 'low') as $position) { |
|
56 | + if (isset($wp_meta_boxes['gravityview']['normal'][$position])) { |
|
57 | + foreach ($wp_meta_boxes['gravityview']['normal'][$position] as $key => $meta_box) { |
|
58 | + if (!preg_match('/^gravityview_/ism', $key)) { |
|
59 | + $wp_meta_boxes['gravityview']['advanced'][$position][$key] = $meta_box; |
|
60 | + unset($wp_meta_boxes['gravityview']['normal'][$position][$key]); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | } |
@@ -69,23 +69,23 @@ discard block |
||
69 | 69 | global $post; |
70 | 70 | |
71 | 71 | // On Comment Edit, for example, $post isn't set. |
72 | - if( empty( $post ) || !is_object( $post ) || !isset( $post->ID ) ) { |
|
72 | + if (empty($post) || !is_object($post) || !isset($post->ID)) { |
|
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
76 | 76 | // select data source for this view |
77 | - add_meta_box( 'gravityview_select_form', $this->get_data_source_header( $post->ID ), array( $this, 'render_data_source_metabox' ), 'gravityview', 'normal', 'high' ); |
|
77 | + add_meta_box('gravityview_select_form', $this->get_data_source_header($post->ID), array($this, 'render_data_source_metabox'), 'gravityview', 'normal', 'high'); |
|
78 | 78 | |
79 | 79 | // select view type/template |
80 | - add_meta_box( 'gravityview_select_template', __( 'Choose a View Type', 'gravityview' ), array( $this, 'render_select_template_metabox' ), 'gravityview', 'normal', 'high' ); |
|
80 | + add_meta_box('gravityview_select_template', __('Choose a View Type', 'gravityview'), array($this, 'render_select_template_metabox'), 'gravityview', 'normal', 'high'); |
|
81 | 81 | |
82 | 82 | // View Configuration box |
83 | - add_meta_box( 'gravityview_view_config', __( 'View Configuration', 'gravityview' ), array( $this, 'render_view_configuration_metabox' ), 'gravityview', 'normal', 'high' ); |
|
83 | + add_meta_box('gravityview_view_config', __('View Configuration', 'gravityview'), array($this, 'render_view_configuration_metabox'), 'gravityview', 'normal', 'high'); |
|
84 | 84 | |
85 | 85 | $this->add_settings_metabox_tabs(); |
86 | 86 | |
87 | 87 | // Other Settings box |
88 | - add_meta_box( 'gravityview_settings', __( 'View Settings', 'gravityview' ), array( $this, 'settings_metabox_render' ), 'gravityview', 'normal', 'core' ); |
|
88 | + add_meta_box('gravityview_settings', __('View Settings', 'gravityview'), array($this, 'settings_metabox_render'), 'gravityview', 'normal', 'core'); |
|
89 | 89 | |
90 | 90 | } |
91 | 91 | |
@@ -94,22 +94,22 @@ discard block |
||
94 | 94 | * @since 1.8 |
95 | 95 | * @param WP_Post $post |
96 | 96 | */ |
97 | - function settings_metabox_render( $post ) { |
|
97 | + function settings_metabox_render($post) { |
|
98 | 98 | |
99 | 99 | /** |
100 | 100 | * @param WP_Post $post |
101 | 101 | */ |
102 | - do_action( 'gravityview/metaboxes/before_render', $post ); |
|
102 | + do_action('gravityview/metaboxes/before_render', $post); |
|
103 | 103 | |
104 | 104 | $metaboxes = GravityView_Metabox_Tabs::get_all(); |
105 | 105 | |
106 | - include self::$metaboxes_dir . 'views/gravityview-navigation.php'; |
|
107 | - include self::$metaboxes_dir . 'views/gravityview-content.php'; |
|
106 | + include self::$metaboxes_dir.'views/gravityview-navigation.php'; |
|
107 | + include self::$metaboxes_dir.'views/gravityview-content.php'; |
|
108 | 108 | |
109 | 109 | /** |
110 | 110 | * @param WP_Post $post |
111 | 111 | */ |
112 | - do_action( 'gravityview/metaboxes/after_render', $post ); |
|
112 | + do_action('gravityview/metaboxes/after_render', $post); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $metaboxes = array( |
122 | 122 | array( |
123 | 123 | 'id' => 'template_settings', |
124 | - 'title' => __( 'View Settings', 'gravityview' ), |
|
124 | + 'title' => __('View Settings', 'gravityview'), |
|
125 | 125 | 'file' => 'view-settings.php', |
126 | 126 | 'icon-class' => 'dashicons-admin-generic', |
127 | 127 | 'callback' => '', |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ), |
130 | 130 | array( |
131 | 131 | 'id' => 'single_entry', // Use the same ID as View Settings for backward compatibility |
132 | - 'title' => __( 'Single Entry', 'gravityview' ), |
|
132 | + 'title' => __('Single Entry', 'gravityview'), |
|
133 | 133 | 'file' => 'single-entry.php', |
134 | 134 | 'icon-class' => 'dashicons-media-default', |
135 | 135 | 'callback' => '', |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | ), |
138 | 138 | array( |
139 | 139 | 'id' => 'sort_filter', |
140 | - 'title' => __( 'Filter & Sort', 'gravityview' ), |
|
140 | + 'title' => __('Filter & Sort', 'gravityview'), |
|
141 | 141 | 'file' => 'sort-filter.php', |
142 | 142 | 'icon-class' => 'dashicons-sort', |
143 | 143 | 'callback' => '', |
@@ -150,17 +150,17 @@ discard block |
||
150 | 150 | * @param array $metaboxes |
151 | 151 | * @since 1.8 |
152 | 152 | */ |
153 | - $metaboxes = apply_filters( 'gravityview/metaboxes/default', $metaboxes ); |
|
153 | + $metaboxes = apply_filters('gravityview/metaboxes/default', $metaboxes); |
|
154 | 154 | |
155 | - foreach( $metaboxes as $m ) { |
|
155 | + foreach ($metaboxes as $m) { |
|
156 | 156 | |
157 | - $tab = new GravityView_Metabox_Tab( $m['id'], $m['title'], $m['file'], $m['icon-class'], $m['callback'], $m['callback_args'] ); |
|
157 | + $tab = new GravityView_Metabox_Tab($m['id'], $m['title'], $m['file'], $m['icon-class'], $m['callback'], $m['callback_args']); |
|
158 | 158 | |
159 | - GravityView_Metabox_Tabs::add( $tab ); |
|
159 | + GravityView_Metabox_Tabs::add($tab); |
|
160 | 160 | |
161 | 161 | } |
162 | 162 | |
163 | - unset( $tab ); |
|
163 | + unset($tab); |
|
164 | 164 | |
165 | 165 | } |
166 | 166 | |
@@ -173,18 +173,18 @@ discard block |
||
173 | 173 | * |
174 | 174 | * @return string "Data Source", plus links if any |
175 | 175 | */ |
176 | - private function get_data_source_header( $post_id ) { |
|
176 | + private function get_data_source_header($post_id) { |
|
177 | 177 | |
178 | 178 | //current value |
179 | - $current_form = gravityview_get_form_id( $post_id ); |
|
179 | + $current_form = gravityview_get_form_id($post_id); |
|
180 | 180 | |
181 | - $links = GravityView_Admin_Views::get_connected_form_links( $current_form, false ); |
|
181 | + $links = GravityView_Admin_Views::get_connected_form_links($current_form, false); |
|
182 | 182 | |
183 | - if( !empty( $links ) ) { |
|
184 | - $links = '<span class="alignright gv-form-links">'. $links .'</span>'; |
|
183 | + if (!empty($links)) { |
|
184 | + $links = '<span class="alignright gv-form-links">'.$links.'</span>'; |
|
185 | 185 | } |
186 | 186 | |
187 | - return __( 'Data Source', 'gravityview' ) . $links; |
|
187 | + return __('Data Source', 'gravityview').$links; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | * @param object $post |
195 | 195 | * @return void |
196 | 196 | */ |
197 | - function render_data_source_metabox( $post ) { |
|
197 | + function render_data_source_metabox($post) { |
|
198 | 198 | |
199 | - include self::$metaboxes_dir . 'views/data-source.php'; |
|
199 | + include self::$metaboxes_dir.'views/data-source.php'; |
|
200 | 200 | |
201 | 201 | } |
202 | 202 | |
@@ -207,9 +207,9 @@ discard block |
||
207 | 207 | * @param object $post |
208 | 208 | * @return void |
209 | 209 | */ |
210 | - function render_select_template_metabox( $post ) { |
|
210 | + function render_select_template_metabox($post) { |
|
211 | 211 | |
212 | - include self::$metaboxes_dir . 'views/select-template.php'; |
|
212 | + include self::$metaboxes_dir.'views/select-template.php'; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -218,18 +218,18 @@ discard block |
||
218 | 218 | * @param mixed $curr_form Form ID |
219 | 219 | * @return null|string Merge tags html; NULL if $curr_form isn't defined. |
220 | 220 | */ |
221 | - public static function render_merge_tags_scripts( $curr_form ) { |
|
221 | + public static function render_merge_tags_scripts($curr_form) { |
|
222 | 222 | |
223 | - if( empty( $curr_form )) { |
|
223 | + if (empty($curr_form)) { |
|
224 | 224 | return NULL; |
225 | 225 | } |
226 | 226 | |
227 | - $form = gravityview_get_form( $curr_form ); |
|
227 | + $form = gravityview_get_form($curr_form); |
|
228 | 228 | |
229 | 229 | $get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL; |
230 | 230 | |
231 | - if( isset( $form['id'] ) ) { |
|
232 | - $form_script = 'var form = ' . GFCommon::json_encode($form) . ';'; |
|
231 | + if (isset($form['id'])) { |
|
232 | + $form_script = 'var form = '.GFCommon::json_encode($form).';'; |
|
233 | 233 | |
234 | 234 | // The `gf_vars()` method needs a $_GET[id] variable set with the form ID. |
235 | 235 | $_GET['id'] = $form['id']; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $form_script = 'var form = new Form();'; |
239 | 239 | } |
240 | 240 | |
241 | - $output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>'; |
|
241 | + $output = '<script type="text/javascript" data-gv-merge-tags="1">'.$form_script."\n".GFCommon::gf_vars(false).'</script>'; |
|
242 | 242 | |
243 | 243 | // Restore previous $_GET setting |
244 | 244 | $_GET['id'] = $get_id_backup; |
@@ -253,20 +253,20 @@ discard block |
||
253 | 253 | * @param mixed $post |
254 | 254 | * @return void |
255 | 255 | */ |
256 | - function render_view_configuration_metabox( $post ) { |
|
256 | + function render_view_configuration_metabox($post) { |
|
257 | 257 | |
258 | 258 | // Use nonce for verification |
259 | - wp_nonce_field( 'gravityview_view_configuration', 'gravityview_view_configuration_nonce' ); |
|
259 | + wp_nonce_field('gravityview_view_configuration', 'gravityview_view_configuration_nonce'); |
|
260 | 260 | |
261 | 261 | // Selected Form |
262 | - $curr_form = gravityview_get_form_id( $post->ID ); |
|
262 | + $curr_form = gravityview_get_form_id($post->ID); |
|
263 | 263 | |
264 | 264 | // Selected template |
265 | - $curr_template = gravityview_get_template_id( $post->ID ); |
|
265 | + $curr_template = gravityview_get_template_id($post->ID); |
|
266 | 266 | |
267 | - echo self::render_merge_tags_scripts( $curr_form ); |
|
267 | + echo self::render_merge_tags_scripts($curr_form); |
|
268 | 268 | |
269 | - include self::$metaboxes_dir . 'views/view-configuration.php'; |
|
269 | + include self::$metaboxes_dir.'views/view-configuration.php'; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -276,12 +276,12 @@ discard block |
||
276 | 276 | * @param object $post |
277 | 277 | * @return void |
278 | 278 | */ |
279 | - function render_view_settings_metabox( $post ) { |
|
279 | + function render_view_settings_metabox($post) { |
|
280 | 280 | |
281 | 281 | // View template settings |
282 | - $current_settings = gravityview_get_template_settings( $post->ID ); |
|
282 | + $current_settings = gravityview_get_template_settings($post->ID); |
|
283 | 283 | |
284 | - include self::$metaboxes_dir . 'views/view-settings.php'; |
|
284 | + include self::$metaboxes_dir.'views/view-settings.php'; |
|
285 | 285 | |
286 | 286 | } |
287 | 287 | |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | global $post; |
299 | 299 | |
300 | 300 | // Only show this on GravityView post types. |
301 | - if( false === gravityview_is_admin_page() ) { return; } |
|
301 | + if (false === gravityview_is_admin_page()) { return; } |
|
302 | 302 | |
303 | 303 | // If the View hasn't been configured yet, don't show embed shortcode |
304 | - if( !gravityview_get_directory_fields( $post->ID ) ) { return; } |
|
304 | + if (!gravityview_get_directory_fields($post->ID)) { return; } |
|
305 | 305 | |
306 | - include self::$metaboxes_dir . 'views/shortcode-hint.php'; |
|
306 | + include self::$metaboxes_dir.'views/shortcode-hint.php'; |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | } |
@@ -291,7 +291,6 @@ |
||
291 | 291 | * Render shortcode hint in the Publish metabox |
292 | 292 | * |
293 | 293 | * @access public |
294 | - * @param object $post |
|
295 | 294 | * @return void |
296 | 295 | */ |
297 | 296 | function render_shortcode_hint() { |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @return void |
26 | 26 | */ |
27 | - public static function add( GravityView_Metabox_Tab $meta_box ) { |
|
28 | - self::$meta_boxes[ $meta_box->id ] = $meta_box; |
|
27 | + public static function add(GravityView_Metabox_Tab $meta_box) { |
|
28 | + self::$meta_boxes[$meta_box->id] = $meta_box; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @return void |
39 | 39 | */ |
40 | - public static function remove( $meta_box_id ) { |
|
41 | - if ( array_key_exists( $meta_box_id, self::$meta_boxes ) ) { |
|
42 | - unset( self::$meta_boxes[ $meta_box_id ] ); |
|
40 | + public static function remove($meta_box_id) { |
|
41 | + if (array_key_exists($meta_box_id, self::$meta_boxes)) { |
|
42 | + unset(self::$meta_boxes[$meta_box_id]); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return bool|GravityView_Metabox_Tab False if none exist at the key $id; GravityView_Metabox_Tab if exists. |
54 | 54 | */ |
55 | - public static function get( $id ) { |
|
56 | - if ( empty( self::$meta_boxes ) || empty( self::$meta_boxes[ $id ] ) ) { |
|
55 | + public static function get($id) { |
|
56 | + if (empty(self::$meta_boxes) || empty(self::$meta_boxes[$id])) { |
|
57 | 57 | return false; |
58 | 58 | } |
59 | 59 | |
60 | - return self::$meta_boxes[ $id ]; |
|
60 | + return self::$meta_boxes[$id]; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -7,55 +7,55 @@ |
||
7 | 7 | |
8 | 8 | |
9 | 9 | // Use nonce for verification |
10 | -wp_nonce_field( 'gravityview_select_form', 'gravityview_select_form_nonce' ); |
|
10 | +wp_nonce_field('gravityview_select_form', 'gravityview_select_form_nonce'); |
|
11 | 11 | |
12 | 12 | //current value |
13 | -$current_form = gravityview_get_form_id( $post->ID ); |
|
13 | +$current_form = gravityview_get_form_id($post->ID); |
|
14 | 14 | |
15 | 15 | // check for available gravity forms |
16 | 16 | $forms = gravityview_get_forms(); |
17 | 17 | |
18 | 18 | ?> |
19 | -<label for="gravityview_form_id" ><?php esc_html_e( 'Where would you like the data to come from for this View?', 'gravityview' ); ?></label> |
|
19 | +<label for="gravityview_form_id" ><?php esc_html_e('Where would you like the data to come from for this View?', 'gravityview'); ?></label> |
|
20 | 20 | |
21 | 21 | <p> |
22 | 22 | <?php |
23 | 23 | |
24 | - if ( empty( $current_form ) && GVCommon::has_cap( 'gravityforms_create_form' ) ) { |
|
24 | + if (empty($current_form) && GVCommon::has_cap('gravityforms_create_form')) { |
|
25 | 25 | ?> |
26 | - <a class="button button-primary" href="#gv_start_fresh" title="<?php esc_attr_e( 'Start Fresh', 'gravityview' ); ?>"><?php esc_html_e( 'Start Fresh', 'gravityview' ); ?></a> |
|
26 | + <a class="button button-primary" href="#gv_start_fresh" title="<?php esc_attr_e('Start Fresh', 'gravityview'); ?>"><?php esc_html_e('Start Fresh', 'gravityview'); ?></a> |
|
27 | 27 | |
28 | - <?php if( !empty( $forms ) ) { ?> |
|
29 | - <span> <?php esc_html_e( 'or use an existing form', 'gravityview' ); ?> </span> |
|
28 | + <?php if (!empty($forms)) { ?> |
|
29 | + <span> <?php esc_html_e('or use an existing form', 'gravityview'); ?> </span> |
|
30 | 30 | <?php } |
31 | 31 | } |
32 | 32 | |
33 | 33 | // If there are no forms to select, show no forms. |
34 | - if( !empty( $forms ) ) { ?> |
|
34 | + if (!empty($forms)) { ?> |
|
35 | 35 | <select name="gravityview_form_id" id="gravityview_form_id"> |
36 | - <option value="" <?php selected( '', $current_form, true ); ?>>— <?php esc_html_e( 'list of forms', 'gravityview' ); ?> —</option> |
|
37 | - <?php foreach( $forms as $form ) { ?> |
|
38 | - <option value="<?php echo $form['id']; ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option> |
|
36 | + <option value="" <?php selected('', $current_form, true); ?>>— <?php esc_html_e('list of forms', 'gravityview'); ?> —</option> |
|
37 | + <?php foreach ($forms as $form) { ?> |
|
38 | + <option value="<?php echo $form['id']; ?>" <?php selected($form['id'], $current_form, true); ?>><?php echo esc_html($form['title']); ?></option> |
|
39 | 39 | <?php } ?> |
40 | 40 | </select> |
41 | 41 | <?php } ?> |
42 | 42 | |
43 | - <a class="button button-primary" <?php if( empty( $current_form ) ) { echo 'style="display:none;"'; } ?> id="gv_switch_view_button" href="#gv_switch_view" title="<?php esc_attr_e( 'Switch View', 'gravityview' ); ?>"><?php esc_html_e( 'Switch View Type', 'gravityview' ); ?></a> |
|
43 | + <a class="button button-primary" <?php if (empty($current_form)) { echo 'style="display:none;"'; } ?> id="gv_switch_view_button" href="#gv_switch_view" title="<?php esc_attr_e('Switch View', 'gravityview'); ?>"><?php esc_html_e('Switch View Type', 'gravityview'); ?></a> |
|
44 | 44 | </p> |
45 | 45 | |
46 | 46 | <?php // confirm dialog box ?> |
47 | -<div id="gravityview_form_id_dialog" class="gv-dialog-options gv-dialog-warning" title="<?php esc_attr_e( 'Attention', 'gravityview' ); ?>"> |
|
48 | - <p><?php esc_html_e( 'Changing the form will reset your field configuration. Changes will be permanent once you save the View.', 'gravityview' ); ?></p> |
|
47 | +<div id="gravityview_form_id_dialog" class="gv-dialog-options gv-dialog-warning" title="<?php esc_attr_e('Attention', 'gravityview'); ?>"> |
|
48 | + <p><?php esc_html_e('Changing the form will reset your field configuration. Changes will be permanent once you save the View.', 'gravityview'); ?></p> |
|
49 | 49 | </div> |
50 | 50 | |
51 | 51 | <?php // confirm template dialog box ?> |
52 | -<div id="gravityview_switch_template_dialog" class="gv-dialog-options gv-dialog-warning" title="<?php esc_attr_e( 'Attention', 'gravityview' ); ?>"> |
|
53 | - <p><?php esc_html_e( 'Changing the View Type will reset your field configuration. Changes will be permanent once you save the View.', 'gravityview' ); ?></p> |
|
52 | +<div id="gravityview_switch_template_dialog" class="gv-dialog-options gv-dialog-warning" title="<?php esc_attr_e('Attention', 'gravityview'); ?>"> |
|
53 | + <p><?php esc_html_e('Changing the View Type will reset your field configuration. Changes will be permanent once you save the View.', 'gravityview'); ?></p> |
|
54 | 54 | </div> |
55 | 55 | |
56 | 56 | <?php // no js notice ?> |
57 | 57 | <div class="error hide-if-js"> |
58 | - <p><?php esc_html_e( 'GravityView requires Javascript to be enabled.', 'gravityview' ); ?></p> |
|
58 | + <p><?php esc_html_e('GravityView requires Javascript to be enabled.', 'gravityview'); ?></p> |
|
59 | 59 | </div> |
60 | 60 | |
61 | 61 | <?php |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package GravityView |
|
4 | - * @subpackage Gravityview/admin/metaboxes/views |
|
5 | - * @since 1.8 |
|
6 | - * @global WP_Post $post |
|
7 | - */ |
|
3 | + * @package GravityView |
|
4 | + * @subpackage Gravityview/admin/metaboxes/views |
|
5 | + * @since 1.8 |
|
6 | + * @global WP_Post $post |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | |
10 | 10 | // Use nonce for verification |