Completed
Pull Request — develop (#1409)
by
unknown
06:30
created
includes/class-admin-views.php 1 patch
Indentation   +80 added lines, -80 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
 			}
@@ -933,9 +933,9 @@  discard block
 block discarded – undo
933 933
 
934 934
 										if ( $form_id ) {
935 935
 											$original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ;
936
-                                        } else {
936
+										} else {
937 937
 											$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
938
-                                        }
938
+										}
939 939
 
940 940
 										if ( !$original_item ) {
941 941
 											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 ) ) );
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 
988 988
 	/**
989 989
 	 * Render the widget active areas
990
-     * @param  string $template_id The current slug of the selected View template
990
+	 * @param  string $template_id The current slug of the selected View template
991 991
 	 * @param  string $zone    Either 'header' or 'footer'
992 992
 	 * @param  string $post_id Current Post ID (view)
993 993
 	 * @return string          html
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
 		$is_widgets_page = ( $pagenow === 'widgets.php' );
1169 1169
 
1170 1170
 		// Add the GV font (with the Astronaut)
1171
-        wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version );
1171
+		wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version );
1172 1172
 		wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version );
1173 1173
 
1174 1174
 		wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true );
@@ -1176,66 +1176,66 @@  discard block
 block discarded – undo
1176 1176
 		if( GFForms::get_page() === 'form_list' ) {
1177 1177
 			wp_enqueue_style( 'gravityview_views_styles' );
1178 1178
 			return;
1179
-        }
1179
+		}
1180 1180
 
1181 1181
 		// Don't process any scripts below here if it's not a GravityView page.
1182 1182
 		if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) {
1183
-		    return;
1183
+			return;
1184 1184
 		}
1185 1185
 
1186
-        wp_enqueue_script( 'jquery-ui-datepicker' );
1187
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version );
1188
-
1189
-        $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1190
-
1191
-        //enqueue scripts
1192
-        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 );
1193
-
1194
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1195
-            'cookiepath' => COOKIEPATH,
1196
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1197
-            'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1198
-            'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1199
-            'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ),
1200
-            'label_add_search_field' => __( 'Add Search Field', 'gravityview' ),
1201
-            'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ),
1202
-            'label_close' => __( 'Close', 'gravityview' ),
1203
-            'label_cancel' => __( 'Cancel', 'gravityview' ),
1204
-            'label_continue' => __( 'Continue', 'gravityview' ),
1205
-            'label_ok' => __( 'Ok', 'gravityview' ),
1206
-            'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1207
-            'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1208
-            'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1209
-            'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1210
-            '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' ),
1211
-        ));
1186
+		wp_enqueue_script( 'jquery-ui-datepicker' );
1187
+		wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version );
1188
+
1189
+		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1190
+
1191
+		//enqueue scripts
1192
+		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 );
1193
+
1194
+		wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1195
+			'cookiepath' => COOKIEPATH,
1196
+			'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1197
+			'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1198
+			'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1199
+			'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ),
1200
+			'label_add_search_field' => __( 'Add Search Field', 'gravityview' ),
1201
+			'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ),
1202
+			'label_close' => __( 'Close', 'gravityview' ),
1203
+			'label_cancel' => __( 'Cancel', 'gravityview' ),
1204
+			'label_continue' => __( 'Continue', 'gravityview' ),
1205
+			'label_ok' => __( 'Ok', 'gravityview' ),
1206
+			'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1207
+			'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1208
+			'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1209
+			'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1210
+			'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' ),
1211
+		));
1212 1212
 
1213 1213
 		wp_enqueue_style( 'gravityview_views_styles' );
1214 1214
 
1215
-        // Enqueue scripts needed for merge tags
1216
-        self::enqueue_gravity_forms_scripts();
1215
+		// Enqueue scripts needed for merge tags
1216
+		self::enqueue_gravity_forms_scripts();
1217 1217
 	}
1218 1218
 
1219 1219
 	/**
1220 1220
 	 * Enqueue Gravity Forms scripts, needed for Merge Tags
1221
-     *
1222
-     * @since 1.0.5-beta
1223
-     *
1224
-     * @return void
1221
+	 *
1222
+	 * @since 1.0.5-beta
1223
+	 *
1224
+	 * @return void
1225 1225
 	 */
1226 1226
 	static function enqueue_gravity_forms_scripts() {
1227 1227
 		GFForms::register_scripts();
1228 1228
 
1229 1229
 		$scripts = array(
1230
-		    'sack',
1231
-		    'gform_gravityforms',
1232
-		    'gform_forms',
1233
-		    'gform_form_admin',
1234
-		    'jquery-ui-autocomplete'
1230
+			'sack',
1231
+			'gform_gravityforms',
1232
+			'gform_forms',
1233
+			'gform_form_admin',
1234
+			'jquery-ui-autocomplete'
1235 1235
 		);
1236 1236
 
1237 1237
 		if ( wp_is_mobile() ) {
1238
-		    $scripts[] = 'jquery-touch-punch';
1238
+			$scripts[] = 'jquery-touch-punch';
1239 1239
 		}
1240 1240
 
1241 1241
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.