@@ -29,12 +29,12 @@ |
||
29 | 29 | */ |
30 | 30 | public static function from_configuration( $configuration ) { |
31 | 31 | |
32 | - if ( empty( $configuration['id'] ) || ! is_string( $configuration['id'] ) ) { |
|
32 | + if ( empty( $configuration[ 'id' ] ) || ! is_string( $configuration[ 'id' ] ) ) { |
|
33 | 33 | gravityview()->log->error( 'Invalid configuration[id] supplied.' ); |
34 | 34 | return null; |
35 | 35 | } |
36 | 36 | |
37 | - $field = self::by_id( $configuration['id'] ); |
|
37 | + $field = self::by_id( $configuration[ 'id' ] ); |
|
38 | 38 | |
39 | 39 | $field->update_configuration( $configuration ); |
40 | 40 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function remove_columns_from_searchable_fields( $fields ) { |
61 | 61 | |
62 | 62 | foreach ( $fields as $key => $field ) { |
63 | - if ( isset( $field['parent'] ) && $field['parent'] instanceof \GF_Field_List ) { |
|
63 | + if ( isset( $field[ 'parent' ] ) && $field[ 'parent' ] instanceof \GF_Field_List ) { |
|
64 | 64 | unset( $fields[ $key ] ); |
65 | 65 | } |
66 | 66 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | // Add the list columns |
87 | 87 | foreach ( $list_fields as $list_field ) { |
88 | 88 | |
89 | - if( empty( $list_field->enableColumns ) ) { |
|
89 | + if ( empty( $list_field->enableColumns ) ) { |
|
90 | 90 | continue; |
91 | 91 | } |
92 | 92 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | // If there are columns, add them under the parent field |
110 | - if( ! empty( $list_columns ) ) { |
|
110 | + if ( ! empty( $list_columns ) ) { |
|
111 | 111 | |
112 | 112 | $index = array_search( $list_field->id, array_keys( $fields ) ) + 1; |
113 | 113 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * Merge the $list_columns into the $fields array at $index |
116 | 116 | * @see https://stackoverflow.com/a/1783125 |
117 | 117 | */ |
118 | - $fields = array_slice( $fields, 0, $index, true) + $list_columns + array_slice( $fields, $index, null, true); |
|
118 | + $fields = array_slice( $fields, 0, $index, true ) + $list_columns + array_slice( $fields, $index, null, true ); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | unset( $list_columns, $index, $input_id ); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $list_rows = maybe_unserialize( $field_value ); |
144 | 144 | |
145 | - if( ! is_array( $list_rows ) ) { |
|
145 | + if ( ! is_array( $list_rows ) ) { |
|
146 | 146 | gravityview()->log->error( '$field_value did not unserialize', array( 'data' => $field_value ) ); |
147 | 147 | return null; |
148 | 148 | } |
@@ -152,18 +152,18 @@ discard block |
||
152 | 152 | // Each list row |
153 | 153 | foreach ( $list_rows as $list_row ) { |
154 | 154 | $current_column = 0; |
155 | - foreach ( (array) $list_row as $column_key => $column_value ) { |
|
155 | + foreach ( (array)$list_row as $column_key => $column_value ) { |
|
156 | 156 | |
157 | 157 | // If the label of the column matches $column_id, or the numeric key value matches, add the value |
158 | - if( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) { |
|
159 | - $column_values[] = $column_value; |
|
158 | + if ( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) { |
|
159 | + $column_values[ ] = $column_value; |
|
160 | 160 | } |
161 | 161 | $current_column++; |
162 | 162 | } |
163 | 163 | } |
164 | 164 | |
165 | 165 | // Return the array of values |
166 | - if( 'raw' === $format ) { |
|
166 | + if ( 'raw' === $format ) { |
|
167 | 167 | return $column_values; |
168 | 168 | } |
169 | 169 | // Return the Gravity Forms Field output |
@@ -186,22 +186,22 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function _filter_field_label( $label, $field, $form, $entry ) { |
188 | 188 | |
189 | - $field_object = RGFormsModel::get_field( $form, $field['id'] ); |
|
189 | + $field_object = RGFormsModel::get_field( $form, $field[ 'id' ] ); |
|
190 | 190 | |
191 | 191 | // Not a list field |
192 | - if( ! $field_object || 'list' !== $field_object->type ) { |
|
192 | + if ( ! $field_object || 'list' !== $field_object->type ) { |
|
193 | 193 | return $label; |
194 | 194 | } |
195 | 195 | |
196 | 196 | // Custom label is defined, so use it |
197 | - if( ! empty( $field['custom_label'] ) ) { |
|
197 | + if ( ! empty( $field[ 'custom_label' ] ) ) { |
|
198 | 198 | return $label; |
199 | 199 | } |
200 | 200 | |
201 | - $column_id = gravityview_get_input_id_from_id( $field['id'] ); |
|
201 | + $column_id = gravityview_get_input_id_from_id( $field[ 'id' ] ); |
|
202 | 202 | |
203 | 203 | // Parent field, not column field |
204 | - if( false === $column_id ) { |
|
204 | + if ( false === $column_id ) { |
|
205 | 205 | return $label; |
206 | 206 | } |
207 | 207 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | public static function get_column_label( GF_Field_List $field, $column_id, $backup_label = '' ) { |
223 | 223 | |
224 | 224 | // Doesn't have columns enabled |
225 | - if( ! isset( $field->choices ) || ! $field->enableColumns ) { |
|
225 | + if ( ! isset( $field->choices ) || ! $field->enableColumns ) { |
|
226 | 226 | return $backup_label; |
227 | 227 | } |
228 | 228 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | function modify_entry_value_workflow_final_status( $output, $entry, $field_settings, $field ) { |
43 | 43 | |
44 | - if( ! empty( $output ) ) { |
|
44 | + if ( ! empty( $output ) ) { |
|
45 | 45 | $output = gravity_flow()->translate_status_label( $output ); |
46 | 46 | } |
47 | 47 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | foreach ( $search_fields as & $search_field ) { |
66 | 66 | if ( $this->name === \GV\Utils::get( $search_field, 'key' ) ) { |
67 | - $search_field['choices'] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options(); |
|
67 | + $search_field[ 'choices' ] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options(); |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 |
@@ -7,15 +7,15 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | 12 | |
13 | 13 | $html_input_type = RGFormsModel::is_html5_enabled() ? 'search' : 'text'; |
14 | 14 | ?> |
15 | 15 | |
16 | 16 | <div class="gv-search-box gv-search-field-text gv-search-field-search_all"> |
17 | 17 | <div class="gv-search"> |
18 | - <?php if( ! gv_empty( $label, false, false ) ) { ?> |
|
18 | + <?php if ( ! gv_empty( $label, false, false ) ) { ?> |
|
19 | 19 | <label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
20 | 20 | <?php } ?> |
21 | 21 | <p><input type="<?php echo $html_input_type; ?>" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p> |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class="gv-search-box gv-search-field-entry_id"> |
15 | 15 | <div class="gv-search"> |
16 | - <?php if( ! gv_empty( $label, false, false ) ) { ?> |
|
16 | + <?php if ( ! gv_empty( $label, false, false ) ) { ?> |
|
17 | 17 | <label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
18 | 18 | <?php } ?> |
19 | 19 | <p><input type="text" name="gv_id" id="gv_entry_id_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p> |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | gravityview()->log->debug( '$passed_atts: ', array( 'data' => $passed_atts ) ); |
49 | 49 | |
50 | 50 | // Get details about the current View |
51 | - if( !empty( $passed_atts['detail'] ) ) { |
|
52 | - return $this->get_view_detail( $passed_atts['detail'] ); |
|
51 | + if ( ! empty( $passed_atts[ 'detail' ] ) ) { |
|
52 | + return $this->get_view_detail( $passed_atts[ 'detail' ] ); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $atts = $this->parse_and_sanitize_atts( $passed_atts ); |
@@ -85,16 +85,16 @@ discard block |
||
85 | 85 | $filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' ); |
86 | 86 | |
87 | 87 | // Only keep the passed attributes after making sure that they're valid pairs |
88 | - $filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts ); |
|
88 | + $filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts ); |
|
89 | 89 | |
90 | 90 | $atts = array(); |
91 | 91 | |
92 | - foreach( $filtered_atts as $key => $passed_value ) { |
|
92 | + foreach ( $filtered_atts as $key => $passed_value ) { |
|
93 | 93 | |
94 | 94 | // Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by} |
95 | 95 | $passed_value = GravityView_Merge_Tags::replace_variables( $passed_value ); |
96 | 96 | |
97 | - switch( $defaults[ $key ]['type'] ) { |
|
97 | + switch ( $defaults[ $key ][ 'type' ] ) { |
|
98 | 98 | |
99 | 99 | /** |
100 | 100 | * Make sure number fields are numeric. |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | * @see http://php.net/manual/en/function.is-numeric.php#107326 |
103 | 103 | */ |
104 | 104 | case 'number': |
105 | - if( is_numeric( $passed_value ) ) { |
|
105 | + if ( is_numeric( $passed_value ) ) { |
|
106 | 106 | $atts[ $key ] = ( $passed_value + 0 ); |
107 | 107 | } |
108 | 108 | break; |
109 | 109 | |
110 | 110 | /** @since 2.1 */ |
111 | 111 | case 'operator': |
112 | - if( GFFormsModel::is_valid_operator( $passed_value ) ) { |
|
112 | + if ( GFFormsModel::is_valid_operator( $passed_value ) ) { |
|
113 | 113 | $atts[ $key ] = $passed_value; |
114 | 114 | } |
115 | 115 | break; |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | */ |
125 | 125 | case 'select': |
126 | 126 | case 'radio': |
127 | - $options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options']; |
|
128 | - if( in_array( $passed_value, array_keys( $options ) ) ) { |
|
127 | + $options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ]; |
|
128 | + if ( in_array( $passed_value, array_keys( $options ) ) ) { |
|
129 | 129 | $atts[ $key ] = $passed_value; |
130 | 130 | } |
131 | 131 | break; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $gravityview_view = GravityView_View::getInstance(); |
155 | 155 | $return = ''; |
156 | 156 | |
157 | - switch( $detail ) { |
|
157 | + switch ( $detail ) { |
|
158 | 158 | case 'total_entries': |
159 | 159 | $return = number_format_i18n( $gravityview_view->getTotalEntries() ); |
160 | 160 | break; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | abstract class GravityView_Extension extends \GV\Extension { |
16 | 16 | public function __construct() { |
17 | - if( ! in_array( $this->_author, array( 'GravityView', 'Katz Web Services, Inc.', true ) ) ) { |
|
17 | + if ( ! in_array( $this->_author, array( 'GravityView', 'Katz Web Services, Inc.', true ) ) ) { |
|
18 | 18 | gravityview()->log->warning( '\GravityView_Extension is deprecated. Inherit from \GV\Extension instead', array( 'data' => $this ) ); |
19 | 19 | } |
20 | 20 | parent::__construct(); |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $gv_page = gravityview()->request->is_admin( '', 'single' ); |
79 | 79 | |
80 | 80 | // New View or Edit View page |
81 | - if( $gv_page && $pagenow === 'post-new.php' ) { |
|
81 | + if ( $gv_page && $pagenow === 'post-new.php' ) { |
|
82 | 82 | remove_meta_box( 'woothemes-settings', 'gravityview', 'normal' ); |
83 | 83 | } |
84 | 84 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | parent::add_hooks(); |
69 | 69 | |
70 | - if( gravityview()->request->is_admin( '', null ) ) { |
|
70 | + if ( gravityview()->request->is_admin( '', null ) ) { |
|
71 | 71 | |
72 | 72 | // Make Yoast metabox go down to the bottom please. |
73 | 73 | add_filter( 'wpseo_metabox_prio', array( $this, 'return_low' ) ); |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function disable_content_analysis( $options ) { |
94 | 94 | |
95 | - $options['keyword_analysis_active'] = false; |
|
96 | - $options['content_analysis_active'] = false; |
|
95 | + $options[ 'keyword_analysis_active' ] = false; |
|
96 | + $options[ 'content_analysis_active' ] = false; |
|
97 | 97 | |
98 | 98 | return $options; |
99 | 99 | } |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | global $pagenow; |
113 | 113 | |
114 | 114 | // New View page |
115 | - if( $pagenow === 'post-new.php' ) { |
|
116 | - $options['hideeditbox-gravityview'] = true; |
|
115 | + if ( $pagenow === 'post-new.php' ) { |
|
116 | + $options[ 'hideeditbox-gravityview' ] = true; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | return $options; |