Completed
Push — develop ( c5be34...cc17e8 )
by Zack
17:04
created
includes/class-admin-views.php 1 patch
Indentation   +83 added lines, -83 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
 	}
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
 		if( empty( $connected_views ) ) {
170 170
 
171
-		    $menu_items['gravityview'] = array(
171
+			$menu_items['gravityview'] = array(
172 172
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
173 173
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
174 174
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
 		// If there were no items added, then let's create the parent menu
200 200
 		if( $sub_menu_items ) {
201 201
 
202
-		    $sub_menu_items[] = array(
203
-			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
204
-                'link_class' => 'gv-create-view',
205
-			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
206
-			    'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
207
-			    'capabilities'   => array( 'edit_gravityviews' ),
208
-            );
202
+			$sub_menu_items[] = array(
203
+				'label' => esc_attr__( 'Create a View', 'gravityview' ),
204
+				'link_class' => 'gv-create-view',
205
+				'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
206
+				'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
207
+				'capabilities'   => array( 'edit_gravityviews' ),
208
+			);
209 209
 
210 210
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
211 211
 			$sub_menu_items[] = array(
@@ -590,12 +590,12 @@  discard block
 block discarded – undo
590 590
 	 * Render html for displaying available fields based on a Form ID
591 591
 	 * $blacklist_field_types - contains the field types which are not proper to be shown in a directory.
592 592
 	 *
593
-     * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
593
+	 * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
594 594
 	 * @access public
595
-     *
595
+	 *
596 596
 	 * @param int $form Gravity Forms Form ID (default: '')
597 597
 	 * @param string $context (default: 'single')
598
-     *
598
+	 *
599 599
 	 * @return void
600 600
 	 */
601 601
 	function render_available_fields( $form = 0, $context = 'single' ) {
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 
610 610
 		if ( ! is_array( $blacklist_field_types ) ) {
611 611
 
612
-		    gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
612
+			gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
613 613
 
614 614
 			$blacklist_field_types = array();
615 615
 		}
@@ -741,12 +741,12 @@  discard block
 block discarded – undo
741 741
 				/**
742 742
 				 * @since 1.7.2
743 743
 				 */
744
-			    'other_entries' => array(
745
-				    'label'	=> __('Other Entries', 'gravityview'),
746
-				    'type'	=> 'other_entries',
747
-				    'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
748
-			    ),
749
-	        );
744
+				'other_entries' => array(
745
+					'label'	=> __('Other Entries', 'gravityview'),
746
+					'type'	=> 'other_entries',
747
+					'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
748
+				),
749
+			);
750 750
 
751 751
 			if( 'single' !== $zone) {
752 752
 
@@ -879,9 +879,9 @@  discard block
 block discarded – undo
879 879
 
880 880
 				$joined_forms = gravityview_get_joined_forms( $post->ID );
881 881
 
882
-                foreach ( $joined_forms as $form ) {
883
-                    $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone );
884
-                }
882
+				foreach ( $joined_forms as $form ) {
883
+					$available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone );
884
+				}
885 885
 			} else {
886 886
 				$available_items[ $form ] = $this->get_registered_widgets();
887 887
 			}
@@ -911,9 +911,9 @@  discard block
 block discarded – undo
911 911
 
912 912
 										if ( $form_id ) {
913 913
 											$original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ;
914
-                                        } else {
914
+										} else {
915 915
 											$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
916
-                                        }
916
+										}
917 917
 
918 918
 										if ( !$original_item ) {
919 919
 											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 ) ) );
@@ -995,13 +995,13 @@  discard block
 block discarded – undo
995 995
 	}
996 996
 
997 997
 	/**
998
-     * Renders "Add Field" tooltips
999
-     *
1000
-     * @since 2.0.11
1001
-     *
998
+	 * Renders "Add Field" tooltips
999
+	 *
1000
+	 * @since 2.0.11
1001
+	 *
1002 1002
 	 * @param string $context "directory", "single", or "edit"
1003
-     *
1004
-     * @return void
1003
+	 *
1004
+	 * @return void
1005 1005
 	 */
1006 1006
 	function render_field_pickers( $context = 'directory' ) {
1007 1007
 
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
             </div>
1029 1029
 			<?php
1030 1030
 		}
1031
-    }
1031
+	}
1032 1032
 
1033 1033
 	/**
1034 1034
 	 * Render the Template Active Areas and configured active fields for a given template id and post id
@@ -1100,59 +1100,59 @@  discard block
 block discarded – undo
1100 1100
 
1101 1101
 		// Don't process any scripts below here if it's not a GravityView page.
1102 1102
 		if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) {
1103
-		    return;
1103
+			return;
1104 1104
 		}
1105 1105
 
1106
-        wp_enqueue_script( 'jquery-ui-datepicker' );
1107
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1108
-
1109
-        $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1110
-
1111
-        //enqueue scripts
1112
-        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' ), GravityView_Plugin::version );
1113
-
1114
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1115
-            'cookiepath' => COOKIEPATH,
1116
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1117
-            'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1118
-            'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1119
-            'label_close' => __( 'Close', 'gravityview' ),
1120
-            'label_cancel' => __( 'Cancel', 'gravityview' ),
1121
-            'label_continue' => __( 'Continue', 'gravityview' ),
1122
-            'label_ok' => __( 'Ok', 'gravityview' ),
1123
-            'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1124
-            'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1125
-            'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1126
-            'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1127
-            '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' ),
1128
-        ));
1129
-
1130
-        wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1131
-
1132
-        // Enqueue scripts needed for merge tags
1133
-        self::enqueue_gravity_forms_scripts();
1106
+		wp_enqueue_script( 'jquery-ui-datepicker' );
1107
+		wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1108
+
1109
+		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1110
+
1111
+		//enqueue scripts
1112
+		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' ), GravityView_Plugin::version );
1113
+
1114
+		wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1115
+			'cookiepath' => COOKIEPATH,
1116
+			'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1117
+			'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1118
+			'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1119
+			'label_close' => __( 'Close', 'gravityview' ),
1120
+			'label_cancel' => __( 'Cancel', 'gravityview' ),
1121
+			'label_continue' => __( 'Continue', 'gravityview' ),
1122
+			'label_ok' => __( 'Ok', 'gravityview' ),
1123
+			'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1124
+			'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1125
+			'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1126
+			'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1127
+			'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' ),
1128
+		));
1129
+
1130
+		wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1131
+
1132
+		// Enqueue scripts needed for merge tags
1133
+		self::enqueue_gravity_forms_scripts();
1134 1134
 	}
1135 1135
 
1136 1136
 	/**
1137 1137
 	 * Enqueue Gravity Forms scripts, needed for Merge Tags
1138
-     *
1139
-     * @since 1.0.5-beta
1140
-     *
1141
-     * @return void
1138
+	 *
1139
+	 * @since 1.0.5-beta
1140
+	 *
1141
+	 * @return void
1142 1142
 	 */
1143 1143
 	static function enqueue_gravity_forms_scripts() {
1144 1144
 		GFForms::register_scripts();
1145 1145
 
1146 1146
 		$scripts = array(
1147
-		    'sack',
1148
-		    'gform_gravityforms',
1149
-		    'gform_forms',
1150
-		    'gform_form_admin',
1151
-		    'jquery-ui-autocomplete'
1147
+			'sack',
1148
+			'gform_gravityforms',
1149
+			'gform_forms',
1150
+			'gform_form_admin',
1151
+			'jquery-ui-autocomplete'
1152 1152
 		);
1153 1153
 
1154 1154
 		if ( wp_is_mobile() ) {
1155
-		    $scripts[] = 'jquery-touch-punch';
1155
+			$scripts[] = 'jquery-touch-punch';
1156 1156
 		}
1157 1157
 
1158 1158
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.