@@ -7,9 +7,9 @@ |
||
7 | 7 | |
8 | 8 | var $name = 'html'; |
9 | 9 | |
10 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
10 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
11 | 11 | |
12 | - unset ( $field_options['search_filter'], $field_options['show_as_link'] ); |
|
12 | + unset ($field_options['search_filter'], $field_options['show_as_link']); |
|
13 | 13 | |
14 | 14 | return $field_options; |
15 | 15 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | parent::__construct(); |
15 | 15 | |
16 | - add_filter( 'gravityview/template/field_label', array( $this, '_filter_field_label' ), 10, 4 ); |
|
16 | + add_filter('gravityview/template/field_label', array($this, '_filter_field_label'), 10, 4); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -30,24 +30,24 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @return array|string|null Returns null if the $field_value passed wasn't an array or serialized array |
32 | 32 | */ |
33 | - public static function column_value( GF_Field_List $field, $field_value, $column_id = 0, $format = 'html' ) { |
|
33 | + public static function column_value(GF_Field_List $field, $field_value, $column_id = 0, $format = 'html') { |
|
34 | 34 | |
35 | - $list_rows = maybe_unserialize( $field_value ); |
|
35 | + $list_rows = maybe_unserialize($field_value); |
|
36 | 36 | |
37 | - if( ! is_array( $list_rows ) ) { |
|
38 | - do_action( 'gravityview_log_error', __METHOD__ . ' - $field_value did not unserialize', $field_value ); |
|
37 | + if (!is_array($list_rows)) { |
|
38 | + do_action('gravityview_log_error', __METHOD__.' - $field_value did not unserialize', $field_value); |
|
39 | 39 | return null; |
40 | 40 | } |
41 | 41 | |
42 | 42 | $column_values = array(); |
43 | 43 | |
44 | 44 | // Each list row |
45 | - foreach ( $list_rows as $list_row ) { |
|
45 | + foreach ($list_rows as $list_row) { |
|
46 | 46 | $current_column = 0; |
47 | - foreach ( $list_row as $column_key => $column_value ) { |
|
47 | + foreach ($list_row as $column_key => $column_value) { |
|
48 | 48 | |
49 | 49 | // If the label of the column matches $column_id, or the numeric key value matches, add the value |
50 | - if( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) { |
|
50 | + if ((string)$column_key === (string)$column_id || (is_numeric($column_id) && (int)$column_id === $current_column)) { |
|
51 | 51 | $column_values[] = $column_value; |
52 | 52 | } |
53 | 53 | $current_column++; |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | // Return the array of values |
58 | - if( 'raw' === $format ) { |
|
58 | + if ('raw' === $format) { |
|
59 | 59 | return $column_values; |
60 | 60 | } |
61 | 61 | // Return the Gravity Forms Field output |
62 | 62 | else { |
63 | - return $field->get_value_entry_detail( serialize( $column_values ), '', false, $format ); |
|
63 | + return $field->get_value_entry_detail(serialize($column_values), '', false, $format); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
@@ -76,30 +76,30 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @return string Existing label if the field isn't |
78 | 78 | */ |
79 | - public function _filter_field_label( $label, $field, $form, $entry ) { |
|
79 | + public function _filter_field_label($label, $field, $form, $entry) { |
|
80 | 80 | |
81 | - $field_object = RGFormsModel::get_field( $form, $field['id'] ); |
|
81 | + $field_object = RGFormsModel::get_field($form, $field['id']); |
|
82 | 82 | |
83 | 83 | // Not a list field |
84 | - if( ! $field_object || 'list' !== $field_object->type ) { |
|
84 | + if (!$field_object || 'list' !== $field_object->type) { |
|
85 | 85 | return $label; |
86 | 86 | } |
87 | 87 | |
88 | 88 | // Custom label is defined, so use it |
89 | - if( ! empty( $field['custom_label'] ) ) { |
|
89 | + if (!empty($field['custom_label'])) { |
|
90 | 90 | return $label; |
91 | 91 | } |
92 | 92 | |
93 | - $field_id_array = explode( '.', $field['id'] ); |
|
93 | + $field_id_array = explode('.', $field['id']); |
|
94 | 94 | |
95 | 95 | // Parent field, not column field |
96 | - if( ! isset( $field_id_array[1] ) ) { |
|
96 | + if (!isset($field_id_array[1])) { |
|
97 | 97 | return $label; |
98 | 98 | } |
99 | 99 | |
100 | - $column_id = intval( $field_id_array[1] ); |
|
100 | + $column_id = intval($field_id_array[1]); |
|
101 | 101 | |
102 | - return self::get_column_label( $field_object, $column_id, $label ); |
|
102 | + return self::get_column_label($field_object, $column_id, $label); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -113,17 +113,17 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return string |
115 | 115 | */ |
116 | - public static function get_column_label( GF_Field_List $field, $column_id, $backup_label = '' ) { |
|
116 | + public static function get_column_label(GF_Field_List $field, $column_id, $backup_label = '') { |
|
117 | 117 | |
118 | 118 | // Doesn't have columns enabled |
119 | - if( ! isset( $field->choices ) || ! $field->enableColumns ) { |
|
119 | + if (!isset($field->choices) || !$field->enableColumns) { |
|
120 | 120 | return $backup_label; |
121 | 121 | } |
122 | 122 | |
123 | 123 | // Get the list of columns, with numeric index keys |
124 | - $columns = wp_list_pluck( $field->choices, 'text' ); |
|
124 | + $columns = wp_list_pluck($field->choices, 'text'); |
|
125 | 125 | |
126 | - return isset( $columns[ $column_id ] ) ? $columns[ $column_id ] : $backup_label; |
|
126 | + return isset($columns[$column_id]) ? $columns[$column_id] : $backup_label; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | } |
@@ -9,18 +9,18 @@ |
||
9 | 9 | |
10 | 10 | var $name = 'number'; |
11 | 11 | |
12 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
12 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
13 | 13 | |
14 | 14 | $field_options['number_format'] = array( |
15 | 15 | 'type' => 'checkbox', |
16 | - 'label' => __( 'Format number?', 'gravityview' ), |
|
16 | + 'label' => __('Format number?', 'gravityview'), |
|
17 | 17 | 'desc' => __('Display numbers with thousands separators.', 'gravityview'), |
18 | 18 | 'value' => false, |
19 | 19 | ); |
20 | 20 | |
21 | 21 | $field_options['decimals'] = array( |
22 | 22 | 'type' => 'number', |
23 | - 'label' => __( 'Decimals', 'gravityview' ), |
|
23 | + 'label' => __('Decimals', 'gravityview'), |
|
24 | 24 | 'desc' => __('Precision of the number of decimal places. Leave blank to use existing precision.', 'gravityview'), |
25 | 25 | 'value' => '', |
26 | 26 | 'merge_tags' => false, |
@@ -13,27 +13,27 @@ discard block |
||
13 | 13 | * @inheritDoc |
14 | 14 | * @since 1.7.2 |
15 | 15 | */ |
16 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
16 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
17 | 17 | |
18 | - if( 'edit' === $context ) { |
|
18 | + if ('edit' === $context) { |
|
19 | 19 | return $field_options; |
20 | 20 | } |
21 | 21 | |
22 | 22 | // No "Link to single entry"; all the items will be links to entries! |
23 | - unset( $field_options['show_as_link'] ); |
|
23 | + unset($field_options['show_as_link']); |
|
24 | 24 | |
25 | 25 | $new_options = array(); |
26 | 26 | |
27 | 27 | $new_options['link_format'] = array( |
28 | 28 | 'type' => 'text', |
29 | - 'label' => __( 'Entry link text (required)', 'gravityview' ), |
|
29 | + 'label' => __('Entry link text (required)', 'gravityview'), |
|
30 | 30 | 'value' => __('Entry #{entry_id}', 'gravityview'), |
31 | 31 | 'merge_tags' => 'force', |
32 | 32 | ); |
33 | 33 | |
34 | 34 | $new_options['after_link'] = array( |
35 | 35 | 'type' => 'textarea', |
36 | - 'label' => __( 'Text or HTML to display after the link (optional)', 'gravityview' ), |
|
36 | + 'label' => __('Text or HTML to display after the link (optional)', 'gravityview'), |
|
37 | 37 | 'desc' => __('This content will be displayed below each entry link.', 'gravityview'), |
38 | 38 | 'value' => '', |
39 | 39 | 'merge_tags' => 'force', |
@@ -42,24 +42,24 @@ discard block |
||
42 | 42 | |
43 | 43 | $new_options['page_size'] = array( |
44 | 44 | 'type' => 'number', |
45 | - 'label' => __( 'Entries to Display', 'gravityview' ), |
|
46 | - 'desc' => __( 'What is the maximum number of entries that should be shown?', 'gravityview' ), |
|
45 | + 'label' => __('Entries to Display', 'gravityview'), |
|
46 | + 'desc' => __('What is the maximum number of entries that should be shown?', 'gravityview'), |
|
47 | 47 | 'value' => '10', |
48 | 48 | 'merge_tags' => false, |
49 | 49 | ); |
50 | 50 | |
51 | 51 | $new_options['no_entries_hide'] = array( |
52 | 52 | 'type' => 'checkbox', |
53 | - 'label' => __( 'Hide if no entries', 'gravityview' ), |
|
54 | - 'desc' => __( 'Don\'t display this field if the entry creator has no other entries', 'gravityview' ), |
|
53 | + 'label' => __('Hide if no entries', 'gravityview'), |
|
54 | + 'desc' => __('Don\'t display this field if the entry creator has no other entries', 'gravityview'), |
|
55 | 55 | 'value' => false, |
56 | 56 | ); |
57 | 57 | |
58 | 58 | $new_options['no_entries_text'] = array( |
59 | 59 | 'type' => 'text', |
60 | - 'label' => __( 'No Entries Text', 'gravityview' ), |
|
61 | - 'desc' => __( 'The text that is shown if the entry creator has no other entries (and "Hide if no entries" is disabled).', 'gravityview' ), |
|
62 | - 'value' => __( 'This user has no other entries.', 'gravityview' ), |
|
60 | + 'label' => __('No Entries Text', 'gravityview'), |
|
61 | + 'desc' => __('The text that is shown if the entry creator has no other entries (and "Hide if no entries" is disabled).', 'gravityview'), |
|
62 | + 'value' => __('This user has no other entries.', 'gravityview'), |
|
63 | 63 | ); |
64 | 64 | |
65 | 65 | return $new_options + $field_options; |
@@ -7,14 +7,14 @@ |
||
7 | 7 | |
8 | 8 | var $name = 'post_category'; |
9 | 9 | |
10 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
10 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
11 | 11 | |
12 | - if( 'edit' === $context ) { |
|
12 | + if ('edit' === $context) { |
|
13 | 13 | return $field_options; |
14 | 14 | } |
15 | 15 | |
16 | - $this->add_field_support('dynamic_data', $field_options ); |
|
17 | - $this->add_field_support('link_to_term', $field_options ); |
|
16 | + $this->add_field_support('dynamic_data', $field_options); |
|
17 | + $this->add_field_support('link_to_term', $field_options); |
|
18 | 18 | |
19 | 19 | return $field_options; |
20 | 20 | } |
@@ -7,15 +7,15 @@ |
||
7 | 7 | |
8 | 8 | var $name = 'post_content'; |
9 | 9 | |
10 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
10 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
11 | 11 | |
12 | - unset( $field_options['show_as_link'] ); |
|
12 | + unset($field_options['show_as_link']); |
|
13 | 13 | |
14 | - if( 'edit' === $context ) { |
|
14 | + if ('edit' === $context) { |
|
15 | 15 | return $field_options; |
16 | 16 | } |
17 | 17 | |
18 | - $this->add_field_support('dynamic_data', $field_options ); |
|
18 | + $this->add_field_support('dynamic_data', $field_options); |
|
19 | 19 | |
20 | 20 | return $field_options; |
21 | 21 | } |
@@ -9,9 +9,9 @@ |
||
9 | 9 | |
10 | 10 | var $name = 'post_id'; |
11 | 11 | |
12 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
12 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
13 | 13 | |
14 | - $this->add_field_support('link_to_post', $field_options ); |
|
14 | + $this->add_field_support('link_to_post', $field_options); |
|
15 | 15 | |
16 | 16 | return $field_options; |
17 | 17 | } |
@@ -7,18 +7,18 @@ |
||
7 | 7 | |
8 | 8 | var $name = 'post_image'; |
9 | 9 | |
10 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
10 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
11 | 11 | |
12 | - unset ( $field_options['search_filter'] ); |
|
12 | + unset ($field_options['search_filter']); |
|
13 | 13 | |
14 | - if( 'edit' === $context ) { |
|
14 | + if ('edit' === $context) { |
|
15 | 15 | return $field_options; |
16 | 16 | } |
17 | 17 | |
18 | - $this->add_field_support('link_to_post', $field_options ); |
|
18 | + $this->add_field_support('link_to_post', $field_options); |
|
19 | 19 | |
20 | 20 | // @since 1.5.4 |
21 | - $this->add_field_support('dynamic_data', $field_options ); |
|
21 | + $this->add_field_support('dynamic_data', $field_options); |
|
22 | 22 | |
23 | 23 | return $field_options; |
24 | 24 | } |
@@ -7,14 +7,14 @@ |
||
7 | 7 | |
8 | 8 | var $name = 'post_tags'; |
9 | 9 | |
10 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
10 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
11 | 11 | |
12 | - if( 'edit' === $context ) { |
|
12 | + if ('edit' === $context) { |
|
13 | 13 | return $field_options; |
14 | 14 | } |
15 | 15 | |
16 | - $this->add_field_support('dynamic_data', $field_options ); |
|
17 | - $this->add_field_support('link_to_term', $field_options ); |
|
16 | + $this->add_field_support('dynamic_data', $field_options); |
|
17 | + $this->add_field_support('link_to_term', $field_options); |
|
18 | 18 | |
19 | 19 | return $field_options; |
20 | 20 | } |