x Sorry, these patches are not available anymore due to data migration. Please run a fresh inspection.
Completed
Pull Request — master (#1038)
by Zack
16:56
created
includes/extensions/entry-notes/class-gravityview-field-notes.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 
176 176
 		if( 'gv_note_add' === $_POST['action'] ) {
177 177
 
178
-            if( ! GVCommon::has_cap( 'gravityview_add_entry_notes' ) ) {
179
-                do_action( 'gravityview_log_error', __METHOD__ . ': The user isnt allowed to add entry notes.' );
180
-                return;
181
-            }
178
+			if( ! GVCommon::has_cap( 'gravityview_add_entry_notes' ) ) {
179
+				do_action( 'gravityview_log_error', __METHOD__ . ': The user isnt allowed to add entry notes.' );
180
+				return;
181
+			}
182 182
 
183 183
 			$post = wp_unslash( $_POST );
184 184
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 *
279 279
 	 * Verify permissions. Check expected $_POST. Parse args, then send to process_delete_notes
280 280
 	 *
281
-  	 * @since 1.17
281
+	 * @since 1.17
282 282
 	 *
283 283
 	 * @see process_delete_notes
284 284
 	 *
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 			'subject-label' => __( 'Subject', 'gravityview' ),
432 432
 			'subject' => __( 'Email subject', 'gravityview' ),
433 433
 			'default-email-subject' => __( 'New entry note', 'gravityview' ),
434
-            'email-footer' => __( 'This note was sent from {url}', 'gravityview' ),
434
+			'email-footer' => __( 'This note was sent from {url}', 'gravityview' ),
435 435
 			'also-email' => __( 'Also email this note to', 'gravityview' ),
436 436
 			'error-add-note' => __( 'There was an error adding the note.', 'gravityview' ),
437 437
 			'error-invalid' => __( 'The request was invalid. Refresh the page and try again.', 'gravityview' ),
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
 
502 502
 		if ( $context instanceof \GV\Template_Context ) {
503 503
 
504
-		    ob_start();
505
-		    $context->template->get_template_part( 'note', 'detail', true );
506
-            $note_detail_html = ob_get_clean();
504
+			ob_start();
505
+			$context->template->get_template_part( 'note', 'detail', true );
506
+			$note_detail_html = ob_get_clean();
507 507
 
508
-            ob_start();
508
+			ob_start();
509 509
 			$context->template->get_template_part( 'note', $note_row_template, true );
510 510
 			$note_row = ob_get_clean();
511 511
 		} else {
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 				'gv-note-to-custom' => '',
762 762
 				'gv-note-subject' => '',
763 763
 				'gv-note-content' => '',
764
-                'current-url' => '',
764
+				'current-url' => '',
765 765
 			);
766 766
 
767 767
 			$current_user  = wp_get_current_user();
@@ -813,9 +813,9 @@  discard block
 block discarded – undo
813 813
 			$message .= $this->get_email_footer( $email_footer, $is_html, $email_data );
814 814
 
815 815
 			/**
816
-             * @filter `gravityview/field/notes/wpautop_email` Should the message content have paragraphs added automatically, if using HTML message format
816
+			 * @filter `gravityview/field/notes/wpautop_email` Should the message content have paragraphs added automatically, if using HTML message format
817 817
 			 * @since 1.18
818
-             * @param bool $wpautop_email True: Apply wpautop() to the email message if using; False: Leave as entered (Default: true)
818
+			 * @param bool $wpautop_email True: Apply wpautop() to the email message if using; False: Leave as entered (Default: true)
819 819
 			 */
820 820
 			$wpautop_email = apply_filters( 'gravityview/field/notes/wpautop_email', true );
821 821
 
@@ -835,12 +835,12 @@  discard block
 block discarded – undo
835 835
 	}
836 836
 
837 837
 	/**
838
-     * Get the footer for Entry Note emails
839
-     *
840
-     * `{url}` is replaced by the URL of the page where the note form was embedded
841
-     *
842
-     * @since 1.18
843
-     * @see GravityView_Field_Notes::strings The default value of $message_footer is set here, with the key 'email-footer'
838
+	 * Get the footer for Entry Note emails
839
+	 *
840
+	 * `{url}` is replaced by the URL of the page where the note form was embedded
841
+	 *
842
+	 * @since 1.18
843
+	 * @see GravityView_Field_Notes::strings The default value of $message_footer is set here, with the key 'email-footer'
844 844
 	 *
845 845
 	 * @param string $email_footer The message footer value
846 846
 	 * @param bool $is_html True: Email is being sent as HTML; False: sent as text
@@ -849,10 +849,10 @@  discard block
 block discarded – undo
849 849
 	 */
850 850
 	private function get_email_footer( $email_footer = '', $is_html = true, $email_data = array() ) {
851 851
 
852
-	    $output = '';
852
+		$output = '';
853 853
 
854 854
 		if( ! empty( $email_footer ) ) {
855
-		    $url = \GV\Utils::get( $email_data, 'current-url' );
855
+			$url = \GV\Utils::get( $email_data, 'current-url' );
856 856
 			$url = html_entity_decode( $url );
857 857
 			$url = site_url( $url );
858 858
 
Please login to merge, or discard this patch.
future/includes/class-gv-template-view-table.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 
20 20
 
21 21
 	/**
22
-     * Constructor. Add filters to modify output.
23
-     *
22
+	 * Constructor. Add filters to modify output.
23
+	 *
24 24
 	 * @since 2.0.4
25 25
 	 *
26 26
 	 * @param View $view
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function __construct( View $view, Entry_Collection $entries, Request $request ) {
31 31
 
32
-	    add_filter( 'gravityview/template/field/label', array( __CLASS__, 'add_columns_sort_links' ), 100, 2 );
32
+		add_filter( 'gravityview/template/field/label', array( __CLASS__, 'add_columns_sort_links' ), 100, 2 );
33 33
 
34 34
 		parent::__construct( $view, $entries, $request );
35 35
 	}
36 36
 
37 37
 	/**
38
-     * Add sorting links to HTML columns that support sorting
39
-     *
40
-     * @since 2.0.4
41
-     * @since 2.0.5 Made static
42
-     *
43
-     * @static
44
-     *
38
+	 * Add sorting links to HTML columns that support sorting
39
+	 *
40
+	 * @since 2.0.4
41
+	 * @since 2.0.5 Made static
42
+	 *
43
+	 * @static
44
+	 *
45 45
 	 * @param string $column_label Label for the table column
46 46
 	 * @param \GV\Template_Context $context
47 47
 	 *
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$sort_columns = $context->view->settings->get( 'sort_columns' );
53 53
 
54 54
 		if ( empty( $sort_columns ) ) {
55
-            return $column_label;
55
+			return $column_label;
56 56
 		}
57 57
 
58 58
 		if ( ! \GravityView_frontend::getInstance()->is_field_sortable( $context->field->ID, $context->view->form->form ) ) {
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
 				 */
194 194
 				do_action( 'gravityview/template/table/cells/before', $context );
195 195
 
196
-                /**
197
-                 * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
198
-                 * @since 1.0.7
196
+				/**
197
+				 * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
198
+				 * @since 1.0.7
199 199
 				 * @param GravityView_View $this Current GravityView_View object
200 200
 				 * @deprecated Use `gravityview/template/table/cells/before`
201
-                 */
202
-                do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() );
201
+				 */
202
+				do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() );
203 203
 
204
-                foreach ( $fields->all() as $field ) {
204
+				foreach ( $fields->all() as $field ) {
205 205
 					$this->the_field( $field, $entry );
206 206
 				}
207 207
 
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 				 */
213 213
 				do_action( 'gravityview/template/table/cells/after', $context );
214 214
 
215
-                /**
216
-                 * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
217
-                 * @since 1.0.7
215
+				/**
216
+				 * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
217
+				 * @since 1.0.7
218 218
 				 * @param GravityView_View $this Current GravityView_View object
219 219
 				 * @deprecated Use `gravityview/template/table/cells/after`
220
-                 */
221
-                do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() );
220
+				 */
221
+				do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() );
222 222
 
223 223
 				?>
224 224
 			</tr>
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 			'hide_empty' => false,
256 256
 			'zone_id' => 'directory_table-columns',
257 257
 			'markup' => '<td id="{{ field_id }}" class="{{ class }}">{{ value }}</td>',
258
-            'form' => $form,
258
+			'form' => $form,
259 259
 		);
260 260
 
261 261
 		/** Output. */
@@ -280,11 +280,11 @@  discard block
 block discarded – undo
280 280
 		do_action( 'gravityview/template/table/body/before', $context );
281 281
 
282 282
 		/**
283
-		* @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows.
284
-		* @deprecated Use `gravityview/template/table/body/before`
285
-		* @since 1.0.7
286
-		* @param \GravityView_View $gravityview_view Current GravityView_View object.
287
-		*/
283
+		 * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows.
284
+		 * @deprecated Use `gravityview/template/table/body/before`
285
+		 * @since 1.0.7
286
+		 * @param \GravityView_View $gravityview_view Current GravityView_View object.
287
+		 */
288 288
 		do_action( 'gravityview_table_body_before', \GravityView_View::getInstance() /** ugh! */ );
289 289
 	}
290 290
 
@@ -306,11 +306,11 @@  discard block
 block discarded – undo
306 306
 		do_action( 'gravityview/template/table/body/after', $context );
307 307
 
308 308
 		/**
309
-		* @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows.
310
-		* @deprecated Use `gravityview/template/table/body/after`
311
-		* @since 1.0.7
312
-		* @param \GravityView_View $gravityview_view Current GravityView_View object.
313
-		*/
309
+		 * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows.
310
+		 * @deprecated Use `gravityview/template/table/body/after`
311
+		 * @since 1.0.7
312
+		 * @param \GravityView_View $gravityview_view Current GravityView_View object.
313
+		 */
314 314
 		do_action( 'gravityview_table_body_after', \GravityView_View::getInstance() /** ugh! */ );
315 315
 	}
316 316
 
Please login to merge, or discard this patch.
includes/class-common.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -305,12 +305,12 @@  discard block
 block discarded – undo
305 305
 						}
306 306
 
307 307
 						/**
308
-                         * @hack
309
-                         * In case of email/email confirmation, the input for email has the same id as the parent field
310
-                         */
308
+						 * @hack
309
+						 * In case of email/email confirmation, the input for email has the same id as the parent field
310
+						 */
311 311
 						if( 'email' === $field['type'] && false === strpos( $input['id'], '.' ) ) {
312
-                            continue;
313
-                        }
312
+							continue;
313
+						}
314 314
 						$fields["{$input['id']}"] = array(
315 315
 							'label' => \GV\Utils::get( $input, 'label' ),
316 316
 							'customLabel' => \GV\Utils::get( $input, 'customLabel' ),
@@ -1349,7 +1349,7 @@  discard block
 block discarded – undo
1349 1349
 			),
1350 1350
 		);
1351 1351
 
1352
-        $fields = $date_created + $fields;
1352
+		$fields = $date_created + $fields;
1353 1353
 
1354 1354
 		$blacklist_field_types = apply_filters( 'gravityview_blacklist_field_types', $blacklist, NULL );
1355 1355
 
@@ -1361,13 +1361,13 @@  discard block
 block discarded – undo
1361 1361
 			}
1362 1362
 		}
1363 1363
 
1364
-        /**
1365
-         * @filter `gravityview/common/sortable_fields` Filter the sortable fields
1366
-         * @since 1.12
1367
-         * @param array $fields Sub-set of GF form fields that are sortable
1368
-         * @param int $formid The Gravity Forms form ID that the fields are from
1369
-         */
1370
-        $fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid );
1364
+		/**
1365
+		 * @filter `gravityview/common/sortable_fields` Filter the sortable fields
1366
+		 * @since 1.12
1367
+		 * @param array $fields Sub-set of GF form fields that are sortable
1368
+		 * @param int $formid The Gravity Forms form ID that the fields are from
1369
+		 */
1370
+		$fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid );
1371 1371
 
1372 1372
 		return $fields;
1373 1373
 	}
@@ -1659,26 +1659,26 @@  discard block
 block discarded – undo
1659 1659
 	}
1660 1660
 
1661 1661
 
1662
-    /**
1663
-     * Display updated/error notice
1664
-     *
1665
-     * @since 1.19.2 Added $cap and $object_id parameters
1666
-     *
1667
-     * @param string $notice text/HTML of notice
1668
-     * @param string $class CSS class for notice (`updated` or `error`)
1669
-     * @param string $cap [Optional] Define a capability required to show a notice. If not set, displays to all caps.
1670
-     *
1671
-     * @return string
1672
-     */
1673
-    public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) {
1674
-
1675
-    	// If $cap is defined, only show notice if user has capability
1676
-    	if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) {
1677
-    		return '';
1678
-	    }
1679
-
1680
-        return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>';
1681
-    }
1662
+	/**
1663
+	 * Display updated/error notice
1664
+	 *
1665
+	 * @since 1.19.2 Added $cap and $object_id parameters
1666
+	 *
1667
+	 * @param string $notice text/HTML of notice
1668
+	 * @param string $class CSS class for notice (`updated` or `error`)
1669
+	 * @param string $cap [Optional] Define a capability required to show a notice. If not set, displays to all caps.
1670
+	 *
1671
+	 * @return string
1672
+	 */
1673
+	public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) {
1674
+
1675
+		// If $cap is defined, only show notice if user has capability
1676
+		if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) {
1677
+			return '';
1678
+		}
1679
+
1680
+		return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>';
1681
+	}
1682 1682
 
1683 1683
 	/**
1684 1684
 	 * Inspired on \GFCommon::encode_shortcodes, reverse the encoding by replacing the ascii characters by the shortcode brackets
Please login to merge, or discard this patch.