@@ -44,16 +44,16 @@ discard block |
||
44 | 44 | */ |
45 | 45 | $atts = apply_filters( 'gravityview/shortcodes/gventry/atts', $atts ); |
46 | 46 | |
47 | - $view = \GV\View::by_id( $atts['view_id'] ); |
|
47 | + $view = \GV\View::by_id( $atts[ 'view_id' ] ); |
|
48 | 48 | |
49 | 49 | if ( ! $view ) { |
50 | - gravityview()->log->error( 'View does not exist #{view_id}', array( 'view_id' => $atts['view_id'] ) ); |
|
50 | + gravityview()->log->error( 'View does not exist #{view_id}', array( 'view_id' => $atts[ 'view_id' ] ) ); |
|
51 | 51 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', null, null, $atts ); |
52 | 52 | } |
53 | 53 | |
54 | - $entry_id = ! empty( $atts['entry_id'] ) ? $atts['entry_id'] : $atts['id']; |
|
54 | + $entry_id = ! empty( $atts[ 'entry_id' ] ) ? $atts[ 'entry_id' ] : $atts[ 'id' ]; |
|
55 | 55 | |
56 | - switch( $entry_id ): |
|
56 | + switch ( $entry_id ): |
|
57 | 57 | case 'last': |
58 | 58 | if ( class_exists( '\GF_Query' ) ) { |
59 | 59 | /** |
@@ -62,17 +62,17 @@ discard block |
||
62 | 62 | * Since we're using \GF_Query shorthand initialization we have to reverse the order parameters here. |
63 | 63 | */ |
64 | 64 | add_filter( 'gravityview_get_entries', $filter = function( $parameters, $args, $form_id ) { |
65 | - if ( ! empty( $parameters['sorting'] ) ) { |
|
65 | + if ( ! empty( $parameters[ 'sorting' ] ) ) { |
|
66 | 66 | /** |
67 | 67 | * Reverse existing sorts. |
68 | 68 | */ |
69 | - $sort = &$parameters['sorting']; |
|
70 | - $sort['direction'] = $sort['direction'] == 'RAND' ? : ( $sort['direction'] == 'ASC' ? 'DESC' : 'ASC' ); |
|
69 | + $sort = &$parameters[ 'sorting' ]; |
|
70 | + $sort[ 'direction' ] = $sort[ 'direction' ] == 'RAND' ?: ( $sort[ 'direction' ] == 'ASC' ? 'DESC' : 'ASC' ); |
|
71 | 71 | } else { |
72 | 72 | /** |
73 | 73 | * Otherwise, sort by date_created. |
74 | 74 | */ |
75 | - $parameters['sorting'] = array( |
|
75 | + $parameters[ 'sorting' ] = array( |
|
76 | 76 | 'key' => 'id', |
77 | 77 | 'direction' => 'ASC', |
78 | 78 | 'is_numeric' => true |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | /** If a sort already exists, reverse it. */ |
89 | 89 | if ( $sort = end( $entries->sorts ) ) { |
90 | - $entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ? : ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode ); |
|
90 | + $entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ?: ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode ); |
|
91 | 91 | } else { |
92 | 92 | /** Otherwise, sort by date_created */ |
93 | 93 | $entries = $entries->sort( new \GV\Entry_Sort( \GV\Internal_Field::by_id( 'id' ), \GV\Entry_Sort::ASC ), \GV\Entry_Sort::NUMERIC ); |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | break; |
106 | 106 | default: |
107 | 107 | if ( ! $entry = \GV\GF_Entry::by_id( $entry_id ) ) { |
108 | - gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts['view_id'] ) ); |
|
108 | + gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts[ 'view_id' ] ) ); |
|
109 | 109 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, null, $atts ); |
110 | 110 | } |
111 | 111 | endswitch; |
112 | 112 | |
113 | - if ( $view->form->ID != $entry['form_id'] ) { |
|
113 | + if ( $view->form->ID != $entry[ 'form_id' ] ) { |
|
114 | 114 | gravityview()->log->error( 'Entry does not belong to view (form mismatch)' ); |
115 | 115 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
116 | 116 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | return apply_filters( 'gravityview/shortcodes/gventry/output', get_the_password_form( $view->ID ), $view, $entry, $atts ); |
121 | 121 | } |
122 | 122 | |
123 | - if ( ! $view->form ) { |
|
123 | + if ( ! $view->form ) { |
|
124 | 124 | gravityview()->log->notice( 'View #{id} has no form attached to it.', array( 'id' => $view->ID ) ); |
125 | 125 | |
126 | 126 | /** |
@@ -143,15 +143,15 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | /** Unapproved entries. */ |
146 | - if ( $entry['status'] != 'active' ) { |
|
146 | + if ( $entry[ 'status' ] != 'active' ) { |
|
147 | 147 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
148 | 148 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
149 | 149 | } |
150 | 150 | |
151 | - $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID ); |
|
151 | + $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID ); |
|
152 | 152 | |
153 | 153 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
154 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
154 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
155 | 155 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
156 | 156 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
157 | 157 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $renderer = new \GV\Entry_Renderer(); |
164 | 164 | |
165 | 165 | $request = new \GV\Mock_Request(); |
166 | - $request->returns['is_entry'] = $entry; |
|
166 | + $request->returns[ 'is_entry' ] = $entry; |
|
167 | 167 | |
168 | 168 | $output = $renderer->render( $entry, $view, $request ); |
169 | 169 |
@@ -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 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
42 | 42 | |
43 | - unset ( $field_options['search_filter'], $field_options['show_as_link'] ); |
|
43 | + unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ] ); |
|
44 | 44 | |
45 | 45 | $new_fields = array( |
46 | 46 | 'content' => array( |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ); |
69 | 69 | |
70 | 70 | if ( 'edit' === $context ) { |
71 | - unset( $field_options['custom_label'], $field_options['show_label'], $field_options['allow_edit_cap'], $new_fields['wpautop'], $new_fields['oembed'] ); |
|
71 | + unset( $field_options[ 'custom_label' ], $field_options[ 'show_label' ], $field_options[ 'allow_edit_cap' ], $new_fields[ 'wpautop' ], $new_fields[ 'oembed' ] ); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return $new_fields + $field_options; |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | |
103 | 103 | // Loop through the configured Edit Entry fields and add Custom Content fields if there are any |
104 | 104 | // TODO: Make this available to other custom GV field types |
105 | - foreach ( (array) $edit_fields as $edit_field ) { |
|
105 | + foreach ( (array)$edit_fields as $edit_field ) { |
|
106 | 106 | |
107 | - if( 'custom' === \GV\Utils::get( $edit_field, 'id') ) { |
|
107 | + if ( 'custom' === \GV\Utils::get( $edit_field, 'id' ) ) { |
|
108 | 108 | |
109 | 109 | $field_data = array( |
110 | 110 | 'label' => \GV\Utils::get( $edit_field, 'custom_label' ), |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | $field_data[ $key ] = GravityView_Merge_Tags::replace_variables( $field_datum, $form, $entry->as_entry(), false, false ); |
118 | 118 | } |
119 | 119 | |
120 | - $field_data['cssClass'] = \GV\Utils::get( $edit_field, 'custom_class' ); |
|
120 | + $field_data[ 'cssClass' ] = \GV\Utils::get( $edit_field, 'custom_class' ); |
|
121 | 121 | |
122 | - $new_fields[] = new GF_Field_HTML( $field_data ); |
|
122 | + $new_fields[ ] = new GF_Field_HTML( $field_data ); |
|
123 | 123 | |
124 | 124 | } else { |
125 | - if( isset( $fields[ $i ] ) ) { |
|
126 | - $new_fields[] = $fields[ $i ]; |
|
125 | + if ( isset( $fields[ $i ] ) ) { |
|
126 | + $new_fields[ ] = $fields[ $i ]; |
|
127 | 127 | } |
128 | 128 | $i++; |
129 | 129 | } |
@@ -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 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | self::$file = plugin_dir_path( __FILE__ ); |
38 | 38 | |
39 | - if( is_admin() ) { |
|
39 | + if ( is_admin() ) { |
|
40 | 40 | $this->load_components( 'admin' ); |
41 | 41 | } |
42 | 42 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | static function getInstance() { |
57 | 57 | |
58 | - if( empty( self::$instance ) ) { |
|
58 | + if ( empty( self::$instance ) ) { |
|
59 | 59 | self::$instance = new GravityView_Edit_Entry; |
60 | 60 | } |
61 | 61 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | private function add_hooks() { |
82 | 82 | |
83 | 83 | // Add front-end access to Gravity Forms delete file action |
84 | - add_action( 'wp_ajax_nopriv_rg_delete_file', array( 'GFForms', 'delete_file') ); |
|
84 | + add_action( 'wp_ajax_nopriv_rg_delete_file', array( 'GFForms', 'delete_file' ) ); |
|
85 | 85 | |
86 | 86 | // Make sure this hook is run for non-admins |
87 | - add_action( 'wp_ajax_rg_delete_file', array( 'GFForms', 'delete_file') ); |
|
87 | + add_action( 'wp_ajax_rg_delete_file', array( 'GFForms', 'delete_file' ) ); |
|
88 | 88 | |
89 | 89 | add_filter( 'gravityview_blacklist_field_types', array( $this, 'modify_field_blacklist' ), 10, 2 ); |
90 | 90 | |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | */ |
100 | 100 | private function addon_specific_hooks() { |
101 | 101 | |
102 | - if( class_exists( 'GFSignature' ) && is_callable( array( 'GFSignature', 'get_instance' ) ) ) { |
|
103 | - add_filter('gform_admin_pre_render', array( GFSignature::get_instance(), 'edit_lead_script')); |
|
102 | + if ( class_exists( 'GFSignature' ) && is_callable( array( 'GFSignature', 'get_instance' ) ) ) { |
|
103 | + add_filter( 'gform_admin_pre_render', array( GFSignature::get_instance(), 'edit_lead_script' ) ); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | } |
@@ -146,15 +146,15 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public static function get_edit_link( $entry, $view_id, $post_id = null, $field_values = '' ) { |
148 | 148 | |
149 | - $nonce_key = self::get_nonce_key( $view_id, $entry['form_id'], $entry['id'] ); |
|
149 | + $nonce_key = self::get_nonce_key( $view_id, $entry[ 'form_id' ], $entry[ 'id' ] ); |
|
150 | 150 | |
151 | - $base = gv_entry_link( $entry, $post_id ? : $view_id ); |
|
151 | + $base = gv_entry_link( $entry, $post_id ?: $view_id ); |
|
152 | 152 | |
153 | 153 | $url = add_query_arg( array( |
154 | 154 | 'edit' => wp_create_nonce( $nonce_key ) |
155 | 155 | ), $base ); |
156 | 156 | |
157 | - if( $post_id ) { |
|
157 | + if ( $post_id ) { |
|
158 | 158 | $url = add_query_arg( array( 'gvid' => $view_id ), $url ); |
159 | 159 | } |
160 | 160 | |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | * Allow passing params to dynamically populate entry with values |
163 | 163 | * @since 1.9.2 |
164 | 164 | */ |
165 | - if( !empty( $field_values ) ) { |
|
165 | + if ( ! empty( $field_values ) ) { |
|
166 | 166 | |
167 | - if( is_array( $field_values ) ) { |
|
167 | + if ( is_array( $field_values ) ) { |
|
168 | 168 | // If already an array, no parse_str() needed |
169 | 169 | $params = $field_values; |
170 | 170 | } else { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public function modify_field_blacklist( $fields = array(), $context = NULL ) { |
187 | 187 | |
188 | - if( empty( $context ) || $context !== 'edit' ) { |
|
188 | + if ( empty( $context ) || $context !== 'edit' ) { |
|
189 | 189 | return $fields; |
190 | 190 | } |
191 | 191 | |
@@ -246,25 +246,25 @@ discard block |
||
246 | 246 | // If they can edit any entries (as defined in Gravity Forms) |
247 | 247 | // Or if they can edit other people's entries |
248 | 248 | // Then we're good. |
249 | - if( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ), $entry['id'] ) ) { |
|
249 | + if ( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ), $entry[ 'id' ] ) ) { |
|
250 | 250 | |
251 | 251 | gravityview()->log->debug( 'User has ability to edit all entries.' ); |
252 | 252 | |
253 | 253 | $user_can_edit = true; |
254 | 254 | |
255 | - } else if( !isset( $entry['created_by'] ) ) { |
|
255 | + } else if ( ! isset( $entry[ 'created_by' ] ) ) { |
|
256 | 256 | |
257 | - gravityview()->log->error( 'Entry `created_by` doesn\'t exist.'); |
|
257 | + gravityview()->log->error( 'Entry `created_by` doesn\'t exist.' ); |
|
258 | 258 | |
259 | 259 | $user_can_edit = false; |
260 | 260 | |
261 | 261 | } else { |
262 | 262 | |
263 | 263 | // get user_edit setting |
264 | - if( empty( $view_id ) || $view_id == GravityView_View::getInstance()->getViewId() ) { |
|
264 | + if ( empty( $view_id ) || $view_id == GravityView_View::getInstance()->getViewId() ) { |
|
265 | 265 | // if View ID not specified or is the current view |
266 | 266 | // @deprecated path |
267 | - $user_edit = GravityView_View::getInstance()->getAtts('user_edit'); |
|
267 | + $user_edit = GravityView_View::getInstance()->getAtts( 'user_edit' ); |
|
268 | 268 | } else { |
269 | 269 | // in case is specified and not the current view |
270 | 270 | $user_edit = GVCommon::get_template_setting( $view_id, 'user_edit' ); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $current_user = wp_get_current_user(); |
274 | 274 | |
275 | 275 | // User edit is disabled |
276 | - if( empty( $user_edit ) ) { |
|
276 | + if ( empty( $user_edit ) ) { |
|
277 | 277 | |
278 | 278 | gravityview()->log->debug( 'User Edit is disabled. Returning false.' ); |
279 | 279 | |
@@ -281,13 +281,13 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | // User edit is enabled and the logged-in user is the same as the user who created the entry. We're good. |
284 | - else if( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry['created_by'] ) ) { |
|
284 | + else if ( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry[ 'created_by' ] ) ) { |
|
285 | 285 | |
286 | 286 | gravityview()->log->debug( 'User {user_id} created the entry.', array( 'user_id', $current_user->ID ) ); |
287 | 287 | |
288 | 288 | $user_can_edit = true; |
289 | 289 | |
290 | - } else if( ! is_user_logged_in() ) { |
|
290 | + } else if ( ! is_user_logged_in() ) { |
|
291 | 291 | |
292 | 292 | gravityview()->log->debug( 'No user defined; edit entry requires logged in user' ); |
293 | 293 | } |
@@ -10,32 +10,32 @@ discard block |
||
10 | 10 | |
11 | 11 | <div id="directory-fields" class="gv-section"> |
12 | 12 | |
13 | - <h4><?php esc_html_e( 'Above Entries Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview'); ?></span></h4> |
|
13 | + <h4><?php esc_html_e( 'Above Entries Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview' ); ?></span></h4> |
|
14 | 14 | |
15 | - <?php do_action('gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?> |
|
15 | + <?php do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?> |
|
16 | 16 | |
17 | - <h4><?php esc_html_e( 'Entries Fields', 'gravityview'); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview'); ?></span></h4> |
|
17 | + <h4><?php esc_html_e( 'Entries Fields', 'gravityview' ); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview' ); ?></span></h4> |
|
18 | 18 | |
19 | 19 | <div id="directory-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
20 | - <?php if(!empty( $curr_template ) ) { |
|
21 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true ); |
|
20 | + <?php if ( ! empty( $curr_template ) ) { |
|
21 | + do_action( 'gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true ); |
|
22 | 22 | } ?> |
23 | 23 | </div> |
24 | 24 | |
25 | - <h4><?php esc_html_e( 'Below Entries Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown below entries.', 'gravityview'); ?></span></h4> |
|
25 | + <h4><?php esc_html_e( 'Below Entries Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown below entries.', 'gravityview' ); ?></span></h4> |
|
26 | 26 | |
27 | 27 | <?php |
28 | 28 | |
29 | - do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
29 | + do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
30 | 30 | |
31 | - do_action('gravityview_render_field_pickers', 'directory' ); |
|
31 | + do_action( 'gravityview_render_field_pickers', 'directory' ); |
|
32 | 32 | |
33 | 33 | ?> |
34 | 34 | |
35 | 35 | <?php // list of available widgets to be shown in the popup ?> |
36 | 36 | <div id="directory-available-widgets" class="hide-if-js gv-tooltip"> |
37 | 37 | <span class="close"><i class="dashicons dashicons-dismiss"></i></span> |
38 | - <?php do_action('gravityview_render_available_widgets' ); ?> |
|
38 | + <?php do_action( 'gravityview_render_available_widgets' ); ?> |
|
39 | 39 | </div> |
40 | 40 | |
41 | 41 | </div> |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | |
52 | 52 | <div id="single-fields" class="gv-section"> |
53 | 53 | |
54 | - <h4><?php esc_html_e( 'These fields will be shown in Single Entry view.', 'gravityview'); ?></h4> |
|
54 | + <h4><?php esc_html_e( 'These fields will be shown in Single Entry view.', 'gravityview' ); ?></h4> |
|
55 | 55 | |
56 | 56 | <div id="single-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
57 | 57 | <?php |
58 | - if(!empty( $curr_template ) ) { |
|
59 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
58 | + if ( ! empty( $curr_template ) ) { |
|
59 | + do_action( 'gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
60 | 60 | } |
61 | 61 | ?> |
62 | 62 | </div> |
63 | 63 | <?php |
64 | - do_action('gravityview_render_field_pickers', 'single' ); |
|
64 | + do_action( 'gravityview_render_field_pickers', 'single' ); |
|
65 | 65 | ?> |
66 | 66 | </div> |
67 | 67 | |
@@ -71,16 +71,16 @@ discard block |
||
71 | 71 | |
72 | 72 | <div id="edit-fields" class="gv-section"> |
73 | 73 | |
74 | - <h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview'); ?> <span><?php esc_html_e('If not configured, all form fields will be displayed.', 'gravityview'); ?></span></h4> |
|
74 | + <h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview' ); ?> <span><?php esc_html_e( 'If not configured, all form fields will be displayed.', 'gravityview' ); ?></span></h4> |
|
75 | 75 | |
76 | 76 | <div id="edit-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
77 | 77 | <?php |
78 | - do_action('gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true ); |
|
78 | + do_action( 'gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true ); |
|
79 | 79 | ?> |
80 | 80 | </div> |
81 | 81 | |
82 | 82 | <?php |
83 | - do_action('gravityview_render_field_pickers', 'edit' ); |
|
83 | + do_action( 'gravityview_render_field_pickers', 'edit' ); |
|
84 | 84 | ?> |
85 | 85 | |
86 | 86 | </div> |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $self = new self(); |
56 | 56 | $self->form = $form; |
57 | 57 | |
58 | - $self->ID = intval( $self->form['id'] ); |
|
58 | + $self->ID = intval( $self->form[ 'id' ] ); |
|
59 | 59 | |
60 | 60 | return $self; |
61 | 61 | } |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | * @return \GV\GF_Form|null An instance of this form or null if not found. |
71 | 71 | */ |
72 | 72 | public static function from_form( $form ) { |
73 | - if ( empty( $form['id'] ) ) { |
|
73 | + if ( empty( $form[ 'id' ] ) ) { |
|
74 | 74 | return null; |
75 | 75 | } |
76 | 76 | |
77 | 77 | $self = new self(); |
78 | 78 | $self->form = $form; |
79 | - $self->ID = $self->form['id']; |
|
79 | + $self->ID = $self->form[ 'id' ]; |
|
80 | 80 | |
81 | 81 | return $self; |
82 | 82 | } |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | |
120 | 120 | /** The offset and limit */ |
121 | 121 | if ( ! empty( $offset->limit ) ) { |
122 | - $paging['page_size'] = $offset->limit; |
|
122 | + $paging[ 'page_size' ] = $offset->limit; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | if ( ! empty( $offset->offset ) ) { |
126 | - $paging['offset'] = $offset->offset; |
|
126 | + $paging[ 'offset' ] = $offset->offset; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) { |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function get_fields() { |
182 | 182 | $fields = array(); |
183 | - foreach ( $this['fields'] as $field ) { |
|
184 | - foreach ( empty( $field['inputs'] ) ? array( $field['id'] ) : wp_list_pluck( $field['inputs'], 'id' ) as $id ) { |
|
183 | + foreach ( $this[ 'fields' ] as $field ) { |
|
184 | + foreach ( empty( $field[ 'inputs' ] ) ? array( $field[ 'id' ] ) : wp_list_pluck( $field[ 'inputs' ], 'id' ) as $id ) { |
|
185 | 185 | if ( is_numeric( $id ) ) { |
186 | 186 | $fields[ $id ] = self::get_field( $this, $id ); |
187 | 187 | } else { |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @return bool Whether the offset exists or not. |
219 | 219 | */ |
220 | 220 | public function offsetExists( $offset ) { |
221 | - return isset( $this->form[$offset] ); |
|
221 | + return isset( $this->form[ $offset ] ); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @return mixed The value of the requested form data. |
234 | 234 | */ |
235 | 235 | public function offsetGet( $offset ) { |
236 | - return $this->form[$offset]; |
|
236 | + return $this->form[ $offset ]; |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | * @return \GV\GF_Entry|null An instance of this entry or null if not found. |
106 | 106 | */ |
107 | 107 | public static function from_entry( $entry ) { |
108 | - if ( empty( $entry['id'] ) ) { |
|
108 | + if ( empty( $entry[ 'id' ] ) ) { |
|
109 | 109 | return null; |
110 | 110 | } |
111 | 111 | |
112 | 112 | $self = new self(); |
113 | 113 | $self->entry = $entry; |
114 | 114 | |
115 | - $self->ID = $self->entry['id']; |
|
115 | + $self->ID = $self->entry[ 'id' ]; |
|
116 | 116 | $self->slug = \GravityView_API::get_entry_slug( $self->ID, $self->as_entry() ); |
117 | 117 | |
118 | 118 | return $self; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @return bool Whether the offset exists or not. |
128 | 128 | */ |
129 | 129 | public function offsetExists( $offset ) { |
130 | - return isset( $this->entry[$offset] ); |
|
130 | + return isset( $this->entry[ $offset ] ); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @return mixed The value of the requested entry data. |
143 | 143 | */ |
144 | 144 | public function offsetGet( $offset ) { |
145 | - return $this->entry[$offset]; |
|
145 | + return $this->entry[ $offset ]; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |