@@ -4,16 +4,16 @@ |
||
4 | 4 | |
5 | 5 | var $name = 'created_by'; |
6 | 6 | |
7 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
7 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
8 | 8 | |
9 | - if( 'edit' === $context ) { |
|
9 | + if ('edit' === $context) { |
|
10 | 10 | return $field_options; |
11 | 11 | } |
12 | 12 | |
13 | 13 | $field_options['name_display'] = array( |
14 | 14 | 'type' => 'select', |
15 | - 'label' => __( 'User Format', 'gravityview' ), |
|
16 | - 'desc' => __( 'How should the User information be displayed?', 'gravityview'), |
|
15 | + 'label' => __('User Format', 'gravityview'), |
|
16 | + 'desc' => __('How should the User information be displayed?', 'gravityview'), |
|
17 | 17 | 'choices' => array( |
18 | 18 | 'display_name' => __('Display Name (Example: "Ellen Ripley")', 'gravityview'), |
19 | 19 | 'user_login' => __('Username (Example: "nostromo")', 'gravityview'), |
@@ -8,19 +8,19 @@ discard block |
||
8 | 8 | |
9 | 9 | var $name = 'custom'; |
10 | 10 | |
11 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
11 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
12 | 12 | |
13 | - unset ( $field_options['search_filter'], $field_options['show_as_link'] ); |
|
13 | + unset ($field_options['search_filter'], $field_options['show_as_link']); |
|
14 | 14 | |
15 | - if( 'edit' === $context ) { |
|
15 | + if ('edit' === $context) { |
|
16 | 16 | return $field_options; |
17 | 17 | } |
18 | 18 | |
19 | 19 | $new_fields = array( |
20 | 20 | 'content' => array( |
21 | 21 | 'type' => 'textarea', |
22 | - 'label' => __( 'Custom Content', 'gravityview' ), |
|
23 | - 'desc' => sprintf( __( 'Enter text or HTML. Also supports shortcodes. You can show or hide data using the %s shortcode (%slearn more%s).', 'gravityview' ), '<code>[gvlogic]</code>', '<a href="http://docs.gravityview.co/article/252-gvlogic-shortcode">', '</a>' ), |
|
22 | + 'label' => __('Custom Content', 'gravityview'), |
|
23 | + 'desc' => sprintf(__('Enter text or HTML. Also supports shortcodes. You can show or hide data using the %s shortcode (%slearn more%s).', 'gravityview'), '<code>[gvlogic]</code>', '<a href="http://docs.gravityview.co/article/252-gvlogic-shortcode">', '</a>'), |
|
24 | 24 | 'value' => '', |
25 | 25 | 'class' => 'code', |
26 | 26 | 'merge_tags' => 'force', |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | ), |
29 | 29 | 'wpautop' => array( |
30 | 30 | 'type' => 'checkbox', |
31 | - 'label' => __( 'Automatically add paragraphs to content', 'gravityview' ), |
|
32 | - 'tooltip' => __( 'Wrap each block of text in an HTML paragraph tag (recommended for text).', 'gravityview' ), |
|
31 | + 'label' => __('Automatically add paragraphs to content', 'gravityview'), |
|
32 | + 'tooltip' => __('Wrap each block of text in an HTML paragraph tag (recommended for text).', 'gravityview'), |
|
33 | 33 | 'value' => '', |
34 | 34 | ), |
35 | 35 | ); |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | var $name = 'date'; |
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('date_display', $field_options ); |
|
16 | + $this->add_field_support('date_display', $field_options); |
|
17 | 17 | |
18 | 18 | return $field_options; |
19 | 19 | } |
@@ -7,12 +7,12 @@ discard block |
||
7 | 7 | |
8 | 8 | var $name = 'email'; |
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 | 12 | // It makes no sense to use this as the link. |
13 | - unset( $field_options['show_as_link'] ); |
|
13 | + unset($field_options['show_as_link']); |
|
14 | 14 | |
15 | - if( 'edit' === $context ) { |
|
15 | + if ('edit' === $context) { |
|
16 | 16 | return $field_options; |
17 | 17 | } |
18 | 18 | |
@@ -20,29 +20,29 @@ discard block |
||
20 | 20 | 'emailmailto' => array( |
21 | 21 | 'type' => 'checkbox', |
22 | 22 | 'value' => true, |
23 | - 'label' => __( 'Link the Email Address', 'gravityview' ), |
|
24 | - 'desc' => __( 'Clicking the link will generate a new email.', 'gravityview' ), |
|
23 | + 'label' => __('Link the Email Address', 'gravityview'), |
|
24 | + 'desc' => __('Clicking the link will generate a new email.', 'gravityview'), |
|
25 | 25 | ), |
26 | 26 | 'emailsubject' => array( |
27 | 27 | 'type' => 'text', |
28 | - 'label' => __( 'Email Subject', 'gravityview' ), |
|
28 | + 'label' => __('Email Subject', 'gravityview'), |
|
29 | 29 | 'value' => '', |
30 | - 'desc' => __( 'Set the default email subject line.', 'gravityview' ), |
|
30 | + 'desc' => __('Set the default email subject line.', 'gravityview'), |
|
31 | 31 | 'merge_tags' => 'force', |
32 | 32 | ), |
33 | 33 | 'emailbody' => array( |
34 | 34 | 'type' => 'textarea', |
35 | - 'label' => __( 'Email Body', 'gravityview' ), |
|
35 | + 'label' => __('Email Body', 'gravityview'), |
|
36 | 36 | 'value' => '', |
37 | - 'desc' => __( 'Set the default email content.', 'gravityview' ), |
|
37 | + 'desc' => __('Set the default email content.', 'gravityview'), |
|
38 | 38 | 'merge_tags' => 'force', |
39 | 39 | 'class' => 'widefat', |
40 | 40 | ), |
41 | 41 | 'emailencrypt' => array( |
42 | 42 | 'type' => 'checkbox', |
43 | 43 | 'value' => true, |
44 | - 'label' => __( 'Encrypt Email Address', 'gravityview' ), |
|
45 | - 'desc' => __( 'Make it harder for spammers to get email addresses from your entries. Email addresses will not be visible with Javascript disabled.', 'gravityview' ) |
|
44 | + 'label' => __('Encrypt Email Address', 'gravityview'), |
|
45 | + 'desc' => __('Make it harder for spammers to get email addresses from your entries. Email addresses will not be visible with Javascript disabled.', 'gravityview') |
|
46 | 46 | ) |
47 | 47 | ); |
48 | 48 |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | var $name = 'date_created'; |
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('date_display', $field_options ); |
|
16 | + $this->add_field_support('date_display', $field_options); |
|
17 | 17 | |
18 | 18 | return $field_options; |
19 | 19 | } |
@@ -7,19 +7,19 @@ |
||
7 | 7 | |
8 | 8 | var $name = 'entry_link'; |
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 | 12 | // Always a link! |
13 | - unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
|
13 | + unset($field_options['show_as_link'], $field_options['search_filter']); |
|
14 | 14 | |
15 | - if( 'edit' === $context ) { |
|
15 | + if ('edit' === $context) { |
|
16 | 16 | return $field_options; |
17 | 17 | } |
18 | 18 | |
19 | 19 | $add_options = array(); |
20 | 20 | $add_options['entry_link_text'] = array( |
21 | 21 | 'type' => 'text', |
22 | - 'label' => __( 'Link Text:', 'gravityview' ), |
|
22 | + 'label' => __('Link Text:', 'gravityview'), |
|
23 | 23 | 'desc' => NULL, |
24 | 24 | 'value' => __('View Details', 'gravityview'), |
25 | 25 | 'merge_tags' => true, |
@@ -227,7 +227,7 @@ |
||
227 | 227 | */ |
228 | 228 | $content = apply_filters( 'gravityview/fields/fileupload/link_content', $content, $gravityview_view->getCurrentField() ); |
229 | 229 | |
230 | - $content = gravityview_get_link( $link, $content, $link_atts ); |
|
230 | + $content = gravityview_get_link( $link, $content, $link_atts ); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | $output_arr[] = array( |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | |
12 | 12 | var $name = 'fileupload'; |
13 | 13 | |
14 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
14 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
15 | 15 | |
16 | - unset( $field_options['search_filter'] ); |
|
16 | + unset($field_options['search_filter']); |
|
17 | 17 | |
18 | - if( 'edit' === $context ) { |
|
18 | + if ('edit' === $context) { |
|
19 | 19 | return $field_options; |
20 | 20 | } |
21 | 21 | |
22 | 22 | $add_options['link_to_file'] = array( |
23 | 23 | 'type' => 'checkbox', |
24 | - 'label' => __( 'Display as a Link:', 'gravityview' ), |
|
24 | + 'label' => __('Display as a Link:', 'gravityview'), |
|
25 | 25 | 'desc' => __('Display the uploaded files as links, rather than embedded content.', 'gravityview'), |
26 | 26 | 'value' => false, |
27 | 27 | 'merge_tags' => false, |
@@ -43,28 +43,28 @@ discard block |
||
43 | 43 | * @param string $gv_class Field class to add to the output HTML |
44 | 44 | * @return array Array of file output, with `file_path` and `html` keys (see comments above) |
45 | 45 | */ |
46 | - static function get_files_array( $value, $gv_class ) { |
|
46 | + static function get_files_array($value, $gv_class) { |
|
47 | 47 | |
48 | 48 | $gravityview_view = GravityView_View::getInstance(); |
49 | 49 | |
50 | - extract( $gravityview_view->getCurrentField() ); |
|
50 | + extract($gravityview_view->getCurrentField()); |
|
51 | 51 | |
52 | 52 | $output_arr = array(); |
53 | 53 | |
54 | 54 | // Get an array of file paths for the field. |
55 | - $file_paths = rgar( $field , 'multipleFiles' ) ? json_decode( $value ) : array( $value ); |
|
55 | + $file_paths = rgar($field, 'multipleFiles') ? json_decode($value) : array($value); |
|
56 | 56 | |
57 | 57 | // Process each file path |
58 | - foreach( $file_paths as $file_path ) { |
|
58 | + foreach ($file_paths as $file_path) { |
|
59 | 59 | |
60 | 60 | // If the site is HTTPS, use HTTPS |
61 | - if(function_exists('set_url_scheme')) { $file_path = set_url_scheme($file_path); } |
|
61 | + if (function_exists('set_url_scheme')) { $file_path = set_url_scheme($file_path); } |
|
62 | 62 | |
63 | 63 | // This is from Gravity Forms's code |
64 | 64 | $file_path = esc_attr(str_replace(" ", "%20", $file_path)); |
65 | 65 | |
66 | 66 | // If the field is set to link to the single entry, link to it. |
67 | - $link = !empty( $field_settings['show_as_link'] ) ? GravityView_API::entry_link( $entry, $field ) : $file_path; |
|
67 | + $link = !empty($field_settings['show_as_link']) ? GravityView_API::entry_link($entry, $field) : $file_path; |
|
68 | 68 | |
69 | 69 | // Get file path information |
70 | 70 | $file_path_info = pathinfo($file_path); |
@@ -86,20 +86,20 @@ discard block |
||
86 | 86 | $content = $image->html(); |
87 | 87 | |
88 | 88 | // The new default content is the image, if it exists. If not, use the file name as the content. |
89 | - $content = !empty( $content ) ? $content : $file_path_info['basename']; |
|
89 | + $content = !empty($content) ? $content : $file_path_info['basename']; |
|
90 | 90 | |
91 | 91 | // If pathinfo() gave us the extension of the file, run the switch statement using that. |
92 | - $extension = empty( $file_path_info['extension'] ) ? NULL : strtolower( $file_path_info['extension'] ); |
|
92 | + $extension = empty($file_path_info['extension']) ? NULL : strtolower($file_path_info['extension']); |
|
93 | 93 | |
94 | 94 | |
95 | - switch( true ) { |
|
95 | + switch (true) { |
|
96 | 96 | |
97 | 97 | // Audio file |
98 | - case in_array( $extension, wp_get_audio_extensions() ): |
|
98 | + case in_array($extension, wp_get_audio_extensions()): |
|
99 | 99 | |
100 | 100 | $disable_lightbox = true; |
101 | 101 | |
102 | - if( shortcode_exists( 'audio' ) ) { |
|
102 | + if (shortcode_exists('audio')) { |
|
103 | 103 | |
104 | 104 | $disable_wrapped_link = true; |
105 | 105 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @since 1.2 |
109 | 109 | * @param array $audio_settings Array with `src` and `class` keys |
110 | 110 | */ |
111 | - $audio_settings = apply_filters( 'gravityview_audio_settings', array( |
|
111 | + $audio_settings = apply_filters('gravityview_audio_settings', array( |
|
112 | 112 | 'src' => $file_path, |
113 | 113 | 'class' => 'wp-audio-shortcode gv-audio gv-field-id-'.$field_settings['id'] |
114 | 114 | )); |
@@ -118,18 +118,18 @@ discard block |
||
118 | 118 | * @see http://codex.wordpress.org/Audio_Shortcode |
119 | 119 | * @see https://developer.wordpress.org/reference/functions/wp_audio_shortcode/ |
120 | 120 | */ |
121 | - $content = wp_audio_shortcode( $audio_settings ); |
|
121 | + $content = wp_audio_shortcode($audio_settings); |
|
122 | 122 | |
123 | 123 | } |
124 | 124 | |
125 | 125 | break; |
126 | 126 | |
127 | 127 | // Video file |
128 | - case in_array( $extension, wp_get_video_extensions() ): |
|
128 | + case in_array($extension, wp_get_video_extensions()): |
|
129 | 129 | |
130 | 130 | $disable_lightbox = true; |
131 | 131 | |
132 | - if( shortcode_exists( 'video' ) ) { |
|
132 | + if (shortcode_exists('video')) { |
|
133 | 133 | |
134 | 134 | $disable_wrapped_link = true; |
135 | 135 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * @since 1.2 |
139 | 139 | * @param array $video_settings Array with `src` and `class` keys |
140 | 140 | */ |
141 | - $video_settings = apply_filters( 'gravityview_video_settings', array( |
|
141 | + $video_settings = apply_filters('gravityview_video_settings', array( |
|
142 | 142 | 'src' => $file_path, |
143 | 143 | 'class' => 'wp-video-shortcode gv-video gv-field-id-'.$field_settings['id'] |
144 | 144 | )); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @see http://codex.wordpress.org/Video_Shortcode |
149 | 149 | * @see https://developer.wordpress.org/reference/functions/wp_video_shortcode/ |
150 | 150 | */ |
151 | - $content = wp_video_shortcode( $video_settings ); |
|
151 | + $content = wp_video_shortcode($video_settings); |
|
152 | 152 | |
153 | 153 | } |
154 | 154 | |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | case $extension === 'pdf': |
159 | 159 | |
160 | 160 | // PDF needs to be displayed in an IFRAME |
161 | - $link = add_query_arg( array( 'TB_iframe' => 'true' ), $link ); |
|
161 | + $link = add_query_arg(array('TB_iframe' => 'true'), $link); |
|
162 | 162 | |
163 | 163 | break; |
164 | 164 | |
165 | 165 | // if not image, do not set the lightbox (@since 1.5.3) |
166 | - case !in_array( $extension, array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ) ): |
|
166 | + case !in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png')): |
|
167 | 167 | |
168 | 168 | $disable_lightbox = true; |
169 | 169 | |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | |
174 | 174 | // If using Link to File, override the content. |
175 | 175 | // (We do this here so that the $disable_lightbox can be set. Yes, there's a little more processing time, but oh well.) |
176 | - if( !empty( $field_settings['link_to_file'] ) ) { |
|
176 | + if (!empty($field_settings['link_to_file'])) { |
|
177 | 177 | |
178 | 178 | // Force the content to be the file name |
179 | - $content = $file_path_info["basename"]; |
|
179 | + $content = $file_path_info["basename"]; |
|
180 | 180 | |
181 | 181 | // Restore the wrapped link |
182 | 182 | $disable_wrapped_link = false; |
@@ -184,14 +184,14 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | // Whether to use lightbox or not |
187 | - if( $disable_lightbox || empty( $gravityview_view->atts['lightbox'] ) || !empty( $field_settings['show_as_link'] ) ) { |
|
187 | + if ($disable_lightbox || empty($gravityview_view->atts['lightbox']) || !empty($field_settings['show_as_link'])) { |
|
188 | 188 | |
189 | - $link_atts = empty( $field_settings['show_as_link'] ) ? array( 'target' => '_blank' ) : array(); |
|
189 | + $link_atts = empty($field_settings['show_as_link']) ? array('target' => '_blank') : array(); |
|
190 | 190 | |
191 | 191 | } else { |
192 | 192 | |
193 | 193 | $link_atts = array( |
194 | - 'rel' => sprintf( "%s-%s", $gv_class, $entry['id'] ), |
|
194 | + 'rel' => sprintf("%s-%s", $gv_class, $entry['id']), |
|
195 | 195 | 'target' => '_blank', |
196 | 196 | 'class' => 'thickbox', |
197 | 197 | ); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @param array|string $link_atts Array or attributes string |
204 | 204 | * @param array $field Current GravityView field array |
205 | 205 | */ |
206 | - $link_atts = apply_filters( 'gravityview/fields/fileupload/link_atts', $link_atts, $gravityview_view->getCurrentField() ); |
|
206 | + $link_atts = apply_filters('gravityview/fields/fileupload/link_atts', $link_atts, $gravityview_view->getCurrentField()); |
|
207 | 207 | |
208 | 208 | /** |
209 | 209 | * @filter `gravityview/fields/fileupload/disable_link` Filter to alter the default behaviour of wrapping images (or image names) with a link to the content object |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | * @param array $gravityview_view->field_data |
213 | 213 | * @see GravityView_API:field_value() for info about $gravityview_view->field_data |
214 | 214 | */ |
215 | - $disable_wrapped_link = apply_filters( 'gravityview/fields/fileupload/disable_link', $disable_wrapped_link, $gravityview_view->getCurrentField() ); |
|
215 | + $disable_wrapped_link = apply_filters('gravityview/fields/fileupload/disable_link', $disable_wrapped_link, $gravityview_view->getCurrentField()); |
|
216 | 216 | |
217 | 217 | // If the HTML output hasn't been overridden by the switch statement above, use the default format |
218 | - if( !empty( $content ) && empty( $disable_wrapped_link ) ) { |
|
218 | + if (!empty($content) && empty($disable_wrapped_link)) { |
|
219 | 219 | |
220 | 220 | /** |
221 | 221 | * Modify the link text (defaults to the file name) |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | * @param string $content The existing anchor content. Could be `<img>` tag, audio/video embed or the file name |
226 | 226 | * @param array $field GravityView array of the current field being processed |
227 | 227 | */ |
228 | - $content = apply_filters( 'gravityview/fields/fileupload/link_content', $content, $gravityview_view->getCurrentField() ); |
|
228 | + $content = apply_filters('gravityview/fields/fileupload/link_content', $content, $gravityview_view->getCurrentField()); |
|
229 | 229 | |
230 | - $content = gravityview_get_link( $link, $content, $link_atts ); |
|
230 | + $content = gravityview_get_link($link, $content, $link_atts); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | $output_arr[] = array( |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @type string $content The generated output for the file \n |
246 | 246 | * @param array $field GravityView array of the current field being processed |
247 | 247 | */ |
248 | - $output_arr = apply_filters( 'gravityview/fields/fileupload/files_array', $output_arr, $gravityview_view->getCurrentField() ); |
|
248 | + $output_arr = apply_filters('gravityview/fields/fileupload/files_array', $output_arr, $gravityview_view->getCurrentField()); |
|
249 | 249 | |
250 | 250 | return $output_arr; |
251 | 251 | } |
@@ -8,16 +8,16 @@ |
||
8 | 8 | var $name = 'quiz_score'; |
9 | 9 | |
10 | 10 | |
11 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
11 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
12 | 12 | |
13 | - if( 'edit' === $context ) { |
|
13 | + if ('edit' === $context) { |
|
14 | 14 | return $field_options; |
15 | 15 | } |
16 | 16 | |
17 | 17 | $new_fields = array( |
18 | 18 | 'quiz_use_max_score' => array( |
19 | 19 | 'type' => 'checkbox', |
20 | - 'label' => __( 'Show Max Score?', 'gravityview' ), |
|
20 | + 'label' => __('Show Max Score?', 'gravityview'), |
|
21 | 21 | 'desc' => __('Display score as the a fraction: "[score]/[max score]". If unchecked, will display score.', 'gravityview'), |
22 | 22 | 'value' => true, |
23 | 23 | 'merge_tags' => false, |
@@ -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 | } |