Completed
Pull Request — master (#605)
by Zack
05:45
created
includes/admin/metaboxes/class-gravityview-metabox-tab.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
 	 * @param array $callback_args Arguments passed to the callback
98 98
 	 * @return void
99 99
 	 */
100
-	function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = array()  ) {
100
+	function __construct($id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = array()) {
101 101
 
102 102
 		$this->id = $this->prefix.$id;
103 103
 		$this->title = $title;
104 104
 		$this->render_template_file = $file;
105 105
 		$this->callback = $callback;
106 106
 		$this->callback_args = $callback_args;
107
-		$this->icon_class_name = $this->parse_icon_class_name( $icon_class_name );
107
+		$this->icon_class_name = $this->parse_icon_class_name($icon_class_name);
108 108
 	}
109 109
 
110 110
 	/**
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
 	 *
117 117
 	 * @return string sanitized CSS class
118 118
 	 */
119
-	function parse_icon_class_name( $icon_class_name = '' ) {
119
+	function parse_icon_class_name($icon_class_name = '') {
120 120
 
121
-		if( preg_match( '/dashicon/i', $icon_class_name ) ) {
122
-			$icon_class_name = 'dashicons ' . $icon_class_name;
121
+		if (preg_match('/dashicon/i', $icon_class_name)) {
122
+			$icon_class_name = 'dashicons '.$icon_class_name;
123 123
 		}
124 124
 
125
-		return esc_attr( $icon_class_name );
125
+		return esc_attr($icon_class_name);
126 126
 	}
127 127
 
128 128
 	/**
@@ -140,38 +140,38 @@  discard block
 block discarded – undo
140 140
 	 *
141 141
 	 * @param WP_Post $post Currently edited post object
142 142
 	 */
143
-	function render( $post ) {
143
+	function render($post) {
144 144
 
145
-		if( !empty( $this->render_template_file ) ) {
145
+		if (!empty($this->render_template_file)) {
146 146
 
147 147
 			$file = $this->render_template_file;
148 148
 
149 149
 			// If the full path exists, use it
150
-			if( file_exists( $file ) ) {
150
+			if (file_exists($file)) {
151 151
 				$path = $file;
152 152
 			} else {
153
-				$path = GRAVITYVIEW_DIR .'includes/admin/metaboxes/views/'.$file;
153
+				$path = GRAVITYVIEW_DIR.'includes/admin/metaboxes/views/'.$file;
154 154
 			}
155 155
 
156
-			if( file_exists( $path ) ) {
156
+			if (file_exists($path)) {
157 157
 				include $path;
158 158
 			} else {
159
-				do_action( 'gravityview_log_error', 'Metabox template file not found', $this );
159
+				do_action('gravityview_log_error', 'Metabox template file not found', $this);
160 160
 			}
161 161
 
162
-		} else if( !empty( $this->callback ) ) {
162
+		} else if (!empty($this->callback)) {
163 163
 
164
-			if( is_callable( $this->callback ) ) {
164
+			if (is_callable($this->callback)) {
165 165
 
166 166
 				/** @see do_accordion_sections() */
167
-				call_user_func( $this->callback, $post, (array) $this );
167
+				call_user_func($this->callback, $post, (array)$this);
168 168
 
169 169
 			} else {
170
-				do_action( 'gravityview_log_error', 'Metabox callback was not callable', $this );
170
+				do_action('gravityview_log_error', 'Metabox callback was not callable', $this);
171 171
 			}
172 172
 
173 173
 		} else {
174
-			do_action( 'gravityview_log_error', 'Metabox file and callback were not found', $this );
174
+			do_action('gravityview_log_error', 'Metabox file and callback were not found', $this);
175 175
 		}
176 176
 	}
177 177
 
Please login to merge, or discard this patch.
includes/admin/class.render.settings.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -23,53 +23,53 @@  discard block
 block discarded – undo
23 23
 	 * @param  string      $input_type  (textarea, list, select, etc.)
24 24
 	 * @return array       Array of field options with `label`, `value`, `type`, `default` keys
25 25
 	 */
26
-	public static function get_default_field_options( $field_type, $template_id, $field_id, $context, $input_type ) {
26
+	public static function get_default_field_options($field_type, $template_id, $field_id, $context, $input_type) {
27 27
 
28 28
 		$field_options = array();
29 29
 
30
-		if( 'field' === $field_type ) {
30
+		if ('field' === $field_type) {
31 31
 
32 32
 			// Default options - fields
33 33
 			$field_options = array(
34 34
 				'show_label' => array(
35 35
 					'type' => 'checkbox',
36
-					'label' => __( 'Show Label', 'gravityview' ),
36
+					'label' => __('Show Label', 'gravityview'),
37 37
 					'value' => true,
38 38
 				),
39 39
 				'custom_label' => array(
40 40
 					'type' => 'text',
41
-					'label' => __( 'Custom Label:', 'gravityview' ),
41
+					'label' => __('Custom Label:', 'gravityview'),
42 42
 					'value' => '',
43 43
 					'merge_tags' => true,
44 44
 				),
45 45
 				'custom_class' => array(
46 46
 					'type' => 'text',
47
-					'label' => __( 'Custom CSS Class:', 'gravityview' ),
48
-					'desc' => __( 'This class will be added to the field container', 'gravityview'),
47
+					'label' => __('Custom CSS Class:', 'gravityview'),
48
+					'desc' => __('This class will be added to the field container', 'gravityview'),
49 49
 					'value' => '',
50 50
 					'merge_tags' => true,
51 51
 					'tooltip' => 'gv_css_merge_tags',
52 52
 				),
53 53
 				'only_loggedin' => array(
54 54
 					'type' => 'checkbox',
55
-					'label' => __( 'Make visible only to logged-in users?', 'gravityview' ),
55
+					'label' => __('Make visible only to logged-in users?', 'gravityview'),
56 56
 					'value' => ''
57 57
 				),
58 58
 				'only_loggedin_cap' => array(
59 59
 					'type' => 'select',
60
-					'label' => __( 'Make visible for:', 'gravityview' ),
61
-					'options' => self::get_cap_choices( $template_id, $field_id, $context, $input_type ),
60
+					'label' => __('Make visible for:', 'gravityview'),
61
+					'options' => self::get_cap_choices($template_id, $field_id, $context, $input_type),
62 62
 					'class' => 'widefat',
63 63
 					'value' => 'read',
64 64
 				),
65 65
 			);
66 66
 
67 67
 			// Match Table as well as DataTables
68
-			if( preg_match( '/table/ism', $template_id ) && 'single' !== $context ) {
68
+			if (preg_match('/table/ism', $template_id) && 'single' !== $context) {
69 69
 				$field_options['width'] = array(
70 70
 					'type' => 'number',
71 71
 					'label' => __('Percent Width', 'gravityview'),
72
-					'desc' => __( 'Leave blank for column width to be based on the field content.', 'gravityview'),
72
+					'desc' => __('Leave blank for column width to be based on the field content.', 'gravityview'),
73 73
 					'class' => 'code widefat',
74 74
 					'value' => '',
75 75
 				);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		 * @param[in]  string      $context     What context are we in? Example: `single` or `directory`
86 86
 		 * @param[in]  string      $input_type  (textarea, list, select, etc.)
87 87
 		 */
88
-		$field_options = apply_filters( "gravityview_template_{$field_type}_options", $field_options, $template_id, $field_id, $context, $input_type );
88
+		$field_options = apply_filters("gravityview_template_{$field_type}_options", $field_options, $template_id, $field_id, $context, $input_type);
89 89
 
90 90
 		/**
91 91
 		 * @filter `gravityview_template_{$input_type}_options` Filter the field options by input type (`$input_type` examples: `textarea`, `list`, `select`, etc.)
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		 * @param[in]  string      $context     What context are we in? Example: `single` or `directory`
96 96
 		 * @param[in]  string      $input_type  (textarea, list, select, etc.)
97 97
 		 */
98
-		$field_options = apply_filters( "gravityview_template_{$input_type}_options", $field_options, $template_id, $field_id, $context, $input_type );
98
+		$field_options = apply_filters("gravityview_template_{$input_type}_options", $field_options, $template_id, $field_id, $context, $input_type);
99 99
 
100 100
 		return $field_options;
101 101
 	}
@@ -111,19 +111,19 @@  discard block
 block discarded – undo
111 111
 	 * @param  string $input_type  Optional. (textarea, list, select, etc.)
112 112
 	 * @return array Associative array, with the key being the capability and the value being the label shown.
113 113
 	 */
114
-	static public function get_cap_choices( $template_id = '', $field_id = '', $context = '', $input_type = '' ) {
114
+	static public function get_cap_choices($template_id = '', $field_id = '', $context = '', $input_type = '') {
115 115
 
116 116
 		$select_cap_choices = array(
117
-			'read' => __( 'Any Logged-In User', 'gravityview' ),
118
-			'publish_posts' => __( 'Author Or Higher', 'gravityview' ),
119
-			'gravityforms_view_entries' => __( 'Can View Gravity Forms Entries', 'gravityview' ),
120
-			'delete_others_posts' => __( 'Editor Or Higher', 'gravityview' ),
121
-			'gravityforms_edit_entries' => __( 'Can Edit Gravity Forms Entries', 'gravityview' ),
122
-			'manage_options' => __( 'Administrator', 'gravityview' ),
117
+			'read' => __('Any Logged-In User', 'gravityview'),
118
+			'publish_posts' => __('Author Or Higher', 'gravityview'),
119
+			'gravityforms_view_entries' => __('Can View Gravity Forms Entries', 'gravityview'),
120
+			'delete_others_posts' => __('Editor Or Higher', 'gravityview'),
121
+			'gravityforms_edit_entries' => __('Can Edit Gravity Forms Entries', 'gravityview'),
122
+			'manage_options' => __('Administrator', 'gravityview'),
123 123
 		);
124 124
 
125
-		if( is_multisite() ) {
126
-			$select_cap_choices['manage_network'] = __('Multisite Super Admin', 'gravityview' );
125
+		if (is_multisite()) {
126
+			$select_cap_choices['manage_network'] = __('Multisite Super Admin', 'gravityview');
127 127
 		}
128 128
 
129 129
 		/**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		 * @param  string $context     Optional. What context are we in? Example: `single` or `directory`
137 137
 		 * @param  string $input_type  Optional. (textarea, list, select, etc.)
138 138
 		 */
139
-		$select_cap_choices = apply_filters('gravityview_field_visibility_caps', $select_cap_choices, $template_id, $field_id, $context, $input_type );
139
+		$select_cap_choices = apply_filters('gravityview_field_visibility_caps', $select_cap_choices, $template_id, $field_id, $context, $input_type);
140 140
 
141 141
 		return $select_cap_choices;
142 142
 	}
@@ -161,26 +161,26 @@  discard block
 block discarded – undo
161 161
 	 *
162 162
 	 * @return string HTML of dialog box
163 163
 	 */
164
-	public static function render_field_options( $field_type, $template_id, $field_id, $field_label, $area, $input_type = NULL, $uniqid = '', $current = '', $context = 'single', $item = array() ) {
164
+	public static function render_field_options($field_type, $template_id, $field_id, $field_label, $area, $input_type = NULL, $uniqid = '', $current = '', $context = 'single', $item = array()) {
165 165
 
166
-		if( empty( $uniqid ) ) {
166
+		if (empty($uniqid)) {
167 167
 			//generate a unique field id
168 168
 			$uniqid = uniqid('', false);
169 169
 		}
170 170
 
171 171
 		// get field/widget options
172
-		$options = self::get_default_field_options( $field_type, $template_id, $field_id, $context, $input_type );
172
+		$options = self::get_default_field_options($field_type, $template_id, $field_id, $context, $input_type);
173 173
 
174 174
 		// two different post arrays, depending of the field type
175
-		$name_prefix = $field_type .'s' .'['. $area .']['. $uniqid .']';
175
+		$name_prefix = $field_type.'s'.'['.$area.']['.$uniqid.']';
176 176
 
177 177
 		// build output
178 178
 		$output = '';
179
-		$output .= '<input type="hidden" class="field-key" name="'. $name_prefix .'[id]" value="'. esc_attr( $field_id ) .'">';
180
-		$output .= '<input type="hidden" class="field-label" name="'. $name_prefix .'[label]" value="'. esc_attr( $field_label ) .'">';
179
+		$output .= '<input type="hidden" class="field-key" name="'.$name_prefix.'[id]" value="'.esc_attr($field_id).'">';
180
+		$output .= '<input type="hidden" class="field-label" name="'.$name_prefix.'[label]" value="'.esc_attr($field_label).'">';
181 181
 
182 182
 		// If there are no options, return what we got.
183
-		if(empty($options)) {
183
+		if (empty($options)) {
184 184
 
185 185
 			// This is here for checking if the output is empty in render_label()
186 186
 			$output .= '<!-- No Options -->';
@@ -188,33 +188,33 @@  discard block
 block discarded – undo
188 188
 			return $output;
189 189
 		}
190 190
 
191
-		$output .= '<div class="gv-dialog-options" title="'. esc_attr( sprintf( __( 'Options: %s', 'gravityview' ) , strip_tags( html_entity_decode( $field_label ) ) ) ) .'">';
191
+		$output .= '<div class="gv-dialog-options" title="'.esc_attr(sprintf(__('Options: %s', 'gravityview'), strip_tags(html_entity_decode($field_label)))).'">';
192 192
 
193 193
 		/**
194 194
 		 * @since 1.8
195 195
 		 */
196
-		if( !empty( $item['subtitle'] ) ) {
197
-			$output .= '<div class="subtitle">' . $item['subtitle'] . '</div>';
196
+		if (!empty($item['subtitle'])) {
197
+			$output .= '<div class="subtitle">'.$item['subtitle'].'</div>';
198 198
 		}
199 199
 
200
-		foreach( $options as $key => $option ) {
200
+		foreach ($options as $key => $option) {
201 201
 
202
-			$value = isset( $current[ $key ] ) ? $current[ $key ] : NULL;
202
+			$value = isset($current[$key]) ? $current[$key] : NULL;
203 203
 
204
-			$field_output = self::render_field_option( $name_prefix . '['. $key .']' , $option, $value);
204
+			$field_output = self::render_field_option($name_prefix.'['.$key.']', $option, $value);
205 205
 
206 206
 			// The setting is empty
207
-			if( empty( $field_output ) ) {
207
+			if (empty($field_output)) {
208 208
 				continue;
209 209
 			}
210 210
 
211
-			switch( $option['type'] ) {
211
+			switch ($option['type']) {
212 212
 				// Hide hidden fields
213 213
 				case 'hidden':
214
-					$output .= '<div class="gv-setting-container gv-setting-container-'. esc_attr( $key ) . ' screen-reader-text">'. $field_output . '</div>';
214
+					$output .= '<div class="gv-setting-container gv-setting-container-'.esc_attr($key).' screen-reader-text">'.$field_output.'</div>';
215 215
 					break;
216 216
 				default:
217
-					$output .= '<div class="gv-setting-container gv-setting-container-'. esc_attr( $key ) . '">'. $field_output .'</div>';
217
+					$output .= '<div class="gv-setting-container gv-setting-container-'.esc_attr($key).'">'.$field_output.'</div>';
218 218
 			}
219 219
 		}
220 220
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 * @param  mixed      $curr_value Current value of option
236 236
 	 * @return string     HTML output of option
237 237
 	 */
238
-	public static function render_field_option( $name = '', $option, $curr_value = NULL ) {
238
+	public static function render_field_option($name = '', $option, $curr_value = NULL) {
239 239
 
240 240
 		$output = '';
241 241
 
@@ -243,19 +243,19 @@  discard block
 block discarded – undo
243 243
 		 * @deprecated setting index 'default' was replaced by 'value'
244 244
 		 * @see GravityView_FieldType::get_field_defaults
245 245
 		 */
246
-		if( !empty( $option['default'] ) && empty( $option['value'] ) ) {
246
+		if (!empty($option['default']) && empty($option['value'])) {
247 247
 			$option['value'] = $option['default'];
248
-			_deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[value] instead of [default] when defining the setting '. $name .' details' );
248
+			_deprecated_function('GravityView_FieldType::get_field_defaults', '1.1.7', '[value] instead of [default] when defining the setting '.$name.' details');
249 249
 		}
250 250
 
251 251
 		// prepare to render option field type
252
-		if( isset( $option['type'] ) ) {
252
+		if (isset($option['type'])) {
253 253
 
254
-			$type_class = self::load_type_class( $option );
254
+			$type_class = self::load_type_class($option);
255 255
 
256
-			if( class_exists( $type_class ) ) {
256
+			if (class_exists($type_class)) {
257 257
 
258
-				$render_type = new $type_class( $name, $option, $curr_value );
258
+				$render_type = new $type_class($name, $option, $curr_value);
259 259
 
260 260
 				ob_start();
261 261
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 				 * @param[in,out] string $output field class name
270 270
 				 * @param[in] array $option  option field data
271 271
 				 */
272
-				$output = apply_filters( "gravityview/option/output/{$option['type']}" , $output, $option );
272
+				$output = apply_filters("gravityview/option/output/{$option['type']}", $output, $option);
273 273
 			}
274 274
 
275 275
 		} // isset option[type]
@@ -291,35 +291,35 @@  discard block
 block discarded – undo
291 291
 	 * @param  string $id               [description]
292 292
 	 * @return void                   [description]
293 293
 	 */
294
-	public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) {
294
+	public static function render_setting_row($key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s') {
295 295
 
296
-		$setting = GravityView_View_Data::get_default_arg( $key, true );
296
+		$setting = GravityView_View_Data::get_default_arg($key, true);
297 297
 
298 298
 		// If the key doesn't exist, there's something wrong.
299
-		if( empty( $setting ) ) { return; }
299
+		if (empty($setting)) { return; }
300 300
 
301 301
 		/**
302 302
 		 * @deprecated setting index 'name' was replaced by 'label'
303 303
 		 * @see GravityView_FieldType::get_field_defaults
304 304
 		 */
305
-		if( isset( $setting['name'] ) && empty( $setting['label'] ) ) {
305
+		if (isset($setting['name']) && empty($setting['label'])) {
306 306
 			$setting['label'] = $setting['name'];
307
-			_deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[label] instead of [name] when defining the setting '. $key .' details' );
307
+			_deprecated_function('GravityView_FieldType::get_field_defaults', '1.1.7', '[label] instead of [name] when defining the setting '.$key.' details');
308 308
 		}
309 309
 
310
-		$name = esc_attr( sprintf( $name, $key ) );
311
-		$setting['id'] = esc_attr( sprintf( $id, $key ) );
312
-		$setting['tooltip'] = 'gv_' . $key;
310
+		$name = esc_attr(sprintf($name, $key));
311
+		$setting['id'] = esc_attr(sprintf($id, $key));
312
+		$setting['tooltip'] = 'gv_'.$key;
313 313
 
314 314
 		// Use default if current setting isn't set.
315
-		$curr_value = isset( $current_settings[ $key ] ) ? $current_settings[ $key ] : $setting['value'];
315
+		$curr_value = isset($current_settings[$key]) ? $current_settings[$key] : $setting['value'];
316 316
 
317 317
 		// default setting type = text
318
-		$setting['type'] = empty( $setting['type'] ) ? 'text' : $setting['type'];
318
+		$setting['type'] = empty($setting['type']) ? 'text' : $setting['type'];
319 319
 
320 320
 		// merge tags
321
-		if( !isset( $setting['merge_tags'] ) ) {
322
-			if( $setting['type'] === 'text' ) {
321
+		if (!isset($setting['merge_tags'])) {
322
+			if ($setting['type'] === 'text') {
323 323
 				$setting['merge_tags'] = true;
324 324
 			} else {
325 325
 				$setting['merge_tags'] = false;
@@ -329,27 +329,27 @@  discard block
 block discarded – undo
329 329
 		$output = '';
330 330
 
331 331
 		// render the setting
332
-		$type_class = self::load_type_class( $setting );
333
-		if( class_exists( $type_class ) ) {
332
+		$type_class = self::load_type_class($setting);
333
+		if (class_exists($type_class)) {
334 334
 			/** @var GravityView_FieldType $render_type */
335
-			$render_type = new $type_class( $name, $setting, $curr_value );
335
+			$render_type = new $type_class($name, $setting, $curr_value);
336 336
 			ob_start();
337
-			$render_type->render_setting( $override_input );
337
+			$render_type->render_setting($override_input);
338 338
 			$output = ob_get_clean();
339 339
 		}
340 340
 
341 341
 		// Check if setting is specific for a template
342
-		if( !empty( $setting['show_in_template'] ) ) {
343
-			if( !is_array( $setting['show_in_template'] ) ) {
344
-				$setting['show_in_template'] = array( $setting['show_in_template'] );
342
+		if (!empty($setting['show_in_template'])) {
343
+			if (!is_array($setting['show_in_template'])) {
344
+				$setting['show_in_template'] = array($setting['show_in_template']);
345 345
 			}
346
-			$show_if = ' data-show-if="'. implode( ' ', $setting['show_in_template'] ).'"';
346
+			$show_if = ' data-show-if="'.implode(' ', $setting['show_in_template']).'"';
347 347
 		} else {
348 348
 			$show_if = '';
349 349
 		}
350 350
 
351 351
 		// output
352
-		echo '<tr valign="top" '. $show_if .'>' . $output . '</tr>';
352
+		echo '<tr valign="top" '.$show_if.'>'.$output.'</tr>';
353 353
 
354 354
 	}
355 355
 
@@ -359,9 +359,9 @@  discard block
 block discarded – undo
359 359
 	 * @param  array $field
360 360
 	 * @return string type class name
361 361
 	 */
362
-	public static function load_type_class( $field = NULL ) {
362
+	public static function load_type_class($field = NULL) {
363 363
 
364
-		if( empty( $field['type'] ) ) {
364
+		if (empty($field['type'])) {
365 365
 			return NULL;
366 366
 		}
367 367
 
@@ -370,20 +370,20 @@  discard block
 block discarded – undo
370 370
 		 * @param string $class_suffix  field class suffix; `GravityView_FieldType_{$class_suffix}`
371 371
 		 * @param array $field   field data
372 372
 		 */
373
-		$type_class = apply_filters( "gravityview/setting/class/{$field['type']}", 'GravityView_FieldType_' . $field['type'], $field );
373
+		$type_class = apply_filters("gravityview/setting/class/{$field['type']}", 'GravityView_FieldType_'.$field['type'], $field);
374 374
 
375
-		if( !class_exists( $type_class ) ) {
375
+		if (!class_exists($type_class)) {
376 376
 
377 377
 			/**
378 378
 			 * @filter `gravityview/setting/class_file/{field_type}`
379 379
 			 * @param string  $field_type_include_path field class file path
380 380
 			 * @param array $field  field data
381 381
 			 */
382
-			$class_file = apply_filters( "gravityview/setting/class_file/{$field['type']}", GRAVITYVIEW_DIR . "includes/admin/field-types/type_{$field['type']}.php", $field );
382
+			$class_file = apply_filters("gravityview/setting/class_file/{$field['type']}", GRAVITYVIEW_DIR."includes/admin/field-types/type_{$field['type']}.php", $field);
383 383
 
384
-			if( $class_file ) {
385
-				if( file_exists( $class_file ) ) {
386
-					require_once( $class_file );
384
+			if ($class_file) {
385
+				if (file_exists($class_file)) {
386
+					require_once($class_file);
387 387
 				}
388 388
 			}
389 389
 
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 	 * @param  string $current current value
404 404
 	 * @return string         html tags
405 405
 	 */
406
-	public static function render_checkbox_option( $name = '', $id = '', $current = '' ) {
406
+	public static function render_checkbox_option($name = '', $id = '', $current = '') {
407 407
 
408
-		$output  = '<input name="'. esc_attr( $name ) .'" type="hidden" value="0">';
409
-		$output .= '<input name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" type="checkbox" value="1" '. checked( $current, '1', false ) .' >';
408
+		$output  = '<input name="'.esc_attr($name).'" type="hidden" value="0">';
409
+		$output .= '<input name="'.esc_attr($name).'" id="'.esc_attr($id).'" type="checkbox" value="1" '.checked($current, '1', false).' >';
410 410
 
411 411
 		return $output;
412 412
 	}
@@ -421,25 +421,25 @@  discard block
 block discarded – undo
421 421
 	 * @param array $args Field settings, including `class` key for CSS class
422 422
 	 * @return string         [html tags]
423 423
 	 */
424
-	public static function render_text_option( $name = '', $id = '', $current = '', $add_merge_tags = NULL, $args = array() ) {
424
+	public static function render_text_option($name = '', $id = '', $current = '', $add_merge_tags = NULL, $args = array()) {
425 425
 
426 426
 		// Show the merge tags if the field is a list view
427
-		$is_list = ( preg_match( '/_list-/ism', $name ));
427
+		$is_list = (preg_match('/_list-/ism', $name));
428 428
 
429 429
 		// Or is a single entry view
430
-		$is_single = ( preg_match( '/single_/ism', $name ));
431
-		$show = ( $is_single || $is_list );
430
+		$is_single = (preg_match('/single_/ism', $name));
431
+		$show = ($is_single || $is_list);
432 432
 
433 433
 		$class = '';
434 434
 		// and $add_merge_tags is not false
435
-		if( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) {
435
+		if ($show && $add_merge_tags !== false || $add_merge_tags === 'force') {
436 436
 			$class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
437 437
 		}
438 438
 
439
-		$class .= !empty( $args['class'] ) ? $args['class'] : 'widefat';
440
-		$type = !empty( $args['type'] ) ? $args['type'] : 'text';
439
+		$class .= !empty($args['class']) ? $args['class'] : 'widefat';
440
+		$type = !empty($args['type']) ? $args['type'] : 'text';
441 441
 
442
-		return '<input name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" type="'.esc_attr($type).'" value="'. esc_attr( $current ) .'" class="'.esc_attr( $class ).'">';
442
+		return '<input name="'.esc_attr($name).'" id="'.esc_attr($id).'" type="'.esc_attr($type).'" value="'.esc_attr($current).'" class="'.esc_attr($class).'">';
443 443
 	}
444 444
 
445 445
 	/**
@@ -451,24 +451,24 @@  discard block
 block discarded – undo
451 451
 	 * @param array $args Field settings, including `class` key for CSS class
452 452
 	 * @return string         [html tags]
453 453
 	 */
454
-	public static function render_textarea_option( $name = '', $id = '', $current = '', $add_merge_tags = NULL, $args = array() ) {
454
+	public static function render_textarea_option($name = '', $id = '', $current = '', $add_merge_tags = NULL, $args = array()) {
455 455
 
456 456
 		// Show the merge tags if the field is a list view
457
-		$is_list = ( preg_match( '/_list-/ism', $name ));
457
+		$is_list = (preg_match('/_list-/ism', $name));
458 458
 
459 459
 		// Or is a single entry view
460
-		$is_single = ( preg_match( '/single_/ism', $name ));
461
-		$show = ( $is_single || $is_list );
460
+		$is_single = (preg_match('/single_/ism', $name));
461
+		$show = ($is_single || $is_list);
462 462
 
463 463
 		$class = '';
464 464
 		// and $add_merge_tags is not false
465
-		if( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) {
465
+		if ($show && $add_merge_tags !== false || $add_merge_tags === 'force') {
466 466
 			$class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
467 467
 		}
468 468
 
469
-		$class .= !empty( $args['class'] ) ? 'widefat '.$args['class'] : 'widefat';
469
+		$class .= !empty($args['class']) ? 'widefat '.$args['class'] : 'widefat';
470 470
 
471
-		return '<textarea name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" class="'.esc_attr( $class ).'">'. esc_textarea( $current ) .'</textarea>';
471
+		return '<textarea name="'.esc_attr($name).'" id="'.esc_attr($id).'" class="'.esc_attr($class).'">'.esc_textarea($current).'</textarea>';
472 472
 	}
473 473
 
474 474
 	/**
@@ -480,11 +480,11 @@  discard block
 block discarded – undo
480 480
 	 * @param  string $current [current value]
481 481
 	 * @return string          [html tags]
482 482
 	 */
483
-	public static function render_select_option( $name = '', $id = '', $choices, $current = '' ) {
483
+	public static function render_select_option($name = '', $id = '', $choices, $current = '') {
484 484
 
485
-		$output = '<select name="'. $name .'" id="'. $id .'">';
486
-		foreach( $choices as $value => $label ) {
487
-			$output .= '<option value="'. esc_attr( $value ) .'" '. selected( $value, $current, false ) .'>'. esc_html( $label ) .'</option>';
485
+		$output = '<select name="'.$name.'" id="'.$id.'">';
486
+		foreach ($choices as $value => $label) {
487
+			$output .= '<option value="'.esc_attr($value).'" '.selected($value, $current, false).'>'.esc_html($label).'</option>';
488 488
 		}
489 489
 		$output .= '</select>';
490 490
 
Please login to merge, or discard this patch.
includes/admin/class-gravityview-support-port.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 	 * @since 1.15
26 26
 	 */
27 27
 	private function add_hooks() {
28
-		add_action( 'personal_options', array( $this, 'user_field' ) );
29
-		add_action( 'personal_options_update', array( $this, 'update_user_meta_value' ) );
30
-		add_action( 'edit_user_profile_update', array( $this, 'update_user_meta_value' ) );
31
-		add_action( 'admin_enqueue_scripts', array( $this, 'maybe_enqueue_script' ), 1000 );
32
-		add_action( 'update_option_active_plugins', array( $this, 'flush_related_plugins_transient' ) );
33
-		add_action( 'update_option_active_sitewide_plugins', array( $this, 'flush_related_plugins_transient' ) );
28
+		add_action('personal_options', array($this, 'user_field'));
29
+		add_action('personal_options_update', array($this, 'update_user_meta_value'));
30
+		add_action('edit_user_profile_update', array($this, 'update_user_meta_value'));
31
+		add_action('admin_enqueue_scripts', array($this, 'maybe_enqueue_script'), 1000);
32
+		add_action('update_option_active_plugins', array($this, 'flush_related_plugins_transient'));
33
+		add_action('update_option_active_sitewide_plugins', array($this, 'flush_related_plugins_transient'));
34 34
 	}
35 35
 
36 36
 	/**
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	 *
43 43
 	 * @return void
44 44
 	 */
45
-	public static function maybe_enqueue_script( $hook ) {
45
+	public static function maybe_enqueue_script($hook) {
46 46
 		global $pagenow;
47 47
 
48 48
 		// Don't show if not GravityView page, or if we're on the Widgets page
49
-		if ( ! gravityview_is_admin_page( $hook ) || $pagenow === 'widgets.php' ) {
49
+		if (!gravityview_is_admin_page($hook) || $pagenow === 'widgets.php') {
50 50
 			return;
51 51
 		}
52 52
 
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 		 * @since 1.15
56 56
 		 * @param boolean $display_beacon Default: `true`
57 57
 		 */
58
-		$display_support_port = apply_filters( 'gravityview/support_port/display', self::show_for_user() );
58
+		$display_support_port = apply_filters('gravityview/support_port/display', self::show_for_user());
59 59
 
60
-		if ( empty( $display_support_port ) ) {
61
-			do_action( 'gravityview_log_debug', __METHOD__ . ' - Not showing Support Port' );
60
+		if (empty($display_support_port)) {
61
+			do_action('gravityview_log_debug', __METHOD__.' - Not showing Support Port');
62 62
 
63 63
 			return;
64 64
 		}
65 65
 
66
-		$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
66
+		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
67 67
 
68
-		wp_enqueue_script( 'gravityview-support', plugins_url( 'assets/js/support' . $script_debug . '.js', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version, true );
68
+		wp_enqueue_script('gravityview-support', plugins_url('assets/js/support'.$script_debug.'.js', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version, true);
69 69
 
70 70
 		self::_localize_script();
71 71
 	}
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
 	private static function _localize_script() {
81 81
 
82 82
 		$translation = array(
83
-			'agentLabel'                => __( 'GravityView Support', 'gravityview' ),
84
-			'searchLabel'               => __( 'Search GravityView Docs', 'gravityview' ),
85
-			'searchErrorLabel'          => __( 'Your search timed out. Please double-check your internet connection and try again.', 'gravityview' ),
86
-			'noResultsLabel'            => _x( 'No results found for', 'a support form search has returned empty for the following word', 'gravityview' ),
87
-			'contactLabel'              => __( 'Contact Support', 'gravityview' ),
88
-			'attachFileLabel'           => __( 'Attach a screenshot or file', 'gravityview' ),
89
-			'attachFileError'           => __( 'The maximum file size is 10 MB', 'gravityview' ),
90
-			'nameLabel'                 => __( 'Your Name', 'gravityview' ),
91
-			'nameError'                 => __( 'Please enter your name', 'gravityview' ),
92
-			'emailLabel'                => __( 'Email address', 'gravityview' ),
93
-			'emailError'                => __( 'Please enter a valid email address', 'gravityview' ),
94
-			'subjectLabel'              => __( 'Subject', 'gravityview' ),
95
-			'subjectError'              => _x( 'Please enter a subject', 'Error shown when submitting support request and there is no subject provided', 'gravityview' ),
96
-			'messageLabel'              => __( 'How can we help you?', 'gravityview' ),
97
-			'messageError'              => _x( 'Please enter a message', 'Error shown when submitting support request and there is no message provided', 'gravityview' ),
98
-			'contactSuccessLabel'       => __( 'Message sent!', 'gravityview' ),
99
-			'contactSuccessDescription' => __( 'Thanks for reaching out! Someone from the GravityView team will get back to you soon.', 'gravityview' ),
83
+			'agentLabel'                => __('GravityView Support', 'gravityview'),
84
+			'searchLabel'               => __('Search GravityView Docs', 'gravityview'),
85
+			'searchErrorLabel'          => __('Your search timed out. Please double-check your internet connection and try again.', 'gravityview'),
86
+			'noResultsLabel'            => _x('No results found for', 'a support form search has returned empty for the following word', 'gravityview'),
87
+			'contactLabel'              => __('Contact Support', 'gravityview'),
88
+			'attachFileLabel'           => __('Attach a screenshot or file', 'gravityview'),
89
+			'attachFileError'           => __('The maximum file size is 10 MB', 'gravityview'),
90
+			'nameLabel'                 => __('Your Name', 'gravityview'),
91
+			'nameError'                 => __('Please enter your name', 'gravityview'),
92
+			'emailLabel'                => __('Email address', 'gravityview'),
93
+			'emailError'                => __('Please enter a valid email address', 'gravityview'),
94
+			'subjectLabel'              => __('Subject', 'gravityview'),
95
+			'subjectError'              => _x('Please enter a subject', 'Error shown when submitting support request and there is no subject provided', 'gravityview'),
96
+			'messageLabel'              => __('How can we help you?', 'gravityview'),
97
+			'messageError'              => _x('Please enter a message', 'Error shown when submitting support request and there is no message provided', 'gravityview'),
98
+			'contactSuccessLabel'       => __('Message sent!', 'gravityview'),
99
+			'contactSuccessDescription' => __('Thanks for reaching out! Someone from the GravityView team will get back to you soon.', 'gravityview'),
100 100
 		);
101 101
 
102
-		$response = GravityView_Settings::getSetting( 'license_key_response' );
102
+		$response = GravityView_Settings::getSetting('license_key_response');
103 103
 
104
-		$response = wp_parse_args( $response, array(
104
+		$response = wp_parse_args($response, array(
105 105
 			'license'          => '',
106 106
 			'message'          => '',
107 107
 			'license_key'      => '',
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
 			'payment_id'       => '',
113 113
 			'customer_name'    => '',
114 114
 			'customer_email'   => '',
115
-		) );
115
+		));
116 116
 
117 117
 		// This is just HTML we don't need.
118
-		unset( $response['message'] );
118
+		unset($response['message']);
119 119
 
120
-		switch ( intval( $response['license_limit'] ) ) {
120
+		switch (intval($response['license_limit'])) {
121 121
 			case 1:
122 122
 				$package = 'Sol';
123 123
 				break;
@@ -128,17 +128,17 @@  discard block
 block discarded – undo
128 128
 				$package = 'Interstellar';
129 129
 				break;
130 130
 			default:
131
-				$package = sprintf( '%d-Site License', $response['license_limit'] );
131
+				$package = sprintf('%d-Site License', $response['license_limit']);
132 132
 		}
133 133
 
134 134
 		$data = array(
135
-			'email'                 => GravityView_Settings::getSetting( 'support-email' ),
135
+			'email'                 => GravityView_Settings::getSetting('support-email'),
136 136
 			'name'                  => $response['customer_name'],
137
-			'Valid License?'        => ucwords( $response['license'] ),
137
+			'Valid License?'        => ucwords($response['license']),
138 138
 			'License Key'           => $response['license_key'],
139 139
 			'License Level'         => $package,
140
-			'Site Admin Email'      => get_bloginfo( 'admin_email' ),
141
-			'Support Email'         => GravityView_Settings::getSetting( 'support-email' ),
140
+			'Site Admin Email'      => get_bloginfo('admin_email'),
141
+			'Support Email'         => GravityView_Settings::getSetting('support-email'),
142 142
 			'License Limit'         => $response['license_limit'],
143 143
 			'Site Count'            => $response['site_count'],
144 144
 			'License Expires'       => $response['expires'],
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 			'Payment ID'            => $response['payment_id'],
147 147
 			'Payment Name'          => $response['customer_name'],
148 148
 			'Payment Email'         => $response['customer_email'],
149
-			'WordPress Version'     => get_bloginfo( 'version', 'display' ),
149
+			'WordPress Version'     => get_bloginfo('version', 'display'),
150 150
 			'PHP Version'           => phpversion(),
151 151
 			'GravityView Version'   => GravityView_Plugin::version,
152 152
 			'Gravity Forms Version' => GFForms::$version,
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
 		);
155 155
 
156 156
 		$localization_data = array(
157
-			'contactEnabled' => (int)current_user_can( 'gravityview_contact_support' ), // @todo use GVCommon::has_cap() after merge
158
-			'protocol' => ( is_ssl() ? 'https' : 'http' ),
157
+			'contactEnabled' => (int)current_user_can('gravityview_contact_support'), // @todo use GVCommon::has_cap() after merge
158
+			'protocol' => (is_ssl() ? 'https' : 'http'),
159 159
 			'data' => $data,
160 160
 			'translation' => $translation,
161 161
 		);
162 162
 
163
-		wp_localize_script( 'gravityview-support', 'gvSupport', $localization_data );
163
+		wp_localize_script('gravityview-support', 'gvSupport', $localization_data);
164 164
 
165
-		unset( $localization_data, $data, $translation, $response, $package );
165
+		unset($localization_data, $data, $translation, $response, $package);
166 166
 	}
167 167
 
168 168
 	/**
@@ -173,36 +173,36 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	static private function get_related_plugins_and_extensions() {
175 175
 
176
-		if ( ! function_exists( 'wp_get_active_and_valid_plugins' ) ) {
176
+		if (!function_exists('wp_get_active_and_valid_plugins')) {
177 177
 			return 'Running < WP 3.0';
178 178
 		}
179 179
 
180
-		$extensions = get_site_transient( self::related_plugins_key );
180
+		$extensions = get_site_transient(self::related_plugins_key);
181 181
 
182
-		if ( empty( $extensions ) ) {
182
+		if (empty($extensions)) {
183 183
 
184 184
 			$active_plugins = wp_get_active_and_valid_plugins();
185 185
 			$extensions = array();
186
-			foreach ( $active_plugins as $active_plugin ) {
186
+			foreach ($active_plugins as $active_plugin) {
187 187
 
188 188
 				// Match gravityview, gravity-forms, gravityforms, gravitate
189
-				if ( ! preg_match( '/(gravityview|gravity-?forms|gravitate)/ism', $active_plugin ) ) {
189
+				if (!preg_match('/(gravityview|gravity-?forms|gravitate)/ism', $active_plugin)) {
190 190
 					continue;
191 191
 				}
192 192
 
193
-				$plugin_data = get_plugin_data( $active_plugin );
193
+				$plugin_data = get_plugin_data($active_plugin);
194 194
 
195
-				$extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] );
195
+				$extensions[] = sprintf('%s %s', $plugin_data['Name'], $plugin_data['Version']);
196 196
 			}
197 197
 
198
-			if( ! empty( $extensions ) ) {
199
-				set_site_transient( self::related_plugins_key, $extensions, HOUR_IN_SECONDS );
198
+			if (!empty($extensions)) {
199
+				set_site_transient(self::related_plugins_key, $extensions, HOUR_IN_SECONDS);
200 200
 			} else {
201 201
 				return 'There was an error fetching related plugins.';
202 202
 			}
203 203
 		}
204 204
 		
205
-		return implode( '<br />', $extensions );
205
+		return implode('<br />', $extensions);
206 206
 	}
207 207
 
208 208
 	/**
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
 	 * @since 1.15
213 213
 	 */
214 214
 	public function flush_related_plugins_transient() {
215
-		if ( function_exists( 'delete_site_transient' ) ) {
216
-			delete_site_transient( self::related_plugins_key );
215
+		if (function_exists('delete_site_transient')) {
216
+			delete_site_transient(self::related_plugins_key);
217 217
 		}
218 218
 	}
219 219
 
@@ -229,20 +229,20 @@  discard block
 block discarded – undo
229 229
 	 *
230 230
 	 * @return bool Whether to show GravityView support
231 231
 	 */
232
-	static public function show_for_user( $user = 0 ) {
232
+	static public function show_for_user($user = 0) {
233 233
 
234
-		if ( ! GVCommon::has_cap( 'gravityview_support_port' ) ) {
234
+		if (!GVCommon::has_cap('gravityview_support_port')) {
235 235
 			return false;
236 236
 		}
237 237
 
238
-		$pref = get_user_option( self::user_pref_name, $user );
238
+		$pref = get_user_option(self::user_pref_name, $user);
239 239
 
240 240
 		// Not set; default to plugin setting
241
-		if ( false === $pref ) {
242
-			return GravityView_Settings::getSetting( 'support_port' );
241
+		if (false === $pref) {
242
+			return GravityView_Settings::getSetting('support_port');
243 243
 		}
244 244
 
245
-		return ! empty( $pref );
245
+		return !empty($pref);
246 246
 	}
247 247
 
248 248
 
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
 	 *
256 256
 	 * @return void
257 257
 	 */
258
-	public function update_user_meta_value( $user_id ) {
259
-		if ( current_user_can( 'edit_user', $user_id ) && isset( $_POST[ self::user_pref_name ] ) ) {
260
-			update_user_meta( $user_id, self::user_pref_name, intval( $_POST[ self::user_pref_name ] ) );
258
+	public function update_user_meta_value($user_id) {
259
+		if (current_user_can('edit_user', $user_id) && isset($_POST[self::user_pref_name])) {
260
+			update_user_meta($user_id, self::user_pref_name, intval($_POST[self::user_pref_name]));
261 261
 		}
262 262
 	}
263 263
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	 *
273 273
 	 * @return void
274 274
 	 */
275
-	public function user_field( $user ) {
275
+	public function user_field($user) {
276 276
 
277 277
 		/**
278 278
 		 * @filter `gravityview/support_port/show_profile_setting` Should the "GravityView Support Port" setting be shown on user profiles?
@@ -282,21 +282,21 @@  discard block
 block discarded – undo
282 282
 		 * @param boolean $allow_profile_setting Default: `true`, if the user has the `gravityview_support_port` capability, which defaults to true for Contributors and higher
283 283
 		 * @param WP_User $user Current user object
284 284
 		 */
285
-		$allow_profile_setting = apply_filters( 'gravityview/support_port/show_profile_setting', current_user_can( 'gravityview_support_port' ), $user );
285
+		$allow_profile_setting = apply_filters('gravityview/support_port/show_profile_setting', current_user_can('gravityview_support_port'), $user);
286 286
 
287
-		if ( $allow_profile_setting && current_user_can( 'edit_user', $user->ID ) ) {
287
+		if ($allow_profile_setting && current_user_can('edit_user', $user->ID)) {
288 288
 			?>
289 289
 			<table class="form-table">
290 290
 				<tbody>
291 291
 					<tr class="user-gravityview-support-button-wrap">
292
-						<th scope="row"><?php _e( 'GravityView Support Port', 'gravityview' ); ?></th>
292
+						<th scope="row"><?php _e('GravityView Support Port', 'gravityview'); ?></th>
293 293
 						<td>
294 294
 							<fieldset>
295
-								<legend class="screen-reader-text"><span><?php _e( 'GravityView Support Port', 'gravityview' ) ?></span></legend>
295
+								<legend class="screen-reader-text"><span><?php _e('GravityView Support Port', 'gravityview') ?></span></legend>
296 296
 								<label>
297
-									<input name="<?php echo esc_attr( self::user_pref_name ); ?>" type="hidden" value="0"/>
298
-									<input name="<?php echo esc_attr( self::user_pref_name ); ?>" type="checkbox" value="1" <?php checked( self::show_for_user( $user->ID ) ); ?> />
299
-									<?php esc_html_e( 'Show GravityView Support Port when on a GravityView-related page', 'gravityview' ); ?>
297
+									<input name="<?php echo esc_attr(self::user_pref_name); ?>" type="hidden" value="0"/>
298
+									<input name="<?php echo esc_attr(self::user_pref_name); ?>" type="checkbox" value="1" <?php checked(self::show_for_user($user->ID)); ?> />
299
+									<?php esc_html_e('Show GravityView Support Port when on a GravityView-related page', 'gravityview'); ?>
300 300
 								</label>
301 301
 							</fieldset>
302 302
 						</td>
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-address.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
 
8 8
 	var $name = 'address';
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
 		// If this is NOT the full address field, return default options.
13
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
13
+		if (floor($field_id) !== floatval($field_id)) {
14 14
 			return $field_options;
15 15
 		}
16 16
 
17
-		if( 'edit' === $context ) {
17
+		if ('edit' === $context) {
18 18
 			return $field_options;
19 19
 		}
20 20
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 		$add_options['show_map_link'] = array(
24 24
 			'type' => 'checkbox',
25
-			'label' => __( 'Show Map Link:', 'gravityview' ),
25
+			'label' => __('Show Map Link:', 'gravityview'),
26 26
 			'desc' => __('Display a "Map It" link below the address', 'gravityview'),
27 27
 			'value' => true,
28 28
 			'merge_tags' => false,
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-checkbox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 	var $name = 'checkbox';
6 6
 
7
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
7
+	var $search_operators = array('is', 'in', 'not in', 'isnot', 'contains');
8 8
 
9 9
 	var $_gf_field_class_name = 'GF_Field_Checkbox';
10 10
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-date.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-email.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  discard block
 block discarded – undo
7 7
 
8 8
 	var $name = 'email';
9 9
 
10
-	var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
10
+	var $search_operators = array('is', 'isnot', 'contains', 'starts_with', 'ends_with');
11 11
 
12 12
 	var $_gf_field_class_name = 'GF_Field_Email';
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 16
 		// It makes no sense to use this as the link.
17
-		unset( $field_options['show_as_link'] );
17
+		unset($field_options['show_as_link']);
18 18
 
19
-		if( 'edit' === $context ) {
19
+		if ('edit' === $context) {
20 20
 			return $field_options;
21 21
 		}
22 22
 
@@ -24,29 +24,29 @@  discard block
 block discarded – undo
24 24
 			'emailmailto' => array(
25 25
 				'type' => 'checkbox',
26 26
 				'value' => true,
27
-				'label' => __( 'Link the Email Address', 'gravityview' ),
28
-				'desc' => __( 'Clicking the link will generate a new email.', 'gravityview' ),
27
+				'label' => __('Link the Email Address', 'gravityview'),
28
+				'desc' => __('Clicking the link will generate a new email.', 'gravityview'),
29 29
 			),
30 30
 			'emailsubject' => array(
31 31
 				'type' => 'text',
32
-				'label' => __( 'Email Subject', 'gravityview' ),
32
+				'label' => __('Email Subject', 'gravityview'),
33 33
 				'value' => '',
34
-				'desc' => __( 'Set the default email subject line.', 'gravityview' ),
34
+				'desc' => __('Set the default email subject line.', 'gravityview'),
35 35
 				'merge_tags' => 'force',
36 36
 			),
37 37
 			'emailbody' => array(
38 38
 				'type' => 'textarea',
39
-				'label' => __( 'Email Body', 'gravityview' ),
39
+				'label' => __('Email Body', 'gravityview'),
40 40
 				'value' => '',
41
-				'desc' => __( 'Set the default email content.', 'gravityview' ),
41
+				'desc' => __('Set the default email content.', 'gravityview'),
42 42
 				'merge_tags' => 'force',
43 43
 				'class' => 'widefat',
44 44
 			),
45 45
 			'emailencrypt' => array(
46 46
 				'type' => 'checkbox',
47 47
 				'value' => true,
48
-				'label' => __( 'Encrypt Email Address', 'gravityview' ),
49
-				'desc' => __( 'Make it harder for spammers to get email addresses from your entries. Email addresses will not be visible with Javascript disabled.', 'gravityview' )
48
+				'label' => __('Encrypt Email Address', 'gravityview'),
49
+				'desc' => __('Make it harder for spammers to get email addresses from your entries. Email addresses will not be visible with Javascript disabled.', 'gravityview')
50 50
 			)
51 51
 		);
52 52
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-entry-link.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 	var $name = 'entry_link';
9 9
 
10
-	var $contexts = array( 'multiple' );
10
+	var $contexts = array('multiple');
11 11
 
12 12
 	/**
13 13
 	 * @var bool
@@ -22,24 +22,24 @@  discard block
 block discarded – undo
22 22
 	var $is_searchable = false;
23 23
 
24 24
 	public function __construct() {
25
-		$this->label = esc_attr__( 'Link to Entry', 'gravityview' );
25
+		$this->label = esc_attr__('Link to Entry', 'gravityview');
26 26
 		$this->description = __('A dedicated link to the single entry with customizable text.', 'gravityview');
27 27
 		parent::__construct();
28 28
 	}
29 29
 
30
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
30
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
31 31
 
32 32
 		// Always a link!
33
-		unset( $field_options['show_as_link'], $field_options['search_filter'] );
33
+		unset($field_options['show_as_link'], $field_options['search_filter']);
34 34
 
35
-		if( 'edit' === $context ) {
35
+		if ('edit' === $context) {
36 36
 			return $field_options;
37 37
 		}
38 38
 
39 39
 		$add_options = array();
40 40
 		$add_options['entry_link_text'] = array(
41 41
 			'type' => 'text',
42
-			'label' => __( 'Link Text:', 'gravityview' ),
42
+			'label' => __('Link Text:', 'gravityview'),
43 43
 			'desc' => NULL,
44 44
 			'value' => __('View Details', 'gravityview'),
45 45
 			'merge_tags' => true,
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-gquiz_score.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,20 +10,20 @@
 block discarded – undo
10 10
 	var $label = 'Quiz Score';
11 11
 
12 12
 	public function __construct() {
13
-		$this->label = esc_attr__( 'Quiz Score', 'gravityview' );
13
+		$this->label = esc_attr__('Quiz Score', 'gravityview');
14 14
 		parent::__construct();
15 15
 	}
16 16
 
17
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
17
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
18 18
 
19
-		if( 'edit' === $context ) {
19
+		if ('edit' === $context) {
20 20
 			return $field_options;
21 21
 		}
22 22
 
23 23
 		$new_fields = array(
24 24
 			'quiz_use_max_score' => array(
25 25
 				'type' => 'checkbox',
26
-				'label' => __( 'Show Max Score?', 'gravityview' ),
26
+				'label' => __('Show Max Score?', 'gravityview'),
27 27
 				'desc' => __('Display score as the a fraction: "[score]/[max score]". If unchecked, will display score.', 'gravityview'),
28 28
 				'value' => true,
29 29
 				'merge_tags' => false,
Please login to merge, or discard this patch.