@@ -10,42 +10,42 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | if ( ! defined( 'WPINC' ) ) { |
13 | - die; |
|
13 | + die; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | |
17 | 17 | class GravityView_Edit_Entry_Admin { |
18 | 18 | |
19 | - protected $loader; |
|
19 | + protected $loader; |
|
20 | 20 | |
21 | - function __construct( GravityView_Edit_Entry $loader ) { |
|
22 | - $this->loader = $loader; |
|
23 | - } |
|
21 | + function __construct( GravityView_Edit_Entry $loader ) { |
|
22 | + $this->loader = $loader; |
|
23 | + } |
|
24 | 24 | |
25 | - function load() { |
|
25 | + function load() { |
|
26 | 26 | |
27 | - if( !is_admin() ) { |
|
28 | - return; |
|
29 | - } |
|
27 | + if( !is_admin() ) { |
|
28 | + return; |
|
29 | + } |
|
30 | 30 | |
31 | - // Add Edit Link as a default field, outside those set in the Gravity Form form |
|
32 | - add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field' ), 10, 3 ); |
|
31 | + // Add Edit Link as a default field, outside those set in the Gravity Form form |
|
32 | + add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field' ), 10, 3 ); |
|
33 | 33 | |
34 | - // For the Edit Entry Link, you don't want visible to all users. |
|
35 | - add_filter( 'gravityview_field_visibility_caps', array( $this, 'modify_visibility_caps' ), 10, 5 ); |
|
34 | + // For the Edit Entry Link, you don't want visible to all users. |
|
35 | + add_filter( 'gravityview_field_visibility_caps', array( $this, 'modify_visibility_caps' ), 10, 5 ); |
|
36 | 36 | |
37 | - // Modify the field options based on the name of the field type |
|
38 | - add_filter( 'gravityview_template_edit_link_options', array( $this, 'edit_link_field_options' ), 10, 5 ); |
|
37 | + // Modify the field options based on the name of the field type |
|
38 | + add_filter( 'gravityview_template_edit_link_options', array( $this, 'edit_link_field_options' ), 10, 5 ); |
|
39 | 39 | |
40 | - // add tooltips |
|
41 | - add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips') ); |
|
40 | + // add tooltips |
|
41 | + add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips') ); |
|
42 | 42 | |
43 | - // custom fields' options for zone EDIT |
|
44 | - add_filter( 'gravityview_template_field_options', array( $this, 'field_options' ), 10, 6 ); |
|
43 | + // custom fields' options for zone EDIT |
|
44 | + add_filter( 'gravityview_template_field_options', array( $this, 'field_options' ), 10, 6 ); |
|
45 | 45 | |
46 | - // Add Edit Entry settings to View Settings |
|
47 | - add_action( 'gravityview/metaboxes/edit_entry', array( $this, 'view_settings_metabox' ) ); |
|
48 | - } |
|
46 | + // Add Edit Entry settings to View Settings |
|
47 | + add_action( 'gravityview/metaboxes/edit_entry', array( $this, 'view_settings_metabox' ) ); |
|
48 | + } |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Render Edit Entry View metabox settings |
@@ -69,100 +69,100 @@ discard block |
||
69 | 69 | GravityView_Render_Settings::render_setting_row( 'edit_redirect_url', $current_settings ); |
70 | 70 | } |
71 | 71 | |
72 | - /** |
|
73 | - * Add Edit Link as a default field, outside those set in the Gravity Form form |
|
74 | - * @param array $entry_default_fields Existing fields |
|
75 | - * @param string|array $form form_ID or form object |
|
76 | - * @param string $zone Either 'single', 'directory', 'header', 'footer' |
|
77 | - */ |
|
78 | - function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) { |
|
79 | - |
|
80 | - if( $zone !== 'edit' ) { |
|
81 | - |
|
82 | - $entry_default_fields['edit_link'] = array( |
|
83 | - 'label' => __('Edit Entry', 'gravityview'), |
|
84 | - 'type' => 'edit_link', |
|
85 | - 'desc' => __('A link to edit the entry. Visible based on View settings.', 'gravityview'), |
|
86 | - ); |
|
87 | - |
|
88 | - } |
|
89 | - |
|
90 | - return $entry_default_fields; |
|
91 | - } |
|
92 | - |
|
93 | - /** |
|
94 | - * Change wording for the Edit context to read Entry Creator |
|
95 | - * |
|
96 | - * @param array $visibility_caps Array of capabilities to display in field dropdown. |
|
97 | - * @param string $field_type Type of field options to render (`field` or `widget`) |
|
98 | - * @param string $template_id Table slug |
|
99 | - * @param float $field_id GF Field ID - Example: `3`, `5.2`, `entry_link`, `created_by` |
|
100 | - * @param string $context What context are we in? Example: `single` or `directory` |
|
101 | - * @param string $input_type (textarea, list, select, etc.) |
|
102 | - * @return array Array of field options with `label`, `value`, `type`, `default` keys |
|
103 | - */ |
|
104 | - function modify_visibility_caps( $visibility_caps = array(), $template_id = '', $field_id = '', $context = '', $input_type = '' ) { |
|
105 | - |
|
106 | - $caps = $visibility_caps; |
|
107 | - |
|
108 | - // If we're configuring fields in the edit context, we want a limited selection |
|
109 | - if( $context === 'edit' ) { |
|
110 | - |
|
111 | - // Remove other built-in caps. |
|
112 | - unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] ); |
|
113 | - |
|
114 | - $caps['read'] = _x('Entry Creator','User capability', 'gravityview'); |
|
115 | - } |
|
116 | - |
|
117 | - return $caps; |
|
118 | - } |
|
119 | - |
|
120 | - /** |
|
121 | - * Add "Edit Link Text" setting to the edit_link field settings |
|
122 | - * |
|
123 | - * @param array $field_options |
|
124 | - * @param string $template_id |
|
125 | - * @param string $field_id |
|
126 | - * @param string $context |
|
127 | - * @param string $input_type |
|
128 | - * |
|
129 | - * @return array $field_options, with "Edit Link Text" field option |
|
130 | - */ |
|
131 | - function edit_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
132 | - |
|
133 | - // Always a link, never a filter |
|
134 | - unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
|
135 | - |
|
136 | - // Edit Entry link should only appear to visitors capable of editing entries |
|
137 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
138 | - |
|
139 | - $add_option['edit_link'] = array( |
|
140 | - 'type' => 'text', |
|
141 | - 'label' => __( 'Edit Link Text', 'gravityview' ), |
|
142 | - 'desc' => NULL, |
|
143 | - 'value' => __('Edit Entry', 'gravityview'), |
|
144 | - 'merge_tags' => true, |
|
145 | - ); |
|
146 | - |
|
147 | - return array_merge( $add_option, $field_options ); |
|
148 | - } |
|
149 | - |
|
150 | - /** |
|
151 | - * Add tooltips |
|
152 | - * @param array $tooltips Existing tooltips |
|
153 | - * @return array Modified tooltips |
|
154 | - */ |
|
155 | - function tooltips( $tooltips ) { |
|
156 | - |
|
157 | - $return = $tooltips; |
|
158 | - |
|
159 | - $return['allow_edit_cap'] = array( |
|
160 | - 'title' => __('Limiting Edit Access', 'gravityview'), |
|
161 | - 'value' => __('Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview'), |
|
162 | - ); |
|
163 | - |
|
164 | - return $return; |
|
165 | - } |
|
72 | + /** |
|
73 | + * Add Edit Link as a default field, outside those set in the Gravity Form form |
|
74 | + * @param array $entry_default_fields Existing fields |
|
75 | + * @param string|array $form form_ID or form object |
|
76 | + * @param string $zone Either 'single', 'directory', 'header', 'footer' |
|
77 | + */ |
|
78 | + function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) { |
|
79 | + |
|
80 | + if( $zone !== 'edit' ) { |
|
81 | + |
|
82 | + $entry_default_fields['edit_link'] = array( |
|
83 | + 'label' => __('Edit Entry', 'gravityview'), |
|
84 | + 'type' => 'edit_link', |
|
85 | + 'desc' => __('A link to edit the entry. Visible based on View settings.', 'gravityview'), |
|
86 | + ); |
|
87 | + |
|
88 | + } |
|
89 | + |
|
90 | + return $entry_default_fields; |
|
91 | + } |
|
92 | + |
|
93 | + /** |
|
94 | + * Change wording for the Edit context to read Entry Creator |
|
95 | + * |
|
96 | + * @param array $visibility_caps Array of capabilities to display in field dropdown. |
|
97 | + * @param string $field_type Type of field options to render (`field` or `widget`) |
|
98 | + * @param string $template_id Table slug |
|
99 | + * @param float $field_id GF Field ID - Example: `3`, `5.2`, `entry_link`, `created_by` |
|
100 | + * @param string $context What context are we in? Example: `single` or `directory` |
|
101 | + * @param string $input_type (textarea, list, select, etc.) |
|
102 | + * @return array Array of field options with `label`, `value`, `type`, `default` keys |
|
103 | + */ |
|
104 | + function modify_visibility_caps( $visibility_caps = array(), $template_id = '', $field_id = '', $context = '', $input_type = '' ) { |
|
105 | + |
|
106 | + $caps = $visibility_caps; |
|
107 | + |
|
108 | + // If we're configuring fields in the edit context, we want a limited selection |
|
109 | + if( $context === 'edit' ) { |
|
110 | + |
|
111 | + // Remove other built-in caps. |
|
112 | + unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] ); |
|
113 | + |
|
114 | + $caps['read'] = _x('Entry Creator','User capability', 'gravityview'); |
|
115 | + } |
|
116 | + |
|
117 | + return $caps; |
|
118 | + } |
|
119 | + |
|
120 | + /** |
|
121 | + * Add "Edit Link Text" setting to the edit_link field settings |
|
122 | + * |
|
123 | + * @param array $field_options |
|
124 | + * @param string $template_id |
|
125 | + * @param string $field_id |
|
126 | + * @param string $context |
|
127 | + * @param string $input_type |
|
128 | + * |
|
129 | + * @return array $field_options, with "Edit Link Text" field option |
|
130 | + */ |
|
131 | + function edit_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
132 | + |
|
133 | + // Always a link, never a filter |
|
134 | + unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
|
135 | + |
|
136 | + // Edit Entry link should only appear to visitors capable of editing entries |
|
137 | + unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
138 | + |
|
139 | + $add_option['edit_link'] = array( |
|
140 | + 'type' => 'text', |
|
141 | + 'label' => __( 'Edit Link Text', 'gravityview' ), |
|
142 | + 'desc' => NULL, |
|
143 | + 'value' => __('Edit Entry', 'gravityview'), |
|
144 | + 'merge_tags' => true, |
|
145 | + ); |
|
146 | + |
|
147 | + return array_merge( $add_option, $field_options ); |
|
148 | + } |
|
149 | + |
|
150 | + /** |
|
151 | + * Add tooltips |
|
152 | + * @param array $tooltips Existing tooltips |
|
153 | + * @return array Modified tooltips |
|
154 | + */ |
|
155 | + function tooltips( $tooltips ) { |
|
156 | + |
|
157 | + $return = $tooltips; |
|
158 | + |
|
159 | + $return['allow_edit_cap'] = array( |
|
160 | + 'title' => __('Limiting Edit Access', 'gravityview'), |
|
161 | + 'value' => __('Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview'), |
|
162 | + ); |
|
163 | + |
|
164 | + return $return; |
|
165 | + } |
|
166 | 166 | |
167 | 167 | /** |
168 | 168 | * Add "Edit Link Text" setting to the edit_link field settings |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
180 | 180 | |
181 | - // We only want to modify the settings for the edit context |
|
182 | - if( 'edit' !== $context ) { |
|
183 | - |
|
184 | - /** |
|
185 | - * @since 1.8.4 |
|
186 | - */ |
|
187 | - $field_options['new_window'] = array( |
|
188 | - 'type' => 'checkbox', |
|
189 | - 'label' => __( 'Open link in a new tab or window?', 'gravityview' ), |
|
190 | - 'value' => false, |
|
191 | - ); |
|
192 | - |
|
193 | - return $field_options; |
|
194 | - } |
|
195 | - |
|
196 | - // Entry field is only for logged in users |
|
197 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
198 | - |
|
199 | - $add_options = array( |
|
200 | - 'allow_edit_cap' => array( |
|
201 | - 'type' => 'select', |
|
202 | - 'label' => __( 'Make field editable to:', 'gravityview' ), |
|
203 | - 'choices' => GravityView_Render_Settings::get_cap_choices( $template_id, $field_id, $context, $input_type ), |
|
204 | - 'tooltip' => 'allow_edit_cap', |
|
205 | - 'class' => 'widefat', |
|
206 | - 'value' => 'read', // Default: entry creator |
|
207 | - ), |
|
208 | - ); |
|
209 | - |
|
210 | - return array_merge( $field_options, $add_options ); |
|
211 | - } |
|
181 | + // We only want to modify the settings for the edit context |
|
182 | + if( 'edit' !== $context ) { |
|
183 | + |
|
184 | + /** |
|
185 | + * @since 1.8.4 |
|
186 | + */ |
|
187 | + $field_options['new_window'] = array( |
|
188 | + 'type' => 'checkbox', |
|
189 | + 'label' => __( 'Open link in a new tab or window?', 'gravityview' ), |
|
190 | + 'value' => false, |
|
191 | + ); |
|
192 | + |
|
193 | + return $field_options; |
|
194 | + } |
|
195 | + |
|
196 | + // Entry field is only for logged in users |
|
197 | + unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
198 | + |
|
199 | + $add_options = array( |
|
200 | + 'allow_edit_cap' => array( |
|
201 | + 'type' => 'select', |
|
202 | + 'label' => __( 'Make field editable to:', 'gravityview' ), |
|
203 | + 'choices' => GravityView_Render_Settings::get_cap_choices( $template_id, $field_id, $context, $input_type ), |
|
204 | + 'tooltip' => 'allow_edit_cap', |
|
205 | + 'class' => 'widefat', |
|
206 | + 'value' => 'read', // Default: entry creator |
|
207 | + ), |
|
208 | + ); |
|
209 | + |
|
210 | + return array_merge( $field_options, $add_options ); |
|
211 | + } |
|
212 | 212 | |
213 | 213 | |
214 | 214 | } // end class |
@@ -63,28 +63,28 @@ discard block |
||
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 |
||
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 |
||
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( |
@@ -596,16 +596,16 @@ discard block |
||
596 | 596 | /** |
597 | 597 | * Render html for displaying available fields based on a Form ID |
598 | 598 | * |
599 | - * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
599 | + * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action |
|
600 | 600 | * |
601 | 601 | * @param int $form Gravity Forms Form ID (default: '') |
602 | 602 | * @param string $context (default: 'single') |
603 | - * |
|
603 | + * |
|
604 | 604 | * @return void |
605 | 605 | */ |
606 | 606 | function render_available_fields( $form = 0, $context = 'single' ) { |
607 | 607 | |
608 | - // Determine if form is a preset and convert it to an array with fields |
|
608 | + // Determine if form is a preset and convert it to an array with fields |
|
609 | 609 | $form = ( is_string( $form ) && preg_match( '/^preset_/', $form ) ) ? GravityView_Ajax::pre_get_form_fields( $form ) : $form; |
610 | 610 | |
611 | 611 | /** |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | |
618 | 618 | if ( ! is_array( $blacklist_field_types ) ) { |
619 | 619 | |
620 | - gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
620 | + gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) ); |
|
621 | 621 | |
622 | 622 | $blacklist_field_types = array(); |
623 | 623 | } |
@@ -753,12 +753,12 @@ discard block |
||
753 | 753 | /** |
754 | 754 | * @since 1.7.2 |
755 | 755 | */ |
756 | - 'other_entries' => array( |
|
757 | - 'label' => __('Other Entries', 'gravityview'), |
|
758 | - 'type' => 'other_entries', |
|
759 | - 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
760 | - ), |
|
761 | - ); |
|
756 | + 'other_entries' => array( |
|
757 | + 'label' => __('Other Entries', 'gravityview'), |
|
758 | + 'type' => 'other_entries', |
|
759 | + 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
760 | + ), |
|
761 | + ); |
|
762 | 762 | |
763 | 763 | if( 'single' !== $zone) { |
764 | 764 | |
@@ -920,9 +920,9 @@ discard block |
||
920 | 920 | |
921 | 921 | $joined_forms = gravityview_get_joined_forms( $post->ID ); |
922 | 922 | |
923 | - foreach ( $joined_forms as $form ) { |
|
924 | - $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
925 | - } |
|
923 | + foreach ( $joined_forms as $form ) { |
|
924 | + $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone ); |
|
925 | + } |
|
926 | 926 | } else { |
927 | 927 | $available_items[ $form ] = \GV\Widget::registered(); |
928 | 928 | } |
@@ -950,9 +950,9 @@ discard block |
||
950 | 950 | |
951 | 951 | if ( $form_id ) { |
952 | 952 | $original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ; |
953 | - } else { |
|
953 | + } else { |
|
954 | 954 | $original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ; |
955 | - } |
|
955 | + } |
|
956 | 956 | |
957 | 957 | if ( !$original_item ) { |
958 | 958 | 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 ) ) ); |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | |
1005 | 1005 | /** |
1006 | 1006 | * Render the widget active areas |
1007 | - * @param string $template_id The current slug of the selected View template |
|
1007 | + * @param string $template_id The current slug of the selected View template |
|
1008 | 1008 | * @param string $zone Either 'header' or 'footer' |
1009 | 1009 | * @param string $post_id Current Post ID (view) |
1010 | 1010 | * @return string html |
@@ -1186,7 +1186,7 @@ discard block |
||
1186 | 1186 | $is_widgets_page = ( $pagenow === 'widgets.php' ); |
1187 | 1187 | |
1188 | 1188 | // Add the GV font (with the Astronaut) |
1189 | - wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
1189 | + wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version ); |
|
1190 | 1190 | wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version ); |
1191 | 1191 | |
1192 | 1192 | wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true ); |
@@ -1194,66 +1194,66 @@ discard block |
||
1194 | 1194 | if( GFForms::get_page() === 'form_list' ) { |
1195 | 1195 | wp_enqueue_style( 'gravityview_views_styles' ); |
1196 | 1196 | return; |
1197 | - } |
|
1197 | + } |
|
1198 | 1198 | |
1199 | 1199 | // Don't process any scripts below here if it's not a GravityView page. |
1200 | 1200 | if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) { |
1201 | - return; |
|
1201 | + return; |
|
1202 | 1202 | } |
1203 | 1203 | |
1204 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
1205 | - wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
1206 | - |
|
1207 | - $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
1208 | - |
|
1209 | - //enqueue scripts |
|
1210 | - 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 ); |
|
1211 | - |
|
1212 | - wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
1213 | - 'cookiepath' => COOKIEPATH, |
|
1214 | - 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
1215 | - 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
1216 | - 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
1217 | - 'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ), |
|
1218 | - 'label_add_search_field' => __( 'Add Search Field', 'gravityview' ), |
|
1219 | - 'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ), |
|
1220 | - 'label_close' => __( 'Close', 'gravityview' ), |
|
1221 | - 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
1222 | - 'label_continue' => __( 'Continue', 'gravityview' ), |
|
1223 | - 'label_ok' => __( 'Ok', 'gravityview' ), |
|
1224 | - 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
1225 | - 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
1226 | - 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
1227 | - 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
1228 | - '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' ), |
|
1229 | - )); |
|
1204 | + wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
1205 | + wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version ); |
|
1206 | + |
|
1207 | + $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
1208 | + |
|
1209 | + //enqueue scripts |
|
1210 | + 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 ); |
|
1211 | + |
|
1212 | + wp_localize_script('gravityview_views_scripts', 'gvGlobals', array( |
|
1213 | + 'cookiepath' => COOKIEPATH, |
|
1214 | + 'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ), |
|
1215 | + 'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ), |
|
1216 | + 'label_viewname' => __( 'Enter View name here', 'gravityview' ), |
|
1217 | + 'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ), |
|
1218 | + 'label_add_search_field' => __( 'Add Search Field', 'gravityview' ), |
|
1219 | + 'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ), |
|
1220 | + 'label_close' => __( 'Close', 'gravityview' ), |
|
1221 | + 'label_cancel' => __( 'Cancel', 'gravityview' ), |
|
1222 | + 'label_continue' => __( 'Continue', 'gravityview' ), |
|
1223 | + 'label_ok' => __( 'Ok', 'gravityview' ), |
|
1224 | + 'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ), |
|
1225 | + 'loading_text' => esc_html__( 'Loading…', 'gravityview' ), |
|
1226 | + 'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ), |
|
1227 | + 'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ), |
|
1228 | + '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' ), |
|
1229 | + )); |
|
1230 | 1230 | |
1231 | 1231 | wp_enqueue_style( 'gravityview_views_styles' ); |
1232 | 1232 | |
1233 | - // Enqueue scripts needed for merge tags |
|
1234 | - self::enqueue_gravity_forms_scripts(); |
|
1233 | + // Enqueue scripts needed for merge tags |
|
1234 | + self::enqueue_gravity_forms_scripts(); |
|
1235 | 1235 | } |
1236 | 1236 | |
1237 | 1237 | /** |
1238 | 1238 | * Enqueue Gravity Forms scripts, needed for Merge Tags |
1239 | - * |
|
1240 | - * @since 1.0.5-beta |
|
1241 | - * |
|
1242 | - * @return void |
|
1239 | + * |
|
1240 | + * @since 1.0.5-beta |
|
1241 | + * |
|
1242 | + * @return void |
|
1243 | 1243 | */ |
1244 | 1244 | static function enqueue_gravity_forms_scripts() { |
1245 | 1245 | GFForms::register_scripts(); |
1246 | 1246 | |
1247 | 1247 | $scripts = array( |
1248 | - 'sack', |
|
1249 | - 'gform_gravityforms', |
|
1250 | - 'gform_forms', |
|
1251 | - 'gform_form_admin', |
|
1252 | - 'jquery-ui-autocomplete' |
|
1248 | + 'sack', |
|
1249 | + 'gform_gravityforms', |
|
1250 | + 'gform_forms', |
|
1251 | + 'gform_form_admin', |
|
1252 | + 'jquery-ui-autocomplete' |
|
1253 | 1253 | ); |
1254 | 1254 | |
1255 | 1255 | if ( wp_is_mobile() ) { |
1256 | - $scripts[] = 'jquery-touch-punch'; |
|
1256 | + $scripts[] = 'jquery-touch-punch'; |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | wp_enqueue_script( $scripts ); |
@@ -532,7 +532,7 @@ |
||
532 | 532 | * @since 1.16.4 |
533 | 533 | * @param int $entry_id ID of the Gravity Forms entry |
534 | 534 | * @param array $entry Deleted entry array |
535 | - */ |
|
535 | + */ |
|
536 | 536 | do_action( 'gravityview/delete-entry/deleted', $entry_id, $entry ); |
537 | 537 | } |
538 | 538 |