@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | // Add the list columns |
| 63 | 63 | foreach ( $list_fields as $list_field ) { |
| 64 | 64 | |
| 65 | - if( empty( $list_field->enableColumns ) ) { |
|
| 65 | + if ( empty( $list_field->enableColumns ) ) { |
|
| 66 | 66 | continue; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // If there are columns, add them under the parent field |
| 86 | - if( ! empty( $list_columns ) ) { |
|
| 86 | + if ( ! empty( $list_columns ) ) { |
|
| 87 | 87 | |
| 88 | 88 | $index = array_search( $list_field->id, array_keys( $fields ) ) + 1; |
| 89 | 89 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * Merge the $list_columns into the $fields array at $index |
| 92 | 92 | * @see https://stackoverflow.com/a/1783125 |
| 93 | 93 | */ |
| 94 | - $fields = array_slice( $fields, 0, $index, true) + $list_columns + array_slice( $fields, $index, null, true); |
|
| 94 | + $fields = array_slice( $fields, 0, $index, true ) + $list_columns + array_slice( $fields, $index, null, true ); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | unset( $list_columns, $index, $input_id ); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | $list_rows = maybe_unserialize( $field_value ); |
| 120 | 120 | |
| 121 | - if( ! is_array( $list_rows ) ) { |
|
| 121 | + if ( ! is_array( $list_rows ) ) { |
|
| 122 | 122 | do_action( 'gravityview_log_error', __METHOD__ . ' - $field_value did not unserialize', $field_value ); |
| 123 | 123 | return null; |
| 124 | 124 | } |
@@ -131,15 +131,15 @@ discard block |
||
| 131 | 131 | foreach ( $list_row as $column_key => $column_value ) { |
| 132 | 132 | |
| 133 | 133 | // If the label of the column matches $column_id, or the numeric key value matches, add the value |
| 134 | - if( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) { |
|
| 135 | - $column_values[] = $column_value; |
|
| 134 | + if ( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) { |
|
| 135 | + $column_values[ ] = $column_value; |
|
| 136 | 136 | } |
| 137 | 137 | $current_column++; |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // Return the array of values |
| 142 | - if( 'raw' === $format ) { |
|
| 142 | + if ( 'raw' === $format ) { |
|
| 143 | 143 | return $column_values; |
| 144 | 144 | } |
| 145 | 145 | // Return the Gravity Forms Field output |
@@ -162,22 +162,22 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function _filter_field_label( $label, $field, $form, $entry ) { |
| 164 | 164 | |
| 165 | - $field_object = RGFormsModel::get_field( $form, $field['id'] ); |
|
| 165 | + $field_object = RGFormsModel::get_field( $form, $field[ 'id' ] ); |
|
| 166 | 166 | |
| 167 | 167 | // Not a list field |
| 168 | - if( ! $field_object || 'list' !== $field_object->type ) { |
|
| 168 | + if ( ! $field_object || 'list' !== $field_object->type ) { |
|
| 169 | 169 | return $label; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | // Custom label is defined, so use it |
| 173 | - if( ! empty( $field['custom_label'] ) ) { |
|
| 173 | + if ( ! empty( $field[ 'custom_label' ] ) ) { |
|
| 174 | 174 | return $label; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - $column_id = gravityview_get_input_id_from_id( $field['id'] ); |
|
| 177 | + $column_id = gravityview_get_input_id_from_id( $field[ 'id' ] ); |
|
| 178 | 178 | |
| 179 | 179 | // Parent field, not column field |
| 180 | - if( false === $column_id ) { |
|
| 180 | + if ( false === $column_id ) { |
|
| 181 | 181 | return $label; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | public static function get_column_label( GF_Field_List $field, $column_id, $backup_label = '' ) { |
| 199 | 199 | |
| 200 | 200 | // Doesn't have columns enabled |
| 201 | - if( ! isset( $field->choices ) || ! $field->enableColumns ) { |
|
| 201 | + if ( ! isset( $field->choices ) || ! $field->enableColumns ) { |
|
| 202 | 202 | return $backup_label; |
| 203 | 203 | } |
| 204 | 204 | |