Completed
Push — master ( 645aad...18187e )
by Zack
25:59 queued 08:23
created
includes/class-admin-views.php 1 patch
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -63,28 +63,28 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 
65 65
 	/**
66
-     * When on the Add/Edit View screen, suggest most popular articles related to that
67
-     *
66
+	 * When on the Add/Edit View screen, suggest most popular articles related to that
67
+	 *
68 68
 	 * @param array $localization_data Data to be passed to the Support Port JS
69 69
 	 *
70 70
 	 * @return array
71 71
 	 */
72 72
 	function suggest_support_articles( $localization_data = array() ) {
73 73
 
74
-	    if( ! gravityview()->request->is_view() ) {
75
-	        return $localization_data;
76
-        }
74
+		if( ! gravityview()->request->is_view() ) {
75
+			return $localization_data;
76
+		}
77 77
 
78 78
 		$localization_data['suggest'] = array(
79
-            '57ef23539033602e61d4a560',
80
-            '54c67bb9e4b0512429885513',
81
-            '54c67bb9e4b0512429885512',
82
-            '54c67bbbe4b07997ea3f3f6b',
83
-            '54d1a33ae4b086c0c0964ce9',
84
-            '57ef253c9033602e61d4a563',
85
-            '552355bfe4b0221aadf2572b',
86
-            '54c67bcde4b051242988553e',
87
-        );
79
+			'57ef23539033602e61d4a560',
80
+			'54c67bb9e4b0512429885513',
81
+			'54c67bb9e4b0512429885512',
82
+			'54c67bbbe4b07997ea3f3f6b',
83
+			'54d1a33ae4b086c0c0964ce9',
84
+			'57ef253c9033602e61d4a563',
85
+			'552355bfe4b0221aadf2572b',
86
+			'54c67bcde4b051242988553e',
87
+		);
88 88
 
89 89
 		return $localization_data;
90 90
 	}
@@ -175,11 +175,11 @@  discard block
 block discarded – undo
175 175
 
176 176
 		if( 'form_list' === GFForms::get_page() ) {
177 177
 			$priority = 790;
178
-        }
178
+		}
179 179
 
180 180
 		if( empty( $connected_views ) ) {
181 181
 
182
-		    $menu_items['gravityview'] = array(
182
+			$menu_items['gravityview'] = array(
183 183
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
184 184
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
185 185
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -210,13 +210,13 @@  discard block
 block discarded – undo
210 210
 		// If there were no items added, then let's create the parent menu
211 211
 		if( $sub_menu_items ) {
212 212
 
213
-		    $sub_menu_items[] = array(
214
-			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
215
-                'link_class' => 'gv-create-view',
216
-			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
217
-			    'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
218
-			    'capabilities'   => array( 'edit_gravityviews' ),
219
-            );
213
+			$sub_menu_items[] = array(
214
+				'label' => esc_attr__( 'Create a View', 'gravityview' ),
215
+				'link_class' => 'gv-create-view',
216
+				'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
217
+				'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
218
+				'capabilities'   => array( 'edit_gravityviews' ),
219
+			);
220 220
 
221 221
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
222 222
 			$sub_menu_items[] = array(
@@ -599,12 +599,12 @@  discard block
 block discarded – undo
599 599
 	 * Render html for displaying available fields based on a Form ID
600 600
 	 * $blacklist_field_types - contains the field types which are not proper to be shown in a directory.
601 601
 	 *
602
-     * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
602
+	 * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
603 603
 	 * @access public
604
-     *
604
+	 *
605 605
 	 * @param int $form Gravity Forms Form ID (default: '')
606 606
 	 * @param string $context (default: 'single')
607
-     *
607
+	 *
608 608
 	 * @return void
609 609
 	 */
610 610
 	function render_available_fields( $form = 0, $context = 'single' ) {
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 
619 619
 		if ( ! is_array( $blacklist_field_types ) ) {
620 620
 
621
-		    gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
621
+			gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
622 622
 
623 623
 			$blacklist_field_types = array();
624 624
 		}
@@ -750,12 +750,12 @@  discard block
 block discarded – undo
750 750
 				/**
751 751
 				 * @since 1.7.2
752 752
 				 */
753
-			    'other_entries' => array(
754
-				    'label'	=> __('Other Entries', 'gravityview'),
755
-				    'type'	=> 'other_entries',
756
-				    'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
757
-			    ),
758
-	        );
753
+				'other_entries' => array(
754
+					'label'	=> __('Other Entries', 'gravityview'),
755
+					'type'	=> 'other_entries',
756
+					'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
757
+				),
758
+			);
759 759
 
760 760
 			if( 'single' !== $zone) {
761 761
 
@@ -903,9 +903,9 @@  discard block
 block discarded – undo
903 903
 
904 904
 				$joined_forms = gravityview_get_joined_forms( $post->ID );
905 905
 
906
-                foreach ( $joined_forms as $form ) {
907
-                    $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone );
908
-                }
906
+				foreach ( $joined_forms as $form ) {
907
+					$available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone );
908
+				}
909 909
 			} else {
910 910
 				$available_items[ $form ] = \GV\Widget::registered();
911 911
 			}
@@ -935,9 +935,9 @@  discard block
 block discarded – undo
935 935
 
936 936
 										if ( $form_id ) {
937 937
 											$original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ;
938
-                                        } else {
938
+										} else {
939 939
 											$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
940
-                                        }
940
+										}
941 941
 
942 942
 										if ( !$original_item ) {
943 943
 											gravityview()->log->error( 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array(' data' => array('available_items' => $available_items, 'field' => $field ) ) );
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
 
991 991
 	/**
992 992
 	 * Render the widget active areas
993
-     * @param  string $template_id The current slug of the selected View template
993
+	 * @param  string $template_id The current slug of the selected View template
994 994
 	 * @param  string $zone    Either 'header' or 'footer'
995 995
 	 * @param  string $post_id Current Post ID (view)
996 996
 	 * @return string          html
@@ -1064,13 +1064,13 @@  discard block
 block discarded – undo
1064 1064
 	}
1065 1065
 
1066 1066
 	/**
1067
-     * Renders "Add Field" tooltips
1068
-     *
1069
-     * @since 2.0.11
1070
-     *
1067
+	 * Renders "Add Field" tooltips
1068
+	 *
1069
+	 * @since 2.0.11
1070
+	 *
1071 1071
 	 * @param string $context "directory", "single", or "edit"
1072
-     *
1073
-     * @return void
1072
+	 *
1073
+	 * @return void
1074 1074
 	 */
1075 1075
 	function render_field_pickers( $context = 'directory' ) {
1076 1076
 
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
             </div>
1098 1098
 			<?php
1099 1099
 		}
1100
-    }
1100
+	}
1101 1101
 
1102 1102
 	/**
1103 1103
 	 * Render the Template Active Areas and configured active fields for a given template id and post id
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 		$is_widgets_page = ( $pagenow === 'widgets.php' );
1164 1164
 
1165 1165
 		// Add the GV font (with the Astronaut)
1166
-        wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version );
1166
+		wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version );
1167 1167
 		wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version );
1168 1168
 
1169 1169
 		wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true );
@@ -1171,66 +1171,66 @@  discard block
 block discarded – undo
1171 1171
 		if( GFForms::get_page() === 'form_list' ) {
1172 1172
 			wp_enqueue_style( 'gravityview_views_styles' );
1173 1173
 			return;
1174
-        }
1174
+		}
1175 1175
 
1176 1176
 		// Don't process any scripts below here if it's not a GravityView page.
1177 1177
 		if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) {
1178
-		    return;
1178
+			return;
1179 1179
 		}
1180 1180
 
1181
-        wp_enqueue_script( 'jquery-ui-datepicker' );
1182
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version );
1183
-
1184
-        $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1185
-
1186
-        //enqueue scripts
1187
-        wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), \GV\Plugin::$version );
1188
-
1189
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1190
-            'cookiepath' => COOKIEPATH,
1191
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1192
-            'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1193
-            'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1194
-            'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ),
1195
-            'label_add_search_field' => __( 'Add Search Field', 'gravityview' ),
1196
-            'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ),
1197
-            'label_close' => __( 'Close', 'gravityview' ),
1198
-            'label_cancel' => __( 'Cancel', 'gravityview' ),
1199
-            'label_continue' => __( 'Continue', 'gravityview' ),
1200
-            'label_ok' => __( 'Ok', 'gravityview' ),
1201
-            'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1202
-            'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1203
-            'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1204
-            'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1205
-            'remove_all_fields' => __( 'Would you like to remove all fields in this zone? (You are seeing this message because you were holding down the ALT key)', 'gravityview' ),
1206
-        ));
1181
+		wp_enqueue_script( 'jquery-ui-datepicker' );
1182
+		wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version );
1183
+
1184
+		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1185
+
1186
+		//enqueue scripts
1187
+		wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), \GV\Plugin::$version );
1188
+
1189
+		wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1190
+			'cookiepath' => COOKIEPATH,
1191
+			'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1192
+			'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1193
+			'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1194
+			'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ),
1195
+			'label_add_search_field' => __( 'Add Search Field', 'gravityview' ),
1196
+			'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ),
1197
+			'label_close' => __( 'Close', 'gravityview' ),
1198
+			'label_cancel' => __( 'Cancel', 'gravityview' ),
1199
+			'label_continue' => __( 'Continue', 'gravityview' ),
1200
+			'label_ok' => __( 'Ok', 'gravityview' ),
1201
+			'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1202
+			'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1203
+			'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1204
+			'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1205
+			'remove_all_fields' => __( 'Would you like to remove all fields in this zone? (You are seeing this message because you were holding down the ALT key)', 'gravityview' ),
1206
+		));
1207 1207
 
1208 1208
 		wp_enqueue_style( 'gravityview_views_styles' );
1209 1209
 
1210
-        // Enqueue scripts needed for merge tags
1211
-        self::enqueue_gravity_forms_scripts();
1210
+		// Enqueue scripts needed for merge tags
1211
+		self::enqueue_gravity_forms_scripts();
1212 1212
 	}
1213 1213
 
1214 1214
 	/**
1215 1215
 	 * Enqueue Gravity Forms scripts, needed for Merge Tags
1216
-     *
1217
-     * @since 1.0.5-beta
1218
-     *
1219
-     * @return void
1216
+	 *
1217
+	 * @since 1.0.5-beta
1218
+	 *
1219
+	 * @return void
1220 1220
 	 */
1221 1221
 	static function enqueue_gravity_forms_scripts() {
1222 1222
 		GFForms::register_scripts();
1223 1223
 
1224 1224
 		$scripts = array(
1225
-		    'sack',
1226
-		    'gform_gravityforms',
1227
-		    'gform_forms',
1228
-		    'gform_form_admin',
1229
-		    'jquery-ui-autocomplete'
1225
+			'sack',
1226
+			'gform_gravityforms',
1227
+			'gform_forms',
1228
+			'gform_form_admin',
1229
+			'jquery-ui-autocomplete'
1230 1230
 		);
1231 1231
 
1232 1232
 		if ( wp_is_mobile() ) {
1233
-		    $scripts[] = 'jquery-touch-punch';
1233
+			$scripts[] = 'jquery-touch-punch';
1234 1234
 		}
1235 1235
 
1236 1236
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/view-configuration.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 
32 32
 			<?php
33 33
 
34
-                do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID );
34
+				do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID );
35 35
 
36
-    			do_action('gravityview_render_field_pickers', 'directory' );
36
+				do_action('gravityview_render_field_pickers', 'directory' );
37 37
 
38
-            ?>
38
+			?>
39 39
 
40 40
 			<?php // list of available widgets to be shown in the popup ?>
41 41
             <div id="directory-available-widgets" class="hide-if-js gv-tooltip">
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
 
61 61
 			<div id="single-active-fields" class="gv-grid">
62 62
 				<?php
63
-                if(!empty( $curr_template ) ) {
64
-				    do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true );
65
-                }
66
-			    ?>
63
+				if(!empty( $curr_template ) ) {
64
+					do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true );
65
+				}
66
+				?>
67 67
 			</div>
68 68
             <?php
69
-                do_action('gravityview_render_field_pickers', 'single' );
69
+				do_action('gravityview_render_field_pickers', 'single' );
70 70
 			?>
71 71
 		</div>
72 72
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			</div>
86 86
 
87 87
 			<?php
88
-			    do_action('gravityview_render_field_pickers', 'edit' );
88
+				do_action('gravityview_render_field_pickers', 'edit' );
89 89
 			?>
90 90
 
91 91
 		</div>
Please login to merge, or discard this patch.