Completed
Pull Request — master (#605)
by Zack
05:22
created
includes/admin/entry-list.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 	function __construct() {
9 9
 
10 10
 		// Add Edit link to the entry actions
11
-		add_action( 'gform_entries_first_column_actions', array( $this, 'add_edit_link' ), 10, 5 );
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( $ ) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * @param array  $lead         The current entry data
51 51
 	 * @param string $query_string URL query string for a link to the current entry. Missing the `?page=` part, which is strange. Example: `gf_entries&view=entry&id=35&lid=5212&filter=&paged=1`
52 52
 	 */
53
-	function add_edit_link( $form_id = NULL, $field_id = NULL, $value = NULL, $lead = array(), $query_string = NULL ) {
53
+	function add_edit_link($form_id = NULL, $field_id = NULL, $value = NULL, $lead = array(), $query_string = NULL) {
54 54
 
55 55
 		$params = array(
56 56
 			'page' => 'gf_entries',
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
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.
includes/admin/field-types/type_checkbox.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,24 +8,24 @@  discard block
 block discarded – undo
8 8
 		?>
9 9
 		<label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>">
10 10
 			<?php $this->render_input(); ?>
11
-			&nbsp;<?php echo $this->get_field_label() . $this->get_tooltip() . $this->get_field_desc(); ?>
11
+			&nbsp;<?php echo $this->get_field_label().$this->get_tooltip().$this->get_field_desc(); ?>
12 12
 		</label>
13 13
 		<?php
14 14
 	}
15 15
 
16
-	function render_setting( $override_input = NULL ) {
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(); ?>">
22
-					<?php echo $this->get_field_left_label() . $this->get_tooltip(); ?>
22
+					<?php echo $this->get_field_left_label().$this->get_tooltip(); ?>
23 23
 				</label>
24 24
 			</td>
25 25
 			<td>
26 26
 				<label>
27
-				<?php $this->render_input( $override_input ); ?>
28
-				&nbsp;<?php echo $this->get_field_label() . $this->get_tooltip() . $this->get_field_desc(); ?>
27
+				<?php $this->render_input($override_input); ?>
28
+				&nbsp;<?php echo $this->get_field_label().$this->get_tooltip().$this->get_field_desc(); ?>
29 29
 				</label>
30 30
 			</td>
31 31
 
@@ -33,23 +33,23 @@  discard block
 block discarded – undo
33 33
 
34 34
 			<td scope="row" colspan="2">
35 35
 				<label for="<?php echo $this->get_field_id(); ?>">
36
-					<?php $this->render_input( $override_input ); ?>
37
-					&nbsp;<?php echo $this->get_field_label() . $this->get_tooltip() . $this->get_field_desc(); ?>
36
+					<?php $this->render_input($override_input); ?>
37
+					&nbsp;<?php echo $this->get_field_label().$this->get_tooltip().$this->get_field_desc(); ?>
38 38
 				</label>
39 39
 			</td>
40 40
 
41 41
 		<?php }
42 42
 	}
43 43
 
44
-	function render_input( $override_input = NULL ) {
45
-		if( isset( $override_input ) ) {
44
+	function render_input($override_input = NULL) {
45
+		if (isset($override_input)) {
46 46
 			echo $override_input;
47 47
 			return;
48 48
 		}
49 49
 
50 50
 		?>
51
-		<input name="<?php echo esc_attr( $this->name ); ?>" type="hidden" value="0" />
52
-       	<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="checkbox" value="1" <?php checked( $this->value, '1', true ); ?> />
51
+		<input name="<?php echo esc_attr($this->name); ?>" type="hidden" value="0" />
52
+       	<input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" type="checkbox" value="1" <?php checked($this->value, '1', true); ?> />
53 53
        	<?php
54 54
 	}
55 55
 
Please login to merge, or discard this patch.
includes/admin/field-types/type_hidden.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 			return;
16 16
 		}
17 17
 
18
-        $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
18
+		$class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
19 19
 
20 20
 		?>
21 21
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" />
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,17 +8,17 @@
 block discarded – undo
8 8
 		$this->render_input();
9 9
 	}
10 10
 
11
-	function render_input( $override_input = null ) {
11
+	function render_input($override_input = null) {
12 12
 
13
-		if( isset( $override_input ) ) {
13
+		if (isset($override_input)) {
14 14
 			echo $override_input;
15 15
 			return;
16 16
 		}
17 17
 
18
-        $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
18
+        $class = !empty($this->field['class']) ? $this->field['class'] : 'widefat';
19 19
 
20 20
 		?>
21
-		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" />
21
+		<input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr($this->value); ?>" class="<?php echo esc_attr($class); ?>" />
22 22
 		<?php
23 23
 	}
24 24
 
Please login to merge, or discard this patch.
includes/admin/field-types/type_number.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
  * number input type
4 4
  */
5 5
 
6
-if( !class_exists('GravityView_FieldType_text') ) {
7
-	include_once( GRAVITYVIEW_DIR . 'includes/admin/field-types/type_text.php' );
6
+if (!class_exists('GravityView_FieldType_text')) {
7
+	include_once(GRAVITYVIEW_DIR.'includes/admin/field-types/type_text.php');
8 8
 }
9 9
 class GravityView_FieldType_number extends GravityView_FieldType_text {
10 10
 
11
-	function render_input( $override_input = null ) {
12
-		if( isset( $override_input ) ) {
11
+	function render_input($override_input = null) {
12
+		if (isset($override_input)) {
13 13
 			echo $override_input;
14 14
 			return;
15 15
 		}
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
 
19 19
 		$show_mt = $this->show_merge_tags();
20 20
 
21
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
21
+        if ($show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force') {
22 22
             $class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
23 23
         }
24
-        $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
24
+        $class .= !empty($this->field['class']) ? $this->field['class'] : 'widefat';
25 25
 
26 26
 		?>
27
-		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="number" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>">
27
+		<input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" type="number" value="<?php echo esc_attr($this->value); ?>" class="<?php echo esc_attr($class); ?>">
28 28
 		<?php
29 29
 	}
30 30
 
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
-            $class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
33
-        }
34
-        $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
31
+		if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
+			$class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
33
+		}
34
+		$class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
35 35
 
36 36
 		?>
37 37
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>">
Please login to merge, or discard this patch.
includes/admin/field-types/type_radio.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,15 +18,15 @@
 block discarded – undo
18 18
 
19 19
 	}
20 20
 
21
-	function render_input( $override_input = null ) {
22
-		if( isset( $override_input ) ) {
21
+	function render_input($override_input = null) {
22
+		if (isset($override_input)) {
23 23
 			echo $override_input;
24 24
 			return;
25 25
 		}
26 26
 
27
-		foreach( $this->field['options'] as $value => $label ) : ?>
27
+		foreach ($this->field['options'] as $value => $label) : ?>
28 28
 		<label class="<?php echo $this->get_label_class(); ?>">
29
-			<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr( $value ); ?>" type="radio" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value, $this->value, true ); ?> />&nbsp;<?php echo esc_html( $label ); ?>
29
+			<input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr($value); ?>" type="radio" value="<?php echo esc_attr($value); ?>" <?php checked($value, $this->value, true); ?> />&nbsp;<?php echo esc_html($label); ?>
30 30
 		</label>
31 31
 <?php
32 32
 		endforeach;
Please login to merge, or discard this patch.
includes/admin/field-types/type_select.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 			echo '<span class="gv-label">'.$this->get_field_label().'</span>';
12 12
 
13
-			echo $this->get_tooltip() . $this->get_field_desc();
13
+			echo $this->get_tooltip().$this->get_field_desc();
14 14
 
15 15
 			$this->render_input();
16 16
 
@@ -19,15 +19,15 @@  discard block
 block discarded – undo
19 19
 		<?php
20 20
 	}
21 21
 
22
-	function render_input( $override_input = null ) {
23
-		if( isset( $override_input ) ) {
22
+	function render_input($override_input = null) {
23
+		if (isset($override_input)) {
24 24
 			echo $override_input;
25 25
 			return;
26 26
 		}
27 27
 		?>
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 ) : ?>
30
-				<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->value, true ); ?>><?php echo esc_html( $label ); ?></option>
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) : ?>
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>
33 33
 		<?php
Please login to merge, or discard this patch.
includes/admin/field-types/type_text.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
-            $class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
33
-        }
34
-        $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
31
+		if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
+			$class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
33
+		}
34
+		$class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
35 35
 
36 36
 		?>
37 37
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>">
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 		<label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php
10 10
 
11 11
 			echo '<span class="gv-label">'.$this->get_field_label().'</span>';
12
-			echo $this->get_tooltip() . $this->get_field_desc();
12
+			echo $this->get_tooltip().$this->get_field_desc();
13 13
 		?><div>
14 14
 				<?php $this->render_input(); ?>
15 15
 			</div>
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 		<?php
18 18
 	}
19 19
 
20
-	function render_input( $override_input = null ) {
20
+	function render_input($override_input = null) {
21 21
 
22
-		if( isset( $override_input ) ) {
22
+		if (isset($override_input)) {
23 23
 			echo $override_input;
24 24
 			return;
25 25
 		}
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
31
+        if ($show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force') {
32 32
             $class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
33 33
         }
34
-        $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
34
+        $class .= !empty($this->field['class']) ? $this->field['class'] : 'widefat';
35 35
 
36 36
 		?>
37
-		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>">
37
+		<input name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr($this->value); ?>" class="<?php echo esc_attr($class); ?>">
38 38
 		<?php
39 39
 	}
40 40
 
Please login to merge, or discard this patch.
includes/admin/field-types/type_textarea.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
-            $class = ' merge-tag-support mt-position-right ';
33
-
34
-            if( empty( $this->field['show_all_fields'] ) ) {
35
-            	$class .= ' mt-hide_all_fields';
36
-            }
37
-        }
38
-        $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat';
31
+		if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
+			$class = ' merge-tag-support mt-position-right ';
33
+
34
+			if( empty( $this->field['show_all_fields'] ) ) {
35
+				$class .= ' mt-hide_all_fields';
36
+			}
37
+		}
38
+		$class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat';
39 39
 
40 40
 		?>
41 41
 		<textarea name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr( $class ); ?>" rows="5"><?php echo esc_textarea(  $this->value ); ?></textarea>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 		<label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php
11 11
 
12 12
 			echo '<span class="gv-label">'.$this->get_field_label().'</span>';
13
-			echo $this->get_tooltip() . $this->get_field_desc();
13
+			echo $this->get_tooltip().$this->get_field_desc();
14 14
 		?><div>
15 15
 				<?php $this->render_input(); ?>
16 16
 			</div>
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 		<?php
19 19
 	}
20 20
 
21
-	function render_input( $override_input = null ) {
22
-		if( isset( $override_input ) ) {
21
+	function render_input($override_input = null) {
22
+		if (isset($override_input)) {
23 23
 			echo $override_input;
24 24
 			return;
25 25
 		}
@@ -28,17 +28,17 @@  discard block
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
31
+        if ($show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force') {
32 32
             $class = ' merge-tag-support mt-position-right ';
33 33
 
34
-            if( empty( $this->field['show_all_fields'] ) ) {
34
+            if (empty($this->field['show_all_fields'])) {
35 35
             	$class .= ' mt-hide_all_fields';
36 36
             }
37 37
         }
38
-        $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat';
38
+        $class .= !empty($this->field['class']) ? 'widefat '.$this->field['class'] : 'widefat';
39 39
 
40 40
 		?>
41
-		<textarea name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr( $class ); ?>" rows="5"><?php echo esc_textarea(  $this->value ); ?></textarea>
41
+		<textarea name="<?php echo esc_attr($this->name); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr($class); ?>" rows="5"><?php echo esc_textarea($this->value); ?></textarea>
42 42
        	<?php
43 43
 	}
44 44
 
Please login to merge, or discard this patch.
includes/admin/metaboxes/class-gravityview-admin-metaboxes.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 		if( !GravityView_Compatibility::is_valid() ) { return; }
16 16
 
17
-        self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/';
17
+		self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/';
18 18
 
19 19
 		include_once self::$metaboxes_dir . 'class-gravityview-metabox-tab.php';
20 20
 
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
 		$get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL;
229 229
 
230 230
 		if( isset( $form['id'] ) ) {
231
-		    $form_script = 'var form = ' . GFCommon::json_encode($form) . ';';
231
+			$form_script = 'var form = ' . GFCommon::json_encode($form) . ';';
232 232
 
233
-		    // The `gf_vars()` method needs a $_GET[id] variable set with the form ID.
234
-		    $_GET['id'] = $form['id'];
233
+			// The `gf_vars()` method needs a $_GET[id] variable set with the form ID.
234
+			$_GET['id'] = $form['id'];
235 235
 
236 236
 		} else {
237
-		    $form_script = 'var form = new Form();';
237
+			$form_script = 'var form = new Form();';
238 238
 		}
239 239
 
240 240
 		$output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>';
Please login to merge, or discard this patch.
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	function __construct() {
19 19
 
20
-		if( !GravityView_Compatibility::is_valid() ) { return; }
20
+		if (!GravityView_Compatibility::is_valid()) { return; }
21 21
 
22
-        self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/';
22
+        self::$metaboxes_dir = GRAVITYVIEW_DIR.'includes/admin/metaboxes/';
23 23
 
24
-		include_once self::$metaboxes_dir . 'class-gravityview-metabox-tab.php';
24
+		include_once self::$metaboxes_dir.'class-gravityview-metabox-tab.php';
25 25
 
26
-		include_once self::$metaboxes_dir . 'class-gravityview-metabox-tabs.php';
26
+		include_once self::$metaboxes_dir.'class-gravityview-metabox-tabs.php';
27 27
 
28 28
 		$this->initialize();
29 29
 
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	function initialize() {
37 37
 
38
-		add_action( 'add_meta_boxes', array( $this, 'register_metaboxes' ));
38
+		add_action('add_meta_boxes', array($this, 'register_metaboxes'));
39 39
 
40
-		add_action( 'add_meta_boxes_gravityview' , array( $this, 'update_priority' ) );
40
+		add_action('add_meta_boxes_gravityview', array($this, 'update_priority'));
41 41
 
42 42
 		// information box
43
-		add_action( 'post_submitbox_misc_actions', array( $this, 'render_shortcode_hint' ) );
43
+		add_action('post_submitbox_misc_actions', array($this, 'render_shortcode_hint'));
44 44
 
45 45
 	}
46 46
 
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 	function update_priority() {
52 52
 		global $wp_meta_boxes;
53 53
 
54
-		if( ! empty( $wp_meta_boxes['gravityview'] ) ) {
55
-			foreach( array( 'high', 'core', 'low' ) as $position ) {
56
-				if( isset( $wp_meta_boxes['gravityview']['normal'][ $position ] ) ) {
57
-					foreach( $wp_meta_boxes['gravityview']['normal'][ $position ] as $key => $meta_box ) {
58
-						if( ! preg_match( '/^gravityview_/ism', $key ) ) {
59
-							$wp_meta_boxes['gravityview']['advanced'][ $position ][ $key ] = $meta_box;
60
-							unset( $wp_meta_boxes['gravityview']['normal'][ $position ][ $key ] );
54
+		if (!empty($wp_meta_boxes['gravityview'])) {
55
+			foreach (array('high', 'core', 'low') as $position) {
56
+				if (isset($wp_meta_boxes['gravityview']['normal'][$position])) {
57
+					foreach ($wp_meta_boxes['gravityview']['normal'][$position] as $key => $meta_box) {
58
+						if (!preg_match('/^gravityview_/ism', $key)) {
59
+							$wp_meta_boxes['gravityview']['advanced'][$position][$key] = $meta_box;
60
+							unset($wp_meta_boxes['gravityview']['normal'][$position][$key]);
61 61
 						}
62 62
 					}
63 63
 				}
@@ -69,23 +69,23 @@  discard block
 block discarded – undo
69 69
 		global $post;
70 70
 
71 71
 		// On Comment Edit, for example, $post isn't set.
72
-		if( empty( $post ) || !is_object( $post ) || !isset( $post->ID ) ) {
72
+		if (empty($post) || !is_object($post) || !isset($post->ID)) {
73 73
 			return;
74 74
 		}
75 75
 
76 76
 		// select data source for this view
77
-		add_meta_box( 'gravityview_select_form', $this->get_data_source_header( $post->ID ), array( $this, 'render_data_source_metabox' ), 'gravityview', 'normal', 'high' );
77
+		add_meta_box('gravityview_select_form', $this->get_data_source_header($post->ID), array($this, 'render_data_source_metabox'), 'gravityview', 'normal', 'high');
78 78
 
79 79
 		// select view type/template
80
-		add_meta_box( 'gravityview_select_template', __( 'Choose a View Type', 'gravityview' ), array( $this, 'render_select_template_metabox' ), 'gravityview', 'normal', 'high' );
80
+		add_meta_box('gravityview_select_template', __('Choose a View Type', 'gravityview'), array($this, 'render_select_template_metabox'), 'gravityview', 'normal', 'high');
81 81
 
82 82
 		// View Configuration box
83
-		add_meta_box( 'gravityview_view_config', __( 'View Configuration', 'gravityview' ), array( $this, 'render_view_configuration_metabox' ), 'gravityview', 'normal', 'high' );
83
+		add_meta_box('gravityview_view_config', __('View Configuration', 'gravityview'), array($this, 'render_view_configuration_metabox'), 'gravityview', 'normal', 'high');
84 84
 
85 85
 		$this->add_settings_metabox_tabs();
86 86
 
87 87
 		// Other Settings box
88
-		add_meta_box( 'gravityview_settings', __( 'View Settings', 'gravityview' ), array( $this, 'settings_metabox_render' ), 'gravityview', 'normal', 'core' );
88
+		add_meta_box('gravityview_settings', __('View Settings', 'gravityview'), array($this, 'settings_metabox_render'), 'gravityview', 'normal', 'core');
89 89
 
90 90
 	}
91 91
 
@@ -94,22 +94,22 @@  discard block
 block discarded – undo
94 94
 	 * @since 1.8
95 95
 	 * @param WP_Post $post
96 96
 	 */
97
-	function settings_metabox_render( $post ) {
97
+	function settings_metabox_render($post) {
98 98
 
99 99
 		/**
100 100
 		 * @param WP_Post $post
101 101
 		 */
102
-		do_action( 'gravityview/metaboxes/before_render', $post );
102
+		do_action('gravityview/metaboxes/before_render', $post);
103 103
 
104 104
 		$metaboxes = GravityView_Metabox_Tabs::get_all();
105 105
 
106
-		include self::$metaboxes_dir . 'views/gravityview-navigation.php';
107
-		include self::$metaboxes_dir . 'views/gravityview-content.php';
106
+		include self::$metaboxes_dir.'views/gravityview-navigation.php';
107
+		include self::$metaboxes_dir.'views/gravityview-content.php';
108 108
 
109 109
 		/**
110 110
 		 * @param WP_Post $post
111 111
 		 */
112
-		do_action( 'gravityview/metaboxes/after_render', $post );
112
+		do_action('gravityview/metaboxes/after_render', $post);
113 113
 	}
114 114
 
115 115
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		$metaboxes = array(
122 122
 			array(
123 123
 				'id' => 'template_settings',
124
-				'title' => __( 'View Settings', 'gravityview' ),
124
+				'title' => __('View Settings', 'gravityview'),
125 125
 				'file' => 'view-settings.php',
126 126
 				'icon-class' => 'dashicons-admin-generic',
127 127
 				'callback' => '',
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 			),
130 130
 			array(
131 131
 				'id' => 'single_entry', // Use the same ID as View Settings for backward compatibility
132
-				'title' => __( 'Single Entry', 'gravityview' ),
132
+				'title' => __('Single Entry', 'gravityview'),
133 133
 				'file' => 'single-entry.php',
134 134
 				'icon-class' => 'dashicons-media-default',
135 135
 				'callback' => '',
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			),
138 138
 			array(
139 139
 				'id' => 'sort_filter',
140
-				'title' => __( 'Filter &amp; Sort', 'gravityview' ),
140
+				'title' => __('Filter &amp; Sort', 'gravityview'),
141 141
 				'file' => 'sort-filter.php',
142 142
 				'icon-class' => 'dashicons-sort',
143 143
 				'callback' => '',
@@ -150,17 +150,17 @@  discard block
 block discarded – undo
150 150
 		 * @param array $metaboxes
151 151
 		 * @since 1.8
152 152
 		 */
153
-		$metaboxes = apply_filters( 'gravityview/metaboxes/default', $metaboxes );
153
+		$metaboxes = apply_filters('gravityview/metaboxes/default', $metaboxes);
154 154
 
155
-		foreach( $metaboxes as $m ) {
155
+		foreach ($metaboxes as $m) {
156 156
 
157
-			$tab = new GravityView_Metabox_Tab( $m['id'], $m['title'], $m['file'], $m['icon-class'], $m['callback'], $m['callback_args'] );
157
+			$tab = new GravityView_Metabox_Tab($m['id'], $m['title'], $m['file'], $m['icon-class'], $m['callback'], $m['callback_args']);
158 158
 
159
-			GravityView_Metabox_Tabs::add( $tab );
159
+			GravityView_Metabox_Tabs::add($tab);
160 160
 
161 161
 		}
162 162
 
163
-		unset( $tab );
163
+		unset($tab);
164 164
 
165 165
 	}
166 166
 
@@ -173,18 +173,18 @@  discard block
 block discarded – undo
173 173
 	 *
174 174
 	 * @return string "Data Source", plus links if any
175 175
 	 */
176
-	private function get_data_source_header( $post_id ) {
176
+	private function get_data_source_header($post_id) {
177 177
 
178 178
 		//current value
179
-		$current_form = gravityview_get_form_id( $post_id );
179
+		$current_form = gravityview_get_form_id($post_id);
180 180
 
181
-		$links = GravityView_Admin_Views::get_connected_form_links( $current_form, false );
181
+		$links = GravityView_Admin_Views::get_connected_form_links($current_form, false);
182 182
 
183
-		if( !empty( $links ) ) {
184
-			$links = '<span class="alignright gv-form-links">'. $links .'</span>';
183
+		if (!empty($links)) {
184
+			$links = '<span class="alignright gv-form-links">'.$links.'</span>';
185 185
 		}
186 186
 
187
-		return __( 'Data Source', 'gravityview' ) . $links;
187
+		return __('Data Source', 'gravityview').$links;
188 188
 	}
189 189
 
190 190
 	/**
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
 	 * @param object $post
195 195
 	 * @return void
196 196
 	 */
197
-	function render_data_source_metabox( $post ) {
197
+	function render_data_source_metabox($post) {
198 198
 
199
-		include self::$metaboxes_dir . 'views/data-source.php';
199
+		include self::$metaboxes_dir.'views/data-source.php';
200 200
 
201 201
 	}
202 202
 
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
 	 * @param object $post
208 208
 	 * @return void
209 209
 	 */
210
-	function render_select_template_metabox( $post ) {
210
+	function render_select_template_metabox($post) {
211 211
 
212
-		include self::$metaboxes_dir . 'views/select-template.php';
212
+		include self::$metaboxes_dir.'views/select-template.php';
213 213
 	}
214 214
 
215 215
 	/**
@@ -218,18 +218,18 @@  discard block
 block discarded – undo
218 218
 	 * @param  mixed      $curr_form Form ID
219 219
 	 * @return null|string     Merge tags html; NULL if $curr_form isn't defined.
220 220
 	 */
221
-	public static function render_merge_tags_scripts( $curr_form ) {
221
+	public static function render_merge_tags_scripts($curr_form) {
222 222
 
223
-		if( empty( $curr_form )) {
223
+		if (empty($curr_form)) {
224 224
 			return NULL;
225 225
 		}
226 226
 
227
-		$form = gravityview_get_form( $curr_form );
227
+		$form = gravityview_get_form($curr_form);
228 228
 
229 229
 		$get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL;
230 230
 
231
-		if( isset( $form['id'] ) ) {
232
-		    $form_script = 'var form = ' . GFCommon::json_encode($form) . ';';
231
+		if (isset($form['id'])) {
232
+		    $form_script = 'var form = '.GFCommon::json_encode($form).';';
233 233
 
234 234
 		    // The `gf_vars()` method needs a $_GET[id] variable set with the form ID.
235 235
 		    $_GET['id'] = $form['id'];
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 		    $form_script = 'var form = new Form();';
239 239
 		}
240 240
 
241
-		$output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>';
241
+		$output = '<script type="text/javascript" data-gv-merge-tags="1">'.$form_script."\n".GFCommon::gf_vars(false).'</script>';
242 242
 
243 243
 		// Restore previous $_GET setting
244 244
 		$_GET['id'] = $get_id_backup;
@@ -253,20 +253,20 @@  discard block
 block discarded – undo
253 253
 	 * @param mixed $post
254 254
 	 * @return void
255 255
 	 */
256
-	function render_view_configuration_metabox( $post ) {
256
+	function render_view_configuration_metabox($post) {
257 257
 
258 258
 		// Use nonce for verification
259
-		wp_nonce_field( 'gravityview_view_configuration', 'gravityview_view_configuration_nonce' );
259
+		wp_nonce_field('gravityview_view_configuration', 'gravityview_view_configuration_nonce');
260 260
 
261 261
 		// Selected Form
262
-		$curr_form = gravityview_get_form_id( $post->ID );
262
+		$curr_form = gravityview_get_form_id($post->ID);
263 263
 
264 264
 		// Selected template
265
-		$curr_template = gravityview_get_template_id( $post->ID );
265
+		$curr_template = gravityview_get_template_id($post->ID);
266 266
 
267
-		echo self::render_merge_tags_scripts( $curr_form );
267
+		echo self::render_merge_tags_scripts($curr_form);
268 268
 
269
-		include self::$metaboxes_dir . 'views/view-configuration.php';
269
+		include self::$metaboxes_dir.'views/view-configuration.php';
270 270
 	}
271 271
 
272 272
 	/**
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
 	 * @param object $post
277 277
 	 * @return void
278 278
 	 */
279
-	function render_view_settings_metabox( $post ) {
279
+	function render_view_settings_metabox($post) {
280 280
 
281 281
 		// View template settings
282
-		$current_settings = gravityview_get_template_settings( $post->ID );
282
+		$current_settings = gravityview_get_template_settings($post->ID);
283 283
 
284
-		include self::$metaboxes_dir . 'views/view-settings.php';
284
+		include self::$metaboxes_dir.'views/view-settings.php';
285 285
 
286 286
 	}
287 287
 
@@ -298,12 +298,12 @@  discard block
 block discarded – undo
298 298
 		global $post;
299 299
 
300 300
 		// Only show this on GravityView post types.
301
-		if( false === gravityview_is_admin_page() ) { return; }
301
+		if (false === gravityview_is_admin_page()) { return; }
302 302
 
303 303
 		// If the View hasn't been configured yet, don't show embed shortcode
304
-		if( !gravityview_get_directory_fields( $post->ID ) ) { return; }
304
+		if (!gravityview_get_directory_fields($post->ID)) { return; }
305 305
 
306
-		include self::$metaboxes_dir . 'views/shortcode-hint.php';
306
+		include self::$metaboxes_dir.'views/shortcode-hint.php';
307 307
 	}
308 308
 
309 309
 }
Please login to merge, or discard this patch.