@@ -62,28 +62,28 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | |
@@ -909,9 +909,9 @@ discard block |
||
909 | 909 | |
910 | 910 | if ($form_id) { |
911 | 911 | $original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ; |
912 | - } else { |
|
912 | + } else { |
|
913 | 913 | $original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ; |
914 | - } |
|
914 | + } |
|
915 | 915 | |
916 | 916 | if( !$original_item ) { |
917 | 917 | 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 ) ) ); |
@@ -1062,59 +1062,59 @@ discard block |
||
1062 | 1062 | |
1063 | 1063 | // Don't process any scripts below here if it's not a GravityView page. |
1064 | 1064 | if( ! gravityview_is_admin_page( $hook, 'single' ) && ! $is_widgets_page ) { |
1065 | - return; |
|
1065 | + return; |
|
1066 | 1066 | } |
1067 | 1067 | |
1068 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
1069 | - wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version ); |
|
1070 | - |
|
1071 | - $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
1072 | - |
|
1073 | - //enqueue scripts |
|
1074 | - 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 ); |
|
1075 | - |
|
1076 | - wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
1077 | - 'cookiepath' => COOKIEPATH, |
|
1078 | - 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
1079 | - 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
1080 | - 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
1081 | - 'label_close' => __( 'Close', 'gravityview' ), |
|
1082 | - 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
1083 | - 'label_continue' => __( 'Continue', 'gravityview' ), |
|
1084 | - 'label_ok' => __( 'Ok', 'gravityview' ), |
|
1085 | - 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
1086 | - 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
1087 | - 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
1088 | - 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
1089 | - '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' ), |
|
1090 | - )); |
|
1091 | - |
|
1092 | - wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version ); |
|
1093 | - |
|
1094 | - // Enqueue scripts needed for merge tags |
|
1095 | - self::enqueue_gravity_forms_scripts(); |
|
1068 | + wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
1069 | + wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version ); |
|
1070 | + |
|
1071 | + $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
1072 | + |
|
1073 | + //enqueue scripts |
|
1074 | + 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 ); |
|
1075 | + |
|
1076 | + wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
1077 | + 'cookiepath' => COOKIEPATH, |
|
1078 | + 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
1079 | + 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
1080 | + 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
1081 | + 'label_close' => __( 'Close', 'gravityview' ), |
|
1082 | + 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
1083 | + 'label_continue' => __( 'Continue', 'gravityview' ), |
|
1084 | + 'label_ok' => __( 'Ok', 'gravityview' ), |
|
1085 | + 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
1086 | + 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
1087 | + 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
1088 | + 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
1089 | + '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' ), |
|
1090 | + )); |
|
1091 | + |
|
1092 | + wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version ); |
|
1093 | + |
|
1094 | + // Enqueue scripts needed for merge tags |
|
1095 | + self::enqueue_gravity_forms_scripts(); |
|
1096 | 1096 | } |
1097 | 1097 | |
1098 | 1098 | /** |
1099 | 1099 | * Enqueue Gravity Forms scripts, needed for Merge Tags |
1100 | - * |
|
1101 | - * @since 1.0.5-beta |
|
1102 | - * |
|
1103 | - * @return void |
|
1100 | + * |
|
1101 | + * @since 1.0.5-beta |
|
1102 | + * |
|
1103 | + * @return void |
|
1104 | 1104 | */ |
1105 | 1105 | static function enqueue_gravity_forms_scripts() { |
1106 | 1106 | GFForms::register_scripts(); |
1107 | 1107 | |
1108 | 1108 | $scripts = array( |
1109 | - 'sack', |
|
1110 | - 'gform_gravityforms', |
|
1111 | - 'gform_forms', |
|
1112 | - 'gform_form_admin', |
|
1113 | - 'jquery-ui-autocomplete' |
|
1109 | + 'sack', |
|
1110 | + 'gform_gravityforms', |
|
1111 | + 'gform_forms', |
|
1112 | + 'gform_form_admin', |
|
1113 | + 'jquery-ui-autocomplete' |
|
1114 | 1114 | ); |
1115 | 1115 | |
1116 | 1116 | if ( wp_is_mobile() ) { |
1117 | - $scripts[] = 'jquery-touch-punch'; |
|
1117 | + $scripts[] = 'jquery-touch-punch'; |
|
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | wp_enqueue_script( $scripts ); |