Completed
Push — develop ( 7592b8...3eb7c5 )
by Zack
14:44
created
includes/fields/class-gravityview-field-phone.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@
 block discarded – undo
40 40
 		}
41 41
 
42 42
 		$field_options['link_phone'] = array(
43
-	        'type' => 'checkbox',
44
-	        'label' => __( 'Make Phone Number Clickable', 'gravityview' ),
45
-	        'desc' => __( 'Allow dialing a number by clicking it?', 'gravityview'),
46
-	        'value' => true,
47
-        );
43
+			'type' => 'checkbox',
44
+			'label' => __( 'Make Phone Number Clickable', 'gravityview' ),
45
+			'desc' => __( 'Allow dialing a number by clicking it?', 'gravityview'),
46
+			'value' => true,
47
+		);
48 48
 
49 49
 		return $field_options;
50 50
 	}
Please login to merge, or discard this patch.
includes/class-gravityview-merge-tags.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		$gv_modifiers = array(
54 54
 			'maxwords:(\d+)' => 'modifier_maxwords', /** @see modifier_maxwords */
55 55
 			'wpautop' => 'modifier_wpautop', /** @see modifier_wpautop */
56
-		    'timestamp' => 'modifier_timestamp', /** @see modifier_timestamp */
56
+			'timestamp' => 'modifier_timestamp', /** @see modifier_timestamp */
57 57
 		);
58 58
 		
59 59
 		$return = $value;
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
 		$atts = array(
255 255
 			'format' => self::get_format_from_modifiers( $exploded, false ),
256
-		    'human' => in_array( 'human', $exploded ), // {date_created:human}
256
+			'human' => in_array( 'human', $exploded ), // {date_created:human}
257 257
 			'diff' => in_array( 'diff', $exploded ), // {date_created:diff}
258 258
 			'raw' => in_array( 'raw', $exploded ), // {date_created:raw}
259 259
 			'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp}
Please login to merge, or discard this patch.
includes/class-gravityview-gfformsmodel.php 1 patch
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -7,133 +7,133 @@
 block discarded – undo
7 7
 
8 8
 class GravityView_GFFormsModel extends GFFormsModel {
9 9
 
10
-    /**
11
-     * Given information provided in an entry, get array of media IDs
12
-     *
13
-     * This is necessary because GF doesn't expect to need to update post images, only to create them.
14
-     *
15
-     * @see GFFormsModel::create_post()
16
-     *
17
-     * @since 1.17
18
-     *
19
-     * @param array $form Gravity Forms form array
20
-     * @param array $entry Gravity Forms entry array
21
-     *
22
-     * @return array Array of "Field ID" => "Media IDs"
23
-     */
24
-    public static function get_post_field_images( $form, $entry ) {
25
-
26
-        $post_data = self::get_post_fields( $form, $entry );
27
-
28
-        $media = get_attached_media( 'image', $entry['post_id'] );
29
-
30
-        $post_images = array();
31
-
32
-        foreach ( $media as $media_item ) {
33
-            foreach( (array) $post_data['images'] as $post_data_item ) {
34
-                if(
35
-                    rgar( $post_data_item, 'title' ) === $media_item->post_title &&
36
-                    rgar( $post_data_item, 'description' ) === $media_item->post_content &&
37
-                    rgar( $post_data_item, 'caption' ) === $media_item->post_excerpt
38
-                ) {
39
-                    $post_images["{$post_data_item['field_id']}"] = $media_item->ID;
40
-                }
41
-            }
42
-        }
43
-
44
-        return $post_images;
45
-    }
46
-
47
-    /**
48
-     * Alias of GFFormsModel::get_post_fields(); just making it public
49
-     *
50
-     * @see GFFormsModel::get_post_fields()
51
-     *
52
-     * @since 1.17
53
-     *
54
-     * @param array $form Gravity Forms form array
55
-     * @param array $entry Gravity Forms entry array
56
-     *
57
-     * @return array
58
-     */
59
-    public static function get_post_fields( $form, $entry ) {
60
-
61
-        $reflection = new ReflectionMethod( 'GFFormsModel', 'get_post_fields' );
62
-
63
-        /**
64
-         * If the method changes to public, use Gravity Forms' method
65
-         * @todo: If/when the method is public, remove the unneeded copied code.
66
-         */
67
-        if( $reflection->isPublic() ) {
68
-            return parent::get_post_fields( $form, $entry );
69
-        }
70
-
71
-        // It was private; let's make it public
72
-        $reflection->setAccessible( true );
73
-
74
-        return $reflection->invoke( new GFFormsModel, $form, $entry );
75
-    }
76
-
77
-    /**
78
-     * Copied function from Gravity Forms plugin \GFFormsModel::copy_post_image since the method is private.
79
-     *
80
-     * @since 1.16.2
81
-     *
82
-     * @param string $url URL of the post image to update
83
-     * @param int $post_id ID of the post image to update
84
-     * @return array|bool Array with `file`, `url` and `type` keys. False: failed to copy file to final directory path.
85
-     */
86
-    public static function copy_post_image( $url, $post_id ) {
87
-
88
-        $reflection = new ReflectionMethod( 'GFFormsModel', 'copy_post_image' );
89
-
90
-        /**
91
-         * If the method changes to public, use Gravity Forms' method
92
-         * @todo: If/when the method is public, remove the unneeded copied code.
93
-         */
94
-        if( $reflection->isPublic() ) {
95
-            return parent::copy_post_image( $url, $post_id );
96
-        }
97
-
98
-        // It was private; let's make it public
99
-        $reflection->setAccessible( true );
100
-
101
-        return $reflection->invoke( new GFFormsModel, $url, $post_id );
102
-    }
103
-
104
-    /**
105
-     * Copied function from Gravity Forms plugin \GFFormsModel::media_handle_upload since the method is private.
106
-     *
107
-     * Note: The method became public in GF 1.9.17.7
108
-     *
109
-     * @see GFFormsModel::media_handle_upload
110
-     * @see GravityView_Edit_Entry_Render::maybe_update_post_fields
111
-     *
112
-     * @uses copy_post_image
113
-     * @uses wp_insert_attachment
114
-     * @uses wp_update_attachment_metadata
115
-     *
116
-     * @param string $url URL of the post image to update
117
-     * @param int $post_id ID of the post image to update
118
-     * @param array $post_data Array of data for the eventual attachment post type that is created using {@see wp_insert_attachment}. Supports `post_mime_type`, `guid`, `post_parent`, `post_title`, `post_content` keys.
119
-     * @return bool|int ID of attachment Post created. Returns false if file not created by copy_post_image
120
-     */
121
-    public static function media_handle_upload( $url, $post_id, $post_data = array() ) {
122
-
123
-        $reflection = new ReflectionMethod( 'GFFormsModel', 'media_handle_upload' );
124
-
125
-        /**
126
-         * If the method changes to public, use Gravity Forms' method
127
-         * @todo: If/when the method is public, remove the unneeded copied code.
128
-         */
129
-        if( $reflection->isPublic() ) {
130
-            return parent::media_handle_upload( $url, $post_id, $post_data );
131
-        }
132
-
133
-        // It was private; let's make it public
134
-        $reflection->setAccessible( true );
135
-
136
-        return $reflection->invoke( new GFFormsModel, $url, $post_id, $post_data );
137
-    }
10
+	/**
11
+	 * Given information provided in an entry, get array of media IDs
12
+	 *
13
+	 * This is necessary because GF doesn't expect to need to update post images, only to create them.
14
+	 *
15
+	 * @see GFFormsModel::create_post()
16
+	 *
17
+	 * @since 1.17
18
+	 *
19
+	 * @param array $form Gravity Forms form array
20
+	 * @param array $entry Gravity Forms entry array
21
+	 *
22
+	 * @return array Array of "Field ID" => "Media IDs"
23
+	 */
24
+	public static function get_post_field_images( $form, $entry ) {
25
+
26
+		$post_data = self::get_post_fields( $form, $entry );
27
+
28
+		$media = get_attached_media( 'image', $entry['post_id'] );
29
+
30
+		$post_images = array();
31
+
32
+		foreach ( $media as $media_item ) {
33
+			foreach( (array) $post_data['images'] as $post_data_item ) {
34
+				if(
35
+					rgar( $post_data_item, 'title' ) === $media_item->post_title &&
36
+					rgar( $post_data_item, 'description' ) === $media_item->post_content &&
37
+					rgar( $post_data_item, 'caption' ) === $media_item->post_excerpt
38
+				) {
39
+					$post_images["{$post_data_item['field_id']}"] = $media_item->ID;
40
+				}
41
+			}
42
+		}
43
+
44
+		return $post_images;
45
+	}
46
+
47
+	/**
48
+	 * Alias of GFFormsModel::get_post_fields(); just making it public
49
+	 *
50
+	 * @see GFFormsModel::get_post_fields()
51
+	 *
52
+	 * @since 1.17
53
+	 *
54
+	 * @param array $form Gravity Forms form array
55
+	 * @param array $entry Gravity Forms entry array
56
+	 *
57
+	 * @return array
58
+	 */
59
+	public static function get_post_fields( $form, $entry ) {
60
+
61
+		$reflection = new ReflectionMethod( 'GFFormsModel', 'get_post_fields' );
62
+
63
+		/**
64
+		 * If the method changes to public, use Gravity Forms' method
65
+		 * @todo: If/when the method is public, remove the unneeded copied code.
66
+		 */
67
+		if( $reflection->isPublic() ) {
68
+			return parent::get_post_fields( $form, $entry );
69
+		}
70
+
71
+		// It was private; let's make it public
72
+		$reflection->setAccessible( true );
73
+
74
+		return $reflection->invoke( new GFFormsModel, $form, $entry );
75
+	}
76
+
77
+	/**
78
+	 * Copied function from Gravity Forms plugin \GFFormsModel::copy_post_image since the method is private.
79
+	 *
80
+	 * @since 1.16.2
81
+	 *
82
+	 * @param string $url URL of the post image to update
83
+	 * @param int $post_id ID of the post image to update
84
+	 * @return array|bool Array with `file`, `url` and `type` keys. False: failed to copy file to final directory path.
85
+	 */
86
+	public static function copy_post_image( $url, $post_id ) {
87
+
88
+		$reflection = new ReflectionMethod( 'GFFormsModel', 'copy_post_image' );
89
+
90
+		/**
91
+		 * If the method changes to public, use Gravity Forms' method
92
+		 * @todo: If/when the method is public, remove the unneeded copied code.
93
+		 */
94
+		if( $reflection->isPublic() ) {
95
+			return parent::copy_post_image( $url, $post_id );
96
+		}
97
+
98
+		// It was private; let's make it public
99
+		$reflection->setAccessible( true );
100
+
101
+		return $reflection->invoke( new GFFormsModel, $url, $post_id );
102
+	}
103
+
104
+	/**
105
+	 * Copied function from Gravity Forms plugin \GFFormsModel::media_handle_upload since the method is private.
106
+	 *
107
+	 * Note: The method became public in GF 1.9.17.7
108
+	 *
109
+	 * @see GFFormsModel::media_handle_upload
110
+	 * @see GravityView_Edit_Entry_Render::maybe_update_post_fields
111
+	 *
112
+	 * @uses copy_post_image
113
+	 * @uses wp_insert_attachment
114
+	 * @uses wp_update_attachment_metadata
115
+	 *
116
+	 * @param string $url URL of the post image to update
117
+	 * @param int $post_id ID of the post image to update
118
+	 * @param array $post_data Array of data for the eventual attachment post type that is created using {@see wp_insert_attachment}. Supports `post_mime_type`, `guid`, `post_parent`, `post_title`, `post_content` keys.
119
+	 * @return bool|int ID of attachment Post created. Returns false if file not created by copy_post_image
120
+	 */
121
+	public static function media_handle_upload( $url, $post_id, $post_data = array() ) {
122
+
123
+		$reflection = new ReflectionMethod( 'GFFormsModel', 'media_handle_upload' );
124
+
125
+		/**
126
+		 * If the method changes to public, use Gravity Forms' method
127
+		 * @todo: If/when the method is public, remove the unneeded copied code.
128
+		 */
129
+		if( $reflection->isPublic() ) {
130
+			return parent::media_handle_upload( $url, $post_id, $post_data );
131
+		}
132
+
133
+		// It was private; let's make it public
134
+		$reflection->setAccessible( true );
135
+
136
+		return $reflection->invoke( new GFFormsModel, $url, $post_id, $post_data );
137
+	}
138 138
 
139 139
 }
140 140
\ No newline at end of file
Please login to merge, or discard this patch.
includes/class-api.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -146,20 +146,20 @@  discard block
 block discarded – undo
146 146
 
147 147
 		if( !empty( $field['custom_class'] ) ) {
148 148
 
149
-            $custom_class = $field['custom_class'];
149
+			$custom_class = $field['custom_class'];
150 150
 
151
-            if( !empty( $entry ) ) {
151
+			if( !empty( $entry ) ) {
152 152
 
153
-                // We want the merge tag to be formatted as a class. The merge tag may be
154
-                // replaced by a multiple-word value that should be output as a single class.
155
-                // "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager`
156
-                add_filter('gform_merge_tag_filter', 'sanitize_html_class');
153
+				// We want the merge tag to be formatted as a class. The merge tag may be
154
+				// replaced by a multiple-word value that should be output as a single class.
155
+				// "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager`
156
+				add_filter('gform_merge_tag_filter', 'sanitize_html_class');
157 157
 
158
-                $custom_class = self::replace_variables( $custom_class, $form, $entry);
158
+				$custom_class = self::replace_variables( $custom_class, $form, $entry);
159 159
 
160
-                // And then we want life to return to normal
161
-                remove_filter('gform_merge_tag_filter', 'sanitize_html_class');
162
-            }
160
+				// And then we want life to return to normal
161
+				remove_filter('gform_merge_tag_filter', 'sanitize_html_class');
162
+			}
163 163
 
164 164
 			// And now we want the spaces to be handled nicely.
165 165
 			$classes[] = gravityview_sanitize_html_class( $custom_class );
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 			'format' => $format,
278 278
 			'entry' => $entry,
279 279
 			'field_type' => $field_type, /** {@since 1.6} */
280
-		    'field_path' => $field_path, /** {@since 1.16} */
280
+			'field_path' => $field_path, /** {@since 1.16} */
281 281
 		));
282 282
 
283 283
 		if( ! empty( $field_path ) ) {
@@ -594,32 +594,32 @@  discard block
 block discarded – undo
594 594
 		return sanitize_title( $slug );
595 595
 	}
596 596
 
597
-    /**
598
-     * If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta
599
-     *
600
-     * Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 );
601
-     *
602
-     * @param $entry array Gravity Forms entry object
603
-     * @param $form array Gravity Forms form object
604
-     */
605
-    public static function entry_create_custom_slug( $entry, $form ) {
606
-        /**
607
-         * @filter `gravityview_custom_entry_slug` On entry creation, check if we are using the custom entry slug feature and update the meta
608
-         * @param boolean $custom Should we process the custom entry slug?
609
-         */
610
-        $custom = apply_filters( 'gravityview_custom_entry_slug', false );
611
-        if( $custom ) {
612
-            // create the gravityview_unique_id and save it
597
+	/**
598
+	 * If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta
599
+	 *
600
+	 * Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 );
601
+	 *
602
+	 * @param $entry array Gravity Forms entry object
603
+	 * @param $form array Gravity Forms form object
604
+	 */
605
+	public static function entry_create_custom_slug( $entry, $form ) {
606
+		/**
607
+		 * @filter `gravityview_custom_entry_slug` On entry creation, check if we are using the custom entry slug feature and update the meta
608
+		 * @param boolean $custom Should we process the custom entry slug?
609
+		 */
610
+		$custom = apply_filters( 'gravityview_custom_entry_slug', false );
611
+		if( $custom ) {
612
+			// create the gravityview_unique_id and save it
613 613
 
614
-            // Get the entry hash
615
-            $hash = self::get_custom_entry_slug( $entry['id'], $entry );
614
+			// Get the entry hash
615
+			$hash = self::get_custom_entry_slug( $entry['id'], $entry );
616 616
 
617
-	        do_action( 'gravityview_log_debug', __METHOD__ . ' - Setting hash for entry "'.$entry['id'].'": ' . $hash );
617
+			do_action( 'gravityview_log_debug', __METHOD__ . ' - Setting hash for entry "'.$entry['id'].'": ' . $hash );
618 618
 
619
-            gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash, rgar( $entry, 'form_id' ) );
619
+			gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash, rgar( $entry, 'form_id' ) );
620 620
 
621
-        }
622
-    }
621
+		}
622
+	}
623 623
 
624 624
 
625 625
 
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 
896 896
 			// If there was an error, continue to the next term.
897 897
 			if ( is_wp_error( $term_link ) ) {
898
-			    continue;
898
+				continue;
899 899
 			}
900 900
 
901 901
 			$output[] = gravityview_get_link( $term_link, esc_html( $term->name ) );
Please login to merge, or discard this patch.
includes/admin/class-gravityview-support-port.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 	 *
222 222
 	 * If the user doesn't have the `gravityview_support_port` capability, returns false; then
223 223
 	 * If global setting is "hide", returns false; then
224
-     * If user preference is not set, return global setting; then
225
-     * If user preference is set, return that setting.
224
+	 * If user preference is not set, return global setting; then
225
+	 * If user preference is set, return that setting.
226 226
 	 *
227 227
 	 * @since 1.15
228
-     * @since 1.17.5 Changed behavior to respect global setting
228
+	 * @since 1.17.5 Changed behavior to respect global setting
229 229
 	 *
230 230
 	 * @param int $user Optional. ID of the user to check, defaults to 0 for current user.
231 231
 	 *
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 		$global_setting = GravityView_Settings::getSetting( 'support_port' );
241 241
 
242 242
 		if ( empty( $global_setting ) ) {
243
-            return false;
243
+			return false;
244 244
 		}
245 245
 
246 246
 		// Get the per-user Support Port setting
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 * Modifies the output of profile.php to add GravityView Support preference
277 277
 	 *
278 278
 	 * @since 1.15
279
-     * @since 1.17.5 Only show if global setting is active
279
+	 * @since 1.17.5 Only show if global setting is active
280 280
 	 *
281 281
 	 * @param WP_User $user Current user info
282 282
 	 *
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		$global_setting = GravityView_Settings::getSetting( 'support_port' );
288 288
 
289 289
 		if ( empty( $global_setting ) ) {
290
-            return;
290
+			return;
291 291
 		}
292 292
 
293 293
 		/**
Please login to merge, or discard this patch.
includes/class-admin-approve-entries.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -346,14 +346,14 @@  discard block
 block discarded – undo
346 346
 	/**
347 347
 	 * update_approved function.
348 348
 	 *
349
-     * @since 1.18 Moved to GravityView_Entry_Approval::update_approved
349
+	 * @since 1.18 Moved to GravityView_Entry_Approval::update_approved
350 350
 	 * @see GravityView_Entry_Approval::update_approved
351
-     *
351
+	 *
352 352
 	 * @param int $entry_id (default: 0)
353 353
 	 * @param int $approved (default: 0)
354 354
 	 * @param int $form_id (default: 0)
355 355
 	 * @param int $approvedcolumn (default: 0)
356
-     *
356
+	 *
357 357
 	 * @return boolean True: It worked; False: it failed
358 358
 	 */
359 359
 	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0) {
@@ -363,9 +363,9 @@  discard block
 block discarded – undo
363 363
 	/**
364 364
 	 * Calculate the approve field.input id
365 365
 	 *
366
-     * @since 1.18 Moved to GravityView_Entry_Approval::get_approved_column
367
-     * @see GravityView_Entry_Approval::get_approved_column
368
-     *
366
+	 * @since 1.18 Moved to GravityView_Entry_Approval::get_approved_column
367
+	 * @see GravityView_Entry_Approval::get_approved_column
368
+	 *
369 369
 	 * @param mixed $form GF Form or Form ID
370 370
 	 * @return false|null|string Returns the input ID of the approved field. Returns NULL if no approved fields were found. Returns false if $form_id wasn't set.
371 371
 	 */
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 			'bulk_actions' => $this->get_bulk_actions( $form_id ),
488 488
 			'bulk_message' => $this->bulk_update_message,
489 489
 			'unapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('unapproved'),
490
-            'approve_title' => GravityView_Entry_Approval_Status::get_title_attr('disapproved'),
490
+			'approve_title' => GravityView_Entry_Approval_Status::get_title_attr('disapproved'),
491 491
 			'disapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('approved'),
492 492
 			'column_title' => __( 'Show entry in directory view?', 'gravityview'),
493 493
 			'column_link' => esc_url( $this->get_sort_link( $form_id ) ),
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
 	}
497 497
 
498 498
 	/**
499
-     * Generate a link to sort by approval status (if there is an Approve/Disapprove field)
500
-     *
501
-     * Note: Sorting by approval will never be great because it's not possible currently to declare the sorting as
502
-     * numeric, but it does group the approved entries together.
503
-     *
499
+	 * Generate a link to sort by approval status (if there is an Approve/Disapprove field)
500
+	 *
501
+	 * Note: Sorting by approval will never be great because it's not possible currently to declare the sorting as
502
+	 * numeric, but it does group the approved entries together.
503
+	 *
504 504
 	 * @param int $form_id
505 505
 	 *
506 506
 	 * @return string Sorting link
@@ -510,20 +510,20 @@  discard block
 block discarded – undo
510 510
 		$approved_column_id = self::get_approved_column( $form_id );
511 511
 
512 512
 		if( ! $approved_column_id ) {
513
-		    return '';
514
-        }
513
+			return '';
514
+		}
515 515
 
516
-	    $order = ( 'desc' === rgget('order') ) ? 'asc' : 'desc';
516
+		$order = ( 'desc' === rgget('order') ) ? 'asc' : 'desc';
517 517
 
518
-	    $args = array(
519
-		    'orderby' => $approved_column_id,
520
-            'order' => $order,
521
-        );
518
+		$args = array(
519
+			'orderby' => $approved_column_id,
520
+			'order' => $order,
521
+		);
522 522
 
523
-	    $link = add_query_arg( $args );
523
+		$link = add_query_arg( $args );
524 524
 
525 525
 		return $link;
526
-    }
526
+	}
527 527
 
528 528
 	/**
529 529
 	 * Get an array of options to be added to the Gravity Forms "Bulk action" dropdown in a "GravityView" option group
Please login to merge, or discard this patch.
includes/extensions/entry-notes/class-gravityview-field-notes.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 *
269 269
 	 * Verify permissions. Check expected $_POST. Parse args, then send to process_delete_notes
270 270
 	 *
271
-  	 * @since 1.17
271
+	 * @since 1.17
272 272
 	 *
273 273
 	 * @see process_delete_notes
274 274
 	 *
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 			'subject-label' => __( 'Subject', 'gravityview' ),
422 422
 			'subject' => __( 'Email subject', 'gravityview' ),
423 423
 			'default-email-subject' => __( 'New entry note', 'gravityview' ),
424
-            'email-footer' => __( 'This note was sent from {url}', 'gravityview' ),
424
+			'email-footer' => __( 'This note was sent from {url}', 'gravityview' ),
425 425
 			'also-email' => __( 'Also email this note to', 'gravityview' ),
426 426
 			'error-add-note' => __( 'There was an error adding the note.', 'gravityview' ),
427 427
 			'error-invalid' => __( 'The request was invalid. Refresh the page and try again.', 'gravityview' ),
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
 				'gv-note-to-custom' => '',
711 711
 				'gv-note-subject' => '',
712 712
 				'gv-note-content' => '',
713
-                'current-url' => '',
713
+				'current-url' => '',
714 714
 			);
715 715
 
716 716
 			$current_user  = wp_get_current_user();
@@ -762,9 +762,9 @@  discard block
 block discarded – undo
762 762
 			$message .= $this->get_email_footer( $email_footer, $is_html, $email_data );
763 763
 
764 764
 			/**
765
-             * @filter `gravityview/field/notes/wpautop_email` Should the message content have paragraphs added automatically, if using HTML message format
765
+			 * @filter `gravityview/field/notes/wpautop_email` Should the message content have paragraphs added automatically, if using HTML message format
766 766
 			 * @since 1.18
767
-             * @param bool $wpautop_email True: Apply wpautop() to the email message if using; False: Leave as entered (Default: true)
767
+			 * @param bool $wpautop_email True: Apply wpautop() to the email message if using; False: Leave as entered (Default: true)
768 768
 			 */
769 769
 			$wpautop_email = apply_filters( 'gravityview/field/notes/wpautop_email', true );
770 770
 
@@ -784,12 +784,12 @@  discard block
 block discarded – undo
784 784
 	}
785 785
 
786 786
 	/**
787
-     * Get the footer for Entry Note emails
788
-     *
789
-     * `{url}` is replaced by the URL of the page where the note form was embedded
790
-     *
791
-     * @since 1.18
792
-     * @see GravityView_Field_Notes::strings The default value of $message_footer is set here, with the key 'email-footer'
787
+	 * Get the footer for Entry Note emails
788
+	 *
789
+	 * `{url}` is replaced by the URL of the page where the note form was embedded
790
+	 *
791
+	 * @since 1.18
792
+	 * @see GravityView_Field_Notes::strings The default value of $message_footer is set here, with the key 'email-footer'
793 793
 	 *
794 794
 	 * @param string $email_footer The message footer value
795 795
 	 * @param bool $is_html True: Email is being sent as HTML; False: sent as text
@@ -798,10 +798,10 @@  discard block
 block discarded – undo
798 798
 	 */
799 799
 	private function get_email_footer( $email_footer = '', $is_html = true, $email_data = array() ) {
800 800
 
801
-	    $output = '';
801
+		$output = '';
802 802
 
803 803
 		if( ! empty( $email_footer ) ) {
804
-		    $url = rgar( $email_data, 'current-url' );
804
+			$url = rgar( $email_data, 'current-url' );
805 805
 			$url = html_entity_decode( $url );
806 806
 			$url = site_url( $url );
807 807
 
Please login to merge, or discard this patch.
includes/class-gravityview-settings.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
 	}
123 123
 
124 124
 	/**
125
-     * Uninstall all traces of GravityView
126
-     *
127
-     * Note: method is public because parent method is public
128
-     *
125
+	 * Uninstall all traces of GravityView
126
+	 *
127
+	 * Note: method is public because parent method is public
128
+	 *
129 129
 	 * @return bool
130 130
 	 */
131 131
 	public function uninstall() {
@@ -137,53 +137,53 @@  discard block
 block discarded – undo
137 137
 		$uninstaller->fire_everything();
138 138
 
139 139
 		/**
140
-         * Set the path so that Gravity Forms can de-activate GravityView
141
-         * @see GFAddOn::uninstall_addon
142
-         * @uses deactivate_plugins()
143
-         */
140
+		 * Set the path so that Gravity Forms can de-activate GravityView
141
+		 * @see GFAddOn::uninstall_addon
142
+		 * @uses deactivate_plugins()
143
+		 */
144 144
 		$this->_path = GRAVITYVIEW_FILE;
145 145
 
146 146
 		return true;
147 147
 	}
148 148
 
149 149
 	/**
150
-     * Get an array of reasons why the plugin might be uninstalled
151
-     *
152
-     * @since 1.17.5
153
-     *
150
+	 * Get an array of reasons why the plugin might be uninstalled
151
+	 *
152
+	 * @since 1.17.5
153
+	 *
154 154
 	 * @return array Array of reasons with the label and followup questions for each uninstall reason
155 155
 	 */
156 156
 	private function get_uninstall_reasons() {
157 157
 
158 158
 		$reasons = array(
159 159
 			'will-continue' => array(
160
-                'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ),
161
-            ),
160
+				'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ),
161
+			),
162 162
 			'no-longer-need' => array(
163
-                'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ),
164
-            ),
163
+				'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ),
164
+			),
165 165
 			'doesnt-work' => array(
166
-                'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ),
167
-            ),
166
+				'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ),
167
+			),
168 168
 			'found-other' => array(
169
-                'label' => esc_html__( 'I found a better plugin', 'gravityview' ),
170
-                'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'),
171
-            ),
169
+				'label' => esc_html__( 'I found a better plugin', 'gravityview' ),
170
+				'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'),
171
+			),
172 172
 			'other' => array(
173
-                'label' => esc_html__( 'Other', 'gravityview' ),
174
-            ),
173
+				'label' => esc_html__( 'Other', 'gravityview' ),
174
+			),
175 175
 		);
176 176
 
177 177
 		shuffle( $reasons );
178 178
 
179 179
 		return $reasons;
180
-    }
180
+	}
181 181
 
182 182
 	/**
183
-     * Display a feedback form when the plugin is uninstalled
184
-     *
185
-     * @since 1.17.5
186
-     *
183
+	 * Display a feedback form when the plugin is uninstalled
184
+	 *
185
+	 * @since 1.17.5
186
+	 *
187 187
 	 * @return string HTML of the uninstallation form
188 188
 	 */
189 189
 	public function uninstall_form() {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
             <h2><?php esc_html_e( 'Why did you uninstall GravityView?', 'gravityview' ); ?></h2>
264 264
             <ul>
265 265
 				<?php
266
-                $reasons = $this->get_uninstall_reasons();
266
+				$reasons = $this->get_uninstall_reasons();
267 267
 				foreach ( $reasons as $reason ) {
268 268
 					printf( '<li><label><input name="reason" type="radio" value="other" data-followup="%s"> %s</label></li>', rgar( $reason, 'followup' ), rgar( $reason, 'label' ) );
269 269
 				}
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 		$license_key = self::getSetting('license_key');
432 432
 		if( '' === $license_key ) {
433 433
 			$license_status = 'inactive';
434
-        }
434
+		}
435 435
 		$license_id = empty( $license_key ) ? 'license' : $license_key;
436 436
 
437 437
 		$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');
@@ -569,12 +569,12 @@  discard block
 block discarded – undo
569 569
 	}
570 570
 
571 571
 	public function app_settings_tab() {
572
-	    parent::app_settings_tab();
572
+		parent::app_settings_tab();
573 573
 
574 574
 		if ( $this->maybe_uninstall() ) {
575
-            echo $this->uninstall_form();
575
+			echo $this->uninstall_form();
576 576
 		}
577
-    }
577
+	}
578 578
 
579 579
 	/**
580 580
 	 * Make protected public
@@ -697,8 +697,8 @@  discard block
 block discarded – undo
697 697
                     type="' . $field['type'] . '"
698 698
                     name="' . esc_attr( $name ) . '"
699 699
                     value="' . $value . '" ' .
700
-		        implode( ' ', $attributes ) .
701
-		        ' />';
700
+				implode( ' ', $attributes ) .
701
+				' />';
702 702
 
703 703
 		if ( $echo ) {
704 704
 			echo $html;
@@ -933,36 +933,36 @@  discard block
 block discarded – undo
933 933
 		}
934 934
 
935 935
 
936
-        $sections = array(
937
-            array(
938
-                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
939
-                'fields'      => $fields,
940
-            )
941
-        );
936
+		$sections = array(
937
+			array(
938
+				'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
939
+				'fields'      => $fields,
940
+			)
941
+		);
942 942
 
943
-        // custom 'update settings' button
944
-        $button = array(
945
-            'class' => 'button button-primary button-hero',
946
-            'type'     => 'save',
947
-        );
943
+		// custom 'update settings' button
944
+		$button = array(
945
+			'class' => 'button button-primary button-hero',
946
+			'type'     => 'save',
947
+		);
948 948
 
949 949
 		if( $disabled_attribute ) {
950 950
 			$button['disabled'] = $disabled_attribute;
951 951
 		}
952 952
 
953 953
 
954
-        /**
955
-         * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page
956
-         * Extensions can tap in here to insert their own section and settings.
957
-         * <code>
958
-         *   $sections[] = array(
959
-         *      'title' => __( 'GravityView My Extension Settings', 'gravityview' ),
960
-         *      'fields' => $settings,
961
-         *   );
962
-         * </code>
963
-         * @param array $extension_settings Empty array, ready for extension settings!
964
-         */
965
-        $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() );
954
+		/**
955
+		 * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page
956
+		 * Extensions can tap in here to insert their own section and settings.
957
+		 * <code>
958
+		 *   $sections[] = array(
959
+		 *      'title' => __( 'GravityView My Extension Settings', 'gravityview' ),
960
+		 *      'fields' => $settings,
961
+		 *   );
962
+		 * </code>
963
+		 * @param array $extension_settings Empty array, ready for extension settings!
964
+		 */
965
+		$extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() );
966 966
 
967 967
 		// If there are extensions, add a section for them
968 968
 		if ( ! empty( $extension_sections ) ) {
@@ -975,13 +975,13 @@  discard block
 block discarded – undo
975 975
 				}
976 976
 			}
977 977
 
978
-            $k = count( $extension_sections ) - 1 ;
979
-            $extension_sections[ $k ]['fields'][] = $button;
978
+			$k = count( $extension_sections ) - 1 ;
979
+			$extension_sections[ $k ]['fields'][] = $button;
980 980
 			$sections = array_merge( $sections, $extension_sections );
981 981
 		} else {
982
-            // add the 'update settings' button to the general section
983
-            $sections[0]['fields'][] = $button;
984
-        }
982
+			// add the 'update settings' button to the general section
983
+			$sections[0]['fields'][] = $button;
984
+		}
985 985
 
986 986
 		return $sections;
987 987
 	}
Please login to merge, or discard this patch.
includes/admin/field-types/type_textarea.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@
 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 ';
31
+		if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
+			$class .= ' merge-tag-support mt-position-right ';
33 33
 
34
-            if( empty( $this->field['show_all_fields'] ) ) {
35
-            	$class .= ' mt-hide_all_fields ';
36
-            }
37
-        }
34
+			if( empty( $this->field['show_all_fields'] ) ) {
35
+				$class .= ' mt-hide_all_fields ';
36
+			}
37
+		}
38 38
 		$class .= rgar( $this->field, 'class' );
39 39
 		$placeholder = rgar( $this->field, 'placeholder' );
40 40
 		?>
Please login to merge, or discard this patch.