Completed
Pull Request — master (#991)
by Zack
12:50 queued 09:33
created
includes/admin/metaboxes/views/select-template.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,27 +22,27 @@
 block discarded – undo
22 22
 
23 23
 <?php // list all the available templates (type= fresh or custom ) ?>
24 24
 <div class="gv-grid">
25
-	<?php foreach( $templates as $id => $template ) {
25
+	<?php foreach ( $templates as $id => $template ) {
26 26
 		$selected = ( $id == $current_template ) ? ' gv-selected' : ''; ?>
27 27
 
28 28
 		<div class="gv-grid-col-1-3">
29
-			<div class="gv-view-types-module<?php echo $selected; ?>" data-filter="<?php echo esc_attr( $template['type'] ); ?>">
29
+			<div class="gv-view-types-module<?php echo $selected; ?>" data-filter="<?php echo esc_attr( $template[ 'type' ] ); ?>">
30 30
 				<div class="gv-view-types-hover">
31 31
 					<div>
32
-						<?php if( !empty( $template['buy_source'] ) ) { ?>
33
-							<p><a href="<?php echo esc_url( $template['buy_source'] ); ?>" class="button-primary button-buy-now"><?php esc_html_e( 'Buy Now', 'gravityview'); ?></a></p>
32
+						<?php if ( ! empty( $template[ 'buy_source' ] ) ) { ?>
33
+							<p><a href="<?php echo esc_url( $template[ 'buy_source' ] ); ?>" class="button-primary button-buy-now"><?php esc_html_e( 'Buy Now', 'gravityview' ); ?></a></p>
34 34
 						<?php } else { ?>
35
-							<p><a href="#gv_select_template" class="button button-large button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview'); ?></a></p>
36
-							<?php if( !empty( $template['preview'] ) ) { ?>
37
-								<a href="<?php echo esc_url( $template['preview'] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview'); ?>"></i></a>
35
+							<p><a href="#gv_select_template" class="button button-large button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview' ); ?></a></p>
36
+							<?php if ( ! empty( $template[ 'preview' ] ) ) { ?>
37
+								<a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview' ); ?>"></i></a>
38 38
 							<?php } ?>
39 39
 						<?php } ?>
40 40
 					</div>
41 41
 				</div>
42 42
 				<div class="gv-view-types-normal">
43
-					<img src="<?php echo esc_url( $template['logo'] ); ?>" alt="<?php echo esc_attr( $template['label'] ); ?>">
44
-					<h5><?php echo esc_attr( $template['label'] ); ?></h5>
45
-					<p class="description"><?php echo esc_attr( $template['description'] ); ?></p>
43
+					<img src="<?php echo esc_url( $template[ 'logo' ] ); ?>" alt="<?php echo esc_attr( $template[ 'label' ] ); ?>">
44
+					<h5><?php echo esc_attr( $template[ 'label' ] ); ?></h5>
45
+					<p class="description"><?php echo esc_attr( $template[ 'description' ] ); ?></p>
46 46
 				</div>
47 47
 			</div>
48 48
 		</div>
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/sort-filter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 	 */
27 27
 	GravityView_Render_Settings::render_setting_row( 'sort_columns', $current_settings );
28 28
 
29
-	$sort_fields_input = '<select name="template_settings[sort_field]" id="gravityview_sort_field">'.gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'] ).'</select>';
29
+	$sort_fields_input = '<select name="template_settings[sort_field]" id="gravityview_sort_field">' . gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ] ) . '</select>';
30 30
 
31 31
 	GravityView_Render_Settings::render_setting_row( 'sort_field', $current_settings, $sort_fields_input );
32 32
 
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/gravityview-navigation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
15 15
 	<?php
16 16
 
17
-	foreach( $metaboxes as $metabox ) {
18
-		$class = !isset( $class ) ? 'nav-tab-active' : '';
17
+	foreach ( $metaboxes as $metabox ) {
18
+		$class = ! isset( $class ) ? 'nav-tab-active' : '';
19 19
 	?>
20 20
 	<li class="ui-state-default">
21 21
 		<a class="nav-tab ui-tabs-anchor <?php echo $class; ?>" href="#<?php echo esc_attr( $metabox->id ); ?>">
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/gravityview-content.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
 	 * Loop through the array of registered metaboxes
20 20
 	 * @var GravityView_Metabox_Tab $metabox
21 21
 	 */
22
-	foreach( $metaboxes as $metabox ) {
22
+	foreach ( $metaboxes as $metabox ) {
23 23
 
24
-		echo '<div id="'.esc_attr( $metabox->id ).'">';
24
+		echo '<div id="' . esc_attr( $metabox->id ) . '">';
25 25
 
26 26
 		$metabox->render( $post );
27 27
 
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/view-configuration.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -10,33 +10,33 @@  discard block
 block discarded – undo
10 10
 
11 11
 		<div id="directory-fields" class="gv-section">
12 12
 
13
-			<h4><?php esc_html_e( 'Above Entries Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview'); ?></span></h4>
13
+			<h4><?php esc_html_e( 'Above Entries Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview' ); ?></span></h4>
14 14
 
15
-			<?php do_action('gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?>
15
+			<?php do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?>
16 16
 
17
-			<h4><?php esc_html_e( 'Entries Fields', 'gravityview'); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview'); ?></span></h4>
17
+			<h4><?php esc_html_e( 'Entries Fields', 'gravityview' ); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview' ); ?></span></h4>
18 18
 
19 19
 			<div id="directory-active-fields" class="gv-grid gv-grid-pad gv-grid-border">
20
-				<?php if(!empty( $curr_template ) ) {
21
-					do_action('gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true );
20
+				<?php if ( ! empty( $curr_template ) ) {
21
+					do_action( 'gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true );
22 22
 				} ?>
23 23
 			</div>
24 24
 
25
-			<h4><?php esc_html_e( 'Below Entries Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown below entries.', 'gravityview'); ?></span></h4>
25
+			<h4><?php esc_html_e( 'Below Entries Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown below entries.', 'gravityview' ); ?></span></h4>
26 26
 
27
-			<?php do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); ?>
27
+			<?php do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); ?>
28 28
 
29 29
 
30 30
 			<?php // list of available fields to be shown in the popup ?>
31 31
 			<div id="directory-available-fields" class="hide-if-js gv-tooltip">
32 32
 				<span class="close"><i class="dashicons dashicons-dismiss"></i></span>
33
-				<?php do_action('gravityview_render_available_fields', $curr_form, 'directory' ); ?>
33
+				<?php do_action( 'gravityview_render_available_fields', $curr_form, 'directory' ); ?>
34 34
 			</div>
35 35
 
36 36
 			<?php // list of available widgets to be shown in the popup ?>
37 37
 			<div id="directory-available-widgets" class="hide-if-js gv-tooltip">
38 38
 				<span class="close"><i class="dashicons dashicons-dismiss"></i></span>
39
-				<?php do_action('gravityview_render_available_widgets' ); ?>
39
+				<?php do_action( 'gravityview_render_available_widgets' ); ?>
40 40
 			</div>
41 41
 
42 42
 		</div>
@@ -52,17 +52,17 @@  discard block
 block discarded – undo
52 52
 
53 53
 		<div id="single-fields" class="gv-section">
54 54
 
55
-			<h4><?php esc_html_e( 'These fields will be shown in Single Entry view.', 'gravityview'); ?></h4>
55
+			<h4><?php esc_html_e( 'These fields will be shown in Single Entry view.', 'gravityview' ); ?></h4>
56 56
 
57 57
 			<div id="single-active-fields" class="gv-grid gv-grid-pad gv-grid-border">
58
-				<?php if(!empty( $curr_template ) ) {
59
-					do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true );
58
+				<?php if ( ! empty( $curr_template ) ) {
59
+					do_action( 'gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true );
60 60
 				} ?>
61 61
 			</div>
62 62
 
63 63
 			<div id="single-available-fields" class="hide-if-js gv-tooltip">
64 64
 				<span class="close"><i class="dashicons dashicons-dismiss"></i></span>
65
-				<?php do_action('gravityview_render_available_fields', $curr_form, 'single' ); ?>
65
+				<?php do_action( 'gravityview_render_available_fields', $curr_form, 'single' ); ?>
66 66
 			</div>
67 67
 
68 68
 		</div>
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 
74 74
 		<div id="edit-fields" class="gv-section">
75 75
 
76
-			<h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview'); ?> <span><?php esc_html_e('If not configured, all form fields will be displayed.', 'gravityview'); ?></span></h4>
76
+			<h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview' ); ?> <span><?php esc_html_e( 'If not configured, all form fields will be displayed.', 'gravityview' ); ?></span></h4>
77 77
 
78 78
 			<div id="edit-active-fields" class="gv-grid gv-grid-pad gv-grid-border">
79 79
 				<?php
80
-				do_action('gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true );
80
+				do_action( 'gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true );
81 81
 				?>
82 82
 			</div>
83 83
 
84 84
 			<div id="edit-available-fields" class="hide-if-js gv-tooltip">
85 85
 				<span class="close"><i class="dashicons dashicons-dismiss"></i></span>
86
-				<?php do_action('gravityview_render_available_fields', $curr_form, 'edit' ); ?>
86
+				<?php do_action( 'gravityview_render_available_fields', $curr_form, 'edit' ); ?>
87 87
 			</div>
88 88
 
89 89
 		</div>
Please login to merge, or discard this patch.
includes/admin/metaboxes/class-gravityview-metabox-tab.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -97,9 +97,9 @@  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
-		$this->id = $this->prefix.$id;
102
+		$this->id = $this->prefix . $id;
103 103
 		$this->title = $title;
104 104
 		$this->render_template_file = $file;
105 105
 		$this->callback = $callback;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	function parse_icon_class_name( $icon_class_name = '' ) {
120 120
 
121
-		if( preg_match( '/dashicon/i', $icon_class_name ) ) {
121
+		if ( preg_match( '/dashicon/i', $icon_class_name ) ) {
122 122
 			$icon_class_name = 'dashicons ' . $icon_class_name;
123 123
 		}
124 124
 
@@ -142,29 +142,29 @@  discard block
 block discarded – undo
142 142
 	 */
143 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 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 170
 				do_action( 'gravityview_log_error', 'Metabox callback was not callable', $this );
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
 	 * @param string $icon_class_name Icon class used in vertical tabs. Supports non-dashicon. If dashicons, no need for `dashicons ` prefix
96 96
 	 * @param string $callback Function to render the metabox, if $file is not defined.
97 97
 	 * @param array $callback_args Arguments passed to the callback
98
-	 * @return void
98
+	 * @return GravityView_Metabox_Tab
99 99
 	 */
100 100
 	function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = array()  ) {
101 101
 
Please login to merge, or discard this patch.
includes/admin/field-types/type_checkbox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 	function render_setting( $override_input = NULL ) {
17 17
 
18
-		if( $this->get_field_left_label() ) { ?>
18
+		if ( $this->get_field_left_label() ) { ?>
19 19
 
20 20
 			<td scope="row">
21 21
 				<label for="<?php echo $this->get_field_id(); ?>">
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	function render_input( $override_input = NULL ) {
45
-		if( isset( $override_input ) ) {
45
+		if ( isset( $override_input ) ) {
46 46
 			echo $override_input;
47 47
 			return;
48 48
 		}
Please login to merge, or discard this patch.
includes/admin/field-types/type_select.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 		?>
9 9
 		<label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php
10 10
 
11
-			echo '<span class="gv-label">'.$this->get_field_label().'</span>';
11
+			echo '<span class="gv-label">' . $this->get_field_label() . '</span>';
12 12
 
13 13
 			echo $this->get_tooltip() . $this->get_field_desc();
14 14
 
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 	}
21 21
 
22 22
 	function render_input( $override_input = null ) {
23
-		if( isset( $override_input ) ) {
23
+		if ( isset( $override_input ) ) {
24 24
 			echo $override_input;
25 25
 			return;
26 26
 		}
27 27
 		?>
28 28
 		<select name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>">
29
-			<?php foreach( $this->field['options'] as $value => $label ) : ?>
29
+			<?php foreach ( $this->field[ 'options' ] as $value => $label ) : ?>
30 30
 				<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->value, true ); ?>><?php echo esc_html( $label ); ?></option>
31 31
 			<?php endforeach; ?>
32 32
 		</select>
Please login to merge, or discard this patch.
includes/admin/entry-list.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 		add_action( 'gform_entries_first_column_actions', array( $this, 'add_edit_link' ), 10, 5 );
12 12
 
13 13
 		// Add script to enable edit link
14
-		add_action( 'admin_head-forms_page_gf_entries', array( $this, 'add_edit_script') );
14
+		add_action( 'admin_head-forms_page_gf_entries', array( $this, 'add_edit_script' ) );
15 15
 
16 16
 	}
17 17
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	public function add_edit_script() {
27 27
 
28 28
 		// We're on a single entry page, or at least not the Entries page.
29
-		if( !empty( $_GET['view'] ) && $_GET['view'] !== 'entries' ) { return; }
29
+		if ( ! empty( $_GET[ 'view' ] ) && $_GET[ 'view' ] !== 'entries' ) { return; }
30 30
 	?>
31 31
 		<script>
32 32
 		jQuery( document ).ready( function( $ ) {
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
 			'page' => 'gf_entries',
57 57
 			'view' => 'entry',
58 58
 			'id'	=> (int)$form_id,
59
-			'lid'	=>	(int)$lead["id"],
59
+			'lid'	=>	(int)$lead[ "id" ],
60 60
 			'screen_mode'	=> 'edit',
61 61
 		);
62 62
 		?>
63 63
 
64 64
 		<span class="edit edit_entry">
65 65
 			|
66
-		    <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview'); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page='.$query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a>
66
+		    <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview' ); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page=' . $query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a>
67 67
 		</span>
68 68
 		<?php
69 69
 	}
Please login to merge, or discard this patch.