@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | |
20 | 20 | |
21 | 21 | /** |
22 | - * Constructor. Add filters to modify output. |
|
23 | - * |
|
22 | + * Constructor. Add filters to modify output. |
|
23 | + * |
|
24 | 24 | * @since 2.0.4 |
25 | 25 | * |
26 | 26 | * @param View $view |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct( View $view, Entry_Collection $entries, Request $request ) { |
31 | 31 | |
32 | - add_filter( 'gravityview/template/field/label', array( __CLASS__, 'add_columns_sort_links' ), 100, 2 ); |
|
32 | + add_filter( 'gravityview/template/field/label', array( __CLASS__, 'add_columns_sort_links' ), 100, 2 ); |
|
33 | 33 | |
34 | 34 | parent::__construct( $view, $entries, $request ); |
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
38 | - * Add sorting links to HTML columns that support sorting |
|
39 | - * |
|
40 | - * @since 2.0.4 |
|
41 | - * @since 2.0.5 Made static |
|
42 | - * |
|
43 | - * @static |
|
44 | - * |
|
38 | + * Add sorting links to HTML columns that support sorting |
|
39 | + * |
|
40 | + * @since 2.0.4 |
|
41 | + * @since 2.0.5 Made static |
|
42 | + * |
|
43 | + * @static |
|
44 | + * |
|
45 | 45 | * @param string $column_label Label for the table column |
46 | 46 | * @param \GV\Template_Context $context |
47 | 47 | * |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $sort_columns = $context->view->settings->get( 'sort_columns' ); |
53 | 53 | |
54 | 54 | if ( empty( $sort_columns ) ) { |
55 | - return $column_label; |
|
55 | + return $column_label; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if ( ! \GravityView_frontend::getInstance()->is_field_sortable( $context->field->ID, $context->view->form->form ) ) { |
@@ -193,15 +193,15 @@ discard block |
||
193 | 193 | */ |
194 | 194 | do_action( 'gravityview/template/table/cells/before', $context ); |
195 | 195 | |
196 | - /** |
|
197 | - * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
198 | - * @since 1.0.7 |
|
196 | + /** |
|
197 | + * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
198 | + * @since 1.0.7 |
|
199 | 199 | * @param GravityView_View $this Current GravityView_View object |
200 | 200 | * @deprecated Use `gravityview/template/table/cells/before` |
201 | - */ |
|
202 | - do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
|
201 | + */ |
|
202 | + do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
|
203 | 203 | |
204 | - foreach ( $fields->all() as $field ) { |
|
204 | + foreach ( $fields->all() as $field ) { |
|
205 | 205 | $this->the_field( $field, $entry ); |
206 | 206 | } |
207 | 207 | |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | */ |
213 | 213 | do_action( 'gravityview/template/table/cells/after', $context ); |
214 | 214 | |
215 | - /** |
|
216 | - * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
217 | - * @since 1.0.7 |
|
215 | + /** |
|
216 | + * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
217 | + * @since 1.0.7 |
|
218 | 218 | * @param GravityView_View $this Current GravityView_View object |
219 | 219 | * @deprecated Use `gravityview/template/table/cells/after` |
220 | - */ |
|
221 | - do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() ); |
|
220 | + */ |
|
221 | + do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() ); |
|
222 | 222 | |
223 | 223 | ?> |
224 | 224 | </tr> |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | 'hide_empty' => false, |
256 | 256 | 'zone_id' => 'directory_table-columns', |
257 | 257 | 'markup' => '<td id="{{ field_id }}" class="{{ class }}">{{ value }}</td>', |
258 | - 'form' => $form, |
|
258 | + 'form' => $form, |
|
259 | 259 | ); |
260 | 260 | |
261 | 261 | /** Output. */ |
@@ -280,11 +280,11 @@ discard block |
||
280 | 280 | do_action( 'gravityview/template/table/body/before', $context ); |
281 | 281 | |
282 | 282 | /** |
283 | - * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
284 | - * @deprecated Use `gravityview/template/table/body/before` |
|
285 | - * @since 1.0.7 |
|
286 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
287 | - */ |
|
283 | + * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
284 | + * @deprecated Use `gravityview/template/table/body/before` |
|
285 | + * @since 1.0.7 |
|
286 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
287 | + */ |
|
288 | 288 | do_action( 'gravityview_table_body_before', \GravityView_View::getInstance() /** ugh! */ ); |
289 | 289 | } |
290 | 290 | |
@@ -306,11 +306,11 @@ discard block |
||
306 | 306 | do_action( 'gravityview/template/table/body/after', $context ); |
307 | 307 | |
308 | 308 | /** |
309 | - * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
310 | - * @deprecated Use `gravityview/template/table/body/after` |
|
311 | - * @since 1.0.7 |
|
312 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
313 | - */ |
|
309 | + * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
310 | + * @deprecated Use `gravityview/template/table/body/after` |
|
311 | + * @since 1.0.7 |
|
312 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
313 | + */ |
|
314 | 314 | do_action( 'gravityview_table_body_after', \GravityView_View::getInstance() /** ugh! */ ); |
315 | 315 | } |
316 | 316 |
@@ -305,12 +305,12 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | /** |
308 | - * @hack |
|
309 | - * In case of email/email confirmation, the input for email has the same id as the parent field |
|
310 | - */ |
|
308 | + * @hack |
|
309 | + * In case of email/email confirmation, the input for email has the same id as the parent field |
|
310 | + */ |
|
311 | 311 | if( 'email' === $field['type'] && false === strpos( $input['id'], '.' ) ) { |
312 | - continue; |
|
313 | - } |
|
312 | + continue; |
|
313 | + } |
|
314 | 314 | $fields["{$input['id']}"] = array( |
315 | 315 | 'label' => \GV\Utils::get( $input, 'label' ), |
316 | 316 | 'customLabel' => \GV\Utils::get( $input, 'customLabel' ), |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | ), |
1350 | 1350 | ); |
1351 | 1351 | |
1352 | - $fields = $date_created + $fields; |
|
1352 | + $fields = $date_created + $fields; |
|
1353 | 1353 | |
1354 | 1354 | $blacklist_field_types = apply_filters( 'gravityview_blacklist_field_types', $blacklist, NULL ); |
1355 | 1355 | |
@@ -1361,13 +1361,13 @@ discard block |
||
1361 | 1361 | } |
1362 | 1362 | } |
1363 | 1363 | |
1364 | - /** |
|
1365 | - * @filter `gravityview/common/sortable_fields` Filter the sortable fields |
|
1366 | - * @since 1.12 |
|
1367 | - * @param array $fields Sub-set of GF form fields that are sortable |
|
1368 | - * @param int $formid The Gravity Forms form ID that the fields are from |
|
1369 | - */ |
|
1370 | - $fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid ); |
|
1364 | + /** |
|
1365 | + * @filter `gravityview/common/sortable_fields` Filter the sortable fields |
|
1366 | + * @since 1.12 |
|
1367 | + * @param array $fields Sub-set of GF form fields that are sortable |
|
1368 | + * @param int $formid The Gravity Forms form ID that the fields are from |
|
1369 | + */ |
|
1370 | + $fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid ); |
|
1371 | 1371 | |
1372 | 1372 | return $fields; |
1373 | 1373 | } |
@@ -1659,26 +1659,26 @@ discard block |
||
1659 | 1659 | } |
1660 | 1660 | |
1661 | 1661 | |
1662 | - /** |
|
1663 | - * Display updated/error notice |
|
1664 | - * |
|
1665 | - * @since 1.19.2 Added $cap and $object_id parameters |
|
1666 | - * |
|
1667 | - * @param string $notice text/HTML of notice |
|
1668 | - * @param string $class CSS class for notice (`updated` or `error`) |
|
1669 | - * @param string $cap [Optional] Define a capability required to show a notice. If not set, displays to all caps. |
|
1670 | - * |
|
1671 | - * @return string |
|
1672 | - */ |
|
1673 | - public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) { |
|
1674 | - |
|
1675 | - // If $cap is defined, only show notice if user has capability |
|
1676 | - if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) { |
|
1677 | - return ''; |
|
1678 | - } |
|
1679 | - |
|
1680 | - return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>'; |
|
1681 | - } |
|
1662 | + /** |
|
1663 | + * Display updated/error notice |
|
1664 | + * |
|
1665 | + * @since 1.19.2 Added $cap and $object_id parameters |
|
1666 | + * |
|
1667 | + * @param string $notice text/HTML of notice |
|
1668 | + * @param string $class CSS class for notice (`updated` or `error`) |
|
1669 | + * @param string $cap [Optional] Define a capability required to show a notice. If not set, displays to all caps. |
|
1670 | + * |
|
1671 | + * @return string |
|
1672 | + */ |
|
1673 | + public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) { |
|
1674 | + |
|
1675 | + // If $cap is defined, only show notice if user has capability |
|
1676 | + if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) { |
|
1677 | + return ''; |
|
1678 | + } |
|
1679 | + |
|
1680 | + return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>'; |
|
1681 | + } |
|
1682 | 1682 | |
1683 | 1683 | /** |
1684 | 1684 | * Inspired on \GFCommon::encode_shortcodes, reverse the encoding by replacing the ascii characters by the shortcode brackets |