Completed
Pull Request — master (#1141)
by
unknown
19:31 queued 15:17
created
includes/admin/metaboxes/views/view-configuration.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 
27 27
 			<?php
28 28
 
29
-                do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID );
29
+				do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID );
30 30
 
31
-    			do_action('gravityview_render_field_pickers', 'directory' );
31
+				do_action('gravityview_render_field_pickers', 'directory' );
32 32
 
33
-                do_action('gravityview_render_field_and_widget_options', 'directory' );
33
+				do_action('gravityview_render_field_and_widget_options', 'directory' );
34 34
 
35
-            ?>
35
+			?>
36 36
 
37 37
 			<?php // list of available widgets to be shown in the popup ?>
38 38
             <div id="directory-available-widgets" class="hide-if-js gv-tooltip">
@@ -57,16 +57,16 @@  discard block
 block discarded – undo
57 57
 
58 58
 			<div id="single-active-fields" class="gv-grid gv-grid-pad gv-grid-border">
59 59
 				<?php
60
-                if(!empty( $curr_template ) ) {
61
-				    do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true );
62
-                }
63
-			    ?>
60
+				if(!empty( $curr_template ) ) {
61
+					do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true );
62
+				}
63
+				?>
64 64
 			</div>
65 65
             <?php
66
-                do_action('gravityview_render_field_pickers', 'single' );
66
+				do_action('gravityview_render_field_pickers', 'single' );
67 67
 
68
-                do_action('gravityview_render_field_and_widget_options', 'single' );
69
-            ?>
68
+				do_action('gravityview_render_field_and_widget_options', 'single' );
69
+			?>
70 70
 		</div>
71 71
 
72 72
 	</div> <?php // end single view tab ?>
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 			</div>
85 85
 
86 86
 			<?php
87
-			    do_action('gravityview_render_field_pickers', 'edit' );
87
+				do_action('gravityview_render_field_pickers', 'edit' );
88 88
 
89
-			    do_action('gravityview_render_field_and_widget_options', 'edit' );
89
+				do_action('gravityview_render_field_and_widget_options', 'edit' );
90 90
 			?>
91 91
 
92 92
 		</div>
Please login to merge, or discard this patch.
includes/class-admin-views.php 1 patch
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -61,28 +61,28 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	/**
64
-     * When on the Add/Edit View screen, suggest most popular articles related to that
65
-     *
64
+	 * When on the Add/Edit View screen, suggest most popular articles related to that
65
+	 *
66 66
 	 * @param array $localization_data Data to be passed to the Support Port JS
67 67
 	 *
68 68
 	 * @return array
69 69
 	 */
70 70
 	function suggest_support_articles( $localization_data = array() ) {
71 71
 
72
-	    if( ! gravityview()->request->is_view() ) {
73
-	        return $localization_data;
74
-        }
72
+		if( ! gravityview()->request->is_view() ) {
73
+			return $localization_data;
74
+		}
75 75
 
76 76
 		$localization_data['suggest'] = array(
77
-            '57ef23539033602e61d4a560',
78
-            '54c67bb9e4b0512429885513',
79
-            '54c67bb9e4b0512429885512',
80
-            '54c67bbbe4b07997ea3f3f6b',
81
-            '54d1a33ae4b086c0c0964ce9',
82
-            '57ef253c9033602e61d4a563',
83
-            '552355bfe4b0221aadf2572b',
84
-            '54c67bcde4b051242988553e',
85
-        );
77
+			'57ef23539033602e61d4a560',
78
+			'54c67bb9e4b0512429885513',
79
+			'54c67bb9e4b0512429885512',
80
+			'54c67bbbe4b07997ea3f3f6b',
81
+			'54d1a33ae4b086c0c0964ce9',
82
+			'57ef253c9033602e61d4a563',
83
+			'552355bfe4b0221aadf2572b',
84
+			'54c67bcde4b051242988553e',
85
+		);
86 86
 
87 87
 		return $localization_data;
88 88
 	}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
 		if( empty( $connected_views ) ) {
168 168
 
169
-		    $menu_items['gravityview'] = array(
169
+			$menu_items['gravityview'] = array(
170 170
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
171 171
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
172 172
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 		// If there were no items added, then let's create the parent menu
198 198
 		if( $sub_menu_items ) {
199 199
 
200
-		    $sub_menu_items[] = array(
201
-			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
202
-                'link_class' => 'gv-create-view',
203
-			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
204
-			    'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
205
-			    'capabilities'   => array( 'edit_gravityviews' ),
206
-            );
200
+			$sub_menu_items[] = array(
201
+				'label' => esc_attr__( 'Create a View', 'gravityview' ),
202
+				'link_class' => 'gv-create-view',
203
+				'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
204
+				'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
205
+				'capabilities'   => array( 'edit_gravityviews' ),
206
+			);
207 207
 
208 208
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
209 209
 			$sub_menu_items[] = array(
@@ -586,12 +586,12 @@  discard block
 block discarded – undo
586 586
 	 * Render html for displaying available fields based on a Form ID
587 587
 	 * $blacklist_field_types - contains the field types which are not proper to be shown in a directory.
588 588
 	 *
589
-     * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
589
+	 * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
590 590
 	 * @access public
591
-     *
591
+	 *
592 592
 	 * @param int $form Gravity Forms Form ID (default: '')
593 593
 	 * @param string $context (default: 'single')
594
-     *
594
+	 *
595 595
 	 * @return void
596 596
 	 */
597 597
 	function render_available_fields( $form = 0, $context = 'single' ) {
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 
606 606
 		if ( ! is_array( $blacklist_field_types ) ) {
607 607
 
608
-		    gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
608
+			gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
609 609
 
610 610
 			$blacklist_field_types = array();
611 611
 		}
@@ -736,12 +736,12 @@  discard block
 block discarded – undo
736 736
 				/**
737 737
 				 * @since 1.7.2
738 738
 				 */
739
-			    'other_entries' => array(
740
-				    'label'	=> __('Other Entries', 'gravityview'),
741
-				    'type'	=> 'other_entries',
742
-				    'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
743
-			    ),
744
-	        );
739
+				'other_entries' => array(
740
+					'label'	=> __('Other Entries', 'gravityview'),
741
+					'type'	=> 'other_entries',
742
+					'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
743
+				),
744
+			);
745 745
 
746 746
 			if( 'single' !== $zone) {
747 747
 
@@ -874,9 +874,9 @@  discard block
 block discarded – undo
874 874
 
875 875
 				$joined_forms = gravityview_get_joined_forms( $post->ID );
876 876
 
877
-                foreach ( $joined_forms as $form ) {
878
-                    $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone );
879
-                }
877
+				foreach ( $joined_forms as $form ) {
878
+					$available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone );
879
+				}
880 880
 			} else {
881 881
 				$available_items[ $form ] = $this->get_registered_widgets();
882 882
 			}
@@ -905,9 +905,9 @@  discard block
 block discarded – undo
905 905
 
906 906
 										if ( $form_id ) {
907 907
 											$original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ;
908
-                                        } else {
908
+										} else {
909 909
 											$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
910
-                                        }
910
+										}
911 911
 
912 912
 										if ( !$original_item ) {
913 913
 											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,12 +995,12 @@  discard block
 block discarded – undo
995 995
 
996 996
 	function render_field_and_widget_options() {
997 997
 
998
-	    // render widgets templates
999
-	    $widgets = \GV\Widget::registered();
998
+		// render widgets templates
999
+		$widgets = \GV\Widget::registered();
1000 1000
 
1001
-	    foreach ($widgets as $widget_identifier => $data) {
1002
-		    echo GravityView_Render_Settings::render_field_and_widget_options( 'widget', $widget_identifier);
1003
-        }
1001
+		foreach ($widgets as $widget_identifier => $data) {
1002
+			echo GravityView_Render_Settings::render_field_and_widget_options( 'widget', $widget_identifier);
1003
+		}
1004 1004
 
1005 1005
 		// render fields templates
1006 1006
 		$forms = gravityview_get_forms( 'any' );
@@ -1018,13 +1018,13 @@  discard block
 block discarded – undo
1018 1018
 	}
1019 1019
 
1020 1020
 	/**
1021
-     * Renders "Add Field" tooltips
1022
-     *
1023
-     * @since 2.0.11
1024
-     *
1021
+	 * Renders "Add Field" tooltips
1022
+	 *
1023
+	 * @since 2.0.11
1024
+	 *
1025 1025
 	 * @param string $context "directory", "single", or "edit"
1026
-     *
1027
-     * @return void
1026
+	 *
1027
+	 * @return void
1028 1028
 	 */
1029 1029
 	function render_field_pickers( $context = 'directory' ) {
1030 1030
 
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
             </div>
1052 1052
 			<?php
1053 1053
 		}
1054
-    }
1054
+	}
1055 1055
 
1056 1056
 	/**
1057 1057
 	 * Render the Template Active Areas and configured active fields for a given template id and post id
@@ -1123,59 +1123,59 @@  discard block
 block discarded – undo
1123 1123
 
1124 1124
 		// Don't process any scripts below here if it's not a GravityView page.
1125 1125
 		if( ! gravityview_is_admin_page( $hook, 'single' ) && ! $is_widgets_page ) {
1126
-		    return;
1126
+			return;
1127 1127
 		}
1128 1128
 
1129
-        wp_enqueue_script( 'jquery-ui-datepicker' );
1130
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1131
-
1132
-        $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1133
-
1134
-        //enqueue scripts
1135
-        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 );
1136
-
1137
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1138
-            'cookiepath' => COOKIEPATH,
1139
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1140
-            'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1141
-            'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1142
-            'label_close' => __( 'Close', 'gravityview' ),
1143
-            'label_cancel' => __( 'Cancel', 'gravityview' ),
1144
-            'label_continue' => __( 'Continue', 'gravityview' ),
1145
-            'label_ok' => __( 'Ok', 'gravityview' ),
1146
-            'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1147
-            'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1148
-            'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1149
-            'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1150
-            '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' ),
1151
-        ));
1152
-
1153
-        wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1154
-
1155
-        // Enqueue scripts needed for merge tags
1156
-        self::enqueue_gravity_forms_scripts();
1129
+		wp_enqueue_script( 'jquery-ui-datepicker' );
1130
+		wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1131
+
1132
+		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1133
+
1134
+		//enqueue scripts
1135
+		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 );
1136
+
1137
+		wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1138
+			'cookiepath' => COOKIEPATH,
1139
+			'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1140
+			'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1141
+			'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1142
+			'label_close' => __( 'Close', 'gravityview' ),
1143
+			'label_cancel' => __( 'Cancel', 'gravityview' ),
1144
+			'label_continue' => __( 'Continue', 'gravityview' ),
1145
+			'label_ok' => __( 'Ok', 'gravityview' ),
1146
+			'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1147
+			'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1148
+			'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1149
+			'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1150
+			'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' ),
1151
+		));
1152
+
1153
+		wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1154
+
1155
+		// Enqueue scripts needed for merge tags
1156
+		self::enqueue_gravity_forms_scripts();
1157 1157
 	}
1158 1158
 
1159 1159
 	/**
1160 1160
 	 * Enqueue Gravity Forms scripts, needed for Merge Tags
1161
-     *
1162
-     * @since 1.0.5-beta
1163
-     *
1164
-     * @return void
1161
+	 *
1162
+	 * @since 1.0.5-beta
1163
+	 *
1164
+	 * @return void
1165 1165
 	 */
1166 1166
 	static function enqueue_gravity_forms_scripts() {
1167 1167
 		GFForms::register_scripts();
1168 1168
 
1169 1169
 		$scripts = array(
1170
-		    'sack',
1171
-		    'gform_gravityforms',
1172
-		    'gform_forms',
1173
-		    'gform_form_admin',
1174
-		    'jquery-ui-autocomplete'
1170
+			'sack',
1171
+			'gform_gravityforms',
1172
+			'gform_forms',
1173
+			'gform_form_admin',
1174
+			'jquery-ui-autocomplete'
1175 1175
 		);
1176 1176
 
1177 1177
 		if ( wp_is_mobile() ) {
1178
-		    $scripts[] = 'jquery-touch-punch';
1178
+			$scripts[] = 'jquery-touch-punch';
1179 1179
 		}
1180 1180
 
1181 1181
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.