Completed
Push — master ( 7ba298...2ce894 )
by Zack
38:21 queued 18:44
created
includes/class-admin-views.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -62,28 +62,28 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	/**
65
-     * When on the Add/Edit View screen, suggest most popular articles related to that
66
-     *
65
+	 * When on the Add/Edit View screen, suggest most popular articles related to that
66
+	 *
67 67
 	 * @param array $localization_data Data to be passed to the Support Port JS
68 68
 	 *
69 69
 	 * @return array
70 70
 	 */
71 71
 	function suggest_support_articles( $localization_data = array() ) {
72 72
 
73
-	    if( ! gravityview()->request->is_view() ) {
74
-	        return $localization_data;
75
-        }
73
+		if( ! gravityview()->request->is_view() ) {
74
+			return $localization_data;
75
+		}
76 76
 
77 77
 		$localization_data['suggest'] = array(
78
-            '57ef23539033602e61d4a560',
79
-            '54c67bb9e4b0512429885513',
80
-            '54c67bb9e4b0512429885512',
81
-            '54c67bbbe4b07997ea3f3f6b',
82
-            '54d1a33ae4b086c0c0964ce9',
83
-            '57ef253c9033602e61d4a563',
84
-            '552355bfe4b0221aadf2572b',
85
-            '54c67bcde4b051242988553e',
86
-        );
78
+			'57ef23539033602e61d4a560',
79
+			'54c67bb9e4b0512429885513',
80
+			'54c67bb9e4b0512429885512',
81
+			'54c67bbbe4b07997ea3f3f6b',
82
+			'54d1a33ae4b086c0c0964ce9',
83
+			'57ef253c9033602e61d4a563',
84
+			'552355bfe4b0221aadf2572b',
85
+			'54c67bcde4b051242988553e',
86
+		);
87 87
 
88 88
 		return $localization_data;
89 89
 	}
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
 		if( empty( $connected_views ) ) {
169 169
 
170
-		    $menu_items['gravityview'] = array(
170
+			$menu_items['gravityview'] = array(
171 171
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
172 172
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
173 173
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
 		// If there were no items added, then let's create the parent menu
199 199
 		if( $sub_menu_items ) {
200 200
 
201
-		    $sub_menu_items[] = array(
202
-			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
203
-                'link_class' => 'gv-create-view',
204
-			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
205
-			    'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
206
-			    'capabilities'   => array( 'edit_gravityviews' ),
207
-            );
201
+			$sub_menu_items[] = array(
202
+				'label' => esc_attr__( 'Create a View', 'gravityview' ),
203
+				'link_class' => 'gv-create-view',
204
+				'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
205
+				'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
206
+				'capabilities'   => array( 'edit_gravityviews' ),
207
+			);
208 208
 
209 209
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
210 210
 			$sub_menu_items[] = array(
@@ -587,12 +587,12 @@  discard block
 block discarded – undo
587 587
 	 * Render html for displaying available fields based on a Form ID
588 588
 	 * $blacklist_field_types - contains the field types which are not proper to be shown in a directory.
589 589
 	 *
590
-     * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
590
+	 * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
591 591
 	 * @access public
592
-     *
592
+	 *
593 593
 	 * @param int $form Gravity Forms Form ID (default: '')
594 594
 	 * @param string $context (default: 'single')
595
-     *
595
+	 *
596 596
 	 * @return void
597 597
 	 */
598 598
 	function render_available_fields( $form = 0, $context = 'single' ) {
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
 		if ( ! is_array( $blacklist_field_types ) ) {
608 608
 
609
-		    gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
609
+			gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
610 610
 
611 611
 			$blacklist_field_types = array();
612 612
 		}
@@ -738,12 +738,12 @@  discard block
 block discarded – undo
738 738
 				/**
739 739
 				 * @since 1.7.2
740 740
 				 */
741
-			    'other_entries' => array(
742
-				    'label'	=> __('Other Entries', 'gravityview'),
743
-				    'type'	=> 'other_entries',
744
-				    'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
745
-			    ),
746
-	        );
741
+				'other_entries' => array(
742
+					'label'	=> __('Other Entries', 'gravityview'),
743
+					'type'	=> 'other_entries',
744
+					'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
745
+				),
746
+			);
747 747
 
748 748
 			if( 'single' !== $zone) {
749 749
 
@@ -1084,59 +1084,59 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
 		// Don't process any scripts below here if it's not a GravityView page.
1086 1086
 		if( ! gravityview_is_admin_page( $hook, 'single' ) && ! $is_widgets_page ) {
1087
-		    return;
1087
+			return;
1088 1088
 		}
1089 1089
 
1090
-        wp_enqueue_script( 'jquery-ui-datepicker' );
1091
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1092
-
1093
-        $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1094
-
1095
-        //enqueue scripts
1096
-        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 );
1097
-
1098
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1099
-            'cookiepath' => COOKIEPATH,
1100
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1101
-            'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1102
-            'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1103
-            'label_close' => __( 'Close', 'gravityview' ),
1104
-            'label_cancel' => __( 'Cancel', 'gravityview' ),
1105
-            'label_continue' => __( 'Continue', 'gravityview' ),
1106
-            'label_ok' => __( 'Ok', 'gravityview' ),
1107
-            'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1108
-            'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1109
-            'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1110
-            'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1111
-            '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' ),
1112
-        ));
1113
-
1114
-        wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1115
-
1116
-        // Enqueue scripts needed for merge tags
1117
-        self::enqueue_gravity_forms_scripts();
1090
+		wp_enqueue_script( 'jquery-ui-datepicker' );
1091
+		wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1092
+
1093
+		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1094
+
1095
+		//enqueue scripts
1096
+		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 );
1097
+
1098
+		wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1099
+			'cookiepath' => COOKIEPATH,
1100
+			'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1101
+			'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1102
+			'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1103
+			'label_close' => __( 'Close', 'gravityview' ),
1104
+			'label_cancel' => __( 'Cancel', 'gravityview' ),
1105
+			'label_continue' => __( 'Continue', 'gravityview' ),
1106
+			'label_ok' => __( 'Ok', 'gravityview' ),
1107
+			'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1108
+			'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1109
+			'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1110
+			'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1111
+			'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' ),
1112
+		));
1113
+
1114
+		wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1115
+
1116
+		// Enqueue scripts needed for merge tags
1117
+		self::enqueue_gravity_forms_scripts();
1118 1118
 	}
1119 1119
 
1120 1120
 	/**
1121 1121
 	 * Enqueue Gravity Forms scripts, needed for Merge Tags
1122
-     *
1123
-     * @since 1.0.5-beta
1124
-     *
1125
-     * @return void
1122
+	 *
1123
+	 * @since 1.0.5-beta
1124
+	 *
1125
+	 * @return void
1126 1126
 	 */
1127 1127
 	static function enqueue_gravity_forms_scripts() {
1128 1128
 		GFForms::register_scripts();
1129 1129
 
1130 1130
 		$scripts = array(
1131
-		    'sack',
1132
-		    'gform_gravityforms',
1133
-		    'gform_forms',
1134
-		    'gform_form_admin',
1135
-		    'jquery-ui-autocomplete'
1131
+			'sack',
1132
+			'gform_gravityforms',
1133
+			'gform_forms',
1134
+			'gform_form_admin',
1135
+			'jquery-ui-autocomplete'
1136 1136
 		);
1137 1137
 
1138 1138
 		if ( wp_is_mobile() ) {
1139
-		    $scripts[] = 'jquery-touch-punch';
1139
+			$scripts[] = 'jquery-touch-punch';
1140 1140
 		}
1141 1141
 
1142 1142
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.