Completed
Pull Request — master (#747)
by Steve
19:06
created
includes/widgets/class-gravityview-widget-custom-content.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 	function __construct() {
19 19
 
20
-		$this->widget_description = __('Insert custom text or HTML as a widget', 'gravityview' );
20
+		$this->widget_description = __( 'Insert custom text or HTML as a widget', 'gravityview' );
21 21
 
22 22
 		$default_values = array(
23 23
 			'header' => 1,
@@ -42,39 +42,39 @@  discard block
 block discarded – undo
42 42
 			),
43 43
 		);
44 44
 
45
-		parent::__construct( __( 'Custom Content', 'gravityview' ) , 'custom_content', $default_values, $settings );
45
+		parent::__construct( __( 'Custom Content', 'gravityview' ), 'custom_content', $default_values, $settings );
46 46
 	}
47 47
 
48
-	public function render_frontend( $widget_args, $content = '', $context = '') {
48
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
49 49
 
50
-		if( !$this->pre_render_frontend() ) {
50
+		if ( ! $this->pre_render_frontend() ) {
51 51
 			return;
52 52
 		}
53 53
 
54
-		if( !empty( $widget_args['title'] ) ) {
55
-			echo $widget_args['title'];
54
+		if ( ! empty( $widget_args[ 'title' ] ) ) {
55
+			echo $widget_args[ 'title' ];
56 56
 		}
57 57
 
58 58
 
59 59
 		// Make sure the class is loaded in DataTables
60
-		if( !class_exists( 'GFFormDisplay' ) ) {
60
+		if ( ! class_exists( 'GFFormDisplay' ) ) {
61 61
 			include_once( GFCommon::get_base_path() . '/form_display.php' );
62 62
 		}
63 63
 
64
-		$widget_args['content'] = trim( rtrim( $widget_args['content'] ) );
64
+		$widget_args[ 'content' ] = trim( rtrim( $widget_args[ 'content' ] ) );
65 65
 
66 66
 		// No custom content
67
-		if( empty( $widget_args['content'] ) ) {
68
-			do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: No content.', get_class($this)) );
67
+		if ( empty( $widget_args[ 'content' ] ) ) {
68
+			do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: No content.', get_class( $this ) ) );
69 69
 			return;
70 70
 		}
71 71
 
72 72
 		// Add paragraphs?
73
-		if( !empty( $widget_args['wpautop'] ) ) {
74
-			$widget_args['content'] = wpautop( $widget_args['content'] );
73
+		if ( ! empty( $widget_args[ 'wpautop' ] ) ) {
74
+			$widget_args[ 'content' ] = wpautop( $widget_args[ 'content' ] );
75 75
 		}
76 76
 
77
-		$content = $widget_args['content'];
77
+		$content = $widget_args[ 'content' ];
78 78
 
79 79
 		$content = GravityView_Merge_Tags::replace_variables( $content );
80 80
 
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 
85 85
 
86 86
 		// Add custom class
87
-		$class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
87
+		$class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
88 88
 		$class = gravityview_sanitize_html_class( $class );
89 89
 
90
-		echo '<div class="gv-widget-custom-content '.$class.'">'. $content .'</div>';
90
+		echo '<div class="gv-widget-custom-content ' . $class . '">' . $content . '</div>';
91 91
 
92 92
 	}
93 93
 
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget-pagination-info.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 	function __construct() {
18 18
 
19
-		$this->widget_description = __('Summary of the number of visible entries out of the total results.', 'gravityview' );
19
+		$this->widget_description = __( 'Summary of the number of visible entries out of the total results.', 'gravityview' );
20 20
 
21 21
 		$default_values = array(
22 22
 			'header' => 1,
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$settings = array();
27 27
 
28
-		parent::__construct( __( 'Show Pagination Info', 'gravityview' ) , 'page_info', $default_values, $settings );
28
+		parent::__construct( __( 'Show Pagination Info', 'gravityview' ), 'page_info', $default_values, $settings );
29 29
 	}
30 30
 
31
-	public function render_frontend( $widget_args, $content = '', $context = '') {
31
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
32 32
 		$gravityview_view = GravityView_View::getInstance();
33 33
 
34
-		if( !$this->pre_render_frontend() ) {
34
+		if ( ! $this->pre_render_frontend() ) {
35 35
 			return;
36 36
 		}
37 37
 
38
-		if( !empty( $widget_args['title'] ) ) {
39
-			echo $widget_args['title'];
38
+		if ( ! empty( $widget_args[ 'title' ] ) ) {
39
+			echo $widget_args[ 'title' ];
40 40
 		}
41 41
 
42 42
 		$pagination_counts = $gravityview_view->getPaginationCounts();
@@ -45,16 +45,16 @@  discard block
 block discarded – undo
45 45
 
46 46
 		$output = '';
47 47
 
48
-		if( ! empty( $pagination_counts ) ) {
48
+		if ( ! empty( $pagination_counts ) ) {
49 49
 
50
-			$first = $pagination_counts['first'];
51
-			$last = $pagination_counts['last'];
52
-			$total = $pagination_counts['total'];
50
+			$first = $pagination_counts[ 'first' ];
51
+			$last = $pagination_counts[ 'last' ];
52
+			$total = $pagination_counts[ 'total' ];
53 53
 
54
-			$class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
54
+			$class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
55 55
 			$class = gravityview_sanitize_html_class( $class );
56 56
 
57
-			$output = '<div class="gv-widget-pagination '.$class.'"><p>'. sprintf(__( 'Displaying %1$s - %2$s of %3$s', 'gravityview' ), number_format_i18n( $first ), number_format_i18n( $last ), number_format_i18n( $total ) ) . '</p></div>';
57
+			$output = '<div class="gv-widget-pagination ' . $class . '"><p>' . sprintf( __( 'Displaying %1$s - %2$s of %3$s', 'gravityview' ), number_format_i18n( $first ), number_format_i18n( $last ), number_format_i18n( $total ) ) . '</p></div>';
58 58
 		}
59 59
 
60 60
 		/**
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget-page-links.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,38 +11,38 @@  discard block
 block discarded – undo
11 11
 
12 12
 	function __construct() {
13 13
 
14
-		$this->widget_description = __('Links to multiple pages of results.', 'gravityview' );
14
+		$this->widget_description = __( 'Links to multiple pages of results.', 'gravityview' );
15 15
 
16 16
 		$default_values = array( 'header' => 1, 'footer' => 1 );
17 17
 		$settings = array( 'show_all' => array(
18 18
 			'type' => 'checkbox',
19 19
 			'label' => __( 'Show each page number', 'gravityview' ),
20
-			'desc' => __('Show every page number instead of summary (eg: 1 2 3 ... 8 »)', 'gravityview'),
20
+			'desc' => __( 'Show every page number instead of summary (eg: 1 2 3 ... 8 »)', 'gravityview' ),
21 21
 			'value' => false
22
-		));
23
-		parent::__construct( __( 'Page Links', 'gravityview' ) , 'page_links', $default_values, $settings );
22
+		) );
23
+		parent::__construct( __( 'Page Links', 'gravityview' ), 'page_links', $default_values, $settings );
24 24
 
25 25
 	}
26 26
 
27
-	public function render_frontend( $widget_args, $content = '', $context = '') {
27
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
28 28
 		$gravityview_view = GravityView_View::getInstance();
29 29
 
30
-		if( !$this->pre_render_frontend() ) {
30
+		if ( ! $this->pre_render_frontend() ) {
31 31
 			return;
32 32
 		}
33 33
 
34
-		$page_size = $gravityview_view->paging['page_size'];
34
+		$page_size = $gravityview_view->paging[ 'page_size' ];
35 35
 		$total = $gravityview_view->total_entries;
36 36
 
37 37
 		$atts = shortcode_atts( array(
38
-			'show_all' => !empty( $this->settings['show_all']['default'] ),
38
+			'show_all' => ! empty( $this->settings[ 'show_all' ][ 'default' ] ),
39 39
 		), $widget_args, 'gravityview_widget_page_links' );
40 40
 
41 41
 		// displaying info
42
-		$curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] );
42
+		$curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] );
43 43
 
44 44
 		$page_link_args = array(
45
-			'base' => add_query_arg('pagenum','%#%', gv_directory_link() ),
45
+			'base' => add_query_arg( 'pagenum', '%#%', gv_directory_link() ),
46 46
 			'format' => '&pagenum=%#%',
47 47
 			'add_args' => array(), //
48 48
 			'prev_text' => '&laquo;',
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			'mid_size' => 2,
53 53
 			'total' => empty( $page_size ) ? 0 : ceil( $total / $page_size ),
54 54
 			'current' => $curr_page,
55
-			'show_all' => !empty( $atts['show_all'] ), // to be available at backoffice
55
+			'show_all' => ! empty( $atts[ 'show_all' ] ), // to be available at backoffice
56 56
 		);
57 57
 
58 58
 		/**
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 		 * @since 1.1.4
61 61
 		 * @param array  $page_link_args Array of arguments for the `paginate_links()` function. [Read more about `paginate_links()`](http://developer.wordpress.org/reference/functions/paginate_links/)
62 62
 		 */
63
-		$page_link_args = apply_filters('gravityview_page_links_args', $page_link_args );
63
+		$page_link_args = apply_filters( 'gravityview_page_links_args', $page_link_args );
64 64
 
65 65
 		$page_links = paginate_links( $page_link_args );
66 66
 
67
-		if( !empty( $page_links )) {
68
-			$class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
67
+		if ( ! empty( $page_links ) ) {
68
+			$class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
69 69
 			$class = gravityview_sanitize_html_class( $class );
70
-			echo '<div class="gv-widget-page-links '.$class.'">'. $page_links .'</div>';
70
+			echo '<div class="gv-widget-page-links ' . $class . '">' . $page_links . '</div>';
71 71
 		} else {
72 72
 			do_action( 'gravityview_log_debug', 'GravityView_Widget_Page_Links[render_frontend] No page links; paginate_links() returned empty response.' );
73 73
 		}
Please login to merge, or discard this patch.
includes/class-gravityview-entry-list.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -170,25 +170,25 @@  discard block
 block discarded – undo
170 170
 	public function get_output() {
171 171
 
172 172
 		// No Entries
173
-		if( empty( $this->entries ) ) {
174
-			return '<div class="gv-no-results">'.$this->empty_message.'</div>';
173
+		if ( empty( $this->entries ) ) {
174
+			return '<div class="gv-no-results">' . $this->empty_message . '</div>';
175 175
 		}
176 176
 
177 177
 		$output = '';
178 178
 		$current_entry = GravityView_View::getInstance()->getCurrentEntry();
179 179
 
180
-		$output .= '<'. $this->wrapper_tag .'>';
180
+		$output .= '<' . $this->wrapper_tag . '>';
181 181
 
182
-		foreach( $this->entries as $entry ) {
182
+		foreach ( $this->entries as $entry ) {
183 183
 
184
-			if( $this->skip_entry( $entry, $current_entry ) ) {
184
+			if ( $this->skip_entry( $entry, $current_entry ) ) {
185 185
 				continue;
186 186
 			}
187 187
 
188 188
 			$output .= $this->get_item_output( $entry );
189 189
 		}
190 190
 
191
-		$output .= '</'. $this->wrapper_tag .'>';
191
+		$output .= '</' . $this->wrapper_tag . '>';
192 192
 
193 193
 		/**
194 194
 		 * @filter `gravityview/widget/recent-entries/output` Modify the HTML of the Recent Entries widget output
@@ -211,15 +211,15 @@  discard block
 block discarded – undo
211 211
 	private function skip_entry( $entry, $current_entry ) {
212 212
 
213 213
 		// If skip entry is off, or there's no current entry, return false
214
-		if( empty( $this->skip_current_entry ) || empty( $current_entry ) ) {
214
+		if ( empty( $this->skip_current_entry ) || empty( $current_entry ) ) {
215 215
 			return false;
216 216
 		}
217 217
 
218 218
 		// If in Single or Edit mode, $current_entry will be an array.
219
-		$current_entry_id = is_array( $current_entry ) ? $current_entry['id'] : $current_entry;
219
+		$current_entry_id = is_array( $current_entry ) ? $current_entry[ 'id' ] : $current_entry;
220 220
 
221 221
 		// If the entry ID matches the current entry, yes: skip
222
-		if( $entry['id'] === $current_entry_id ) {
222
+		if ( $entry[ 'id' ] === $current_entry_id ) {
223 223
 			return true;
224 224
 		}
225 225
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 
247 247
 		$item_output = gravityview_get_link( $link, $this->link_format );
248 248
 
249
-		if( !empty( $this->after_link ) ) {
249
+		if ( ! empty( $this->after_link ) ) {
250 250
 
251 251
 			/**
252 252
 			 * @filter `gravityview/entry-list/after-link` Modify the content displayed after the entry link in an entry list
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 			 * @param array $entry Gravity Forms entry array
256 256
 			 * @param GravityView_Entry_List $this The current class instance
257 257
 			 */
258
-			$after_link = apply_filters( 'gravityview/entry-list/after-link', '<div>'.$this->after_link.'</div>', $entry, $this );
258
+			$after_link = apply_filters( 'gravityview/entry-list/after-link', '<div>' . $this->after_link . '</div>', $entry, $this );
259 259
 
260 260
 			$item_output .= $after_link;
261 261
 		}
262 262
 
263 263
 		$item_output = GravityView_API::replace_variables( $item_output, $this->form, $entry );
264 264
 
265
-		$item_output = '<'. $this->item_tag .'>'. $item_output .'</'. $this->item_tag .'>';
265
+		$item_output = '<' . $this->item_tag . '>' . $item_output . '</' . $this->item_tag . '>';
266 266
 
267 267
 		/**
268 268
 		 * @filter `gravityview/entry-list/item` Modify each item's output in an entry list
Please login to merge, or discard this patch.
includes/class-gravityview-shortcode.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 		do_action( 'gravityview_log_debug', __FUNCTION__ . ' $passed_atts: ', $passed_atts );
50 50
 
51 51
 		// Get details about the current View
52
-		if( !empty( $passed_atts['detail'] ) ) {
53
-			return $this->get_view_detail( $passed_atts['detail'] );
52
+		if ( ! empty( $passed_atts[ 'detail' ] ) ) {
53
+			return $this->get_view_detail( $passed_atts[ 'detail' ] );
54 54
 		}
55 55
 
56 56
 		$atts = $this->parse_and_sanitize_atts( $passed_atts );
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 
91 91
 		$atts = array();
92 92
 
93
-		foreach( $filtered_atts as $key => $passed_value ) {
93
+		foreach ( $filtered_atts as $key => $passed_value ) {
94 94
 
95 95
 			// Allow using {get} merge tags in shortcode attributes
96 96
 			$passed_value = GravityView_Merge_Tags::replace_get_variables( $passed_value );
97 97
 
98
-			switch( $defaults[ $key ]['type'] ) {
98
+			switch ( $defaults[ $key ][ 'type' ] ) {
99 99
 
100 100
 				/**
101 101
 				 * Make sure number fields are numeric.
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 				 * @see http://php.net/manual/en/function.is-numeric.php#107326
104 104
 				 */
105 105
 				case 'number':
106
-					if( is_numeric( $passed_value ) ) {
106
+					if ( is_numeric( $passed_value ) ) {
107 107
 						$atts[ $key ] = ( $passed_value + 0 );
108 108
 					}
109 109
 					break;
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 				 */
119 119
 				case 'select':
120 120
 				case 'radio':
121
-					$options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options'];
122
-					if( in_array( $passed_value, array_keys( $options ) ) ) {
121
+					$options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ];
122
+					if ( in_array( $passed_value, array_keys( $options ) ) ) {
123 123
 						$atts[ $key ] = $passed_value;
124 124
 					}
125 125
 					break;
@@ -148,21 +148,21 @@  discard block
 block discarded – undo
148 148
 		$gravityview_view = GravityView_View::getInstance();
149 149
 		$return = '';
150 150
 
151
-		switch( $detail ) {
151
+		switch ( $detail ) {
152 152
 			case 'total_entries':
153 153
 				$return = number_format_i18n( $gravityview_view->getTotalEntries() );
154 154
 				break;
155 155
 			case 'first_entry':
156 156
 				$paging = $gravityview_view->getPaginationCounts();
157
-				$return = empty( $paging ) ? '' : number_format_i18n( $paging['first'] );
157
+				$return = empty( $paging ) ? '' : number_format_i18n( $paging[ 'first' ] );
158 158
 				break;
159 159
 			case 'last_entry':
160 160
 				$paging = $gravityview_view->getPaginationCounts();
161
-				$return = empty( $paging ) ? '' : number_format_i18n( $paging['last'] );
161
+				$return = empty( $paging ) ? '' : number_format_i18n( $paging[ 'last' ] );
162 162
 				break;
163 163
 			case 'page_size':
164 164
 				$paging = $gravityview_view->getPaging();
165
-				$return = number_format_i18n( $paging['page_size'] );
165
+				$return = number_format_i18n( $paging[ 'page_size' ] );
166 166
 				break;
167 167
 		}
168 168
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-tags.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 	var $name = 'post_category';
11 11
 
12
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
12
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
13 13
 
14 14
 	var $_gf_field_class_name = 'GF_Field_Post_Category';
15 15
 
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
 
23 23
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
24 24
 
25
-		if( 'edit' === $context ) {
25
+		if ( 'edit' === $context ) {
26 26
 			return $field_options;
27 27
 		}
28 28
 
29
-		$this->add_field_support('dynamic_data', $field_options );
30
-		$this->add_field_support('link_to_term', $field_options );
29
+		$this->add_field_support( 'dynamic_data', $field_options );
30
+		$this->add_field_support( 'link_to_term', $field_options );
31 31
 
32 32
 		return $field_options;
33 33
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-multiselect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 	var $name = 'radio';
11 11
 
12
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
12
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
13 13
 
14 14
 	var $_gf_field_class_name = 'GF_Field_Radio';
15 15
 
Please login to merge, or discard this patch.
includes/class-gravityview-settings.php 4 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -301,6 +301,7 @@
 block discarded – undo
301 301
 	 * Make protected public
302 302
 	 * @inheritDoc
303 303
 	 * @access public
304
+	 * @param string $setting_name
304 305
 	 */
305 306
 	public function get_app_setting( $setting_name ) {
306 307
 
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
                     type="' . $field['type'] . '"
419 419
                     name="' . esc_attr( $name ) . '"
420 420
                     value="' . $value . '" ' .
421
-		        implode( ' ', $attributes ) .
422
-		        ' />';
421
+				implode( ' ', $attributes ) .
422
+				' />';
423 423
 
424 424
 		if ( $echo ) {
425 425
 			echo $html;
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 					array(
649 649
 						'label' => _x( 'Permanently Delete', 'Setting: what to do when uninstalling plugin', 'gravityview' ),
650 650
 						'value' => 'delete',
651
-					    'tooltip' => sprintf( '<h6>%s</h6><p><span class="howto">%s</span></p><p>%s</p>', __( 'Delete all GravityView content and settings', 'gravityview' ), __( 'If you delete then re-install GravityView, it will be like installing GravityView for the first time.', 'gravityview' ), __( 'When GravityView is uninstalled and deleted, delete all Views, GravityView entry approvals, GravityView-generated entry notes (including approval and entry creator changes), and GravityView plugin settings. No Gravity Forms data will be touched.', 'gravityview' ) ),
651
+						'tooltip' => sprintf( '<h6>%s</h6><p><span class="howto">%s</span></p><p>%s</p>', __( 'Delete all GravityView content and settings', 'gravityview' ), __( 'If you delete then re-install GravityView, it will be like installing GravityView for the first time.', 'gravityview' ), __( 'When GravityView is uninstalled and deleted, delete all Views, GravityView entry approvals, GravityView-generated entry notes (including approval and entry creator changes), and GravityView plugin settings. No Gravity Forms data will be touched.', 'gravityview' ) ),
652 652
 					),
653 653
 				),
654 654
 				'description'   => sprintf( __( 'Should GravityView content and entry approval status be removed from the site when the GravityView plugin is deleted?', 'gravityview' ), __( 'Permanently Delete', 'gravityview' ) ),
@@ -674,36 +674,36 @@  discard block
 block discarded – undo
674 674
 		}
675 675
 
676 676
 
677
-        $sections = array(
678
-            array(
679
-                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
680
-                'fields'      => $fields,
681
-            )
682
-        );
677
+		$sections = array(
678
+			array(
679
+				'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
680
+				'fields'      => $fields,
681
+			)
682
+		);
683 683
 
684
-        // custom 'update settings' button
685
-        $button = array(
686
-            'class' => 'button button-primary button-hero',
687
-            'type'     => 'save',
688
-        );
684
+		// custom 'update settings' button
685
+		$button = array(
686
+			'class' => 'button button-primary button-hero',
687
+			'type'     => 'save',
688
+		);
689 689
 
690 690
 		if( $disabled_attribute ) {
691 691
 			$button['disabled'] = $disabled_attribute;
692 692
 		}
693 693
 
694 694
 
695
-        /**
696
-         * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page
697
-         * Extensions can tap in here to insert their own section and settings.
698
-         * <code>
699
-         *   $sections[] = array(
700
-         *      'title' => __( 'GravityView My Extension Settings', 'gravityview' ),
701
-         *      'fields' => $settings,
702
-         *   );
703
-         * </code>
704
-         * @param array $extension_settings Empty array, ready for extension settings!
705
-         */
706
-        $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() );
695
+		/**
696
+		 * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page
697
+		 * Extensions can tap in here to insert their own section and settings.
698
+		 * <code>
699
+		 *   $sections[] = array(
700
+		 *      'title' => __( 'GravityView My Extension Settings', 'gravityview' ),
701
+		 *      'fields' => $settings,
702
+		 *   );
703
+		 * </code>
704
+		 * @param array $extension_settings Empty array, ready for extension settings!
705
+		 */
706
+		$extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() );
707 707
 
708 708
 		// If there are extensions, add a section for them
709 709
 		if ( ! empty( $extension_sections ) ) {
@@ -716,13 +716,13 @@  discard block
 block discarded – undo
716 716
 				}
717 717
 			}
718 718
 
719
-            $k = count( $extension_sections ) - 1 ;
720
-            $extension_sections[ $k ]['fields'][] = $button;
719
+			$k = count( $extension_sections ) - 1 ;
720
+			$extension_sections[ $k ]['fields'][] = $button;
721 721
 			$sections = array_merge( $sections, $extension_sections );
722 722
 		} else {
723
-            // add the 'update settings' button to the general section
724
-            $sections[0]['fields'][] = $button;
725
-        }
723
+			// add the 'update settings' button to the general section
724
+			$sections[0]['fields'][] = $button;
725
+		}
726 726
 
727 727
 		return $sections;
728 728
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -441,8 +441,9 @@
 block discarded – undo
441 441
 		$field['name']  = 'gform-settings-save';
442 442
 		$field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton';
443 443
 
444
-		if ( ! rgar( $field, 'value' ) )
445
-			$field['value'] = __( 'Update Settings', 'gravityview' );
444
+		if ( ! rgar( $field, 'value' ) ) {
445
+					$field['value'] = __( 'Update Settings', 'gravityview' );
446
+		}
446 447
 
447 448
 		$output = $this->settings_submit( $field, false );
448 449
 
Please login to merge, or discard this patch.
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if( ! class_exists('GFAddOn') ) {
3
+if ( ! class_exists( 'GFAddOn' ) ) {
4 4
 	return;
5 5
 }
6 6
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function __construct( $prevent_multiple_instances = '' ) {
77 77
 
78
-		if( $prevent_multiple_instances === 'get_instance' ) {
78
+		if ( $prevent_multiple_instances === 'get_instance' ) {
79 79
 			return parent::__construct();
80 80
 		}
81 81
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public static function get_instance() {
89 89
 
90
-		if( empty( self::$instance ) ) {
90
+		if ( empty( self::$instance ) ) {
91 91
 			self::$instance = new self( 'get_instance' );
92 92
 		}
93 93
 
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
 		 * Prevent Gravity Forms from showing the uninstall tab on the settings page
111 111
 		 * @hack
112 112
 		 */
113
-		if( $caps === $this->_capabilities_uninstall ) {
113
+		if ( $caps === $this->_capabilities_uninstall ) {
114 114
 			return false;
115 115
 		}
116 116
 
117
-		if( empty( $caps ) ) {
117
+		if ( empty( $caps ) ) {
118 118
 			$caps = array( 'gravityview_full_access' );
119 119
 		}
120 120
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		add_filter( 'gform_addon_app_settings_menu_gravityview', array( $this, 'modify_app_settings_menu_title' ) );
138 138
 
139 139
 		/** @since 1.7.6 */
140
-		add_action('network_admin_menu', array( $this, 'add_network_menu' ) );
140
+		add_action( 'network_admin_menu', array( $this, 'add_network_menu' ) );
141 141
 
142 142
 		parent::init_admin();
143 143
 	}
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public function modify_app_settings_menu_title( $setting_tabs ) {
153 153
 
154
-		$setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview');
154
+		$setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' );
155 155
 
156 156
 		return $setting_tabs;
157 157
 	}
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	private function _load_license_handler() {
170 170
 
171
-		if( !empty( $this->License_Handler ) ) {
171
+		if ( ! empty( $this->License_Handler ) ) {
172 172
 			return;
173 173
 		}
174 174
 
175
-		require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php');
175
+		require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php' );
176 176
 
177 177
 		$this->License_Handler = GV_License_Handler::get_instance( $this );
178 178
 	}
@@ -184,39 +184,39 @@  discard block
 block discarded – undo
184 184
 	function license_key_notice() {
185 185
 
186 186
 		// Only show on GravityView pages
187
-		if( ! gravityview_is_admin_page() ) {
187
+		if ( ! gravityview_is_admin_page() ) {
188 188
 			return;
189 189
 		}
190 190
 
191
-		$license_status = self::getSetting('license_key_status');
192
-		$license_id = self::getSetting('license_key');
191
+		$license_status = self::getSetting( 'license_key_status' );
192
+		$license_id = self::getSetting( 'license_key' );
193 193
 		$license_id = empty( $license_id ) ? 'license' : $license_id;
194 194
 
195
-		$message = esc_html__('Your GravityView license %s. This means you&rsquo;re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview');
195
+		$message = esc_html__( 'Your GravityView license %s. This means you&rsquo;re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview' );
196 196
 
197 197
 		/**
198 198
 		 * I wanted to remove the period from after the buttons in the string,
199 199
 		 * but didn't want to mess up the translation strings for the translators.
200 200
 		 */
201 201
 		$message = mb_substr( $message, 0, mb_strlen( $message ) - 1 );
202
-		$title = __('Inactive License', 'gravityview');
202
+		$title = __( 'Inactive License', 'gravityview' );
203 203
 		$status = '';
204 204
 		$update_below = false;
205 205
 		$primary_button_link = admin_url( 'edit.php?post_type=gravityview&amp;page=gravityview_settings' );
206 206
 		switch ( $license_status ) {
207 207
 			/** @since 1.17 */
208 208
 			case 'expired':
209
-				$title = __('Expired License', 'gravityview');
209
+				$title = __( 'Expired License', 'gravityview' );
210 210
 				$status = 'expired';
211
-				$message = $this->get_license_handler()->strings( 'expired', self::getSetting('license_key_response') );
211
+				$message = $this->get_license_handler()->strings( 'expired', self::getSetting( 'license_key_response' ) );
212 212
 				break;
213 213
 			case 'invalid':
214
-				$title = __('Invalid License', 'gravityview');
215
-				$status = __('is invalid', 'gravityview');
214
+				$title = __( 'Invalid License', 'gravityview' );
215
+				$status = __( 'is invalid', 'gravityview' );
216 216
 				break;
217 217
 			case 'deactivated':
218
-				$status = __('is inactive', 'gravityview');
219
-				$update_below = __('Activate your license key below.', 'gravityview');
218
+				$status = __( 'is inactive', 'gravityview' );
219
+				$update_below = __( 'Activate your license key below.', 'gravityview' );
220 220
 				break;
221 221
 			/** @noinspection PhpMissingBreakStatementInspection */
222 222
 			case '':
@@ -224,27 +224,27 @@  discard block
 block discarded – undo
224 224
 				// break intentionally left blank
225 225
 			case 'inactive':
226 226
 			case 'site_inactive':
227
-				$status = __('has not been activated', 'gravityview');
228
-				$update_below = __('Activate your license key below.', 'gravityview');
227
+				$status = __( 'has not been activated', 'gravityview' );
228
+				$update_below = __( 'Activate your license key below.', 'gravityview' );
229 229
 				break;
230 230
 		}
231
-		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice';
231
+		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice';
232 232
 
233 233
 		// Show a different notice on settings page for inactive licenses (hide the buttons)
234
-		if( $update_below && gravityview_is_admin_page( '', 'settings' ) ) {
234
+		if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) {
235 235
 			$message = sprintf( $message, $status, '<div class="hidden">', '', '', '</div><a href="#" onclick="jQuery(\'#license_key\').focus(); return false;">' . $update_below . '</a>' );
236 236
 		} else {
237 237
 			$message = sprintf( $message, $status, "\n\n" . '<a href="' . $primary_button_link . '" class="button button-primary">', '</a>', '<a href="' . esc_url( $url ) . '" class="button button-secondary">', '</a>' );
238 238
 		}
239 239
 
240
-		if( !empty( $status ) ) {
240
+		if ( ! empty( $status ) ) {
241 241
 			GravityView_Admin_Notices::add_notice( array(
242 242
 				'message' => $message,
243 243
 				'class'	=> 'updated',
244 244
 				'title' => $title,
245 245
 				'cap' => 'gravityview_edit_settings',
246
-				'dismiss' => sha1( $license_status.'_'.$license_id ),
247
-			));
246
+				'dismiss' => sha1( $license_status . '_' . $license_id ),
247
+			) );
248 248
 		}
249 249
 	}
250 250
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
 		$styles = parent::styles();
258 258
 
259
-		$styles[] = array(
259
+		$styles[ ] = array(
260 260
 			'handle'  => 'gravityview_settings',
261 261
 			'src'     => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ),
262 262
 			'version' => GravityView_Plugin::version,
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 * @return void
280 280
 	 */
281 281
 	public function add_network_menu() {
282
-		if( GravityView_Plugin::is_network_activated() ) {
282
+		if ( GravityView_Plugin::is_network_activated() ) {
283 283
 			add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' );
284 284
 		}
285 285
 	}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 		 * If multisite and not network admin, we don't want the settings to show.
297 297
 		 * @since 1.7.6
298 298
 		 */
299
-		$show_submenu = !is_multisite() ||  is_main_site() || !GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() );
299
+		$show_submenu = ! is_multisite() || is_main_site() || ! GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() );
300 300
 
301 301
 		/**
302 302
 		 * Override whether to show the Settings menu on a per-blog basis.
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 		 */
306 306
 		$show_submenu = apply_filters( 'gravityview/show-settings-menu', $show_submenu );
307 307
 
308
-		if( $show_submenu ) {
308
+		if ( $show_submenu ) {
309 309
 			add_submenu_page( 'edit.php?post_type=gravityview', __( 'Settings', 'gravityview' ), __( 'Settings', 'gravityview' ), $this->_capabilities_app_settings, $this->_slug . '_settings', array( $this, 'app_tab_page' ) );
310 310
 		}
311 311
 	}
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 		/**
337 337
 		 * Backward compatibility with Redux
338 338
 		 */
339
-		if( $setting_name === 'license' ) {
339
+		if ( $setting_name === 'license' ) {
340 340
 			return array(
341 341
 				'license' => parent::get_app_setting( 'license_key' ),
342 342
 				'status' => parent::get_app_setting( 'license_key_status' ),
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 
401 401
 		$return = $text . $activation;
402 402
 
403
-		if( $echo ) {
403
+		if ( $echo ) {
404 404
 			echo $return;
405 405
 		}
406 406
 
@@ -427,15 +427,15 @@  discard block
 block discarded – undo
427 427
 	 */
428 428
 	public function settings_submit( $field, $echo = true ) {
429 429
 
430
-		$field['type']  = ( isset($field['type']) && in_array( $field['type'], array('submit','reset','button') ) ) ? $field['type'] : 'submit';
430
+		$field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit';
431 431
 
432 432
 		$attributes    = $this->get_field_attributes( $field );
433 433
 		$default_value = rgar( $field, 'value' ) ? rgar( $field, 'value' ) : rgar( $field, 'default_value' );
434
-		$value         = $this->get_setting( $field['name'], $default_value );
434
+		$value         = $this->get_setting( $field[ 'name' ], $default_value );
435 435
 
436 436
 
437
-		$attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton';
438
-		$name    = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_'.$field['name'];
437
+		$attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton';
438
+		$name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ];
439 439
 
440 440
 		if ( empty( $value ) ) {
441 441
 			$value = __( 'Update Settings', 'gravityview' );
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 		$attributes = $this->get_field_attributes( $field );
445 445
 
446 446
 		$html = '<input
447
-                    type="' . $field['type'] . '"
447
+                    type="' . $field[ 'type' ] . '"
448 448
                     name="' . esc_attr( $name ) . '"
449 449
                     value="' . $value . '" ' .
450 450
 		        implode( ' ', $attributes ) .
@@ -466,16 +466,16 @@  discard block
 block discarded – undo
466 466
 	 * @return string
467 467
 	 */
468 468
 	public function settings_save( $field, $echo = true ) {
469
-		$field['type']  = 'submit';
470
-		$field['name']  = 'gform-settings-save';
471
-		$field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton';
469
+		$field[ 'type' ]  = 'submit';
470
+		$field[ 'name' ]  = 'gform-settings-save';
471
+		$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton';
472 472
 
473 473
 		if ( ! rgar( $field, 'value' ) )
474
-			$field['value'] = __( 'Update Settings', 'gravityview' );
474
+			$field[ 'value' ] = __( 'Update Settings', 'gravityview' );
475 475
 
476 476
 		$output = $this->settings_submit( $field, false );
477 477
 
478
-		if( $echo ) {
478
+		if ( $echo ) {
479 479
 			echo $output;
480 480
 		}
481 481
 
@@ -492,8 +492,8 @@  discard block
 block discarded – undo
492 492
 		parent::single_setting_label( $field );
493 493
 
494 494
 		// Added by GravityView
495
-		if ( isset( $field['description'] ) ) {
496
-			echo '<span class="description">'. $field['description'] .'</span>';
495
+		if ( isset( $field[ 'description' ] ) ) {
496
+			echo '<span class="description">' . $field[ 'description' ] . '</span>';
497 497
 		}
498 498
 
499 499
 	}
@@ -555,11 +555,11 @@  discard block
 block discarded – undo
555 555
 
556 556
 		// If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response),
557 557
 		// then we assume it's changed. If it's changed, unset the status and the previous response.
558
-		if( $local_key !== $response_key ) {
558
+		if ( $local_key !== $response_key ) {
559 559
 
560
-			unset( $posted_settings['license_key_response'] );
561
-			unset( $posted_settings['license_key_status'] );
562
-			GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
560
+			unset( $posted_settings[ 'license_key_response' ] );
561
+			unset( $posted_settings[ 'license_key_status' ] );
562
+			GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
563 563
 		}
564 564
 
565 565
 		return $posted_settings;
@@ -594,25 +594,25 @@  discard block
 block discarded – undo
594 594
 				'label'             => __( 'License Key', 'gravityview' ),
595 595
 				'description'          => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates &amp; support.', 'gravityview' ),
596 596
 				'type'              => 'edd_license',
597
-				'data-pending-text' => __('Verifying license&hellip;', 'gravityview'),
598
-				'default_value'           => $default_settings['license_key'],
597
+				'data-pending-text' => __( 'Verifying license&hellip;', 'gravityview' ),
598
+				'default_value'           => $default_settings[ 'license_key' ],
599 599
 				'class'             => ( '' == $this->get_app_setting( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key',
600 600
 			),
601 601
 			array(
602 602
 				'name'       => 'license_key_response',
603
-				'default_value'  => $default_settings['license_key_response'],
603
+				'default_value'  => $default_settings[ 'license_key_response' ],
604 604
 				'type'     => 'hidden',
605 605
 			),
606 606
 			array(
607 607
 				'name'       => 'license_key_status',
608
-				'default_value'  => $default_settings['license_key_status'],
608
+				'default_value'  => $default_settings[ 'license_key_status' ],
609 609
 				'type'     => 'hidden',
610 610
 			),
611 611
 			array(
612 612
 				'name'       => 'support-email',
613 613
 				'type'     => 'text',
614 614
 				'validate' => 'email',
615
-				'default_value'  => $default_settings['support-email'],
615
+				'default_value'  => $default_settings[ 'support-email' ],
616 616
 				'label'    => __( 'Support Email', 'gravityview' ),
617 617
 				'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ),
618 618
 				'class'    => 'code regular-text',
@@ -624,44 +624,44 @@  discard block
 block discarded – undo
624 624
 				'name'         => 'support_port',
625 625
 				'type'       => 'radio',
626 626
 				'label'      => __( 'Show Support Port?', 'gravityview' ),
627
-				'default_value'    => $default_settings['support_port'],
627
+				'default_value'    => $default_settings[ 'support_port' ],
628 628
 				'horizontal' => 1,
629 629
 				'choices'    => array(
630 630
 					array(
631
-						'label' => _x('Show', 'Setting: Show or Hide', 'gravityview'),
631
+						'label' => _x( 'Show', 'Setting: Show or Hide', 'gravityview' ),
632 632
 						'value' => '1',
633 633
 					),
634 634
 					array(
635
-						'label' => _x('Hide', 'Setting: Show or Hide', 'gravityview'),
635
+						'label' => _x( 'Hide', 'Setting: Show or Hide', 'gravityview' ),
636 636
 						'value' => '0',
637 637
 					),
638 638
 				),
639
-				'tooltip' => '<p><img src="' . esc_url_raw( plugins_url('assets/images/screenshots/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__('The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview') . '</p>',
639
+				'tooltip' => '<p><img src="' . esc_url_raw( plugins_url( 'assets/images/screenshots/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__( 'The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview' ) . '</p>',
640 640
 				'description'   => __( 'Show the Support Port on GravityView pages?', 'gravityview' ),
641 641
 			),
642 642
 			array(
643 643
 				'name'         => 'no-conflict-mode',
644 644
 				'type'       => 'radio',
645 645
 				'label'      => __( 'No-Conflict Mode', 'gravityview' ),
646
-				'default_value'    => $default_settings['no-conflict-mode'],
646
+				'default_value'    => $default_settings[ 'no-conflict-mode' ],
647 647
 				'horizontal' => 1,
648 648
 				'choices'    => array(
649 649
 					array(
650
-						'label' => _x('On', 'Setting: On or off', 'gravityview'),
650
+						'label' => _x( 'On', 'Setting: On or off', 'gravityview' ),
651 651
 						'value' => '1',
652 652
 					),
653 653
 					array(
654
-						'label' => _x('Off', 'Setting: On or off', 'gravityview'),
654
+						'label' => _x( 'Off', 'Setting: On or off', 'gravityview' ),
655 655
 						'value' => '0',
656 656
 					),
657 657
 				),
658
-				'description'   => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __('If your Edit View tabs are ugly, enable this setting.', 'gravityview'),
658
+				'description'   => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __( 'If your Edit View tabs are ugly, enable this setting.', 'gravityview' ),
659 659
 			),
660 660
 			array(
661 661
 				'name'       => 'delete-on-uninstall',
662 662
 				'type'       => 'radio',
663 663
 				'label'      => __( 'Remove Data on Delete?', 'gravityview' ),
664
-				'default_value'    => $default_settings['delete-on-uninstall'],
664
+				'default_value'    => $default_settings[ 'delete-on-uninstall' ],
665 665
 				'horizontal' => 1,
666 666
 				'choices'    => array(
667 667
 					array(
@@ -687,20 +687,20 @@  discard block
 block discarded – undo
687 687
 		 * @since 1.7.4
688 688
 		 */
689 689
 		foreach ( $fields as &$field ) {
690
-			$field['name']          = isset( $field['name'] ) ? $field['name'] : rgget('id', $field );
691
-			$field['label']         = isset( $field['label'] ) ? $field['label'] : rgget('title', $field );
692
-			$field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : rgget('default', $field );
693
-			$field['description']   = isset( $field['description'] ) ? $field['description'] : rgget('subtitle', $field );
690
+			$field[ 'name' ]          = isset( $field[ 'name' ] ) ? $field[ 'name' ] : rgget( 'id', $field );
691
+			$field[ 'label' ]         = isset( $field[ 'label' ] ) ? $field[ 'label' ] : rgget( 'title', $field );
692
+			$field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : rgget( 'default', $field );
693
+			$field[ 'description' ]   = isset( $field[ 'description' ] ) ? $field[ 'description' ] : rgget( 'subtitle', $field );
694 694
 
695
-			if( $disabled_attribute ) {
696
-				$field['disabled']  = $disabled_attribute;
695
+			if ( $disabled_attribute ) {
696
+				$field[ 'disabled' ] = $disabled_attribute;
697 697
 			}
698 698
 		}
699 699
 
700 700
 
701 701
         $sections = array(
702 702
             array(
703
-                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
703
+                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), GravityView_Plugin::version ) ),
704 704
                 'fields'      => $fields,
705 705
             )
706 706
         );
@@ -711,8 +711,8 @@  discard block
 block discarded – undo
711 711
             'type'     => 'save',
712 712
         );
713 713
 
714
-		if( $disabled_attribute ) {
715
-			$button['disabled'] = $disabled_attribute;
714
+		if ( $disabled_attribute ) {
715
+			$button[ 'disabled' ] = $disabled_attribute;
716 716
 		}
717 717
 
718 718
 
@@ -732,20 +732,20 @@  discard block
 block discarded – undo
732 732
 		// If there are extensions, add a section for them
733 733
 		if ( ! empty( $extension_sections ) ) {
734 734
 
735
-			if( $disabled_attribute ) {
735
+			if ( $disabled_attribute ) {
736 736
 				foreach ( $extension_sections as &$section ) {
737
-					foreach ( $section['fields'] as &$field ) {
738
-						$field['disabled'] = $disabled_attribute;
737
+					foreach ( $section[ 'fields' ] as &$field ) {
738
+						$field[ 'disabled' ] = $disabled_attribute;
739 739
 					}
740 740
 				}
741 741
 			}
742 742
 
743
-            $k = count( $extension_sections ) - 1 ;
744
-            $extension_sections[ $k ]['fields'][] = $button;
743
+            $k = count( $extension_sections ) - 1;
744
+            $extension_sections[ $k ][ 'fields' ][ ] = $button;
745 745
 			$sections = array_merge( $sections, $extension_sections );
746 746
 		} else {
747 747
             // add the 'update settings' button to the general section
748
-            $sections[0]['fields'][] = $button;
748
+            $sections[ 0 ][ 'fields' ][ ] = $button;
749 749
         }
750 750
 
751 751
 		return $sections;
Please login to merge, or discard this patch.
includes/fields/class-gravityview-fields.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	/**
78 78
 	 * Alias for get_instance()
79 79
 	 *
80
-	 * @param $field_name
80
+	 * @param string $field_name
81 81
 	 *
82 82
 	 * @return GravityView_Field|false
83 83
 	 */
@@ -88,7 +88,6 @@  discard block
 block discarded – undo
88 88
 	/**
89 89
 	 * Alias for get_instance()
90 90
 	 *
91
-	 * @param string|GF_Field $field_name Gravity Forms field class or the class name type
92 91
 	 *
93 92
 	 * @return GravityView_Field
94 93
 	 */
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @return GravityView_Field | bool
43 43
 	 */
44 44
 	public static function create( $properties ) {
45
-		$type = isset( $properties['type'] ) ? $properties['type'] : '';
46
-		$type = empty( $properties['inputType'] ) ? $type : $properties['inputType'];
45
+		$type = isset( $properties[ 'type' ] ) ? $properties[ 'type' ] : '';
46
+		$type = empty( $properties[ 'inputType' ] ) ? $type : $properties[ 'inputType' ];
47 47
 		if ( empty( $type ) || ! isset( self::$_fields[ $type ] ) ) {
48 48
 			return new GravityView_Field( $properties );
49 49
 		}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 * @return bool True: yes, it exists; False: nope
63 63
 	 */
64 64
 	public static function exists( $field_name ) {
65
-		return isset( self::$_fields["{$field_name}"] );
65
+		return isset( self::$_fields[ "{$field_name}" ] );
66 66
 	}
67 67
 
68 68
 	/**
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
 
97 97
 		$field_type = is_a( $gf_field, 'GF_Field' ) ? get_class( $gf_field ) : $gf_field;
98 98
 
99
-		foreach( self::$_fields as $field ) {
100
-			if( $field_type === $field->_gf_field_class_name ) {
99
+		foreach ( self::$_fields as $field ) {
100
+			if ( $field_type === $field->_gf_field_class_name ) {
101 101
 				return $field;
102 102
 			}
103 103
 		}
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	public static function get_all( $group = '' ) {
118 118
 
119
-		if( '' !== $group ) {
119
+		if ( '' !== $group ) {
120 120
 			$return_fields = self::$_fields;
121 121
 			foreach ( $return_fields as $key => $field ) {
122
-				if( $group !== $field->group ) {
122
+				if ( $group !== $field->group ) {
123 123
 					unset( $return_fields[ $key ] );
124 124
 				}
125 125
 			}
Please login to merge, or discard this patch.