@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | * |
599 | 599 | * @param string $CNT_ISO |
600 | 600 | * |
601 | - * @return mixed string | array |
|
601 | + * @return string|null string | array |
|
602 | 602 | */ |
603 | 603 | public function display_country_settings($CNT_ISO = '') |
604 | 604 | { |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | * delete_state |
885 | 885 | * |
886 | 886 | * @access public |
887 | - * @return boolean | void |
|
887 | + * @return false|null | void |
|
888 | 888 | */ |
889 | 889 | public function delete_state() |
890 | 890 | { |
@@ -1126,11 +1126,11 @@ discard block |
||
1126 | 1126 | /** |
1127 | 1127 | * generates a dropdown of all parent pages - copied from WP core |
1128 | 1128 | * |
1129 | - * @param unknown_type $default |
|
1130 | - * @param unknown_type $parent |
|
1131 | - * @param unknown_type $level |
|
1129 | + * @param integer $default |
|
1130 | + * @param integer $parent |
|
1131 | + * @param integer $level |
|
1132 | 1132 | * |
1133 | - * @return unknown |
|
1133 | + * @return null|false |
|
1134 | 1134 | */ |
1135 | 1135 | public static function page_settings_dropdown($default = 0, $parent = 0, $level = 0) |
1136 | 1136 | { |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | use EventEspresso\admin_pages\general_settings\AdminOptionsSettings; |
3 | 3 | |
4 | 4 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
5 | - exit('NO direct script access allowed'); |
|
5 | + exit('NO direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | /** |
@@ -22,1138 +22,1138 @@ discard block |
||
22 | 22 | { |
23 | 23 | |
24 | 24 | |
25 | - /** |
|
26 | - * _question_group |
|
27 | - * holds the specific question group object for the question group details screen |
|
28 | - * @var object |
|
29 | - */ |
|
30 | - protected $_question_group; |
|
25 | + /** |
|
26 | + * _question_group |
|
27 | + * holds the specific question group object for the question group details screen |
|
28 | + * @var object |
|
29 | + */ |
|
30 | + protected $_question_group; |
|
31 | 31 | |
32 | 32 | |
33 | - public function __construct($routing = true) |
|
34 | - { |
|
35 | - parent::__construct($routing); |
|
36 | - } |
|
33 | + public function __construct($routing = true) |
|
34 | + { |
|
35 | + parent::__construct($routing); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | |
39 | - protected function _init_page_props() |
|
40 | - { |
|
41 | - $this->page_slug = GEN_SET_PG_SLUG; |
|
42 | - $this->page_label = GEN_SET_LABEL; |
|
43 | - $this->_admin_base_url = GEN_SET_ADMIN_URL; |
|
44 | - $this->_admin_base_path = GEN_SET_ADMIN; |
|
45 | - } |
|
39 | + protected function _init_page_props() |
|
40 | + { |
|
41 | + $this->page_slug = GEN_SET_PG_SLUG; |
|
42 | + $this->page_label = GEN_SET_LABEL; |
|
43 | + $this->_admin_base_url = GEN_SET_ADMIN_URL; |
|
44 | + $this->_admin_base_path = GEN_SET_ADMIN; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - protected function _ajax_hooks() |
|
49 | - { |
|
50 | - add_action('wp_ajax_espresso_display_country_settings', array($this, 'display_country_settings')); |
|
51 | - add_action('wp_ajax_espresso_display_country_states', array($this, 'display_country_states')); |
|
52 | - add_action('wp_ajax_espresso_delete_state', array($this, 'delete_state'), 10, 3); |
|
53 | - add_action('wp_ajax_espresso_add_new_state', array($this, 'add_new_state')); |
|
54 | - } |
|
48 | + protected function _ajax_hooks() |
|
49 | + { |
|
50 | + add_action('wp_ajax_espresso_display_country_settings', array($this, 'display_country_settings')); |
|
51 | + add_action('wp_ajax_espresso_display_country_states', array($this, 'display_country_states')); |
|
52 | + add_action('wp_ajax_espresso_delete_state', array($this, 'delete_state'), 10, 3); |
|
53 | + add_action('wp_ajax_espresso_add_new_state', array($this, 'add_new_state')); |
|
54 | + } |
|
55 | 55 | |
56 | 56 | |
57 | - protected function _define_page_props() |
|
58 | - { |
|
59 | - $this->_admin_page_title = GEN_SET_LABEL; |
|
60 | - $this->_labels = array( |
|
61 | - 'publishbox' => __('Update Settings', 'event_espresso') |
|
62 | - ); |
|
63 | - } |
|
57 | + protected function _define_page_props() |
|
58 | + { |
|
59 | + $this->_admin_page_title = GEN_SET_LABEL; |
|
60 | + $this->_labels = array( |
|
61 | + 'publishbox' => __('Update Settings', 'event_espresso') |
|
62 | + ); |
|
63 | + } |
|
64 | 64 | |
65 | 65 | |
66 | - protected function _set_page_routes() |
|
67 | - { |
|
68 | - $this->_page_routes = array( |
|
66 | + protected function _set_page_routes() |
|
67 | + { |
|
68 | + $this->_page_routes = array( |
|
69 | 69 | |
70 | - 'critical_pages' => array( |
|
71 | - 'func' => '_espresso_page_settings', |
|
72 | - 'capability' => 'manage_options' |
|
73 | - ), |
|
74 | - 'update_espresso_page_settings' => array( |
|
75 | - 'func' => '_update_espresso_page_settings', |
|
76 | - 'capability' => 'manage_options', |
|
77 | - 'noheader' => true, |
|
78 | - ), |
|
79 | - 'default' => array( |
|
80 | - 'func' => '_your_organization_settings', |
|
81 | - 'capability' => 'manage_options', |
|
82 | - ), |
|
70 | + 'critical_pages' => array( |
|
71 | + 'func' => '_espresso_page_settings', |
|
72 | + 'capability' => 'manage_options' |
|
73 | + ), |
|
74 | + 'update_espresso_page_settings' => array( |
|
75 | + 'func' => '_update_espresso_page_settings', |
|
76 | + 'capability' => 'manage_options', |
|
77 | + 'noheader' => true, |
|
78 | + ), |
|
79 | + 'default' => array( |
|
80 | + 'func' => '_your_organization_settings', |
|
81 | + 'capability' => 'manage_options', |
|
82 | + ), |
|
83 | 83 | |
84 | - 'update_your_organization_settings' => array( |
|
85 | - 'func' => '_update_your_organization_settings', |
|
86 | - 'capability' => 'manage_options', |
|
87 | - 'noheader' => true, |
|
88 | - ), |
|
84 | + 'update_your_organization_settings' => array( |
|
85 | + 'func' => '_update_your_organization_settings', |
|
86 | + 'capability' => 'manage_options', |
|
87 | + 'noheader' => true, |
|
88 | + ), |
|
89 | 89 | |
90 | - 'admin_option_settings' => array( |
|
91 | - 'func' => '_admin_option_settings', |
|
92 | - 'capability' => 'manage_options', |
|
93 | - ), |
|
90 | + 'admin_option_settings' => array( |
|
91 | + 'func' => '_admin_option_settings', |
|
92 | + 'capability' => 'manage_options', |
|
93 | + ), |
|
94 | 94 | |
95 | - 'update_admin_option_settings' => array( |
|
96 | - 'func' => '_update_admin_option_settings', |
|
97 | - 'capability' => 'manage_options', |
|
98 | - 'noheader' => true, |
|
99 | - ), |
|
95 | + 'update_admin_option_settings' => array( |
|
96 | + 'func' => '_update_admin_option_settings', |
|
97 | + 'capability' => 'manage_options', |
|
98 | + 'noheader' => true, |
|
99 | + ), |
|
100 | 100 | |
101 | - 'country_settings' => array( |
|
102 | - 'func' => '_country_settings', |
|
103 | - 'capability' => 'manage_options' |
|
104 | - ), |
|
101 | + 'country_settings' => array( |
|
102 | + 'func' => '_country_settings', |
|
103 | + 'capability' => 'manage_options' |
|
104 | + ), |
|
105 | 105 | |
106 | - 'update_country_settings' => array( |
|
107 | - 'func' => '_update_country_settings', |
|
108 | - 'capability' => 'manage_options', |
|
109 | - 'noheader' => true, |
|
110 | - ), |
|
106 | + 'update_country_settings' => array( |
|
107 | + 'func' => '_update_country_settings', |
|
108 | + 'capability' => 'manage_options', |
|
109 | + 'noheader' => true, |
|
110 | + ), |
|
111 | 111 | |
112 | - 'display_country_settings' => array( |
|
113 | - 'func' => 'display_country_settings', |
|
114 | - 'capability' => 'manage_options', |
|
115 | - 'noheader' => true, |
|
116 | - ), |
|
112 | + 'display_country_settings' => array( |
|
113 | + 'func' => 'display_country_settings', |
|
114 | + 'capability' => 'manage_options', |
|
115 | + 'noheader' => true, |
|
116 | + ), |
|
117 | 117 | |
118 | - 'add_new_state' => array( |
|
119 | - 'func' => 'add_new_state', |
|
120 | - 'capability' => 'manage_options', |
|
121 | - 'noheader' => true, |
|
122 | - ), |
|
118 | + 'add_new_state' => array( |
|
119 | + 'func' => 'add_new_state', |
|
120 | + 'capability' => 'manage_options', |
|
121 | + 'noheader' => true, |
|
122 | + ), |
|
123 | 123 | |
124 | - 'delete_state' => array( |
|
125 | - 'func' => 'delete_state', |
|
126 | - 'capability' => 'manage_options', |
|
127 | - 'noheader' => true, |
|
128 | - ) |
|
129 | - ); |
|
130 | - } |
|
131 | - |
|
132 | - |
|
133 | - protected function _set_page_config() |
|
134 | - { |
|
135 | - $this->_page_config = array( |
|
136 | - 'critical_pages' => array( |
|
137 | - 'nav' => array( |
|
138 | - 'label' => __('Critical Pages', 'event_espresso'), |
|
139 | - 'order' => 50 |
|
140 | - ), |
|
141 | - 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
142 | - 'help_tabs' => array( |
|
143 | - 'general_settings_critical_pages_help_tab' => array( |
|
144 | - 'title' => __('Critical Pages', 'event_espresso'), |
|
145 | - 'filename' => 'general_settings_critical_pages' |
|
146 | - ) |
|
147 | - ), |
|
148 | - 'help_tour' => array('Critical_Pages_Help_Tour'), |
|
149 | - 'require_nonce' => false |
|
150 | - ), |
|
151 | - 'default' => array( |
|
152 | - 'nav' => array( |
|
153 | - 'label' => __('Your Organization', 'event_espresso'), |
|
154 | - 'order' => 20 |
|
155 | - ), |
|
156 | - 'help_tabs' => array( |
|
157 | - 'general_settings_your_organization_help_tab' => array( |
|
158 | - 'title' => __('Your Organization', 'event_espresso'), |
|
159 | - 'filename' => 'general_settings_your_organization' |
|
160 | - ) |
|
161 | - ), |
|
162 | - 'help_tour' => array('Your_Organization_Help_Tour'), |
|
163 | - 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
164 | - 'require_nonce' => false |
|
165 | - ), |
|
166 | - 'admin_option_settings' => array( |
|
167 | - 'nav' => array( |
|
168 | - 'label' => __('Admin Options', 'event_espresso'), |
|
169 | - 'order' => 60 |
|
170 | - ), |
|
171 | - 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
172 | - 'help_tabs' => array( |
|
173 | - 'general_settings_admin_options_help_tab' => array( |
|
174 | - 'title' => __('Admin Options', 'event_espresso'), |
|
175 | - 'filename' => 'general_settings_admin_options' |
|
176 | - ) |
|
177 | - ), |
|
178 | - 'help_tour' => array('Admin_Options_Help_Tour'), |
|
179 | - 'require_nonce' => false |
|
180 | - ), |
|
181 | - 'country_settings' => array( |
|
182 | - 'nav' => array( |
|
183 | - 'label' => __('Countries', 'event_espresso'), |
|
184 | - 'order' => 70 |
|
185 | - ), |
|
186 | - 'help_tabs' => array( |
|
187 | - 'general_settings_countries_help_tab' => array( |
|
188 | - 'title' => __('Countries', 'event_espresso'), |
|
189 | - 'filename' => 'general_settings_countries' |
|
190 | - ) |
|
191 | - ), |
|
192 | - 'help_tour' => array('Countries_Help_Tour'), |
|
193 | - 'require_nonce' => false |
|
194 | - ) |
|
195 | - ); |
|
196 | - } |
|
197 | - |
|
198 | - |
|
199 | - protected function _add_screen_options() |
|
200 | - { |
|
201 | - } |
|
202 | - |
|
203 | - protected function _add_feature_pointers() |
|
204 | - { |
|
205 | - } |
|
206 | - |
|
207 | - public function load_scripts_styles() |
|
208 | - { |
|
209 | - //styles |
|
210 | - wp_enqueue_style('espresso-ui-theme'); |
|
211 | - //scripts |
|
212 | - wp_enqueue_script('ee_admin_js'); |
|
213 | - } |
|
214 | - |
|
215 | - public function admin_init() |
|
216 | - { |
|
217 | - EE_Registry::$i18n_js_strings['invalid_server_response'] = __('An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', |
|
218 | - 'event_espresso'); |
|
219 | - EE_Registry::$i18n_js_strings['error_occurred'] = __('An error occurred! Please refresh the page and try again.', |
|
220 | - 'event_espresso'); |
|
221 | - EE_Registry::$i18n_js_strings['confirm_delete_state'] = __('Are you sure you want to delete this State / Province?', |
|
222 | - 'event_espresso'); |
|
223 | - $protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://'; |
|
224 | - EE_Registry::$i18n_js_strings['ajax_url'] = admin_url('admin-ajax.php?page=espresso_general_settings', |
|
225 | - $protocol); |
|
226 | - } |
|
227 | - |
|
228 | - public function admin_notices() |
|
229 | - { |
|
230 | - } |
|
231 | - |
|
232 | - public function admin_footer_scripts() |
|
233 | - { |
|
234 | - } |
|
235 | - |
|
236 | - |
|
237 | - public function load_scripts_styles_default() |
|
238 | - { |
|
239 | - //styles |
|
240 | - wp_enqueue_style('thickbox'); |
|
241 | - //scripts |
|
242 | - wp_enqueue_script('media-upload'); |
|
243 | - wp_enqueue_script('thickbox'); |
|
244 | - wp_register_script('organization_settings', GEN_SET_ASSETS_URL . 'your_organization_settings.js', |
|
245 | - array('jquery', 'media-upload', 'thickbox'), EVENT_ESPRESSO_VERSION, true); |
|
246 | - wp_register_style('organization-css', GEN_SET_ASSETS_URL . 'organization.css', array(), EVENT_ESPRESSO_VERSION); |
|
247 | - wp_enqueue_script('organization_settings'); |
|
248 | - wp_enqueue_style('organization-css'); |
|
249 | - $confirm_image_delete = array( |
|
250 | - 'text' => __('Do you really want to delete this image? Please remember to save your settings to complete the removal.', |
|
251 | - 'event_espresso') |
|
252 | - ); |
|
253 | - wp_localize_script('organization_settings', 'confirm_image_delete', $confirm_image_delete); |
|
124 | + 'delete_state' => array( |
|
125 | + 'func' => 'delete_state', |
|
126 | + 'capability' => 'manage_options', |
|
127 | + 'noheader' => true, |
|
128 | + ) |
|
129 | + ); |
|
130 | + } |
|
131 | + |
|
132 | + |
|
133 | + protected function _set_page_config() |
|
134 | + { |
|
135 | + $this->_page_config = array( |
|
136 | + 'critical_pages' => array( |
|
137 | + 'nav' => array( |
|
138 | + 'label' => __('Critical Pages', 'event_espresso'), |
|
139 | + 'order' => 50 |
|
140 | + ), |
|
141 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
142 | + 'help_tabs' => array( |
|
143 | + 'general_settings_critical_pages_help_tab' => array( |
|
144 | + 'title' => __('Critical Pages', 'event_espresso'), |
|
145 | + 'filename' => 'general_settings_critical_pages' |
|
146 | + ) |
|
147 | + ), |
|
148 | + 'help_tour' => array('Critical_Pages_Help_Tour'), |
|
149 | + 'require_nonce' => false |
|
150 | + ), |
|
151 | + 'default' => array( |
|
152 | + 'nav' => array( |
|
153 | + 'label' => __('Your Organization', 'event_espresso'), |
|
154 | + 'order' => 20 |
|
155 | + ), |
|
156 | + 'help_tabs' => array( |
|
157 | + 'general_settings_your_organization_help_tab' => array( |
|
158 | + 'title' => __('Your Organization', 'event_espresso'), |
|
159 | + 'filename' => 'general_settings_your_organization' |
|
160 | + ) |
|
161 | + ), |
|
162 | + 'help_tour' => array('Your_Organization_Help_Tour'), |
|
163 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
164 | + 'require_nonce' => false |
|
165 | + ), |
|
166 | + 'admin_option_settings' => array( |
|
167 | + 'nav' => array( |
|
168 | + 'label' => __('Admin Options', 'event_espresso'), |
|
169 | + 'order' => 60 |
|
170 | + ), |
|
171 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
172 | + 'help_tabs' => array( |
|
173 | + 'general_settings_admin_options_help_tab' => array( |
|
174 | + 'title' => __('Admin Options', 'event_espresso'), |
|
175 | + 'filename' => 'general_settings_admin_options' |
|
176 | + ) |
|
177 | + ), |
|
178 | + 'help_tour' => array('Admin_Options_Help_Tour'), |
|
179 | + 'require_nonce' => false |
|
180 | + ), |
|
181 | + 'country_settings' => array( |
|
182 | + 'nav' => array( |
|
183 | + 'label' => __('Countries', 'event_espresso'), |
|
184 | + 'order' => 70 |
|
185 | + ), |
|
186 | + 'help_tabs' => array( |
|
187 | + 'general_settings_countries_help_tab' => array( |
|
188 | + 'title' => __('Countries', 'event_espresso'), |
|
189 | + 'filename' => 'general_settings_countries' |
|
190 | + ) |
|
191 | + ), |
|
192 | + 'help_tour' => array('Countries_Help_Tour'), |
|
193 | + 'require_nonce' => false |
|
194 | + ) |
|
195 | + ); |
|
196 | + } |
|
197 | + |
|
198 | + |
|
199 | + protected function _add_screen_options() |
|
200 | + { |
|
201 | + } |
|
202 | + |
|
203 | + protected function _add_feature_pointers() |
|
204 | + { |
|
205 | + } |
|
206 | + |
|
207 | + public function load_scripts_styles() |
|
208 | + { |
|
209 | + //styles |
|
210 | + wp_enqueue_style('espresso-ui-theme'); |
|
211 | + //scripts |
|
212 | + wp_enqueue_script('ee_admin_js'); |
|
213 | + } |
|
214 | + |
|
215 | + public function admin_init() |
|
216 | + { |
|
217 | + EE_Registry::$i18n_js_strings['invalid_server_response'] = __('An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', |
|
218 | + 'event_espresso'); |
|
219 | + EE_Registry::$i18n_js_strings['error_occurred'] = __('An error occurred! Please refresh the page and try again.', |
|
220 | + 'event_espresso'); |
|
221 | + EE_Registry::$i18n_js_strings['confirm_delete_state'] = __('Are you sure you want to delete this State / Province?', |
|
222 | + 'event_espresso'); |
|
223 | + $protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://'; |
|
224 | + EE_Registry::$i18n_js_strings['ajax_url'] = admin_url('admin-ajax.php?page=espresso_general_settings', |
|
225 | + $protocol); |
|
226 | + } |
|
227 | + |
|
228 | + public function admin_notices() |
|
229 | + { |
|
230 | + } |
|
231 | + |
|
232 | + public function admin_footer_scripts() |
|
233 | + { |
|
234 | + } |
|
235 | + |
|
236 | + |
|
237 | + public function load_scripts_styles_default() |
|
238 | + { |
|
239 | + //styles |
|
240 | + wp_enqueue_style('thickbox'); |
|
241 | + //scripts |
|
242 | + wp_enqueue_script('media-upload'); |
|
243 | + wp_enqueue_script('thickbox'); |
|
244 | + wp_register_script('organization_settings', GEN_SET_ASSETS_URL . 'your_organization_settings.js', |
|
245 | + array('jquery', 'media-upload', 'thickbox'), EVENT_ESPRESSO_VERSION, true); |
|
246 | + wp_register_style('organization-css', GEN_SET_ASSETS_URL . 'organization.css', array(), EVENT_ESPRESSO_VERSION); |
|
247 | + wp_enqueue_script('organization_settings'); |
|
248 | + wp_enqueue_style('organization-css'); |
|
249 | + $confirm_image_delete = array( |
|
250 | + 'text' => __('Do you really want to delete this image? Please remember to save your settings to complete the removal.', |
|
251 | + 'event_espresso') |
|
252 | + ); |
|
253 | + wp_localize_script('organization_settings', 'confirm_image_delete', $confirm_image_delete); |
|
254 | 254 | |
255 | - } |
|
256 | - |
|
257 | - public function load_scripts_styles_country_settings() |
|
258 | - { |
|
259 | - //scripts |
|
260 | - wp_register_script('gen_settings_countries', GEN_SET_ASSETS_URL . 'gen_settings_countries.js', |
|
261 | - array('ee_admin_js'), EVENT_ESPRESSO_VERSION, true); |
|
262 | - wp_register_style('organization-css', GEN_SET_ASSETS_URL . 'organization.css', array(), EVENT_ESPRESSO_VERSION); |
|
263 | - wp_enqueue_script('gen_settings_countries'); |
|
264 | - wp_enqueue_style('organization-css'); |
|
255 | + } |
|
256 | + |
|
257 | + public function load_scripts_styles_country_settings() |
|
258 | + { |
|
259 | + //scripts |
|
260 | + wp_register_script('gen_settings_countries', GEN_SET_ASSETS_URL . 'gen_settings_countries.js', |
|
261 | + array('ee_admin_js'), EVENT_ESPRESSO_VERSION, true); |
|
262 | + wp_register_style('organization-css', GEN_SET_ASSETS_URL . 'organization.css', array(), EVENT_ESPRESSO_VERSION); |
|
263 | + wp_enqueue_script('gen_settings_countries'); |
|
264 | + wp_enqueue_style('organization-css'); |
|
265 | 265 | |
266 | - } |
|
267 | - |
|
268 | - |
|
269 | - /************* Espresso Pages *************/ |
|
270 | - /** |
|
271 | - * _espresso_page_settings |
|
272 | - * |
|
273 | - * @throws \EE_Error |
|
274 | - */ |
|
275 | - protected function _espresso_page_settings() |
|
276 | - { |
|
277 | - // Check to make sure all of the main pages are setup properly, |
|
278 | - // if not create the default pages and display an admin notice |
|
279 | - EEH_Activation::verify_default_pages_exist(); |
|
280 | - $this->_transient_garbage_collection(); |
|
281 | - $this->_template_args['values'] = $this->_yes_no_values; |
|
282 | - $this->_template_args['reg_page_id'] = isset(EE_Registry::instance()->CFG->core->reg_page_id) |
|
283 | - ? EE_Registry::instance()->CFG->core->reg_page_id |
|
284 | - : null; |
|
285 | - $this->_template_args['reg_page_obj'] = isset(EE_Registry::instance()->CFG->core->reg_page_id) |
|
286 | - ? get_page(EE_Registry::instance()->CFG->core->reg_page_id) |
|
287 | - : false; |
|
288 | - $this->_template_args['txn_page_id'] = isset(EE_Registry::instance()->CFG->core->txn_page_id) |
|
289 | - ? EE_Registry::instance()->CFG->core->txn_page_id |
|
290 | - : null; |
|
291 | - $this->_template_args['txn_page_obj'] = isset(EE_Registry::instance()->CFG->core->txn_page_id) |
|
292 | - ? get_page(EE_Registry::instance()->CFG->core->txn_page_id) |
|
293 | - : false; |
|
294 | - $this->_template_args['thank_you_page_id'] = isset(EE_Registry::instance()->CFG->core->thank_you_page_id) |
|
295 | - ? EE_Registry::instance()->CFG->core->thank_you_page_id |
|
296 | - : null; |
|
297 | - $this->_template_args['thank_you_page_obj'] = isset(EE_Registry::instance()->CFG->core->thank_you_page_id) |
|
298 | - ? get_page(EE_Registry::instance()->CFG->core->thank_you_page_id) |
|
299 | - : false; |
|
300 | - $this->_template_args['cancel_page_id'] = isset(EE_Registry::instance()->CFG->core->cancel_page_id) |
|
301 | - ? EE_Registry::instance()->CFG->core->cancel_page_id |
|
302 | - : null; |
|
303 | - $this->_template_args['cancel_page_obj'] = isset(EE_Registry::instance()->CFG->core->cancel_page_id) |
|
304 | - ? get_page(EE_Registry::instance()->CFG->core->cancel_page_id) |
|
305 | - : false; |
|
306 | - $this->_set_add_edit_form_tags('update_espresso_page_settings'); |
|
307 | - $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
308 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
309 | - GEN_SET_TEMPLATE_PATH . 'espresso_page_settings.template.php', |
|
310 | - $this->_template_args, |
|
311 | - true |
|
312 | - ); |
|
313 | - $this->display_admin_page_with_sidebar(); |
|
266 | + } |
|
267 | + |
|
268 | + |
|
269 | + /************* Espresso Pages *************/ |
|
270 | + /** |
|
271 | + * _espresso_page_settings |
|
272 | + * |
|
273 | + * @throws \EE_Error |
|
274 | + */ |
|
275 | + protected function _espresso_page_settings() |
|
276 | + { |
|
277 | + // Check to make sure all of the main pages are setup properly, |
|
278 | + // if not create the default pages and display an admin notice |
|
279 | + EEH_Activation::verify_default_pages_exist(); |
|
280 | + $this->_transient_garbage_collection(); |
|
281 | + $this->_template_args['values'] = $this->_yes_no_values; |
|
282 | + $this->_template_args['reg_page_id'] = isset(EE_Registry::instance()->CFG->core->reg_page_id) |
|
283 | + ? EE_Registry::instance()->CFG->core->reg_page_id |
|
284 | + : null; |
|
285 | + $this->_template_args['reg_page_obj'] = isset(EE_Registry::instance()->CFG->core->reg_page_id) |
|
286 | + ? get_page(EE_Registry::instance()->CFG->core->reg_page_id) |
|
287 | + : false; |
|
288 | + $this->_template_args['txn_page_id'] = isset(EE_Registry::instance()->CFG->core->txn_page_id) |
|
289 | + ? EE_Registry::instance()->CFG->core->txn_page_id |
|
290 | + : null; |
|
291 | + $this->_template_args['txn_page_obj'] = isset(EE_Registry::instance()->CFG->core->txn_page_id) |
|
292 | + ? get_page(EE_Registry::instance()->CFG->core->txn_page_id) |
|
293 | + : false; |
|
294 | + $this->_template_args['thank_you_page_id'] = isset(EE_Registry::instance()->CFG->core->thank_you_page_id) |
|
295 | + ? EE_Registry::instance()->CFG->core->thank_you_page_id |
|
296 | + : null; |
|
297 | + $this->_template_args['thank_you_page_obj'] = isset(EE_Registry::instance()->CFG->core->thank_you_page_id) |
|
298 | + ? get_page(EE_Registry::instance()->CFG->core->thank_you_page_id) |
|
299 | + : false; |
|
300 | + $this->_template_args['cancel_page_id'] = isset(EE_Registry::instance()->CFG->core->cancel_page_id) |
|
301 | + ? EE_Registry::instance()->CFG->core->cancel_page_id |
|
302 | + : null; |
|
303 | + $this->_template_args['cancel_page_obj'] = isset(EE_Registry::instance()->CFG->core->cancel_page_id) |
|
304 | + ? get_page(EE_Registry::instance()->CFG->core->cancel_page_id) |
|
305 | + : false; |
|
306 | + $this->_set_add_edit_form_tags('update_espresso_page_settings'); |
|
307 | + $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
308 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
309 | + GEN_SET_TEMPLATE_PATH . 'espresso_page_settings.template.php', |
|
310 | + $this->_template_args, |
|
311 | + true |
|
312 | + ); |
|
313 | + $this->display_admin_page_with_sidebar(); |
|
314 | 314 | |
315 | - } |
|
316 | - |
|
317 | - protected function _update_espresso_page_settings() |
|
318 | - { |
|
319 | - // capture incoming request data |
|
320 | - $reg_page_id = isset($this->_req_data['reg_page_id']) ? absint($this->_req_data['reg_page_id']) : EE_Registry::instance()->CFG->core->reg_page_id; |
|
321 | - $txn_page_id = isset($this->_req_data['txn_page_id']) ? absint($this->_req_data['txn_page_id']) : EE_Registry::instance()->CFG->core->txn_page_id; |
|
322 | - $thank_you_page_id = isset($this->_req_data['thank_you_page_id']) ? absint($this->_req_data['thank_you_page_id']) : EE_Registry::instance()->CFG->core->thank_you_page_id; |
|
323 | - $cancel_page_id = isset($this->_req_data['cancel_page_id']) ? absint($this->_req_data['cancel_page_id']) : EE_Registry::instance()->CFG->core->cancel_page_id; |
|
324 | - // pack critical_pages into an array |
|
325 | - $critical_pages = array( |
|
326 | - 'reg_page_id' => $reg_page_id, |
|
327 | - 'txn_page_id' => $txn_page_id, |
|
328 | - 'thank_you_page_id' => $thank_you_page_id, |
|
329 | - 'cancel_page_id' => $cancel_page_id |
|
330 | - ); |
|
331 | - foreach ($critical_pages as $critical_page_name => $critical_page_id) { |
|
332 | - // has the page changed ? |
|
333 | - if (EE_Registry::instance()->CFG->core->{$critical_page_name} !== $critical_page_id) { |
|
334 | - // grab post object for old page |
|
335 | - $post = get_post(EE_Registry::instance()->CFG->core->{$critical_page_name}); |
|
336 | - // update post shortcodes for old page |
|
337 | - EventEspresso\core\admin\PostShortcodeTracking::parse_post_content_on_save($critical_page_id, $post); |
|
338 | - // grab post object for new page |
|
339 | - $post = get_post($critical_page_id); |
|
340 | - // update post shortcodes for new page |
|
341 | - EventEspresso\core\admin\PostShortcodeTracking::parse_post_content_on_save($critical_page_id, $post); |
|
342 | - } |
|
343 | - } |
|
344 | - // set page IDs |
|
345 | - EE_Registry::instance()->CFG->core->reg_page_id = $reg_page_id; |
|
346 | - EE_Registry::instance()->CFG->core->txn_page_id = $txn_page_id; |
|
347 | - EE_Registry::instance()->CFG->core->thank_you_page_id = $thank_you_page_id; |
|
348 | - EE_Registry::instance()->CFG->core->cancel_page_id = $cancel_page_id; |
|
315 | + } |
|
316 | + |
|
317 | + protected function _update_espresso_page_settings() |
|
318 | + { |
|
319 | + // capture incoming request data |
|
320 | + $reg_page_id = isset($this->_req_data['reg_page_id']) ? absint($this->_req_data['reg_page_id']) : EE_Registry::instance()->CFG->core->reg_page_id; |
|
321 | + $txn_page_id = isset($this->_req_data['txn_page_id']) ? absint($this->_req_data['txn_page_id']) : EE_Registry::instance()->CFG->core->txn_page_id; |
|
322 | + $thank_you_page_id = isset($this->_req_data['thank_you_page_id']) ? absint($this->_req_data['thank_you_page_id']) : EE_Registry::instance()->CFG->core->thank_you_page_id; |
|
323 | + $cancel_page_id = isset($this->_req_data['cancel_page_id']) ? absint($this->_req_data['cancel_page_id']) : EE_Registry::instance()->CFG->core->cancel_page_id; |
|
324 | + // pack critical_pages into an array |
|
325 | + $critical_pages = array( |
|
326 | + 'reg_page_id' => $reg_page_id, |
|
327 | + 'txn_page_id' => $txn_page_id, |
|
328 | + 'thank_you_page_id' => $thank_you_page_id, |
|
329 | + 'cancel_page_id' => $cancel_page_id |
|
330 | + ); |
|
331 | + foreach ($critical_pages as $critical_page_name => $critical_page_id) { |
|
332 | + // has the page changed ? |
|
333 | + if (EE_Registry::instance()->CFG->core->{$critical_page_name} !== $critical_page_id) { |
|
334 | + // grab post object for old page |
|
335 | + $post = get_post(EE_Registry::instance()->CFG->core->{$critical_page_name}); |
|
336 | + // update post shortcodes for old page |
|
337 | + EventEspresso\core\admin\PostShortcodeTracking::parse_post_content_on_save($critical_page_id, $post); |
|
338 | + // grab post object for new page |
|
339 | + $post = get_post($critical_page_id); |
|
340 | + // update post shortcodes for new page |
|
341 | + EventEspresso\core\admin\PostShortcodeTracking::parse_post_content_on_save($critical_page_id, $post); |
|
342 | + } |
|
343 | + } |
|
344 | + // set page IDs |
|
345 | + EE_Registry::instance()->CFG->core->reg_page_id = $reg_page_id; |
|
346 | + EE_Registry::instance()->CFG->core->txn_page_id = $txn_page_id; |
|
347 | + EE_Registry::instance()->CFG->core->thank_you_page_id = $thank_you_page_id; |
|
348 | + EE_Registry::instance()->CFG->core->cancel_page_id = $cancel_page_id; |
|
349 | 349 | |
350 | - EE_Registry::instance()->CFG->core = apply_filters('FHEE__General_Settings_Admin_Page___update_espresso_page_settings__CFG_core', |
|
351 | - EE_Registry::instance()->CFG->core, $this->_req_data); |
|
350 | + EE_Registry::instance()->CFG->core = apply_filters('FHEE__General_Settings_Admin_Page___update_espresso_page_settings__CFG_core', |
|
351 | + EE_Registry::instance()->CFG->core, $this->_req_data); |
|
352 | 352 | |
353 | - $what = __('Critical Pages & Shortcodes', 'event_espresso'); |
|
354 | - $success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG->core, __FILE__, |
|
355 | - __FUNCTION__, __LINE__); |
|
356 | - $query_args = array( |
|
357 | - 'action' => 'critical_pages' |
|
358 | - ); |
|
359 | - $this->_redirect_after_action(false, '', '', $query_args, true); |
|
353 | + $what = __('Critical Pages & Shortcodes', 'event_espresso'); |
|
354 | + $success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG->core, __FILE__, |
|
355 | + __FUNCTION__, __LINE__); |
|
356 | + $query_args = array( |
|
357 | + 'action' => 'critical_pages' |
|
358 | + ); |
|
359 | + $this->_redirect_after_action(false, '', '', $query_args, true); |
|
360 | 360 | |
361 | - } |
|
361 | + } |
|
362 | 362 | |
363 | 363 | |
364 | - /************* Your Organization *************/ |
|
364 | + /************* Your Organization *************/ |
|
365 | 365 | |
366 | 366 | |
367 | - protected function _your_organization_settings() |
|
368 | - { |
|
367 | + protected function _your_organization_settings() |
|
368 | + { |
|
369 | 369 | |
370 | - $this->_template_args['site_license_key'] = isset(EE_Registry::instance()->NET_CFG->core->site_license_key) ? EE_Registry::instance()->NET_CFG->core->get_pretty('site_license_key') : ''; |
|
371 | - $this->_template_args['organization_name'] = isset(EE_Registry::instance()->CFG->organization->name) ? EE_Registry::instance()->CFG->organization->get_pretty('name') : ''; |
|
372 | - $this->_template_args['organization_address_1'] = isset(EE_Registry::instance()->CFG->organization->address_1) ? EE_Registry::instance()->CFG->organization->get_pretty('address_1') : ''; |
|
373 | - $this->_template_args['organization_address_2'] = isset(EE_Registry::instance()->CFG->organization->address_2) ? EE_Registry::instance()->CFG->organization->get_pretty('address_2') : ''; |
|
374 | - $this->_template_args['organization_city'] = isset(EE_Registry::instance()->CFG->organization->city) ? EE_Registry::instance()->CFG->organization->get_pretty('city') : ''; |
|
375 | - $this->_template_args['organization_zip'] = isset(EE_Registry::instance()->CFG->organization->zip) ? EE_Registry::instance()->CFG->organization->get_pretty('zip') : ''; |
|
376 | - $this->_template_args['organization_email'] = isset(EE_Registry::instance()->CFG->organization->email) ? EE_Registry::instance()->CFG->organization->get_pretty('email') : ''; |
|
377 | - $this->_template_args['organization_phone'] = isset(EE_Registry::instance()->CFG->organization->phone) ? EE_Registry::instance()->CFG->organization->get_pretty('phone') : ''; |
|
378 | - $this->_template_args['organization_vat'] = isset(EE_Registry::instance()->CFG->organization->vat) ? EE_Registry::instance()->CFG->organization->get_pretty('vat') : ''; |
|
379 | - $this->_template_args['currency_sign'] = isset(EE_Registry::instance()->CFG->currency->sign) ? EE_Registry::instance()->CFG->currency->get_pretty('sign') : '$'; |
|
380 | - $this->_template_args['organization_logo_url'] = isset(EE_Registry::instance()->CFG->organization->logo_url) ? EE_Registry::instance()->CFG->organization->get_pretty('logo_url') : false; |
|
381 | - $this->_template_args['organization_facebook'] = isset(EE_Registry::instance()->CFG->organization->facebook) ? EE_Registry::instance()->CFG->organization->get_pretty('facebook') : ''; |
|
382 | - $this->_template_args['organization_twitter'] = isset(EE_Registry::instance()->CFG->organization->twitter) ? EE_Registry::instance()->CFG->organization->get_pretty('twitter') : ''; |
|
383 | - $this->_template_args['organization_linkedin'] = isset(EE_Registry::instance()->CFG->organization->linkedin) ? EE_Registry::instance()->CFG->organization->get_pretty('linkedin') : ''; |
|
384 | - $this->_template_args['organization_pinterest'] = isset(EE_Registry::instance()->CFG->organization->pinterest) ? EE_Registry::instance()->CFG->organization->get_pretty('pinterest') : ''; |
|
385 | - $this->_template_args['organization_google'] = isset(EE_Registry::instance()->CFG->organization->google) ? EE_Registry::instance()->CFG->organization->get_pretty('google') : ''; |
|
386 | - $this->_template_args['organization_instagram'] = isset(EE_Registry::instance()->CFG->organization->instagram) ? EE_Registry::instance()->CFG->organization->get_pretty('instagram') : ''; |
|
387 | - //UXIP settings |
|
388 | - $this->_template_args['ee_ueip_optin'] = isset(EE_Registry::instance()->CFG->core->ee_ueip_optin) ? EE_Registry::instance()->CFG->core->get_pretty('ee_ueip_optin') : true; |
|
370 | + $this->_template_args['site_license_key'] = isset(EE_Registry::instance()->NET_CFG->core->site_license_key) ? EE_Registry::instance()->NET_CFG->core->get_pretty('site_license_key') : ''; |
|
371 | + $this->_template_args['organization_name'] = isset(EE_Registry::instance()->CFG->organization->name) ? EE_Registry::instance()->CFG->organization->get_pretty('name') : ''; |
|
372 | + $this->_template_args['organization_address_1'] = isset(EE_Registry::instance()->CFG->organization->address_1) ? EE_Registry::instance()->CFG->organization->get_pretty('address_1') : ''; |
|
373 | + $this->_template_args['organization_address_2'] = isset(EE_Registry::instance()->CFG->organization->address_2) ? EE_Registry::instance()->CFG->organization->get_pretty('address_2') : ''; |
|
374 | + $this->_template_args['organization_city'] = isset(EE_Registry::instance()->CFG->organization->city) ? EE_Registry::instance()->CFG->organization->get_pretty('city') : ''; |
|
375 | + $this->_template_args['organization_zip'] = isset(EE_Registry::instance()->CFG->organization->zip) ? EE_Registry::instance()->CFG->organization->get_pretty('zip') : ''; |
|
376 | + $this->_template_args['organization_email'] = isset(EE_Registry::instance()->CFG->organization->email) ? EE_Registry::instance()->CFG->organization->get_pretty('email') : ''; |
|
377 | + $this->_template_args['organization_phone'] = isset(EE_Registry::instance()->CFG->organization->phone) ? EE_Registry::instance()->CFG->organization->get_pretty('phone') : ''; |
|
378 | + $this->_template_args['organization_vat'] = isset(EE_Registry::instance()->CFG->organization->vat) ? EE_Registry::instance()->CFG->organization->get_pretty('vat') : ''; |
|
379 | + $this->_template_args['currency_sign'] = isset(EE_Registry::instance()->CFG->currency->sign) ? EE_Registry::instance()->CFG->currency->get_pretty('sign') : '$'; |
|
380 | + $this->_template_args['organization_logo_url'] = isset(EE_Registry::instance()->CFG->organization->logo_url) ? EE_Registry::instance()->CFG->organization->get_pretty('logo_url') : false; |
|
381 | + $this->_template_args['organization_facebook'] = isset(EE_Registry::instance()->CFG->organization->facebook) ? EE_Registry::instance()->CFG->organization->get_pretty('facebook') : ''; |
|
382 | + $this->_template_args['organization_twitter'] = isset(EE_Registry::instance()->CFG->organization->twitter) ? EE_Registry::instance()->CFG->organization->get_pretty('twitter') : ''; |
|
383 | + $this->_template_args['organization_linkedin'] = isset(EE_Registry::instance()->CFG->organization->linkedin) ? EE_Registry::instance()->CFG->organization->get_pretty('linkedin') : ''; |
|
384 | + $this->_template_args['organization_pinterest'] = isset(EE_Registry::instance()->CFG->organization->pinterest) ? EE_Registry::instance()->CFG->organization->get_pretty('pinterest') : ''; |
|
385 | + $this->_template_args['organization_google'] = isset(EE_Registry::instance()->CFG->organization->google) ? EE_Registry::instance()->CFG->organization->get_pretty('google') : ''; |
|
386 | + $this->_template_args['organization_instagram'] = isset(EE_Registry::instance()->CFG->organization->instagram) ? EE_Registry::instance()->CFG->organization->get_pretty('instagram') : ''; |
|
387 | + //UXIP settings |
|
388 | + $this->_template_args['ee_ueip_optin'] = isset(EE_Registry::instance()->CFG->core->ee_ueip_optin) ? EE_Registry::instance()->CFG->core->get_pretty('ee_ueip_optin') : true; |
|
389 | 389 | |
390 | - $STA_ID = isset(EE_Registry::instance()->CFG->organization->STA_ID) ? EE_Registry::instance()->CFG->organization->STA_ID : 4; |
|
391 | - $this->_template_args['states'] = new EE_Question_Form_Input( |
|
392 | - EE_Question::new_instance(array( |
|
393 | - 'QST_ID' => 0, |
|
394 | - 'QST_display_text' => __('State/Province', 'event_espresso'), |
|
395 | - 'QST_system' => 'admin-state' |
|
396 | - )), |
|
397 | - EE_Answer::new_instance(array( |
|
398 | - 'ANS_ID' => 0, |
|
399 | - 'ANS_value' => $STA_ID |
|
400 | - )), |
|
401 | - array( |
|
402 | - 'input_id' => 'organization_state', |
|
403 | - 'input_name' => 'organization_state', |
|
404 | - 'input_prefix' => '', |
|
405 | - 'append_qstn_id' => false |
|
406 | - ) |
|
407 | - ); |
|
390 | + $STA_ID = isset(EE_Registry::instance()->CFG->organization->STA_ID) ? EE_Registry::instance()->CFG->organization->STA_ID : 4; |
|
391 | + $this->_template_args['states'] = new EE_Question_Form_Input( |
|
392 | + EE_Question::new_instance(array( |
|
393 | + 'QST_ID' => 0, |
|
394 | + 'QST_display_text' => __('State/Province', 'event_espresso'), |
|
395 | + 'QST_system' => 'admin-state' |
|
396 | + )), |
|
397 | + EE_Answer::new_instance(array( |
|
398 | + 'ANS_ID' => 0, |
|
399 | + 'ANS_value' => $STA_ID |
|
400 | + )), |
|
401 | + array( |
|
402 | + 'input_id' => 'organization_state', |
|
403 | + 'input_name' => 'organization_state', |
|
404 | + 'input_prefix' => '', |
|
405 | + 'append_qstn_id' => false |
|
406 | + ) |
|
407 | + ); |
|
408 | 408 | |
409 | - $CNT_ISO = isset(EE_Registry::instance()->CFG->organization->CNT_ISO) ? EE_Registry::instance()->CFG->organization->CNT_ISO : 'US'; |
|
410 | - $this->_template_args['countries'] = new EE_Question_Form_Input( |
|
411 | - EE_Question::new_instance(array( |
|
412 | - 'QST_ID' => 0, |
|
413 | - 'QST_display_text' => __('Country', 'event_espresso'), |
|
414 | - 'QST_system' => 'admin-country' |
|
415 | - )), |
|
416 | - EE_Answer::new_instance(array( |
|
417 | - 'ANS_ID' => 0, |
|
418 | - 'ANS_value' => $CNT_ISO |
|
419 | - )), |
|
420 | - array( |
|
421 | - 'input_id' => 'organization_country', |
|
422 | - 'input_name' => 'organization_country', |
|
423 | - 'input_prefix' => '', |
|
424 | - 'append_qstn_id' => false |
|
425 | - ) |
|
426 | - ); |
|
409 | + $CNT_ISO = isset(EE_Registry::instance()->CFG->organization->CNT_ISO) ? EE_Registry::instance()->CFG->organization->CNT_ISO : 'US'; |
|
410 | + $this->_template_args['countries'] = new EE_Question_Form_Input( |
|
411 | + EE_Question::new_instance(array( |
|
412 | + 'QST_ID' => 0, |
|
413 | + 'QST_display_text' => __('Country', 'event_espresso'), |
|
414 | + 'QST_system' => 'admin-country' |
|
415 | + )), |
|
416 | + EE_Answer::new_instance(array( |
|
417 | + 'ANS_ID' => 0, |
|
418 | + 'ANS_value' => $CNT_ISO |
|
419 | + )), |
|
420 | + array( |
|
421 | + 'input_id' => 'organization_country', |
|
422 | + 'input_name' => 'organization_country', |
|
423 | + 'input_prefix' => '', |
|
424 | + 'append_qstn_id' => false |
|
425 | + ) |
|
426 | + ); |
|
427 | 427 | |
428 | - add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2); |
|
429 | - add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2); |
|
428 | + add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2); |
|
429 | + add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2); |
|
430 | 430 | |
431 | - //PUE verification stuff |
|
432 | - $ver_option_key = 'puvererr_' . basename(EE_PLUGIN_BASENAME); |
|
433 | - $verify_fail = get_option($ver_option_key); |
|
434 | - $this->_template_args['site_license_key_verified'] = $verify_fail || ! empty($verify_fail) || (empty($this->_template_args['site_license_key']) && empty($verify_fail)) ? '<span class="dashicons dashicons-admin-network ee-icon-color-ee-red ee-icon-size-20"></span>' : '<span class="dashicons dashicons-admin-network ee-icon-color-ee-green ee-icon-size-20"></span>'; |
|
431 | + //PUE verification stuff |
|
432 | + $ver_option_key = 'puvererr_' . basename(EE_PLUGIN_BASENAME); |
|
433 | + $verify_fail = get_option($ver_option_key); |
|
434 | + $this->_template_args['site_license_key_verified'] = $verify_fail || ! empty($verify_fail) || (empty($this->_template_args['site_license_key']) && empty($verify_fail)) ? '<span class="dashicons dashicons-admin-network ee-icon-color-ee-red ee-icon-size-20"></span>' : '<span class="dashicons dashicons-admin-network ee-icon-color-ee-green ee-icon-size-20"></span>'; |
|
435 | 435 | |
436 | - $this->_set_add_edit_form_tags('update_your_organization_settings'); |
|
437 | - $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
438 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'your_organization_settings.template.php', |
|
439 | - $this->_template_args, true); |
|
436 | + $this->_set_add_edit_form_tags('update_your_organization_settings'); |
|
437 | + $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
438 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'your_organization_settings.template.php', |
|
439 | + $this->_template_args, true); |
|
440 | 440 | |
441 | - $this->display_admin_page_with_sidebar(); |
|
442 | - } |
|
443 | - |
|
444 | - protected function _update_your_organization_settings() |
|
445 | - { |
|
446 | - if (is_main_site()) { |
|
447 | - EE_Registry::instance()->NET_CFG->core->site_license_key = isset($this->_req_data['site_license_key']) ? sanitize_text_field($this->_req_data['site_license_key']) : EE_Registry::instance()->NET_CFG->core->site_license_key; |
|
448 | - } |
|
449 | - EE_Registry::instance()->CFG->organization->name = isset($this->_req_data['organization_name']) ? sanitize_text_field($this->_req_data['organization_name']) : EE_Registry::instance()->CFG->organization->name; |
|
450 | - EE_Registry::instance()->CFG->organization->address_1 = isset($this->_req_data['organization_address_1']) ? sanitize_text_field($this->_req_data['organization_address_1']) : EE_Registry::instance()->CFG->organization->address_1; |
|
451 | - EE_Registry::instance()->CFG->organization->address_2 = isset($this->_req_data['organization_address_2']) ? sanitize_text_field($this->_req_data['organization_address_2']) : EE_Registry::instance()->CFG->organization->address_2; |
|
452 | - EE_Registry::instance()->CFG->organization->city = isset($this->_req_data['organization_city']) ? sanitize_text_field($this->_req_data['organization_city']) : EE_Registry::instance()->CFG->organization->city; |
|
453 | - EE_Registry::instance()->CFG->organization->STA_ID = isset($this->_req_data['organization_state']) ? absint($this->_req_data['organization_state']) : EE_Registry::instance()->CFG->organization->STA_ID; |
|
454 | - EE_Registry::instance()->CFG->organization->CNT_ISO = isset($this->_req_data['organization_country']) ? sanitize_text_field($this->_req_data['organization_country']) : EE_Registry::instance()->CFG->organization->CNT_ISO; |
|
455 | - EE_Registry::instance()->CFG->organization->zip = isset($this->_req_data['organization_zip']) ? sanitize_text_field($this->_req_data['organization_zip']) : EE_Registry::instance()->CFG->organization->zip; |
|
456 | - EE_Registry::instance()->CFG->organization->email = isset($this->_req_data['organization_email']) ? sanitize_email($this->_req_data['organization_email']) : EE_Registry::instance()->CFG->organization->email; |
|
457 | - EE_Registry::instance()->CFG->organization->vat = isset($this->_req_data['organization_vat']) ? sanitize_text_field($this->_req_data['organization_vat']) : EE_Registry::instance()->CFG->organization->vat; |
|
458 | - EE_Registry::instance()->CFG->organization->phone = isset($this->_req_data['organization_phone']) ? sanitize_text_field($this->_req_data['organization_phone']) : EE_Registry::instance()->CFG->organization->phone; |
|
459 | - EE_Registry::instance()->CFG->organization->logo_url = isset($this->_req_data['organization_logo_url']) ? esc_url_raw($this->_req_data['organization_logo_url']) : EE_Registry::instance()->CFG->organization->logo_url; |
|
460 | - EE_Registry::instance()->CFG->organization->facebook = isset($this->_req_data['organization_facebook']) ? esc_url_raw($this->_req_data['organization_facebook']) : EE_Registry::instance()->CFG->organization->facebook; |
|
461 | - EE_Registry::instance()->CFG->organization->twitter = isset($this->_req_data['organization_twitter']) ? esc_url_raw($this->_req_data['organization_twitter']) : EE_Registry::instance()->CFG->organization->twitter; |
|
462 | - EE_Registry::instance()->CFG->organization->linkedin = isset($this->_req_data['organization_linkedin']) ? esc_url_raw($this->_req_data['organization_linkedin']) : EE_Registry::instance()->CFG->organization->linkedin; |
|
463 | - EE_Registry::instance()->CFG->organization->pinterest = isset($this->_req_data['organization_pinterest']) ? esc_url_raw($this->_req_data['organization_pinterest']) : EE_Registry::instance()->CFG->organization->pinterest; |
|
464 | - EE_Registry::instance()->CFG->organization->google = isset($this->_req_data['organization_google']) ? esc_url_raw($this->_req_data['organization_google']) : EE_Registry::instance()->CFG->organization->google; |
|
465 | - EE_Registry::instance()->CFG->organization->instagram = isset($this->_req_data['organization_instagram']) ? esc_url_raw($this->_req_data['organization_instagram']) : EE_Registry::instance()->CFG->organization->instagram; |
|
466 | - EE_Registry::instance()->CFG->core->ee_ueip_optin = isset($this->_req_data['ueip_optin']) && ! empty($this->_req_data['ueip_optin']) ? $this->_req_data['ueip_optin'] : EE_Registry::instance()->CFG->core->ee_ueip_optin; |
|
441 | + $this->display_admin_page_with_sidebar(); |
|
442 | + } |
|
443 | + |
|
444 | + protected function _update_your_organization_settings() |
|
445 | + { |
|
446 | + if (is_main_site()) { |
|
447 | + EE_Registry::instance()->NET_CFG->core->site_license_key = isset($this->_req_data['site_license_key']) ? sanitize_text_field($this->_req_data['site_license_key']) : EE_Registry::instance()->NET_CFG->core->site_license_key; |
|
448 | + } |
|
449 | + EE_Registry::instance()->CFG->organization->name = isset($this->_req_data['organization_name']) ? sanitize_text_field($this->_req_data['organization_name']) : EE_Registry::instance()->CFG->organization->name; |
|
450 | + EE_Registry::instance()->CFG->organization->address_1 = isset($this->_req_data['organization_address_1']) ? sanitize_text_field($this->_req_data['organization_address_1']) : EE_Registry::instance()->CFG->organization->address_1; |
|
451 | + EE_Registry::instance()->CFG->organization->address_2 = isset($this->_req_data['organization_address_2']) ? sanitize_text_field($this->_req_data['organization_address_2']) : EE_Registry::instance()->CFG->organization->address_2; |
|
452 | + EE_Registry::instance()->CFG->organization->city = isset($this->_req_data['organization_city']) ? sanitize_text_field($this->_req_data['organization_city']) : EE_Registry::instance()->CFG->organization->city; |
|
453 | + EE_Registry::instance()->CFG->organization->STA_ID = isset($this->_req_data['organization_state']) ? absint($this->_req_data['organization_state']) : EE_Registry::instance()->CFG->organization->STA_ID; |
|
454 | + EE_Registry::instance()->CFG->organization->CNT_ISO = isset($this->_req_data['organization_country']) ? sanitize_text_field($this->_req_data['organization_country']) : EE_Registry::instance()->CFG->organization->CNT_ISO; |
|
455 | + EE_Registry::instance()->CFG->organization->zip = isset($this->_req_data['organization_zip']) ? sanitize_text_field($this->_req_data['organization_zip']) : EE_Registry::instance()->CFG->organization->zip; |
|
456 | + EE_Registry::instance()->CFG->organization->email = isset($this->_req_data['organization_email']) ? sanitize_email($this->_req_data['organization_email']) : EE_Registry::instance()->CFG->organization->email; |
|
457 | + EE_Registry::instance()->CFG->organization->vat = isset($this->_req_data['organization_vat']) ? sanitize_text_field($this->_req_data['organization_vat']) : EE_Registry::instance()->CFG->organization->vat; |
|
458 | + EE_Registry::instance()->CFG->organization->phone = isset($this->_req_data['organization_phone']) ? sanitize_text_field($this->_req_data['organization_phone']) : EE_Registry::instance()->CFG->organization->phone; |
|
459 | + EE_Registry::instance()->CFG->organization->logo_url = isset($this->_req_data['organization_logo_url']) ? esc_url_raw($this->_req_data['organization_logo_url']) : EE_Registry::instance()->CFG->organization->logo_url; |
|
460 | + EE_Registry::instance()->CFG->organization->facebook = isset($this->_req_data['organization_facebook']) ? esc_url_raw($this->_req_data['organization_facebook']) : EE_Registry::instance()->CFG->organization->facebook; |
|
461 | + EE_Registry::instance()->CFG->organization->twitter = isset($this->_req_data['organization_twitter']) ? esc_url_raw($this->_req_data['organization_twitter']) : EE_Registry::instance()->CFG->organization->twitter; |
|
462 | + EE_Registry::instance()->CFG->organization->linkedin = isset($this->_req_data['organization_linkedin']) ? esc_url_raw($this->_req_data['organization_linkedin']) : EE_Registry::instance()->CFG->organization->linkedin; |
|
463 | + EE_Registry::instance()->CFG->organization->pinterest = isset($this->_req_data['organization_pinterest']) ? esc_url_raw($this->_req_data['organization_pinterest']) : EE_Registry::instance()->CFG->organization->pinterest; |
|
464 | + EE_Registry::instance()->CFG->organization->google = isset($this->_req_data['organization_google']) ? esc_url_raw($this->_req_data['organization_google']) : EE_Registry::instance()->CFG->organization->google; |
|
465 | + EE_Registry::instance()->CFG->organization->instagram = isset($this->_req_data['organization_instagram']) ? esc_url_raw($this->_req_data['organization_instagram']) : EE_Registry::instance()->CFG->organization->instagram; |
|
466 | + EE_Registry::instance()->CFG->core->ee_ueip_optin = isset($this->_req_data['ueip_optin']) && ! empty($this->_req_data['ueip_optin']) ? $this->_req_data['ueip_optin'] : EE_Registry::instance()->CFG->core->ee_ueip_optin; |
|
467 | 467 | |
468 | - EE_Registry::instance()->CFG->currency = new EE_Currency_Config(EE_Registry::instance()->CFG->organization->CNT_ISO); |
|
468 | + EE_Registry::instance()->CFG->currency = new EE_Currency_Config(EE_Registry::instance()->CFG->organization->CNT_ISO); |
|
469 | 469 | |
470 | - EE_Registry::instance()->CFG = apply_filters('FHEE__General_Settings_Admin_Page___update_your_organization_settings__CFG', |
|
471 | - EE_Registry::instance()->CFG); |
|
470 | + EE_Registry::instance()->CFG = apply_filters('FHEE__General_Settings_Admin_Page___update_your_organization_settings__CFG', |
|
471 | + EE_Registry::instance()->CFG); |
|
472 | 472 | |
473 | - $what = 'Your Organization Settings'; |
|
474 | - $success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, |
|
475 | - __LINE__); |
|
473 | + $what = 'Your Organization Settings'; |
|
474 | + $success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, |
|
475 | + __LINE__); |
|
476 | 476 | |
477 | - $this->_redirect_after_action($success, $what, 'updated', array('action' => 'default')); |
|
477 | + $this->_redirect_after_action($success, $what, 'updated', array('action' => 'default')); |
|
478 | 478 | |
479 | - } |
|
480 | - |
|
481 | - |
|
482 | - |
|
483 | - /************* Admin Options *************/ |
|
484 | - |
|
485 | - |
|
486 | - /** |
|
487 | - * _admin_option_settings |
|
488 | - * |
|
489 | - * @throws \EE_Error |
|
490 | - * @throws \LogicException |
|
491 | - */ |
|
492 | - protected function _admin_option_settings() |
|
493 | - { |
|
494 | - $this->_template_args['admin_page_content'] = ''; |
|
495 | - try { |
|
496 | - $admin_options_settings_form = new AdminOptionsSettings(EE_Registry::instance()); |
|
497 | - // still need this for the old school form in Extend_General_Settings_Admin_Page |
|
498 | - $this->_template_args['values'] = $this->_yes_no_values; |
|
499 | - // also need to account for the do_action that was in the old template |
|
500 | - $admin_options_settings_form->setTemplateArgs($this->_template_args); |
|
501 | - $this->_template_args['admin_page_content'] = $admin_options_settings_form->display(); |
|
502 | - } catch (Exception $e) { |
|
503 | - EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
504 | - } |
|
505 | - $this->_set_add_edit_form_tags('update_admin_option_settings'); |
|
506 | - $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
507 | - $this->display_admin_page_with_sidebar(); |
|
508 | - } |
|
509 | - |
|
510 | - |
|
511 | - /** |
|
512 | - * _update_admin_option_settings |
|
513 | - * |
|
514 | - * @throws \EE_Error |
|
515 | - * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
516 | - * @throws \EventEspresso\core\exceptions\InvalidFormSubmissionException |
|
517 | - * @throws \InvalidArgumentException |
|
518 | - * @throws \LogicException |
|
519 | - */ |
|
520 | - protected function _update_admin_option_settings() |
|
521 | - { |
|
522 | - try { |
|
523 | - $admin_options_settings_form = new AdminOptionsSettings(EE_Registry::instance()); |
|
524 | - $admin_options_settings_form->process($this->_req_data[$admin_options_settings_form->slug()]); |
|
525 | - EE_Registry::instance()->CFG->admin = apply_filters( |
|
526 | - 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', |
|
527 | - EE_Registry::instance()->CFG->admin |
|
528 | - ); |
|
529 | - } catch (Exception $e) { |
|
530 | - EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
531 | - } |
|
532 | - $this->_redirect_after_action( |
|
533 | - apply_filters( |
|
534 | - 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', |
|
535 | - $this->_update_espresso_configuration( |
|
536 | - 'Admin Options', |
|
537 | - EE_Registry::instance()->CFG->admin, |
|
538 | - __FILE__, __FUNCTION__, __LINE__ |
|
539 | - ) |
|
540 | - ), |
|
541 | - 'Admin Options', |
|
542 | - 'updated', |
|
543 | - array('action' => 'admin_option_settings') |
|
544 | - ); |
|
479 | + } |
|
480 | + |
|
481 | + |
|
482 | + |
|
483 | + /************* Admin Options *************/ |
|
484 | + |
|
485 | + |
|
486 | + /** |
|
487 | + * _admin_option_settings |
|
488 | + * |
|
489 | + * @throws \EE_Error |
|
490 | + * @throws \LogicException |
|
491 | + */ |
|
492 | + protected function _admin_option_settings() |
|
493 | + { |
|
494 | + $this->_template_args['admin_page_content'] = ''; |
|
495 | + try { |
|
496 | + $admin_options_settings_form = new AdminOptionsSettings(EE_Registry::instance()); |
|
497 | + // still need this for the old school form in Extend_General_Settings_Admin_Page |
|
498 | + $this->_template_args['values'] = $this->_yes_no_values; |
|
499 | + // also need to account for the do_action that was in the old template |
|
500 | + $admin_options_settings_form->setTemplateArgs($this->_template_args); |
|
501 | + $this->_template_args['admin_page_content'] = $admin_options_settings_form->display(); |
|
502 | + } catch (Exception $e) { |
|
503 | + EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
504 | + } |
|
505 | + $this->_set_add_edit_form_tags('update_admin_option_settings'); |
|
506 | + $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
507 | + $this->display_admin_page_with_sidebar(); |
|
508 | + } |
|
509 | + |
|
510 | + |
|
511 | + /** |
|
512 | + * _update_admin_option_settings |
|
513 | + * |
|
514 | + * @throws \EE_Error |
|
515 | + * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
516 | + * @throws \EventEspresso\core\exceptions\InvalidFormSubmissionException |
|
517 | + * @throws \InvalidArgumentException |
|
518 | + * @throws \LogicException |
|
519 | + */ |
|
520 | + protected function _update_admin_option_settings() |
|
521 | + { |
|
522 | + try { |
|
523 | + $admin_options_settings_form = new AdminOptionsSettings(EE_Registry::instance()); |
|
524 | + $admin_options_settings_form->process($this->_req_data[$admin_options_settings_form->slug()]); |
|
525 | + EE_Registry::instance()->CFG->admin = apply_filters( |
|
526 | + 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', |
|
527 | + EE_Registry::instance()->CFG->admin |
|
528 | + ); |
|
529 | + } catch (Exception $e) { |
|
530 | + EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
531 | + } |
|
532 | + $this->_redirect_after_action( |
|
533 | + apply_filters( |
|
534 | + 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', |
|
535 | + $this->_update_espresso_configuration( |
|
536 | + 'Admin Options', |
|
537 | + EE_Registry::instance()->CFG->admin, |
|
538 | + __FILE__, __FUNCTION__, __LINE__ |
|
539 | + ) |
|
540 | + ), |
|
541 | + 'Admin Options', |
|
542 | + 'updated', |
|
543 | + array('action' => 'admin_option_settings') |
|
544 | + ); |
|
545 | 545 | |
546 | - } |
|
546 | + } |
|
547 | 547 | |
548 | 548 | |
549 | - /************* Countries *************/ |
|
549 | + /************* Countries *************/ |
|
550 | 550 | |
551 | 551 | |
552 | - protected function _country_settings() |
|
553 | - { |
|
552 | + protected function _country_settings() |
|
553 | + { |
|
554 | 554 | |
555 | - $CNT_ISO = isset(EE_Registry::instance()->CFG->organization->CNT_ISO) ? EE_Registry::instance()->CFG->organization->CNT_ISO : 'US'; |
|
556 | - $CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : $CNT_ISO; |
|
555 | + $CNT_ISO = isset(EE_Registry::instance()->CFG->organization->CNT_ISO) ? EE_Registry::instance()->CFG->organization->CNT_ISO : 'US'; |
|
556 | + $CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : $CNT_ISO; |
|
557 | 557 | |
558 | - //load field generator helper |
|
558 | + //load field generator helper |
|
559 | 559 | |
560 | - $this->_template_args['values'] = $this->_yes_no_values; |
|
560 | + $this->_template_args['values'] = $this->_yes_no_values; |
|
561 | 561 | |
562 | - $this->_template_args['countries'] = new EE_Question_Form_Input( |
|
563 | - EE_Question::new_instance(array( |
|
564 | - 'QST_ID' => 0, |
|
565 | - 'QST_display_text' => __('Select Country', 'event_espresso'), |
|
566 | - 'QST_system' => 'admin-country' |
|
567 | - )), |
|
568 | - EE_Answer::new_instance(array( |
|
569 | - 'ANS_ID' => 0, |
|
570 | - 'ANS_value' => $CNT_ISO |
|
571 | - )), |
|
572 | - array( |
|
573 | - 'input_id' => 'country', |
|
574 | - 'input_name' => 'country', |
|
575 | - 'input_prefix' => '', |
|
576 | - 'append_qstn_id' => false |
|
577 | - ) |
|
578 | - ); |
|
562 | + $this->_template_args['countries'] = new EE_Question_Form_Input( |
|
563 | + EE_Question::new_instance(array( |
|
564 | + 'QST_ID' => 0, |
|
565 | + 'QST_display_text' => __('Select Country', 'event_espresso'), |
|
566 | + 'QST_system' => 'admin-country' |
|
567 | + )), |
|
568 | + EE_Answer::new_instance(array( |
|
569 | + 'ANS_ID' => 0, |
|
570 | + 'ANS_value' => $CNT_ISO |
|
571 | + )), |
|
572 | + array( |
|
573 | + 'input_id' => 'country', |
|
574 | + 'input_name' => 'country', |
|
575 | + 'input_prefix' => '', |
|
576 | + 'append_qstn_id' => false |
|
577 | + ) |
|
578 | + ); |
|
579 | 579 | // EEH_Debug_Tools::printr( $this->_template_args['countries'], 'countries <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
580 | 580 | |
581 | - add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2); |
|
582 | - add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2); |
|
583 | - $this->_template_args['country_details_settings'] = $this->display_country_settings(); |
|
584 | - $this->_template_args['country_states_settings'] = $this->display_country_states(); |
|
581 | + add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2); |
|
582 | + add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2); |
|
583 | + $this->_template_args['country_details_settings'] = $this->display_country_settings(); |
|
584 | + $this->_template_args['country_states_settings'] = $this->display_country_states(); |
|
585 | 585 | |
586 | - $this->_set_add_edit_form_tags('update_country_settings'); |
|
587 | - $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
588 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'countries_settings.template.php', |
|
589 | - $this->_template_args, true); |
|
590 | - $this->display_admin_page_with_no_sidebar(); |
|
591 | - } |
|
592 | - |
|
593 | - |
|
594 | - /** |
|
595 | - * display_country_settings |
|
596 | - * |
|
597 | - * @access public |
|
598 | - * |
|
599 | - * @param string $CNT_ISO |
|
600 | - * |
|
601 | - * @return mixed string | array |
|
602 | - */ |
|
603 | - public function display_country_settings($CNT_ISO = '') |
|
604 | - { |
|
586 | + $this->_set_add_edit_form_tags('update_country_settings'); |
|
587 | + $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
588 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'countries_settings.template.php', |
|
589 | + $this->_template_args, true); |
|
590 | + $this->display_admin_page_with_no_sidebar(); |
|
591 | + } |
|
592 | + |
|
593 | + |
|
594 | + /** |
|
595 | + * display_country_settings |
|
596 | + * |
|
597 | + * @access public |
|
598 | + * |
|
599 | + * @param string $CNT_ISO |
|
600 | + * |
|
601 | + * @return mixed string | array |
|
602 | + */ |
|
603 | + public function display_country_settings($CNT_ISO = '') |
|
604 | + { |
|
605 | 605 | |
606 | - $CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : $CNT_ISO; |
|
607 | - if ( ! $CNT_ISO) { |
|
608 | - return ''; |
|
609 | - } |
|
606 | + $CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : $CNT_ISO; |
|
607 | + if ( ! $CNT_ISO) { |
|
608 | + return ''; |
|
609 | + } |
|
610 | 610 | |
611 | - // for ajax |
|
612 | - remove_all_filters('FHEE__EEH_Form_Fields__label_html'); |
|
613 | - remove_all_filters('FHEE__EEH_Form_Fields__input_html'); |
|
614 | - add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2); |
|
615 | - add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2); |
|
616 | - $country = EEM_Country::instance()->get_one_by_ID($CNT_ISO); |
|
617 | - //EEH_Debug_Tools::printr( $country, '$country <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
618 | - $country_input_types = array( |
|
619 | - 'CNT_active' => array( |
|
620 | - 'type' => 'RADIO_BTN', |
|
621 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
622 | - 'class' => '', |
|
623 | - 'options' => $this->_yes_no_values, |
|
624 | - 'use_desc_4_label' => true |
|
625 | - ), |
|
626 | - 'CNT_ISO' => array( |
|
627 | - 'type' => 'TEXT', |
|
628 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
629 | - 'class' => 'small-text' |
|
630 | - ), |
|
631 | - 'CNT_ISO3' => array( |
|
632 | - 'type' => 'TEXT', |
|
633 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
634 | - 'class' => 'small-text' |
|
635 | - ), |
|
636 | - 'RGN_ID' => array( |
|
637 | - 'type' => 'TEXT', |
|
638 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
639 | - 'class' => 'small-text' |
|
640 | - ), |
|
641 | - 'CNT_name' => array( |
|
642 | - 'type' => 'TEXT', |
|
643 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
644 | - 'class' => 'regular-text' |
|
645 | - ), |
|
646 | - 'CNT_cur_code' => array( |
|
647 | - 'type' => 'TEXT', |
|
648 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
649 | - 'class' => 'small-text' |
|
650 | - ), |
|
651 | - 'CNT_cur_single' => array( |
|
652 | - 'type' => 'TEXT', |
|
653 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
654 | - 'class' => 'medium-text' |
|
655 | - ), |
|
656 | - 'CNT_cur_plural' => array( |
|
657 | - 'type' => 'TEXT', |
|
658 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
659 | - 'class' => 'medium-text' |
|
660 | - ), |
|
661 | - 'CNT_cur_sign' => array( |
|
662 | - 'type' => 'TEXT', |
|
663 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
664 | - 'class' => 'small-text', |
|
665 | - 'htmlentities' => false |
|
666 | - ), |
|
667 | - 'CNT_cur_sign_b4' => array( |
|
668 | - 'type' => 'RADIO_BTN', |
|
669 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
670 | - 'class' => '', |
|
671 | - 'options' => $this->_yes_no_values, |
|
672 | - 'use_desc_4_label' => true |
|
673 | - ), |
|
674 | - 'CNT_cur_dec_plc' => array( |
|
675 | - 'type' => 'RADIO_BTN', |
|
676 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
677 | - 'class' => '', |
|
678 | - 'options' => array( |
|
679 | - array('id' => 0, 'text' => ''), |
|
680 | - array('id' => 1, 'text' => ''), |
|
681 | - array('id' => 2, 'text' => ''), |
|
682 | - array('id' => 3, 'text' => '') |
|
683 | - ) |
|
684 | - ), |
|
685 | - 'CNT_cur_dec_mrk' => array( |
|
686 | - 'type' => 'RADIO_BTN', |
|
687 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
688 | - 'class' => '', |
|
689 | - 'options' => array( |
|
690 | - array( |
|
691 | - 'id' => ',', |
|
692 | - 'text' => __(', (comma)', 'event_espresso') |
|
693 | - ), |
|
694 | - array('id' => '.', 'text' => __('. (decimal)', 'event_espresso')) |
|
695 | - ), |
|
696 | - 'use_desc_4_label' => true |
|
697 | - ), |
|
698 | - 'CNT_cur_thsnds' => array( |
|
699 | - 'type' => 'RADIO_BTN', |
|
700 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
701 | - 'class' => '', |
|
702 | - 'options' => array( |
|
703 | - array( |
|
704 | - 'id' => ',', |
|
705 | - 'text' => __(', (comma)', 'event_espresso') |
|
706 | - ), |
|
707 | - array('id' => '.', 'text' => __('. (decimal)', 'event_espresso')) |
|
708 | - ), |
|
709 | - 'use_desc_4_label' => true |
|
710 | - ), |
|
711 | - 'CNT_tel_code' => array( |
|
712 | - 'type' => 'TEXT', |
|
713 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
714 | - 'class' => 'small-text' |
|
715 | - ), |
|
716 | - 'CNT_is_EU' => array( |
|
717 | - 'type' => 'RADIO_BTN', |
|
718 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
719 | - 'class' => '', |
|
720 | - 'options' => $this->_yes_no_values, |
|
721 | - 'use_desc_4_label' => true |
|
722 | - ) |
|
723 | - ); |
|
724 | - $this->_template_args['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($country, |
|
725 | - $country_input_types); |
|
726 | - $country_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'country_details_settings.template.php', |
|
727 | - $this->_template_args, true); |
|
611 | + // for ajax |
|
612 | + remove_all_filters('FHEE__EEH_Form_Fields__label_html'); |
|
613 | + remove_all_filters('FHEE__EEH_Form_Fields__input_html'); |
|
614 | + add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2); |
|
615 | + add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2); |
|
616 | + $country = EEM_Country::instance()->get_one_by_ID($CNT_ISO); |
|
617 | + //EEH_Debug_Tools::printr( $country, '$country <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
618 | + $country_input_types = array( |
|
619 | + 'CNT_active' => array( |
|
620 | + 'type' => 'RADIO_BTN', |
|
621 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
622 | + 'class' => '', |
|
623 | + 'options' => $this->_yes_no_values, |
|
624 | + 'use_desc_4_label' => true |
|
625 | + ), |
|
626 | + 'CNT_ISO' => array( |
|
627 | + 'type' => 'TEXT', |
|
628 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
629 | + 'class' => 'small-text' |
|
630 | + ), |
|
631 | + 'CNT_ISO3' => array( |
|
632 | + 'type' => 'TEXT', |
|
633 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
634 | + 'class' => 'small-text' |
|
635 | + ), |
|
636 | + 'RGN_ID' => array( |
|
637 | + 'type' => 'TEXT', |
|
638 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
639 | + 'class' => 'small-text' |
|
640 | + ), |
|
641 | + 'CNT_name' => array( |
|
642 | + 'type' => 'TEXT', |
|
643 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
644 | + 'class' => 'regular-text' |
|
645 | + ), |
|
646 | + 'CNT_cur_code' => array( |
|
647 | + 'type' => 'TEXT', |
|
648 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
649 | + 'class' => 'small-text' |
|
650 | + ), |
|
651 | + 'CNT_cur_single' => array( |
|
652 | + 'type' => 'TEXT', |
|
653 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
654 | + 'class' => 'medium-text' |
|
655 | + ), |
|
656 | + 'CNT_cur_plural' => array( |
|
657 | + 'type' => 'TEXT', |
|
658 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
659 | + 'class' => 'medium-text' |
|
660 | + ), |
|
661 | + 'CNT_cur_sign' => array( |
|
662 | + 'type' => 'TEXT', |
|
663 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
664 | + 'class' => 'small-text', |
|
665 | + 'htmlentities' => false |
|
666 | + ), |
|
667 | + 'CNT_cur_sign_b4' => array( |
|
668 | + 'type' => 'RADIO_BTN', |
|
669 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
670 | + 'class' => '', |
|
671 | + 'options' => $this->_yes_no_values, |
|
672 | + 'use_desc_4_label' => true |
|
673 | + ), |
|
674 | + 'CNT_cur_dec_plc' => array( |
|
675 | + 'type' => 'RADIO_BTN', |
|
676 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
677 | + 'class' => '', |
|
678 | + 'options' => array( |
|
679 | + array('id' => 0, 'text' => ''), |
|
680 | + array('id' => 1, 'text' => ''), |
|
681 | + array('id' => 2, 'text' => ''), |
|
682 | + array('id' => 3, 'text' => '') |
|
683 | + ) |
|
684 | + ), |
|
685 | + 'CNT_cur_dec_mrk' => array( |
|
686 | + 'type' => 'RADIO_BTN', |
|
687 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
688 | + 'class' => '', |
|
689 | + 'options' => array( |
|
690 | + array( |
|
691 | + 'id' => ',', |
|
692 | + 'text' => __(', (comma)', 'event_espresso') |
|
693 | + ), |
|
694 | + array('id' => '.', 'text' => __('. (decimal)', 'event_espresso')) |
|
695 | + ), |
|
696 | + 'use_desc_4_label' => true |
|
697 | + ), |
|
698 | + 'CNT_cur_thsnds' => array( |
|
699 | + 'type' => 'RADIO_BTN', |
|
700 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
701 | + 'class' => '', |
|
702 | + 'options' => array( |
|
703 | + array( |
|
704 | + 'id' => ',', |
|
705 | + 'text' => __(', (comma)', 'event_espresso') |
|
706 | + ), |
|
707 | + array('id' => '.', 'text' => __('. (decimal)', 'event_espresso')) |
|
708 | + ), |
|
709 | + 'use_desc_4_label' => true |
|
710 | + ), |
|
711 | + 'CNT_tel_code' => array( |
|
712 | + 'type' => 'TEXT', |
|
713 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
714 | + 'class' => 'small-text' |
|
715 | + ), |
|
716 | + 'CNT_is_EU' => array( |
|
717 | + 'type' => 'RADIO_BTN', |
|
718 | + 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
719 | + 'class' => '', |
|
720 | + 'options' => $this->_yes_no_values, |
|
721 | + 'use_desc_4_label' => true |
|
722 | + ) |
|
723 | + ); |
|
724 | + $this->_template_args['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($country, |
|
725 | + $country_input_types); |
|
726 | + $country_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'country_details_settings.template.php', |
|
727 | + $this->_template_args, true); |
|
728 | 728 | |
729 | - if (defined('DOING_AJAX')) { |
|
730 | - $notices = EE_Error::get_notices(false, false, false); |
|
731 | - echo json_encode(array( |
|
732 | - 'return_data' => $country_details_settings, |
|
733 | - 'success' => $notices['success'], |
|
734 | - 'errors' => $notices['errors'] |
|
735 | - )); |
|
736 | - die(); |
|
737 | - } else { |
|
738 | - return $country_details_settings; |
|
739 | - } |
|
729 | + if (defined('DOING_AJAX')) { |
|
730 | + $notices = EE_Error::get_notices(false, false, false); |
|
731 | + echo json_encode(array( |
|
732 | + 'return_data' => $country_details_settings, |
|
733 | + 'success' => $notices['success'], |
|
734 | + 'errors' => $notices['errors'] |
|
735 | + )); |
|
736 | + die(); |
|
737 | + } else { |
|
738 | + return $country_details_settings; |
|
739 | + } |
|
740 | 740 | |
741 | - } |
|
742 | - |
|
743 | - |
|
744 | - /** |
|
745 | - * display_country_states |
|
746 | - * |
|
747 | - * @access public |
|
748 | - * |
|
749 | - * @param string $CNT_ISO |
|
750 | - * |
|
751 | - * @return string |
|
752 | - */ |
|
753 | - public function display_country_states($CNT_ISO = '') |
|
754 | - { |
|
741 | + } |
|
742 | + |
|
743 | + |
|
744 | + /** |
|
745 | + * display_country_states |
|
746 | + * |
|
747 | + * @access public |
|
748 | + * |
|
749 | + * @param string $CNT_ISO |
|
750 | + * |
|
751 | + * @return string |
|
752 | + */ |
|
753 | + public function display_country_states($CNT_ISO = '') |
|
754 | + { |
|
755 | 755 | |
756 | - $CNT_ISO = isset($this->_req_data['country']) ? sanitize_text_field($this->_req_data['country']) : $CNT_ISO; |
|
756 | + $CNT_ISO = isset($this->_req_data['country']) ? sanitize_text_field($this->_req_data['country']) : $CNT_ISO; |
|
757 | 757 | |
758 | - if ( ! $CNT_ISO) { |
|
759 | - return ''; |
|
760 | - } |
|
761 | - // for ajax |
|
762 | - remove_all_filters('FHEE__EEH_Form_Fields__label_html'); |
|
763 | - remove_all_filters('FHEE__EEH_Form_Fields__input_html'); |
|
764 | - add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'state_form_field_label_wrap'), 10, 2); |
|
765 | - add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'state_form_field_input__wrap'), 10, 2); |
|
766 | - $states = EEM_State::instance()->get_all_states_for_these_countries(array($CNT_ISO => $CNT_ISO)); |
|
758 | + if ( ! $CNT_ISO) { |
|
759 | + return ''; |
|
760 | + } |
|
761 | + // for ajax |
|
762 | + remove_all_filters('FHEE__EEH_Form_Fields__label_html'); |
|
763 | + remove_all_filters('FHEE__EEH_Form_Fields__input_html'); |
|
764 | + add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'state_form_field_label_wrap'), 10, 2); |
|
765 | + add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'state_form_field_input__wrap'), 10, 2); |
|
766 | + $states = EEM_State::instance()->get_all_states_for_these_countries(array($CNT_ISO => $CNT_ISO)); |
|
767 | 767 | |
768 | 768 | // echo '<h4>$CNT_ISO : ' . $CNT_ISO . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
769 | 769 | // global $wpdb; |
770 | 770 | // echo '<h4>' . $wpdb->last_query . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
771 | 771 | // EEH_Debug_Tools::printr( $states, '$states <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
772 | - if ($states) { |
|
773 | - foreach ($states as $STA_ID => $state) { |
|
774 | - if ($state instanceof EE_State) { |
|
775 | - //STA_abbrev STA_name STA_active |
|
776 | - $state_input_types = array( |
|
777 | - 'STA_abbrev' => array( |
|
778 | - 'type' => 'TEXT', |
|
779 | - 'input_name' => 'states[' . $STA_ID . ']', |
|
780 | - 'class' => 'mid-text' |
|
781 | - ), |
|
782 | - 'STA_name' => array( |
|
783 | - 'type' => 'TEXT', |
|
784 | - 'input_name' => 'states[' . $STA_ID . ']', |
|
785 | - 'class' => 'regular-text' |
|
786 | - ), |
|
787 | - 'STA_active' => array( |
|
788 | - 'type' => 'RADIO_BTN', |
|
789 | - 'input_name' => 'states[' . $STA_ID . ']', |
|
790 | - 'options' => $this->_yes_no_values, |
|
791 | - 'use_desc_4_label' => true |
|
792 | - ) |
|
793 | - ); |
|
794 | - $this->_template_args['states'][$STA_ID]['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($state, |
|
795 | - $state_input_types); |
|
796 | - $query_args = array( |
|
797 | - 'action' => 'delete_state', |
|
798 | - 'STA_ID' => $STA_ID, |
|
799 | - 'CNT_ISO' => $CNT_ISO, |
|
800 | - 'STA_abbrev' => $state->abbrev() |
|
801 | - ); |
|
802 | - $this->_template_args['states'][$STA_ID]['delete_state_url'] = EE_Admin_Page::add_query_args_and_nonce($query_args, |
|
803 | - GEN_SET_ADMIN_URL); |
|
804 | - } |
|
805 | - } |
|
806 | - } else { |
|
807 | - $this->_template_args['states'] = false; |
|
808 | - } |
|
772 | + if ($states) { |
|
773 | + foreach ($states as $STA_ID => $state) { |
|
774 | + if ($state instanceof EE_State) { |
|
775 | + //STA_abbrev STA_name STA_active |
|
776 | + $state_input_types = array( |
|
777 | + 'STA_abbrev' => array( |
|
778 | + 'type' => 'TEXT', |
|
779 | + 'input_name' => 'states[' . $STA_ID . ']', |
|
780 | + 'class' => 'mid-text' |
|
781 | + ), |
|
782 | + 'STA_name' => array( |
|
783 | + 'type' => 'TEXT', |
|
784 | + 'input_name' => 'states[' . $STA_ID . ']', |
|
785 | + 'class' => 'regular-text' |
|
786 | + ), |
|
787 | + 'STA_active' => array( |
|
788 | + 'type' => 'RADIO_BTN', |
|
789 | + 'input_name' => 'states[' . $STA_ID . ']', |
|
790 | + 'options' => $this->_yes_no_values, |
|
791 | + 'use_desc_4_label' => true |
|
792 | + ) |
|
793 | + ); |
|
794 | + $this->_template_args['states'][$STA_ID]['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($state, |
|
795 | + $state_input_types); |
|
796 | + $query_args = array( |
|
797 | + 'action' => 'delete_state', |
|
798 | + 'STA_ID' => $STA_ID, |
|
799 | + 'CNT_ISO' => $CNT_ISO, |
|
800 | + 'STA_abbrev' => $state->abbrev() |
|
801 | + ); |
|
802 | + $this->_template_args['states'][$STA_ID]['delete_state_url'] = EE_Admin_Page::add_query_args_and_nonce($query_args, |
|
803 | + GEN_SET_ADMIN_URL); |
|
804 | + } |
|
805 | + } |
|
806 | + } else { |
|
807 | + $this->_template_args['states'] = false; |
|
808 | + } |
|
809 | 809 | // EEH_Debug_Tools::printr( $this->_template_args['states'], 'states <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
810 | - $this->_template_args['add_new_state_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'add_new_state'), |
|
811 | - GEN_SET_ADMIN_URL); |
|
810 | + $this->_template_args['add_new_state_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'add_new_state'), |
|
811 | + GEN_SET_ADMIN_URL); |
|
812 | 812 | |
813 | - $state_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'state_details_settings.template.php', |
|
814 | - $this->_template_args, true); |
|
813 | + $state_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'state_details_settings.template.php', |
|
814 | + $this->_template_args, true); |
|
815 | 815 | |
816 | - if (defined('DOING_AJAX')) { |
|
817 | - $notices = EE_Error::get_notices(false, false, false); |
|
818 | - echo json_encode(array( |
|
819 | - 'return_data' => $state_details_settings, |
|
820 | - 'success' => $notices['success'], |
|
821 | - 'errors' => $notices['errors'] |
|
822 | - )); |
|
823 | - die(); |
|
824 | - } else { |
|
825 | - return $state_details_settings; |
|
826 | - } |
|
816 | + if (defined('DOING_AJAX')) { |
|
817 | + $notices = EE_Error::get_notices(false, false, false); |
|
818 | + echo json_encode(array( |
|
819 | + 'return_data' => $state_details_settings, |
|
820 | + 'success' => $notices['success'], |
|
821 | + 'errors' => $notices['errors'] |
|
822 | + )); |
|
823 | + die(); |
|
824 | + } else { |
|
825 | + return $state_details_settings; |
|
826 | + } |
|
827 | 827 | |
828 | - } |
|
828 | + } |
|
829 | 829 | |
830 | 830 | |
831 | - /** |
|
832 | - * add_new_state |
|
833 | - * |
|
834 | - * @access public |
|
835 | - * @return void |
|
836 | - */ |
|
837 | - public function add_new_state() |
|
838 | - { |
|
831 | + /** |
|
832 | + * add_new_state |
|
833 | + * |
|
834 | + * @access public |
|
835 | + * @return void |
|
836 | + */ |
|
837 | + public function add_new_state() |
|
838 | + { |
|
839 | 839 | |
840 | - $success = true; |
|
840 | + $success = true; |
|
841 | 841 | |
842 | - $CNT_ISO = isset($this->_req_data['CNT_ISO']) ? strtoupper(sanitize_text_field($this->_req_data['CNT_ISO'])) : false; |
|
843 | - if ( ! $CNT_ISO) { |
|
844 | - EE_Error::add_error(__('No Country ISO code or an invalid Country ISO code was received.', |
|
845 | - 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
846 | - $success = false; |
|
847 | - } |
|
848 | - $STA_abbrev = isset($this->_req_data['STA_abbrev']) ? sanitize_text_field($this->_req_data['STA_abbrev']) : false; |
|
849 | - if ( ! $STA_abbrev) { |
|
850 | - EE_Error::add_error(__('No State ISO code or an invalid State ISO code was received.', 'event_espresso'), |
|
851 | - __FILE__, __FUNCTION__, __LINE__); |
|
852 | - $success = false; |
|
853 | - } |
|
854 | - $STA_name = isset($this->_req_data['STA_name']) ? sanitize_text_field($this->_req_data['STA_name']) : |
|
855 | - false; |
|
856 | - if ( ! $STA_name) { |
|
857 | - EE_Error::add_error(__('No State name or an invalid State name was received.', 'event_espresso'), __FILE__, |
|
858 | - __FUNCTION__, __LINE__); |
|
859 | - $success = false; |
|
860 | - } |
|
842 | + $CNT_ISO = isset($this->_req_data['CNT_ISO']) ? strtoupper(sanitize_text_field($this->_req_data['CNT_ISO'])) : false; |
|
843 | + if ( ! $CNT_ISO) { |
|
844 | + EE_Error::add_error(__('No Country ISO code or an invalid Country ISO code was received.', |
|
845 | + 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
846 | + $success = false; |
|
847 | + } |
|
848 | + $STA_abbrev = isset($this->_req_data['STA_abbrev']) ? sanitize_text_field($this->_req_data['STA_abbrev']) : false; |
|
849 | + if ( ! $STA_abbrev) { |
|
850 | + EE_Error::add_error(__('No State ISO code or an invalid State ISO code was received.', 'event_espresso'), |
|
851 | + __FILE__, __FUNCTION__, __LINE__); |
|
852 | + $success = false; |
|
853 | + } |
|
854 | + $STA_name = isset($this->_req_data['STA_name']) ? sanitize_text_field($this->_req_data['STA_name']) : |
|
855 | + false; |
|
856 | + if ( ! $STA_name) { |
|
857 | + EE_Error::add_error(__('No State name or an invalid State name was received.', 'event_espresso'), __FILE__, |
|
858 | + __FUNCTION__, __LINE__); |
|
859 | + $success = false; |
|
860 | + } |
|
861 | 861 | |
862 | - if ($success) { |
|
863 | - $cols_n_values = array( |
|
864 | - 'CNT_ISO' => $CNT_ISO, |
|
865 | - 'STA_abbrev' => $STA_abbrev, |
|
866 | - 'STA_name' => $STA_name, |
|
867 | - 'STA_active' => true |
|
868 | - ); |
|
869 | - $success = EEM_State::instance()->insert($cols_n_values); |
|
870 | - EE_Error::add_success(__('The State was added successfully.', 'event_espresso')); |
|
871 | - } |
|
862 | + if ($success) { |
|
863 | + $cols_n_values = array( |
|
864 | + 'CNT_ISO' => $CNT_ISO, |
|
865 | + 'STA_abbrev' => $STA_abbrev, |
|
866 | + 'STA_name' => $STA_name, |
|
867 | + 'STA_active' => true |
|
868 | + ); |
|
869 | + $success = EEM_State::instance()->insert($cols_n_values); |
|
870 | + EE_Error::add_success(__('The State was added successfully.', 'event_espresso')); |
|
871 | + } |
|
872 | 872 | |
873 | - if (defined('DOING_AJAX')) { |
|
874 | - $notices = EE_Error::get_notices(false, false, false); |
|
875 | - echo json_encode(array_merge($notices, array('return_data' => $CNT_ISO))); |
|
876 | - die(); |
|
877 | - } else { |
|
878 | - $this->_redirect_after_action($success, 'State', 'added', array('action' => 'country_settings')); |
|
879 | - } |
|
880 | - } |
|
881 | - |
|
882 | - |
|
883 | - /** |
|
884 | - * delete_state |
|
885 | - * |
|
886 | - * @access public |
|
887 | - * @return boolean | void |
|
888 | - */ |
|
889 | - public function delete_state() |
|
890 | - { |
|
891 | - $CNT_ISO = isset($this->_req_data['CNT_ISO']) ? strtoupper(sanitize_text_field($this->_req_data['CNT_ISO'])) : false; |
|
892 | - $STA_ID = isset($this->_req_data['STA_ID']) ? sanitize_text_field($this->_req_data['STA_ID']) : false; |
|
893 | - $STA_abbrev = isset($this->_req_data['STA_abbrev']) ? sanitize_text_field($this->_req_data['STA_abbrev']) : false; |
|
894 | - if ( ! $STA_ID) { |
|
895 | - EE_Error::add_error(__('No State ID or an invalid State ID was received.', 'event_espresso'), __FILE__, |
|
896 | - __FUNCTION__, __LINE__); |
|
873 | + if (defined('DOING_AJAX')) { |
|
874 | + $notices = EE_Error::get_notices(false, false, false); |
|
875 | + echo json_encode(array_merge($notices, array('return_data' => $CNT_ISO))); |
|
876 | + die(); |
|
877 | + } else { |
|
878 | + $this->_redirect_after_action($success, 'State', 'added', array('action' => 'country_settings')); |
|
879 | + } |
|
880 | + } |
|
881 | + |
|
882 | + |
|
883 | + /** |
|
884 | + * delete_state |
|
885 | + * |
|
886 | + * @access public |
|
887 | + * @return boolean | void |
|
888 | + */ |
|
889 | + public function delete_state() |
|
890 | + { |
|
891 | + $CNT_ISO = isset($this->_req_data['CNT_ISO']) ? strtoupper(sanitize_text_field($this->_req_data['CNT_ISO'])) : false; |
|
892 | + $STA_ID = isset($this->_req_data['STA_ID']) ? sanitize_text_field($this->_req_data['STA_ID']) : false; |
|
893 | + $STA_abbrev = isset($this->_req_data['STA_abbrev']) ? sanitize_text_field($this->_req_data['STA_abbrev']) : false; |
|
894 | + if ( ! $STA_ID) { |
|
895 | + EE_Error::add_error(__('No State ID or an invalid State ID was received.', 'event_espresso'), __FILE__, |
|
896 | + __FUNCTION__, __LINE__); |
|
897 | 897 | |
898 | - return false; |
|
899 | - } |
|
900 | - $success = EEM_State::instance()->delete_by_ID($STA_ID); |
|
901 | - if ($success !== false) { |
|
902 | - do_action('AHEE__General_Settings_Admin_Page__delete_state__state_deleted', $CNT_ISO, $STA_ID, |
|
903 | - array('STA_abbrev' => $STA_abbrev)); |
|
904 | - EE_Error::add_success(__('The State was deleted successfully.', 'event_espresso')); |
|
905 | - } |
|
906 | - if (defined('DOING_AJAX')) { |
|
907 | - $notices = EE_Error::get_notices(false, false); |
|
908 | - $notices['return_data'] = true; |
|
909 | - echo json_encode($notices); |
|
910 | - die(); |
|
911 | - } else { |
|
912 | - $this->_redirect_after_action($success, 'State', 'deleted', array('action' => 'country_settings')); |
|
913 | - } |
|
914 | - } |
|
915 | - |
|
916 | - |
|
917 | - /** |
|
918 | - * _update_country_settings |
|
919 | - * |
|
920 | - * @access protected |
|
921 | - * @return void |
|
922 | - */ |
|
923 | - protected function _update_country_settings() |
|
924 | - { |
|
898 | + return false; |
|
899 | + } |
|
900 | + $success = EEM_State::instance()->delete_by_ID($STA_ID); |
|
901 | + if ($success !== false) { |
|
902 | + do_action('AHEE__General_Settings_Admin_Page__delete_state__state_deleted', $CNT_ISO, $STA_ID, |
|
903 | + array('STA_abbrev' => $STA_abbrev)); |
|
904 | + EE_Error::add_success(__('The State was deleted successfully.', 'event_espresso')); |
|
905 | + } |
|
906 | + if (defined('DOING_AJAX')) { |
|
907 | + $notices = EE_Error::get_notices(false, false); |
|
908 | + $notices['return_data'] = true; |
|
909 | + echo json_encode($notices); |
|
910 | + die(); |
|
911 | + } else { |
|
912 | + $this->_redirect_after_action($success, 'State', 'deleted', array('action' => 'country_settings')); |
|
913 | + } |
|
914 | + } |
|
915 | + |
|
916 | + |
|
917 | + /** |
|
918 | + * _update_country_settings |
|
919 | + * |
|
920 | + * @access protected |
|
921 | + * @return void |
|
922 | + */ |
|
923 | + protected function _update_country_settings() |
|
924 | + { |
|
925 | 925 | // EEH_Debug_Tools::printr( $this->_req_data, '$this->_req_data <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
926 | - // grab the country ISO code |
|
927 | - $CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : false; |
|
928 | - if ( ! $CNT_ISO) { |
|
929 | - EE_Error::add_error(__('No Country ISO code or an invalid Country ISO code was received.', |
|
930 | - 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
926 | + // grab the country ISO code |
|
927 | + $CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : false; |
|
928 | + if ( ! $CNT_ISO) { |
|
929 | + EE_Error::add_error(__('No Country ISO code or an invalid Country ISO code was received.', |
|
930 | + 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
931 | 931 | |
932 | - return; |
|
933 | - } |
|
934 | - $cols_n_values = array(); |
|
935 | - $cols_n_values['CNT_ISO3'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_ISO3']) ? strtoupper(sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_ISO3'])) : false; |
|
936 | - $cols_n_values['RGN_ID'] = isset($this->_req_data['cntry'][$CNT_ISO]['RGN_ID']) ? absint($this->_req_data['cntry'][$CNT_ISO]['RGN_ID']) : null; |
|
937 | - $cols_n_values['CNT_name'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_name']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_name']) : null; |
|
938 | - $cols_n_values['CNT_cur_code'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_code']) ? strtoupper(sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_code'])) : 'USD'; |
|
939 | - $cols_n_values['CNT_cur_single'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_single']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_single']) : 'dollar'; |
|
940 | - $cols_n_values['CNT_cur_plural'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_plural']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_plural']) : 'dollars'; |
|
941 | - $cols_n_values['CNT_cur_sign'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign']) : '$'; |
|
942 | - $cols_n_values['CNT_cur_sign_b4'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign_b4']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign_b4']) : true; |
|
943 | - $cols_n_values['CNT_cur_dec_plc'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_plc']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_plc']) : 2; |
|
944 | - $cols_n_values['CNT_cur_dec_mrk'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_mrk']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_mrk']) : '.'; |
|
945 | - $cols_n_values['CNT_cur_thsnds'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_thsnds']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_thsnds']) : ','; |
|
946 | - $cols_n_values['CNT_tel_code'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_tel_code']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_tel_code']) : null; |
|
947 | - $cols_n_values['CNT_is_EU'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_is_EU']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_is_EU']) : false; |
|
948 | - $cols_n_values['CNT_active'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_active']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_active']) : false; |
|
949 | - // allow filtering of country data |
|
950 | - $cols_n_values = apply_filters('FHEE__General_Settings_Admin_Page___update_country_settings__cols_n_values', |
|
951 | - $cols_n_values); |
|
952 | - //EEH_Debug_Tools::printr( $cols_n_values, '$cols_n_values <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
953 | - // where values |
|
954 | - $where_cols_n_values = array(array('CNT_ISO' => $CNT_ISO)); |
|
955 | - // run the update |
|
956 | - $success = EEM_Country::instance()->update($cols_n_values, $where_cols_n_values); |
|
932 | + return; |
|
933 | + } |
|
934 | + $cols_n_values = array(); |
|
935 | + $cols_n_values['CNT_ISO3'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_ISO3']) ? strtoupper(sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_ISO3'])) : false; |
|
936 | + $cols_n_values['RGN_ID'] = isset($this->_req_data['cntry'][$CNT_ISO]['RGN_ID']) ? absint($this->_req_data['cntry'][$CNT_ISO]['RGN_ID']) : null; |
|
937 | + $cols_n_values['CNT_name'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_name']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_name']) : null; |
|
938 | + $cols_n_values['CNT_cur_code'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_code']) ? strtoupper(sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_code'])) : 'USD'; |
|
939 | + $cols_n_values['CNT_cur_single'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_single']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_single']) : 'dollar'; |
|
940 | + $cols_n_values['CNT_cur_plural'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_plural']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_plural']) : 'dollars'; |
|
941 | + $cols_n_values['CNT_cur_sign'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign']) : '$'; |
|
942 | + $cols_n_values['CNT_cur_sign_b4'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign_b4']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign_b4']) : true; |
|
943 | + $cols_n_values['CNT_cur_dec_plc'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_plc']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_plc']) : 2; |
|
944 | + $cols_n_values['CNT_cur_dec_mrk'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_mrk']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_mrk']) : '.'; |
|
945 | + $cols_n_values['CNT_cur_thsnds'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_thsnds']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_thsnds']) : ','; |
|
946 | + $cols_n_values['CNT_tel_code'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_tel_code']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_tel_code']) : null; |
|
947 | + $cols_n_values['CNT_is_EU'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_is_EU']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_is_EU']) : false; |
|
948 | + $cols_n_values['CNT_active'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_active']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_active']) : false; |
|
949 | + // allow filtering of country data |
|
950 | + $cols_n_values = apply_filters('FHEE__General_Settings_Admin_Page___update_country_settings__cols_n_values', |
|
951 | + $cols_n_values); |
|
952 | + //EEH_Debug_Tools::printr( $cols_n_values, '$cols_n_values <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
953 | + // where values |
|
954 | + $where_cols_n_values = array(array('CNT_ISO' => $CNT_ISO)); |
|
955 | + // run the update |
|
956 | + $success = EEM_Country::instance()->update($cols_n_values, $where_cols_n_values); |
|
957 | 957 | // global $wpdb; |
958 | 958 | // echo '<h4>' . $wpdb->last_query . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
959 | 959 | // echo '<h4>$success : ' . $success . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; |
960 | - if (isset($this->_req_data['states']) && is_array($this->_req_data['states']) && $success !== false) { |
|
961 | - // allow filtering of states data |
|
962 | - $states = apply_filters('FHEE__General_Settings_Admin_Page___update_country_settings__states', |
|
963 | - $this->_req_data['states']); |
|
960 | + if (isset($this->_req_data['states']) && is_array($this->_req_data['states']) && $success !== false) { |
|
961 | + // allow filtering of states data |
|
962 | + $states = apply_filters('FHEE__General_Settings_Admin_Page___update_country_settings__states', |
|
963 | + $this->_req_data['states']); |
|
964 | 964 | // EEH_Debug_Tools::printr( $states, '$states <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
965 | - // loop thru state data ( looks like : states[75][STA_name] ) |
|
966 | - foreach ($states as $STA_ID => $state) { |
|
967 | - $cols_n_values = array( |
|
968 | - 'CNT_ISO' => $CNT_ISO, |
|
969 | - 'STA_abbrev' => sanitize_text_field($state['STA_abbrev']), |
|
970 | - 'STA_name' => sanitize_text_field($state['STA_name']), |
|
971 | - 'STA_active' => (bool)absint($state['STA_active']) |
|
972 | - ); |
|
973 | - // where values |
|
974 | - $where_cols_n_values = array(array('STA_ID' => $STA_ID)); |
|
975 | - // run the update |
|
976 | - $success = EEM_State::instance()->update($cols_n_values, $where_cols_n_values); |
|
977 | - if ($success !== false) { |
|
978 | - do_action('AHEE__General_Settings_Admin_Page__update_country_settings__state_saved', $CNT_ISO, |
|
979 | - $STA_ID, $cols_n_values); |
|
980 | - } |
|
981 | - } |
|
982 | - } |
|
983 | - // check if country being edited matches org option country, and if so, then update EE_Config with new settings |
|
984 | - if (isset(EE_Registry::instance()->CFG->organization->CNT_ISO) && $CNT_ISO == EE_Registry::instance()->CFG->organization->CNT_ISO) { |
|
985 | - EE_Registry::instance()->CFG->currency = new EE_Currency_Config($CNT_ISO); |
|
986 | - EE_Registry::instance()->CFG->update_espresso_config(); |
|
987 | - } |
|
988 | - $this->_redirect_after_action($success, 'Countries', 'updated', |
|
989 | - array('action' => 'country_settings', 'country' => $CNT_ISO)); |
|
990 | - } |
|
991 | - |
|
992 | - |
|
993 | - /** |
|
994 | - * form_form_field_label_wrap |
|
995 | - * |
|
996 | - * @access public |
|
997 | - * |
|
998 | - * @param string $label |
|
999 | - * |
|
1000 | - * @return string |
|
1001 | - */ |
|
1002 | - public function country_form_field_label_wrap($label, $required_text) |
|
1003 | - { |
|
1004 | - return ' |
|
965 | + // loop thru state data ( looks like : states[75][STA_name] ) |
|
966 | + foreach ($states as $STA_ID => $state) { |
|
967 | + $cols_n_values = array( |
|
968 | + 'CNT_ISO' => $CNT_ISO, |
|
969 | + 'STA_abbrev' => sanitize_text_field($state['STA_abbrev']), |
|
970 | + 'STA_name' => sanitize_text_field($state['STA_name']), |
|
971 | + 'STA_active' => (bool)absint($state['STA_active']) |
|
972 | + ); |
|
973 | + // where values |
|
974 | + $where_cols_n_values = array(array('STA_ID' => $STA_ID)); |
|
975 | + // run the update |
|
976 | + $success = EEM_State::instance()->update($cols_n_values, $where_cols_n_values); |
|
977 | + if ($success !== false) { |
|
978 | + do_action('AHEE__General_Settings_Admin_Page__update_country_settings__state_saved', $CNT_ISO, |
|
979 | + $STA_ID, $cols_n_values); |
|
980 | + } |
|
981 | + } |
|
982 | + } |
|
983 | + // check if country being edited matches org option country, and if so, then update EE_Config with new settings |
|
984 | + if (isset(EE_Registry::instance()->CFG->organization->CNT_ISO) && $CNT_ISO == EE_Registry::instance()->CFG->organization->CNT_ISO) { |
|
985 | + EE_Registry::instance()->CFG->currency = new EE_Currency_Config($CNT_ISO); |
|
986 | + EE_Registry::instance()->CFG->update_espresso_config(); |
|
987 | + } |
|
988 | + $this->_redirect_after_action($success, 'Countries', 'updated', |
|
989 | + array('action' => 'country_settings', 'country' => $CNT_ISO)); |
|
990 | + } |
|
991 | + |
|
992 | + |
|
993 | + /** |
|
994 | + * form_form_field_label_wrap |
|
995 | + * |
|
996 | + * @access public |
|
997 | + * |
|
998 | + * @param string $label |
|
999 | + * |
|
1000 | + * @return string |
|
1001 | + */ |
|
1002 | + public function country_form_field_label_wrap($label, $required_text) |
|
1003 | + { |
|
1004 | + return ' |
|
1005 | 1005 | <tr> |
1006 | 1006 | <th> |
1007 | 1007 | ' . $label . ' |
1008 | 1008 | </th>'; |
1009 | - } |
|
1010 | - |
|
1011 | - |
|
1012 | - /** |
|
1013 | - * form_form_field_input__wrap |
|
1014 | - * |
|
1015 | - * @access public |
|
1016 | - * |
|
1017 | - * @param string $label |
|
1018 | - * |
|
1019 | - * @return string |
|
1020 | - */ |
|
1021 | - public function country_form_field_input__wrap($input, $label) |
|
1022 | - { |
|
1023 | - return ' |
|
1009 | + } |
|
1010 | + |
|
1011 | + |
|
1012 | + /** |
|
1013 | + * form_form_field_input__wrap |
|
1014 | + * |
|
1015 | + * @access public |
|
1016 | + * |
|
1017 | + * @param string $label |
|
1018 | + * |
|
1019 | + * @return string |
|
1020 | + */ |
|
1021 | + public function country_form_field_input__wrap($input, $label) |
|
1022 | + { |
|
1023 | + return ' |
|
1024 | 1024 | <td class="general-settings-country-input-td"> |
1025 | 1025 | ' . $input . ' |
1026 | 1026 | </td> |
1027 | 1027 | </tr>'; |
1028 | - } |
|
1029 | - |
|
1030 | - |
|
1031 | - /** |
|
1032 | - * form_form_field_label_wrap |
|
1033 | - * |
|
1034 | - * @access public |
|
1035 | - * |
|
1036 | - * @param string $label |
|
1037 | - * @param string $required_text |
|
1038 | - * |
|
1039 | - * @return string |
|
1040 | - */ |
|
1041 | - public function state_form_field_label_wrap($label, $required_text) |
|
1042 | - { |
|
1043 | - return $required_text; |
|
1044 | - } |
|
1045 | - |
|
1046 | - |
|
1047 | - /** |
|
1048 | - * form_form_field_input__wrap |
|
1049 | - * |
|
1050 | - * @access public |
|
1051 | - * |
|
1052 | - * @param string $label |
|
1053 | - * |
|
1054 | - * @return string |
|
1055 | - */ |
|
1056 | - public function state_form_field_input__wrap($input, $label) |
|
1057 | - { |
|
1058 | - return ' |
|
1028 | + } |
|
1029 | + |
|
1030 | + |
|
1031 | + /** |
|
1032 | + * form_form_field_label_wrap |
|
1033 | + * |
|
1034 | + * @access public |
|
1035 | + * |
|
1036 | + * @param string $label |
|
1037 | + * @param string $required_text |
|
1038 | + * |
|
1039 | + * @return string |
|
1040 | + */ |
|
1041 | + public function state_form_field_label_wrap($label, $required_text) |
|
1042 | + { |
|
1043 | + return $required_text; |
|
1044 | + } |
|
1045 | + |
|
1046 | + |
|
1047 | + /** |
|
1048 | + * form_form_field_input__wrap |
|
1049 | + * |
|
1050 | + * @access public |
|
1051 | + * |
|
1052 | + * @param string $label |
|
1053 | + * |
|
1054 | + * @return string |
|
1055 | + */ |
|
1056 | + public function state_form_field_input__wrap($input, $label) |
|
1057 | + { |
|
1058 | + return ' |
|
1059 | 1059 | <td class="general-settings-country-state-input-td"> |
1060 | 1060 | ' . $input . ' |
1061 | 1061 | </td>'; |
1062 | 1062 | |
1063 | - } |
|
1063 | + } |
|
1064 | 1064 | |
1065 | 1065 | |
1066 | 1066 | |
1067 | 1067 | |
1068 | 1068 | |
1069 | 1069 | |
1070 | - /***********/ |
|
1070 | + /***********/ |
|
1071 | 1071 | |
1072 | 1072 | |
1073 | - /** |
|
1074 | - * displays edit and view links for critical EE pages |
|
1075 | - * |
|
1076 | - * @access public |
|
1077 | - * |
|
1078 | - * @param int $ee_page_id |
|
1079 | - * |
|
1080 | - * @return string |
|
1081 | - */ |
|
1082 | - public static function edit_view_links($ee_page_id) |
|
1083 | - { |
|
1084 | - $links = '<a href="' . add_query_arg(array('post' => $ee_page_id, 'action' => 'edit'), |
|
1085 | - admin_url('post.php')) . '" >' . __('Edit', 'event_espresso') . '</a>'; |
|
1086 | - $links .= ' | '; |
|
1087 | - $links .= '<a href="' . get_permalink($ee_page_id) . '" >' . __('View', 'event_espresso') . '</a>'; |
|
1073 | + /** |
|
1074 | + * displays edit and view links for critical EE pages |
|
1075 | + * |
|
1076 | + * @access public |
|
1077 | + * |
|
1078 | + * @param int $ee_page_id |
|
1079 | + * |
|
1080 | + * @return string |
|
1081 | + */ |
|
1082 | + public static function edit_view_links($ee_page_id) |
|
1083 | + { |
|
1084 | + $links = '<a href="' . add_query_arg(array('post' => $ee_page_id, 'action' => 'edit'), |
|
1085 | + admin_url('post.php')) . '" >' . __('Edit', 'event_espresso') . '</a>'; |
|
1086 | + $links .= ' | '; |
|
1087 | + $links .= '<a href="' . get_permalink($ee_page_id) . '" >' . __('View', 'event_espresso') . '</a>'; |
|
1088 | 1088 | |
1089 | - return $links; |
|
1090 | - } |
|
1091 | - |
|
1092 | - |
|
1093 | - /** |
|
1094 | - * displays page and shortcode status for critical EE pages |
|
1095 | - * |
|
1096 | - * @param WP page object $ee_page |
|
1097 | - * |
|
1098 | - * @return string |
|
1099 | - */ |
|
1100 | - public static function page_and_shortcode_status($ee_page, $shortcode) |
|
1101 | - { |
|
1089 | + return $links; |
|
1090 | + } |
|
1091 | + |
|
1092 | + |
|
1093 | + /** |
|
1094 | + * displays page and shortcode status for critical EE pages |
|
1095 | + * |
|
1096 | + * @param WP page object $ee_page |
|
1097 | + * |
|
1098 | + * @return string |
|
1099 | + */ |
|
1100 | + public static function page_and_shortcode_status($ee_page, $shortcode) |
|
1101 | + { |
|
1102 | 1102 | |
1103 | - // page status |
|
1104 | - if (isset($ee_page->post_status) && $ee_page->post_status == 'publish') { |
|
1105 | - $pg_colour = 'green'; |
|
1106 | - $pg_status = sprintf(__('Page%sStatus%sOK', 'event_espresso'), ' ', ' '); |
|
1107 | - } else { |
|
1108 | - $pg_colour = 'red'; |
|
1109 | - $pg_status = sprintf(__('Page%sVisibility%sProblem', 'event_espresso'), ' ', ' '); |
|
1110 | - } |
|
1103 | + // page status |
|
1104 | + if (isset($ee_page->post_status) && $ee_page->post_status == 'publish') { |
|
1105 | + $pg_colour = 'green'; |
|
1106 | + $pg_status = sprintf(__('Page%sStatus%sOK', 'event_espresso'), ' ', ' '); |
|
1107 | + } else { |
|
1108 | + $pg_colour = 'red'; |
|
1109 | + $pg_status = sprintf(__('Page%sVisibility%sProblem', 'event_espresso'), ' ', ' '); |
|
1110 | + } |
|
1111 | 1111 | |
1112 | - // shortcode status |
|
1113 | - if (isset($ee_page->post_content) && strpos($ee_page->post_content, $shortcode) !== false) { |
|
1114 | - $sc_colour = 'green'; |
|
1115 | - $sc_status = sprintf(__('Shortcode%sOK', 'event_espresso'), ' '); |
|
1116 | - } else { |
|
1117 | - $sc_colour = 'red'; |
|
1118 | - $sc_status = sprintf(__('Shortcode%sProblem', 'event_espresso'), ' '); |
|
1119 | - } |
|
1112 | + // shortcode status |
|
1113 | + if (isset($ee_page->post_content) && strpos($ee_page->post_content, $shortcode) !== false) { |
|
1114 | + $sc_colour = 'green'; |
|
1115 | + $sc_status = sprintf(__('Shortcode%sOK', 'event_espresso'), ' '); |
|
1116 | + } else { |
|
1117 | + $sc_colour = 'red'; |
|
1118 | + $sc_status = sprintf(__('Shortcode%sProblem', 'event_espresso'), ' '); |
|
1119 | + } |
|
1120 | 1120 | |
1121 | - return '<span style="color:' . $pg_colour . '; margin-right:2em;"><strong>' . $pg_status . '</strong></span><span style="color:' . $sc_colour . '"><strong>' . $sc_status . '</strong></span>'; |
|
1121 | + return '<span style="color:' . $pg_colour . '; margin-right:2em;"><strong>' . $pg_status . '</strong></span><span style="color:' . $sc_colour . '"><strong>' . $sc_status . '</strong></span>'; |
|
1122 | 1122 | |
1123 | - } |
|
1124 | - |
|
1125 | - |
|
1126 | - /** |
|
1127 | - * generates a dropdown of all parent pages - copied from WP core |
|
1128 | - * |
|
1129 | - * @param unknown_type $default |
|
1130 | - * @param unknown_type $parent |
|
1131 | - * @param unknown_type $level |
|
1132 | - * |
|
1133 | - * @return unknown |
|
1134 | - */ |
|
1135 | - public static function page_settings_dropdown($default = 0, $parent = 0, $level = 0) |
|
1136 | - { |
|
1137 | - global $wpdb; |
|
1138 | - $items = $wpdb->get_results($wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status != 'trash' ORDER BY menu_order", |
|
1139 | - $parent)); |
|
1123 | + } |
|
1124 | + |
|
1125 | + |
|
1126 | + /** |
|
1127 | + * generates a dropdown of all parent pages - copied from WP core |
|
1128 | + * |
|
1129 | + * @param unknown_type $default |
|
1130 | + * @param unknown_type $parent |
|
1131 | + * @param unknown_type $level |
|
1132 | + * |
|
1133 | + * @return unknown |
|
1134 | + */ |
|
1135 | + public static function page_settings_dropdown($default = 0, $parent = 0, $level = 0) |
|
1136 | + { |
|
1137 | + global $wpdb; |
|
1138 | + $items = $wpdb->get_results($wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status != 'trash' ORDER BY menu_order", |
|
1139 | + $parent)); |
|
1140 | 1140 | |
1141 | - if ($items) { |
|
1142 | - foreach ($items as $item) { |
|
1143 | - $pad = str_repeat(' ', $level * 3); |
|
1144 | - if ($item->ID == $default) { |
|
1145 | - $current = ' selected="selected"'; |
|
1146 | - } else { |
|
1147 | - $current = ''; |
|
1148 | - } |
|
1141 | + if ($items) { |
|
1142 | + foreach ($items as $item) { |
|
1143 | + $pad = str_repeat(' ', $level * 3); |
|
1144 | + if ($item->ID == $default) { |
|
1145 | + $current = ' selected="selected"'; |
|
1146 | + } else { |
|
1147 | + $current = ''; |
|
1148 | + } |
|
1149 | 1149 | |
1150 | - echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>"; |
|
1151 | - parent_dropdown($default, $item->ID, $level + 1); |
|
1152 | - } |
|
1153 | - } else { |
|
1154 | - return false; |
|
1155 | - } |
|
1156 | - } |
|
1150 | + echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>"; |
|
1151 | + parent_dropdown($default, $item->ID, $level + 1); |
|
1152 | + } |
|
1153 | + } else { |
|
1154 | + return false; |
|
1155 | + } |
|
1156 | + } |
|
1157 | 1157 | |
1158 | 1158 | |
1159 | 1159 | } //ends Forms_Admin_Page class |
@@ -241,9 +241,9 @@ discard block |
||
241 | 241 | //scripts |
242 | 242 | wp_enqueue_script('media-upload'); |
243 | 243 | wp_enqueue_script('thickbox'); |
244 | - wp_register_script('organization_settings', GEN_SET_ASSETS_URL . 'your_organization_settings.js', |
|
244 | + wp_register_script('organization_settings', GEN_SET_ASSETS_URL.'your_organization_settings.js', |
|
245 | 245 | array('jquery', 'media-upload', 'thickbox'), EVENT_ESPRESSO_VERSION, true); |
246 | - wp_register_style('organization-css', GEN_SET_ASSETS_URL . 'organization.css', array(), EVENT_ESPRESSO_VERSION); |
|
246 | + wp_register_style('organization-css', GEN_SET_ASSETS_URL.'organization.css', array(), EVENT_ESPRESSO_VERSION); |
|
247 | 247 | wp_enqueue_script('organization_settings'); |
248 | 248 | wp_enqueue_style('organization-css'); |
249 | 249 | $confirm_image_delete = array( |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | public function load_scripts_styles_country_settings() |
258 | 258 | { |
259 | 259 | //scripts |
260 | - wp_register_script('gen_settings_countries', GEN_SET_ASSETS_URL . 'gen_settings_countries.js', |
|
260 | + wp_register_script('gen_settings_countries', GEN_SET_ASSETS_URL.'gen_settings_countries.js', |
|
261 | 261 | array('ee_admin_js'), EVENT_ESPRESSO_VERSION, true); |
262 | - wp_register_style('organization-css', GEN_SET_ASSETS_URL . 'organization.css', array(), EVENT_ESPRESSO_VERSION); |
|
262 | + wp_register_style('organization-css', GEN_SET_ASSETS_URL.'organization.css', array(), EVENT_ESPRESSO_VERSION); |
|
263 | 263 | wp_enqueue_script('gen_settings_countries'); |
264 | 264 | wp_enqueue_style('organization-css'); |
265 | 265 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $this->_set_add_edit_form_tags('update_espresso_page_settings'); |
307 | 307 | $this->_set_publish_post_box_vars(null, false, false, null, false); |
308 | 308 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
309 | - GEN_SET_TEMPLATE_PATH . 'espresso_page_settings.template.php', |
|
309 | + GEN_SET_TEMPLATE_PATH.'espresso_page_settings.template.php', |
|
310 | 310 | $this->_template_args, |
311 | 311 | true |
312 | 312 | ); |
@@ -429,13 +429,13 @@ discard block |
||
429 | 429 | add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2); |
430 | 430 | |
431 | 431 | //PUE verification stuff |
432 | - $ver_option_key = 'puvererr_' . basename(EE_PLUGIN_BASENAME); |
|
432 | + $ver_option_key = 'puvererr_'.basename(EE_PLUGIN_BASENAME); |
|
433 | 433 | $verify_fail = get_option($ver_option_key); |
434 | 434 | $this->_template_args['site_license_key_verified'] = $verify_fail || ! empty($verify_fail) || (empty($this->_template_args['site_license_key']) && empty($verify_fail)) ? '<span class="dashicons dashicons-admin-network ee-icon-color-ee-red ee-icon-size-20"></span>' : '<span class="dashicons dashicons-admin-network ee-icon-color-ee-green ee-icon-size-20"></span>'; |
435 | 435 | |
436 | 436 | $this->_set_add_edit_form_tags('update_your_organization_settings'); |
437 | 437 | $this->_set_publish_post_box_vars(null, false, false, null, false); |
438 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'your_organization_settings.template.php', |
|
438 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'your_organization_settings.template.php', |
|
439 | 439 | $this->_template_args, true); |
440 | 440 | |
441 | 441 | $this->display_admin_page_with_sidebar(); |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | |
586 | 586 | $this->_set_add_edit_form_tags('update_country_settings'); |
587 | 587 | $this->_set_publish_post_box_vars(null, false, false, null, false); |
588 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'countries_settings.template.php', |
|
588 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'countries_settings.template.php', |
|
589 | 589 | $this->_template_args, true); |
590 | 590 | $this->display_admin_page_with_no_sidebar(); |
591 | 591 | } |
@@ -615,65 +615,65 @@ discard block |
||
615 | 615 | add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2); |
616 | 616 | $country = EEM_Country::instance()->get_one_by_ID($CNT_ISO); |
617 | 617 | //EEH_Debug_Tools::printr( $country, '$country <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
618 | - $country_input_types = array( |
|
618 | + $country_input_types = array( |
|
619 | 619 | 'CNT_active' => array( |
620 | 620 | 'type' => 'RADIO_BTN', |
621 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
621 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
622 | 622 | 'class' => '', |
623 | 623 | 'options' => $this->_yes_no_values, |
624 | 624 | 'use_desc_4_label' => true |
625 | 625 | ), |
626 | 626 | 'CNT_ISO' => array( |
627 | 627 | 'type' => 'TEXT', |
628 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
628 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
629 | 629 | 'class' => 'small-text' |
630 | 630 | ), |
631 | 631 | 'CNT_ISO3' => array( |
632 | 632 | 'type' => 'TEXT', |
633 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
633 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
634 | 634 | 'class' => 'small-text' |
635 | 635 | ), |
636 | 636 | 'RGN_ID' => array( |
637 | 637 | 'type' => 'TEXT', |
638 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
638 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
639 | 639 | 'class' => 'small-text' |
640 | 640 | ), |
641 | 641 | 'CNT_name' => array( |
642 | 642 | 'type' => 'TEXT', |
643 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
643 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
644 | 644 | 'class' => 'regular-text' |
645 | 645 | ), |
646 | 646 | 'CNT_cur_code' => array( |
647 | 647 | 'type' => 'TEXT', |
648 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
648 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
649 | 649 | 'class' => 'small-text' |
650 | 650 | ), |
651 | 651 | 'CNT_cur_single' => array( |
652 | 652 | 'type' => 'TEXT', |
653 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
653 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
654 | 654 | 'class' => 'medium-text' |
655 | 655 | ), |
656 | 656 | 'CNT_cur_plural' => array( |
657 | 657 | 'type' => 'TEXT', |
658 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
658 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
659 | 659 | 'class' => 'medium-text' |
660 | 660 | ), |
661 | 661 | 'CNT_cur_sign' => array( |
662 | 662 | 'type' => 'TEXT', |
663 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
663 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
664 | 664 | 'class' => 'small-text', |
665 | 665 | 'htmlentities' => false |
666 | 666 | ), |
667 | 667 | 'CNT_cur_sign_b4' => array( |
668 | 668 | 'type' => 'RADIO_BTN', |
669 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
669 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
670 | 670 | 'class' => '', |
671 | 671 | 'options' => $this->_yes_no_values, |
672 | 672 | 'use_desc_4_label' => true |
673 | 673 | ), |
674 | 674 | 'CNT_cur_dec_plc' => array( |
675 | 675 | 'type' => 'RADIO_BTN', |
676 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
676 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
677 | 677 | 'class' => '', |
678 | 678 | 'options' => array( |
679 | 679 | array('id' => 0, 'text' => ''), |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | ), |
685 | 685 | 'CNT_cur_dec_mrk' => array( |
686 | 686 | 'type' => 'RADIO_BTN', |
687 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
687 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
688 | 688 | 'class' => '', |
689 | 689 | 'options' => array( |
690 | 690 | array( |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | ), |
698 | 698 | 'CNT_cur_thsnds' => array( |
699 | 699 | 'type' => 'RADIO_BTN', |
700 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
700 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
701 | 701 | 'class' => '', |
702 | 702 | 'options' => array( |
703 | 703 | array( |
@@ -710,12 +710,12 @@ discard block |
||
710 | 710 | ), |
711 | 711 | 'CNT_tel_code' => array( |
712 | 712 | 'type' => 'TEXT', |
713 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
713 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
714 | 714 | 'class' => 'small-text' |
715 | 715 | ), |
716 | 716 | 'CNT_is_EU' => array( |
717 | 717 | 'type' => 'RADIO_BTN', |
718 | - 'input_name' => 'cntry[' . $CNT_ISO . ']', |
|
718 | + 'input_name' => 'cntry['.$CNT_ISO.']', |
|
719 | 719 | 'class' => '', |
720 | 720 | 'options' => $this->_yes_no_values, |
721 | 721 | 'use_desc_4_label' => true |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | ); |
724 | 724 | $this->_template_args['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($country, |
725 | 725 | $country_input_types); |
726 | - $country_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'country_details_settings.template.php', |
|
726 | + $country_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'country_details_settings.template.php', |
|
727 | 727 | $this->_template_args, true); |
728 | 728 | |
729 | 729 | if (defined('DOING_AJAX')) { |
@@ -773,20 +773,20 @@ discard block |
||
773 | 773 | foreach ($states as $STA_ID => $state) { |
774 | 774 | if ($state instanceof EE_State) { |
775 | 775 | //STA_abbrev STA_name STA_active |
776 | - $state_input_types = array( |
|
776 | + $state_input_types = array( |
|
777 | 777 | 'STA_abbrev' => array( |
778 | 778 | 'type' => 'TEXT', |
779 | - 'input_name' => 'states[' . $STA_ID . ']', |
|
779 | + 'input_name' => 'states['.$STA_ID.']', |
|
780 | 780 | 'class' => 'mid-text' |
781 | 781 | ), |
782 | 782 | 'STA_name' => array( |
783 | 783 | 'type' => 'TEXT', |
784 | - 'input_name' => 'states[' . $STA_ID . ']', |
|
784 | + 'input_name' => 'states['.$STA_ID.']', |
|
785 | 785 | 'class' => 'regular-text' |
786 | 786 | ), |
787 | 787 | 'STA_active' => array( |
788 | 788 | 'type' => 'RADIO_BTN', |
789 | - 'input_name' => 'states[' . $STA_ID . ']', |
|
789 | + 'input_name' => 'states['.$STA_ID.']', |
|
790 | 790 | 'options' => $this->_yes_no_values, |
791 | 791 | 'use_desc_4_label' => true |
792 | 792 | ) |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | $this->_template_args['add_new_state_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'add_new_state'), |
811 | 811 | GEN_SET_ADMIN_URL); |
812 | 812 | |
813 | - $state_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'state_details_settings.template.php', |
|
813 | + $state_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'state_details_settings.template.php', |
|
814 | 814 | $this->_template_args, true); |
815 | 815 | |
816 | 816 | if (defined('DOING_AJAX')) { |
@@ -851,8 +851,7 @@ discard block |
||
851 | 851 | __FILE__, __FUNCTION__, __LINE__); |
852 | 852 | $success = false; |
853 | 853 | } |
854 | - $STA_name = isset($this->_req_data['STA_name']) ? sanitize_text_field($this->_req_data['STA_name']) : |
|
855 | - false; |
|
854 | + $STA_name = isset($this->_req_data['STA_name']) ? sanitize_text_field($this->_req_data['STA_name']) : false; |
|
856 | 855 | if ( ! $STA_name) { |
857 | 856 | EE_Error::add_error(__('No State name or an invalid State name was received.', 'event_espresso'), __FILE__, |
858 | 857 | __FUNCTION__, __LINE__); |
@@ -866,7 +865,7 @@ discard block |
||
866 | 865 | 'STA_name' => $STA_name, |
867 | 866 | 'STA_active' => true |
868 | 867 | ); |
869 | - $success = EEM_State::instance()->insert($cols_n_values); |
|
868 | + $success = EEM_State::instance()->insert($cols_n_values); |
|
870 | 869 | EE_Error::add_success(__('The State was added successfully.', 'event_espresso')); |
871 | 870 | } |
872 | 871 | |
@@ -968,7 +967,7 @@ discard block |
||
968 | 967 | 'CNT_ISO' => $CNT_ISO, |
969 | 968 | 'STA_abbrev' => sanitize_text_field($state['STA_abbrev']), |
970 | 969 | 'STA_name' => sanitize_text_field($state['STA_name']), |
971 | - 'STA_active' => (bool)absint($state['STA_active']) |
|
970 | + 'STA_active' => (bool) absint($state['STA_active']) |
|
972 | 971 | ); |
973 | 972 | // where values |
974 | 973 | $where_cols_n_values = array(array('STA_ID' => $STA_ID)); |
@@ -1004,7 +1003,7 @@ discard block |
||
1004 | 1003 | return ' |
1005 | 1004 | <tr> |
1006 | 1005 | <th> |
1007 | - ' . $label . ' |
|
1006 | + ' . $label.' |
|
1008 | 1007 | </th>'; |
1009 | 1008 | } |
1010 | 1009 | |
@@ -1022,7 +1021,7 @@ discard block |
||
1022 | 1021 | { |
1023 | 1022 | return ' |
1024 | 1023 | <td class="general-settings-country-input-td"> |
1025 | - ' . $input . ' |
|
1024 | + ' . $input.' |
|
1026 | 1025 | </td> |
1027 | 1026 | </tr>'; |
1028 | 1027 | } |
@@ -1057,7 +1056,7 @@ discard block |
||
1057 | 1056 | { |
1058 | 1057 | return ' |
1059 | 1058 | <td class="general-settings-country-state-input-td"> |
1060 | - ' . $input . ' |
|
1059 | + ' . $input.' |
|
1061 | 1060 | </td>'; |
1062 | 1061 | |
1063 | 1062 | } |
@@ -1081,10 +1080,10 @@ discard block |
||
1081 | 1080 | */ |
1082 | 1081 | public static function edit_view_links($ee_page_id) |
1083 | 1082 | { |
1084 | - $links = '<a href="' . add_query_arg(array('post' => $ee_page_id, 'action' => 'edit'), |
|
1085 | - admin_url('post.php')) . '" >' . __('Edit', 'event_espresso') . '</a>'; |
|
1083 | + $links = '<a href="'.add_query_arg(array('post' => $ee_page_id, 'action' => 'edit'), |
|
1084 | + admin_url('post.php')).'" >'.__('Edit', 'event_espresso').'</a>'; |
|
1086 | 1085 | $links .= ' | '; |
1087 | - $links .= '<a href="' . get_permalink($ee_page_id) . '" >' . __('View', 'event_espresso') . '</a>'; |
|
1086 | + $links .= '<a href="'.get_permalink($ee_page_id).'" >'.__('View', 'event_espresso').'</a>'; |
|
1088 | 1087 | |
1089 | 1088 | return $links; |
1090 | 1089 | } |
@@ -1118,7 +1117,7 @@ discard block |
||
1118 | 1117 | $sc_status = sprintf(__('Shortcode%sProblem', 'event_espresso'), ' '); |
1119 | 1118 | } |
1120 | 1119 | |
1121 | - return '<span style="color:' . $pg_colour . '; margin-right:2em;"><strong>' . $pg_status . '</strong></span><span style="color:' . $sc_colour . '"><strong>' . $sc_status . '</strong></span>'; |
|
1120 | + return '<span style="color:'.$pg_colour.'; margin-right:2em;"><strong>'.$pg_status.'</strong></span><span style="color:'.$sc_colour.'"><strong>'.$sc_status.'</strong></span>'; |
|
1122 | 1121 | |
1123 | 1122 | } |
1124 | 1123 | |
@@ -1147,7 +1146,7 @@ discard block |
||
1147 | 1146 | $current = ''; |
1148 | 1147 | } |
1149 | 1148 | |
1150 | - echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>"; |
|
1149 | + echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad ".esc_html($item->post_title)."</option>"; |
|
1151 | 1150 | parent_dropdown($default, $item->ID, $level + 1); |
1152 | 1151 | } |
1153 | 1152 | } else { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
3 | - exit('NO direct script access allowed'); |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -18,64 +18,64 @@ discard block |
||
18 | 18 | class Registration_Form_Questions_Overview_Help_Tour extends EE_Help_Tour |
19 | 19 | { |
20 | 20 | |
21 | - protected function _set_tour_properties() |
|
22 | - { |
|
23 | - $this->_label = __('Questions Overview Tour', 'event_espresso'); |
|
24 | - $this->_slug = $this->_is_caf ? 'questions-overview-caf-joyride' : 'questions-overview-joyride'; |
|
25 | - } |
|
21 | + protected function _set_tour_properties() |
|
22 | + { |
|
23 | + $this->_label = __('Questions Overview Tour', 'event_espresso'); |
|
24 | + $this->_slug = $this->_is_caf ? 'questions-overview-caf-joyride' : 'questions-overview-joyride'; |
|
25 | + } |
|
26 | 26 | |
27 | - protected function _set_tour_stops() |
|
28 | - { |
|
29 | - $this->_stops = array( |
|
30 | - 10 => array( |
|
31 | - 'content' => $this->_start(), |
|
32 | - ), |
|
33 | - 30 => array( |
|
34 | - 'id' => 'display_text', |
|
35 | - 'content' => $this->_display_text_stop(), |
|
36 | - 'options' => array( |
|
37 | - 'tipLocation' => 'top', |
|
38 | - 'tipAdjustmentX' => -5, |
|
39 | - 'tipAdjustmentY' => -25 |
|
40 | - ) |
|
41 | - ), |
|
42 | - 40 => array( |
|
43 | - 'id' => 'admin_label', |
|
44 | - 'content' => $this->_admin_label_stop(), |
|
45 | - 'options' => array( |
|
46 | - 'tipLocation' => 'top', |
|
47 | - 'tipAdjustmentX' => 20, |
|
48 | - 'tipAdjustmentY' => -25 |
|
49 | - ) |
|
50 | - ), |
|
51 | - 50 => array( |
|
52 | - 'id' => 'type', |
|
53 | - 'content' => $this->_type_stop(), |
|
54 | - 'options' => array( |
|
55 | - 'tipLocation' => 'top', |
|
56 | - 'tipAdjustmentX' => -5, |
|
57 | - 'tipAdjustmentY' => -25 |
|
58 | - ) |
|
59 | - ), |
|
60 | - 60 => array( |
|
61 | - 'id' => 'values', |
|
62 | - 'content' => $this->_values_stop(), |
|
63 | - 'options' => array( |
|
64 | - 'tipLocation' => 'top', |
|
65 | - 'tipAdjustmentX' => -5, |
|
66 | - 'tipAdjustmentY' => -25 |
|
67 | - ) |
|
68 | - ), |
|
69 | - 70 => array( |
|
70 | - 'id' => 'required', |
|
71 | - 'content' => $this->_required_stop(), |
|
72 | - 'options' => array( |
|
73 | - 'tipLocation' => 'top', |
|
74 | - 'tipAdjustmentY' => -20, |
|
75 | - 'tipAdjustmentX' => -15 |
|
76 | - ) |
|
77 | - ), |
|
78 | - /*80 => array( |
|
27 | + protected function _set_tour_stops() |
|
28 | + { |
|
29 | + $this->_stops = array( |
|
30 | + 10 => array( |
|
31 | + 'content' => $this->_start(), |
|
32 | + ), |
|
33 | + 30 => array( |
|
34 | + 'id' => 'display_text', |
|
35 | + 'content' => $this->_display_text_stop(), |
|
36 | + 'options' => array( |
|
37 | + 'tipLocation' => 'top', |
|
38 | + 'tipAdjustmentX' => -5, |
|
39 | + 'tipAdjustmentY' => -25 |
|
40 | + ) |
|
41 | + ), |
|
42 | + 40 => array( |
|
43 | + 'id' => 'admin_label', |
|
44 | + 'content' => $this->_admin_label_stop(), |
|
45 | + 'options' => array( |
|
46 | + 'tipLocation' => 'top', |
|
47 | + 'tipAdjustmentX' => 20, |
|
48 | + 'tipAdjustmentY' => -25 |
|
49 | + ) |
|
50 | + ), |
|
51 | + 50 => array( |
|
52 | + 'id' => 'type', |
|
53 | + 'content' => $this->_type_stop(), |
|
54 | + 'options' => array( |
|
55 | + 'tipLocation' => 'top', |
|
56 | + 'tipAdjustmentX' => -5, |
|
57 | + 'tipAdjustmentY' => -25 |
|
58 | + ) |
|
59 | + ), |
|
60 | + 60 => array( |
|
61 | + 'id' => 'values', |
|
62 | + 'content' => $this->_values_stop(), |
|
63 | + 'options' => array( |
|
64 | + 'tipLocation' => 'top', |
|
65 | + 'tipAdjustmentX' => -5, |
|
66 | + 'tipAdjustmentY' => -25 |
|
67 | + ) |
|
68 | + ), |
|
69 | + 70 => array( |
|
70 | + 'id' => 'required', |
|
71 | + 'content' => $this->_required_stop(), |
|
72 | + 'options' => array( |
|
73 | + 'tipLocation' => 'top', |
|
74 | + 'tipAdjustmentY' => -20, |
|
75 | + 'tipAdjustmentX' => -15 |
|
76 | + ) |
|
77 | + ), |
|
78 | + /*80 => array( |
|
79 | 79 | 'class' => 'bulkactions', |
80 | 80 | 'content' => $this->_bulk_actions_stop(), |
81 | 81 | 'options' => array( |
@@ -84,78 +84,78 @@ discard block |
||
84 | 84 | 'tipAdjustmentX' => -15 |
85 | 85 | ) |
86 | 86 | ),*/ |
87 | - 90 => array( |
|
88 | - 'id' => 'event-espresso_page_espresso_registration_form-search-input', |
|
89 | - 'content' => $this->_search_stop(), |
|
90 | - 'options' => array( |
|
91 | - 'tipLocation' => 'left', |
|
92 | - 'tipAdjustmentY' => -50, |
|
93 | - 'tipAdjustmentX' => -15 |
|
94 | - ) |
|
95 | - ), |
|
96 | - 100 => array( |
|
97 | - 'id' => 'add-new-question', |
|
98 | - 'content' => $this->_add_new_question_stop(), |
|
99 | - 'options' => array( |
|
100 | - 'tipLocation' => 'right', |
|
101 | - 'tipAdjustmentY' => -50, |
|
102 | - 'tipAdjustmentX' => 15 |
|
103 | - ) |
|
104 | - ), |
|
105 | - ); |
|
106 | - } |
|
87 | + 90 => array( |
|
88 | + 'id' => 'event-espresso_page_espresso_registration_form-search-input', |
|
89 | + 'content' => $this->_search_stop(), |
|
90 | + 'options' => array( |
|
91 | + 'tipLocation' => 'left', |
|
92 | + 'tipAdjustmentY' => -50, |
|
93 | + 'tipAdjustmentX' => -15 |
|
94 | + ) |
|
95 | + ), |
|
96 | + 100 => array( |
|
97 | + 'id' => 'add-new-question', |
|
98 | + 'content' => $this->_add_new_question_stop(), |
|
99 | + 'options' => array( |
|
100 | + 'tipLocation' => 'right', |
|
101 | + 'tipAdjustmentY' => -50, |
|
102 | + 'tipAdjustmentX' => 15 |
|
103 | + ) |
|
104 | + ), |
|
105 | + ); |
|
106 | + } |
|
107 | 107 | |
108 | 108 | |
109 | - protected function _start() |
|
110 | - { |
|
111 | - $content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>'; |
|
112 | - $content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
113 | - 'event_espresso') . '</p>'; |
|
109 | + protected function _start() |
|
110 | + { |
|
111 | + $content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>'; |
|
112 | + $content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
113 | + 'event_espresso') . '</p>'; |
|
114 | 114 | |
115 | - return $content; |
|
116 | - } |
|
115 | + return $content; |
|
116 | + } |
|
117 | 117 | |
118 | - protected function _display_text_stop() |
|
119 | - { |
|
120 | - return '<p>' . __('View available questions. You can reorder your questions by dragging and dropping them.', |
|
121 | - 'event_espresso') . '</p>'; |
|
122 | - } |
|
118 | + protected function _display_text_stop() |
|
119 | + { |
|
120 | + return '<p>' . __('View available questions. You can reorder your questions by dragging and dropping them.', |
|
121 | + 'event_espresso') . '</p>'; |
|
122 | + } |
|
123 | 123 | |
124 | - protected function _admin_label_stop() |
|
125 | - { |
|
126 | - return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>'; |
|
127 | - } |
|
124 | + protected function _admin_label_stop() |
|
125 | + { |
|
126 | + return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>'; |
|
127 | + } |
|
128 | 128 | |
129 | - protected function _type_stop() |
|
130 | - { |
|
131 | - return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', |
|
132 | - 'event_espresso') . '</p>'; |
|
133 | - } |
|
129 | + protected function _type_stop() |
|
130 | + { |
|
131 | + return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', |
|
132 | + 'event_espresso') . '</p>'; |
|
133 | + } |
|
134 | 134 | |
135 | - protected function _values_stop() |
|
136 | - { |
|
137 | - return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', |
|
138 | - 'event_espresso') . '</p>'; |
|
139 | - } |
|
135 | + protected function _values_stop() |
|
136 | + { |
|
137 | + return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', |
|
138 | + 'event_espresso') . '</p>'; |
|
139 | + } |
|
140 | 140 | |
141 | - protected function _required_stop() |
|
142 | - { |
|
143 | - return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>'; |
|
144 | - } |
|
141 | + protected function _required_stop() |
|
142 | + { |
|
143 | + return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>'; |
|
144 | + } |
|
145 | 145 | |
146 | - /* protected function _bulk_actions_stop() { |
|
146 | + /* protected function _bulk_actions_stop() { |
|
147 | 147 | return '<p>' . __('Perform bulk actions to multiple questions.', 'event_espresso') . '</p>'; |
148 | 148 | } */ |
149 | 149 | |
150 | - protected function _search_stop() |
|
151 | - { |
|
152 | - return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', |
|
153 | - 'event_espresso') . '</p>'; |
|
154 | - } |
|
150 | + protected function _search_stop() |
|
151 | + { |
|
152 | + return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', |
|
153 | + 'event_espresso') . '</p>'; |
|
154 | + } |
|
155 | 155 | |
156 | - protected function _add_new_question_stop() |
|
157 | - { |
|
158 | - return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>'; |
|
159 | - } |
|
156 | + protected function _add_new_question_stop() |
|
157 | + { |
|
158 | + return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>'; |
|
159 | + } |
|
160 | 160 | |
161 | 161 | } |
162 | 162 | \ No newline at end of file |
@@ -108,39 +108,39 @@ discard block |
||
108 | 108 | |
109 | 109 | protected function _start() |
110 | 110 | { |
111 | - $content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>'; |
|
112 | - $content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
113 | - 'event_espresso') . '</p>'; |
|
111 | + $content = '<h3>'.__('Questions Overview', 'event_espresso').'</h3>'; |
|
112 | + $content .= '<p>'.__('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', |
|
113 | + 'event_espresso').'</p>'; |
|
114 | 114 | |
115 | 115 | return $content; |
116 | 116 | } |
117 | 117 | |
118 | 118 | protected function _display_text_stop() |
119 | 119 | { |
120 | - return '<p>' . __('View available questions. You can reorder your questions by dragging and dropping them.', |
|
121 | - 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('View available questions. You can reorder your questions by dragging and dropping them.', |
|
121 | + 'event_espresso').'</p>'; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | protected function _admin_label_stop() |
125 | 125 | { |
126 | - return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>'; |
|
126 | + return '<p>'.__('View the admin label for your questions.', 'event_espresso').'</p>'; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | protected function _type_stop() |
130 | 130 | { |
131 | - return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', |
|
132 | - 'event_espresso') . '</p>'; |
|
131 | + return '<p>'.__('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', |
|
132 | + 'event_espresso').'</p>'; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | protected function _values_stop() |
136 | 136 | { |
137 | - return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', |
|
138 | - 'event_espresso') . '</p>'; |
|
137 | + return '<p>'.__('View stored values for checkboxes, radio buttons, and select boxes.', |
|
138 | + 'event_espresso').'</p>'; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | protected function _required_stop() |
142 | 142 | { |
143 | - return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>'; |
|
143 | + return '<p>'.__('View if a question is required.', 'event_espresso').'</p>'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /* protected function _bulk_actions_stop() { |
@@ -149,13 +149,13 @@ discard block |
||
149 | 149 | |
150 | 150 | protected function _search_stop() |
151 | 151 | { |
152 | - return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', |
|
153 | - 'event_espresso') . '</p>'; |
|
152 | + return '<p>'.__('Search through questions. The following sources will be searched: Name of Question (display text).', |
|
153 | + 'event_espresso').'</p>'; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | protected function _add_new_question_stop() |
157 | 157 | { |
158 | - return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>'; |
|
158 | + return '<p>'.__('Click here to add a new question.', 'event_espresso').'</p>'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | } |
162 | 162 | \ No newline at end of file |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
3 | - exit('NO direct script access allowed'); |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -21,68 +21,68 @@ discard block |
||
21 | 21 | { |
22 | 22 | |
23 | 23 | |
24 | - public function __construct($routing = true) |
|
25 | - { |
|
26 | - parent::__construct($routing); |
|
27 | - define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
28 | - } |
|
24 | + public function __construct($routing = true) |
|
25 | + { |
|
26 | + parent::__construct($routing); |
|
27 | + define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - protected function _extend_page_config() |
|
32 | - { |
|
31 | + protected function _extend_page_config() |
|
32 | + { |
|
33 | 33 | |
34 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
34 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
35 | 35 | |
36 | - //filters and action hooks here |
|
37 | - add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
|
38 | - add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', |
|
39 | - array($this, 'update_debug_logging_options'), 10, 1); |
|
36 | + //filters and action hooks here |
|
37 | + add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
|
38 | + add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', |
|
39 | + array($this, 'update_debug_logging_options'), 10, 1); |
|
40 | 40 | |
41 | - } |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | - /************* Logging Settings *************/ |
|
45 | + /************* Logging Settings *************/ |
|
46 | 46 | |
47 | - /** |
|
48 | - * debug_logging_options |
|
49 | - * |
|
50 | - * @param array $template_args |
|
51 | - * |
|
52 | - * @return void |
|
53 | - */ |
|
54 | - public function debug_logging_options($template_args = array()) |
|
55 | - { |
|
56 | - $template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging; |
|
57 | - $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : false; |
|
58 | - $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
|
59 | - $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
60 | - EEH_Template::display_template($template, $template_args); |
|
61 | - } |
|
47 | + /** |
|
48 | + * debug_logging_options |
|
49 | + * |
|
50 | + * @param array $template_args |
|
51 | + * |
|
52 | + * @return void |
|
53 | + */ |
|
54 | + public function debug_logging_options($template_args = array()) |
|
55 | + { |
|
56 | + $template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging; |
|
57 | + $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : false; |
|
58 | + $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
|
59 | + $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
60 | + EEH_Template::display_template($template, $template_args); |
|
61 | + } |
|
62 | 62 | |
63 | 63 | |
64 | - /** |
|
65 | - * update_debug_logging_options |
|
66 | - * |
|
67 | - * @param array $admin_options |
|
68 | - * |
|
69 | - * @return array |
|
70 | - */ |
|
71 | - public function update_debug_logging_options($admin_options = array()) |
|
72 | - { |
|
73 | - $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool)absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging; |
|
74 | - $admin_options->use_full_logging = $use_full_logging; |
|
64 | + /** |
|
65 | + * update_debug_logging_options |
|
66 | + * |
|
67 | + * @param array $admin_options |
|
68 | + * |
|
69 | + * @return array |
|
70 | + */ |
|
71 | + public function update_debug_logging_options($admin_options = array()) |
|
72 | + { |
|
73 | + $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool)absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging; |
|
74 | + $admin_options->use_full_logging = $use_full_logging; |
|
75 | 75 | |
76 | - if ($use_full_logging === false) { |
|
77 | - EE_Error::get_notices(false); |
|
78 | - EE_Error::reset_notices(); |
|
79 | - } |
|
76 | + if ($use_full_logging === false) { |
|
77 | + EE_Error::get_notices(false); |
|
78 | + EE_Error::reset_notices(); |
|
79 | + } |
|
80 | 80 | |
81 | - $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint($this->_req_data['use_remote_logging']) : $admin_options->use_remote_logging; |
|
82 | - $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw($this->_req_data['remote_logging_url']) : $admin_options->remote_logging_url; |
|
81 | + $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint($this->_req_data['use_remote_logging']) : $admin_options->use_remote_logging; |
|
82 | + $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw($this->_req_data['remote_logging_url']) : $admin_options->remote_logging_url; |
|
83 | 83 | |
84 | - return $admin_options; |
|
85 | - } |
|
84 | + return $admin_options; |
|
85 | + } |
|
86 | 86 | |
87 | 87 | |
88 | 88 | } |
@@ -24,14 +24,14 @@ discard block |
||
24 | 24 | public function __construct($routing = true) |
25 | 25 | { |
26 | 26 | parent::__construct($routing); |
27 | - define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
27 | + define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'general_settings/templates/'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function _extend_page_config() |
32 | 32 | { |
33 | 33 | |
34 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
34 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'general_settings'; |
|
35 | 35 | |
36 | 36 | //filters and action hooks here |
37 | 37 | add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging; |
57 | 57 | $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : false; |
58 | 58 | $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
59 | - $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
59 | + $template = GEN_SET_CAF_TEMPLATE_PATH.'debug_log_settings.template.php'; |
|
60 | 60 | EEH_Template::display_template($template, $template_args); |
61 | 61 | } |
62 | 62 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function update_debug_logging_options($admin_options = array()) |
72 | 72 | { |
73 | - $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool)absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging; |
|
73 | + $use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool) absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging; |
|
74 | 74 | $admin_options->use_full_logging = $use_full_logging; |
75 | 75 | |
76 | 76 | if ($use_full_logging === false) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
3 | - exit('NO direct script access allowed'); |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -18,130 +18,130 @@ discard block |
||
18 | 18 | class Registration_Form_Question_Groups_Help_Tour extends EE_Help_Tour |
19 | 19 | { |
20 | 20 | |
21 | - protected function _set_tour_properties() |
|
22 | - { |
|
23 | - $this->_label = __('Question Groups Tour', 'event_espresso'); |
|
24 | - $this->_slug = $this->_is_caf ? 'question-groups-caf-overview-joyride' : 'question-groups-overview-joyride'; |
|
25 | - } |
|
21 | + protected function _set_tour_properties() |
|
22 | + { |
|
23 | + $this->_label = __('Question Groups Tour', 'event_espresso'); |
|
24 | + $this->_slug = $this->_is_caf ? 'question-groups-caf-overview-joyride' : 'question-groups-overview-joyride'; |
|
25 | + } |
|
26 | 26 | |
27 | 27 | |
28 | - protected function _set_tour_stops() |
|
29 | - { |
|
30 | - $this->_stops = array( |
|
31 | - 10 => array( |
|
32 | - 'content' => $this->_start(), |
|
33 | - ) |
|
34 | - ); |
|
28 | + protected function _set_tour_stops() |
|
29 | + { |
|
30 | + $this->_stops = array( |
|
31 | + 10 => array( |
|
32 | + 'content' => $this->_start(), |
|
33 | + ) |
|
34 | + ); |
|
35 | 35 | |
36 | - if ($this->_is_caf) { |
|
37 | - $this->_stops[20] = array( |
|
38 | - 'id' => 'name', |
|
39 | - 'content' => $this->_name_stop(), |
|
40 | - 'options' => array( |
|
41 | - 'tipLocation' => 'top', |
|
42 | - 'tipAdjustmentY' => -30, |
|
43 | - 'tipAdjustmentX' => 25 |
|
44 | - ) |
|
45 | - ); |
|
46 | - $this->_stops[30] = array( |
|
47 | - 'id' => 'description', |
|
48 | - 'content' => $this->_description_stop(), |
|
49 | - 'options' => array( |
|
50 | - 'tipLocation' => 'top', |
|
51 | - 'tipAdjustmentY' => -30, |
|
52 | - 'tipAdjustmentX' => 20 |
|
53 | - ) |
|
54 | - ); |
|
55 | - $this->_stops[40] = array( |
|
56 | - 'id' => 'show_group_name', |
|
57 | - 'content' => $this->_show_group_name_stop(), |
|
58 | - 'options' => array( |
|
59 | - 'tipLocation' => 'top', |
|
60 | - 'tipAdjustmentY' => -30, |
|
61 | - 'tipAdjustmentX' => 20 |
|
62 | - ) |
|
63 | - ); |
|
64 | - $this->_stops[50] = array( |
|
65 | - 'id' => 'show_group_desc', |
|
66 | - 'content' => $this->_show_group_description_stop(), |
|
67 | - 'options' => array( |
|
68 | - 'tipLocation' => 'top', |
|
69 | - 'tipAdjustmentY' => -30, |
|
70 | - 'tipAdjustmentX' => 20 |
|
71 | - ) |
|
72 | - ); |
|
73 | - $this->_stops[60] = array( |
|
74 | - 'class' => 'bulkactions', |
|
75 | - 'content' => $this->_bulk_actions_stop(), |
|
76 | - 'options' => array( |
|
77 | - 'tipLocation' => 'left', |
|
78 | - 'tipAdjustmentY' => -50, |
|
79 | - 'tipAdjustmentX' => -80 |
|
80 | - ) |
|
81 | - ); |
|
82 | - $this->_stops[70] = array( |
|
83 | - 'id' => 'add-new-question-group', |
|
84 | - 'content' => $this->_add_new_question_group_stop(), |
|
85 | - 'options' => array( |
|
86 | - 'tipLocation' => 'right', |
|
87 | - 'tipAdjustmentY' => -50, |
|
88 | - 'tipAdjustmentX' => 15 |
|
89 | - ) |
|
90 | - ); |
|
91 | - } |
|
92 | - } |
|
36 | + if ($this->_is_caf) { |
|
37 | + $this->_stops[20] = array( |
|
38 | + 'id' => 'name', |
|
39 | + 'content' => $this->_name_stop(), |
|
40 | + 'options' => array( |
|
41 | + 'tipLocation' => 'top', |
|
42 | + 'tipAdjustmentY' => -30, |
|
43 | + 'tipAdjustmentX' => 25 |
|
44 | + ) |
|
45 | + ); |
|
46 | + $this->_stops[30] = array( |
|
47 | + 'id' => 'description', |
|
48 | + 'content' => $this->_description_stop(), |
|
49 | + 'options' => array( |
|
50 | + 'tipLocation' => 'top', |
|
51 | + 'tipAdjustmentY' => -30, |
|
52 | + 'tipAdjustmentX' => 20 |
|
53 | + ) |
|
54 | + ); |
|
55 | + $this->_stops[40] = array( |
|
56 | + 'id' => 'show_group_name', |
|
57 | + 'content' => $this->_show_group_name_stop(), |
|
58 | + 'options' => array( |
|
59 | + 'tipLocation' => 'top', |
|
60 | + 'tipAdjustmentY' => -30, |
|
61 | + 'tipAdjustmentX' => 20 |
|
62 | + ) |
|
63 | + ); |
|
64 | + $this->_stops[50] = array( |
|
65 | + 'id' => 'show_group_desc', |
|
66 | + 'content' => $this->_show_group_description_stop(), |
|
67 | + 'options' => array( |
|
68 | + 'tipLocation' => 'top', |
|
69 | + 'tipAdjustmentY' => -30, |
|
70 | + 'tipAdjustmentX' => 20 |
|
71 | + ) |
|
72 | + ); |
|
73 | + $this->_stops[60] = array( |
|
74 | + 'class' => 'bulkactions', |
|
75 | + 'content' => $this->_bulk_actions_stop(), |
|
76 | + 'options' => array( |
|
77 | + 'tipLocation' => 'left', |
|
78 | + 'tipAdjustmentY' => -50, |
|
79 | + 'tipAdjustmentX' => -80 |
|
80 | + ) |
|
81 | + ); |
|
82 | + $this->_stops[70] = array( |
|
83 | + 'id' => 'add-new-question-group', |
|
84 | + 'content' => $this->_add_new_question_group_stop(), |
|
85 | + 'options' => array( |
|
86 | + 'tipLocation' => 'right', |
|
87 | + 'tipAdjustmentY' => -50, |
|
88 | + 'tipAdjustmentX' => 15 |
|
89 | + ) |
|
90 | + ); |
|
91 | + } |
|
92 | + } |
|
93 | 93 | |
94 | 94 | |
95 | - protected function _start() |
|
96 | - { |
|
97 | - $content = '<h3>' . __('Question Groups', 'event_espresso') . '</h3>'; |
|
98 | - if ($this->_is_caf) { |
|
99 | - $content .= '<p>' . __('This tour of the Question Groups page will go over different areas of the screen to help you understand what they are used for.', |
|
100 | - 'event_espresso') . '</p>'; |
|
101 | - } else { |
|
102 | - $content .= '<p>' . __('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', |
|
103 | - 'event_espresso') . '</p>'; |
|
104 | - } |
|
95 | + protected function _start() |
|
96 | + { |
|
97 | + $content = '<h3>' . __('Question Groups', 'event_espresso') . '</h3>'; |
|
98 | + if ($this->_is_caf) { |
|
99 | + $content .= '<p>' . __('This tour of the Question Groups page will go over different areas of the screen to help you understand what they are used for.', |
|
100 | + 'event_espresso') . '</p>'; |
|
101 | + } else { |
|
102 | + $content .= '<p>' . __('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', |
|
103 | + 'event_espresso') . '</p>'; |
|
104 | + } |
|
105 | 105 | |
106 | - return $content; |
|
107 | - } |
|
106 | + return $content; |
|
107 | + } |
|
108 | 108 | |
109 | - protected function _name_stop() |
|
110 | - { |
|
111 | - return '<p>' . __('View available questions groups. You can reorder your questions by dragging and dropping them.', |
|
112 | - 'event_espresso') . '</p>'; |
|
113 | - } |
|
109 | + protected function _name_stop() |
|
110 | + { |
|
111 | + return '<p>' . __('View available questions groups. You can reorder your questions by dragging and dropping them.', |
|
112 | + 'event_espresso') . '</p>'; |
|
113 | + } |
|
114 | 114 | |
115 | - protected function _description_stop() |
|
116 | - { |
|
117 | - return '<p>' . __('View the question group description.', 'event_espresso') . '</p>'; |
|
118 | - } |
|
115 | + protected function _description_stop() |
|
116 | + { |
|
117 | + return '<p>' . __('View the question group description.', 'event_espresso') . '</p>'; |
|
118 | + } |
|
119 | 119 | |
120 | - protected function _show_group_name_stop() |
|
121 | - { |
|
122 | - return '<p>' . __('View if the name of the question group should be shown to customers.', |
|
123 | - 'event_espresso') . '</p>'; |
|
124 | - } |
|
120 | + protected function _show_group_name_stop() |
|
121 | + { |
|
122 | + return '<p>' . __('View if the name of the question group should be shown to customers.', |
|
123 | + 'event_espresso') . '</p>'; |
|
124 | + } |
|
125 | 125 | |
126 | - protected function _show_group_description_stop() |
|
127 | - { |
|
128 | - return '<p>' . __('View if the description of the question group should be shown to customers.', |
|
129 | - 'event_espresso') . '</p>'; |
|
130 | - } |
|
126 | + protected function _show_group_description_stop() |
|
127 | + { |
|
128 | + return '<p>' . __('View if the description of the question group should be shown to customers.', |
|
129 | + 'event_espresso') . '</p>'; |
|
130 | + } |
|
131 | 131 | |
132 | - protected function _bulk_actions_stop() |
|
133 | - { |
|
134 | - return '<p>' . __('Perform bulk actions to multiple question groups.', 'event_espresso') . '</p>'; |
|
135 | - } |
|
132 | + protected function _bulk_actions_stop() |
|
133 | + { |
|
134 | + return '<p>' . __('Perform bulk actions to multiple question groups.', 'event_espresso') . '</p>'; |
|
135 | + } |
|
136 | 136 | |
137 | - protected function _search_stop() |
|
138 | - { |
|
139 | - return '<p>' . __('Search through questions. The following sources will be searched: question group name and question group description.', |
|
140 | - 'event_espresso') . '</p>'; |
|
141 | - } |
|
137 | + protected function _search_stop() |
|
138 | + { |
|
139 | + return '<p>' . __('Search through questions. The following sources will be searched: question group name and question group description.', |
|
140 | + 'event_espresso') . '</p>'; |
|
141 | + } |
|
142 | 142 | |
143 | - protected function _add_new_question_group_stop() |
|
144 | - { |
|
145 | - return '<p>' . __('Click here to create a new question group.', 'event_espresso') . '</p>'; |
|
146 | - } |
|
143 | + protected function _add_new_question_group_stop() |
|
144 | + { |
|
145 | + return '<p>' . __('Click here to create a new question group.', 'event_espresso') . '</p>'; |
|
146 | + } |
|
147 | 147 | } |
148 | 148 | \ No newline at end of file |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | |
95 | 95 | protected function _start() |
96 | 96 | { |
97 | - $content = '<h3>' . __('Question Groups', 'event_espresso') . '</h3>'; |
|
97 | + $content = '<h3>'.__('Question Groups', 'event_espresso').'</h3>'; |
|
98 | 98 | if ($this->_is_caf) { |
99 | - $content .= '<p>' . __('This tour of the Question Groups page will go over different areas of the screen to help you understand what they are used for.', |
|
100 | - 'event_espresso') . '</p>'; |
|
99 | + $content .= '<p>'.__('This tour of the Question Groups page will go over different areas of the screen to help you understand what they are used for.', |
|
100 | + 'event_espresso').'</p>'; |
|
101 | 101 | } else { |
102 | - $content .= '<p>' . __('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', |
|
103 | - 'event_espresso') . '</p>'; |
|
102 | + $content .= '<p>'.__('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', |
|
103 | + 'event_espresso').'</p>'; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | return $content; |
@@ -108,40 +108,40 @@ discard block |
||
108 | 108 | |
109 | 109 | protected function _name_stop() |
110 | 110 | { |
111 | - return '<p>' . __('View available questions groups. You can reorder your questions by dragging and dropping them.', |
|
112 | - 'event_espresso') . '</p>'; |
|
111 | + return '<p>'.__('View available questions groups. You can reorder your questions by dragging and dropping them.', |
|
112 | + 'event_espresso').'</p>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function _description_stop() |
116 | 116 | { |
117 | - return '<p>' . __('View the question group description.', 'event_espresso') . '</p>'; |
|
117 | + return '<p>'.__('View the question group description.', 'event_espresso').'</p>'; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | protected function _show_group_name_stop() |
121 | 121 | { |
122 | - return '<p>' . __('View if the name of the question group should be shown to customers.', |
|
123 | - 'event_espresso') . '</p>'; |
|
122 | + return '<p>'.__('View if the name of the question group should be shown to customers.', |
|
123 | + 'event_espresso').'</p>'; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | protected function _show_group_description_stop() |
127 | 127 | { |
128 | - return '<p>' . __('View if the description of the question group should be shown to customers.', |
|
129 | - 'event_espresso') . '</p>'; |
|
128 | + return '<p>'.__('View if the description of the question group should be shown to customers.', |
|
129 | + 'event_espresso').'</p>'; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | protected function _bulk_actions_stop() |
133 | 133 | { |
134 | - return '<p>' . __('Perform bulk actions to multiple question groups.', 'event_espresso') . '</p>'; |
|
134 | + return '<p>'.__('Perform bulk actions to multiple question groups.', 'event_espresso').'</p>'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | protected function _search_stop() |
138 | 138 | { |
139 | - return '<p>' . __('Search through questions. The following sources will be searched: question group name and question group description.', |
|
140 | - 'event_espresso') . '</p>'; |
|
139 | + return '<p>'.__('Search through questions. The following sources will be searched: question group name and question group description.', |
|
140 | + 'event_espresso').'</p>'; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | protected function _add_new_question_group_stop() |
144 | 144 | { |
145 | - return '<p>' . __('Click here to create a new question group.', 'event_espresso') . '</p>'; |
|
145 | + return '<p>'.__('Click here to create a new question group.', 'event_espresso').'</p>'; |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | \ No newline at end of file |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
3 | - exit('NO direct script access allowed'); |
|
3 | + exit('NO direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -18,121 +18,121 @@ discard block |
||
18 | 18 | class Your_Organization_Help_Tour extends EE_Help_Tour |
19 | 19 | { |
20 | 20 | |
21 | - protected function _set_tour_properties() |
|
22 | - { |
|
23 | - $this->_label = __('Your Organization Tour', 'event_espresso'); |
|
24 | - $this->_slug = 'your-organization-joyride'; |
|
25 | - } |
|
21 | + protected function _set_tour_properties() |
|
22 | + { |
|
23 | + $this->_label = __('Your Organization Tour', 'event_espresso'); |
|
24 | + $this->_slug = 'your-organization-joyride'; |
|
25 | + } |
|
26 | 26 | |
27 | 27 | |
28 | - protected function _set_tour_stops() |
|
29 | - { |
|
30 | - $this->_stops = array( |
|
31 | - 10 => array( |
|
32 | - 'content' => $this->_start(), |
|
33 | - ), |
|
34 | - 30 => array( |
|
35 | - 'id' => 'contact_info_h4', |
|
36 | - 'content' => $this->_contact_information_stop(), |
|
37 | - 'options' => array( |
|
38 | - 'tipLocation' => 'left', |
|
39 | - 'tipAdjustmentY' => -50, |
|
40 | - 'tipAdjustmentX' => 15 |
|
41 | - ) |
|
42 | - ), |
|
43 | - 40 => array( |
|
44 | - 'id' => 'upload_image', |
|
45 | - 'content' => $this->_upload_image_stop(), |
|
46 | - 'options' => array( |
|
47 | - 'tipLocation' => 'right', |
|
48 | - 'tipAdjustmentY' => -50, |
|
49 | - 'tipAdjustmentX' => 15 |
|
50 | - ) |
|
51 | - ), |
|
52 | - 50 => array( |
|
53 | - 'id' => 'organization_facebook', |
|
54 | - 'content' => $this->_organization_facebook_stop(), |
|
55 | - 'options' => array( |
|
56 | - 'tipLocation' => 'right', |
|
57 | - 'tipAdjustmentY' => -50, |
|
58 | - 'tipAdjustmentX' => 15 |
|
59 | - ) |
|
60 | - ), |
|
61 | - 60 => array( |
|
62 | - 'id' => 'ueip_optin', |
|
63 | - 'content' => $this->_ueip_option_stop(), |
|
64 | - 'options' => array( |
|
65 | - 'tipLocation' => 'right', |
|
66 | - 'tipAdjustmentY' => -50, |
|
67 | - 'tipAdjustmentX' => 15 |
|
68 | - ) |
|
69 | - ), |
|
70 | - 70 => array( |
|
71 | - 'id' => 'espresso_major_buttons_wrapper', |
|
72 | - 'content' => $this->_end_tour_stop(), |
|
73 | - 'options' => array( |
|
74 | - 'tipLocation' => 'right', |
|
75 | - 'tipAdjustmentY' => -50, |
|
76 | - 'tipAdjustmentX' => 185 |
|
77 | - ) |
|
78 | - ) |
|
79 | - ); |
|
28 | + protected function _set_tour_stops() |
|
29 | + { |
|
30 | + $this->_stops = array( |
|
31 | + 10 => array( |
|
32 | + 'content' => $this->_start(), |
|
33 | + ), |
|
34 | + 30 => array( |
|
35 | + 'id' => 'contact_info_h4', |
|
36 | + 'content' => $this->_contact_information_stop(), |
|
37 | + 'options' => array( |
|
38 | + 'tipLocation' => 'left', |
|
39 | + 'tipAdjustmentY' => -50, |
|
40 | + 'tipAdjustmentX' => 15 |
|
41 | + ) |
|
42 | + ), |
|
43 | + 40 => array( |
|
44 | + 'id' => 'upload_image', |
|
45 | + 'content' => $this->_upload_image_stop(), |
|
46 | + 'options' => array( |
|
47 | + 'tipLocation' => 'right', |
|
48 | + 'tipAdjustmentY' => -50, |
|
49 | + 'tipAdjustmentX' => 15 |
|
50 | + ) |
|
51 | + ), |
|
52 | + 50 => array( |
|
53 | + 'id' => 'organization_facebook', |
|
54 | + 'content' => $this->_organization_facebook_stop(), |
|
55 | + 'options' => array( |
|
56 | + 'tipLocation' => 'right', |
|
57 | + 'tipAdjustmentY' => -50, |
|
58 | + 'tipAdjustmentX' => 15 |
|
59 | + ) |
|
60 | + ), |
|
61 | + 60 => array( |
|
62 | + 'id' => 'ueip_optin', |
|
63 | + 'content' => $this->_ueip_option_stop(), |
|
64 | + 'options' => array( |
|
65 | + 'tipLocation' => 'right', |
|
66 | + 'tipAdjustmentY' => -50, |
|
67 | + 'tipAdjustmentX' => 15 |
|
68 | + ) |
|
69 | + ), |
|
70 | + 70 => array( |
|
71 | + 'id' => 'espresso_major_buttons_wrapper', |
|
72 | + 'content' => $this->_end_tour_stop(), |
|
73 | + 'options' => array( |
|
74 | + 'tipLocation' => 'right', |
|
75 | + 'tipAdjustmentY' => -50, |
|
76 | + 'tipAdjustmentX' => 185 |
|
77 | + ) |
|
78 | + ) |
|
79 | + ); |
|
80 | 80 | |
81 | - if (is_main_site()) { |
|
82 | - $this->_stops[20] = array( |
|
83 | - 'id' => 'site_license_key', |
|
84 | - 'content' => $this->_site_license_key_stop(), |
|
85 | - 'options' => array( |
|
86 | - 'tipLocation' => 'right', |
|
87 | - 'tipAdjustmentY' => -50, |
|
88 | - 'tipAdjustmentX' => 15 |
|
89 | - ) |
|
90 | - ); |
|
91 | - } |
|
92 | - ksort( $this->_stops ); |
|
93 | - } |
|
81 | + if (is_main_site()) { |
|
82 | + $this->_stops[20] = array( |
|
83 | + 'id' => 'site_license_key', |
|
84 | + 'content' => $this->_site_license_key_stop(), |
|
85 | + 'options' => array( |
|
86 | + 'tipLocation' => 'right', |
|
87 | + 'tipAdjustmentY' => -50, |
|
88 | + 'tipAdjustmentX' => 15 |
|
89 | + ) |
|
90 | + ); |
|
91 | + } |
|
92 | + ksort( $this->_stops ); |
|
93 | + } |
|
94 | 94 | |
95 | 95 | |
96 | - protected function _start() |
|
97 | - { |
|
98 | - $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
99 | - $content .= '<p>' . __('This tour of the Your Organization page will go over different areas of the screen to help you understand what they are used for.', |
|
100 | - 'event_espresso') . '</p>'; |
|
96 | + protected function _start() |
|
97 | + { |
|
98 | + $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
99 | + $content .= '<p>' . __('This tour of the Your Organization page will go over different areas of the screen to help you understand what they are used for.', |
|
100 | + 'event_espresso') . '</p>'; |
|
101 | 101 | |
102 | - return $content; |
|
103 | - } |
|
102 | + return $content; |
|
103 | + } |
|
104 | 104 | |
105 | - protected function _site_license_key_stop() |
|
106 | - { |
|
107 | - return '<p>' . __('Enter your support license key here to enable one-click updates.', |
|
108 | - 'event_espresso') . '</p>'; |
|
109 | - } |
|
105 | + protected function _site_license_key_stop() |
|
106 | + { |
|
107 | + return '<p>' . __('Enter your support license key here to enable one-click updates.', |
|
108 | + 'event_espresso') . '</p>'; |
|
109 | + } |
|
110 | 110 | |
111 | - protected function _contact_information_stop() |
|
112 | - { |
|
113 | - return '<p>' . __('You can change your business / organization information below. Be sure to keep this information updated as it is used in other areas of the site. Adjusting the country option here will update your currency settings. More options are available in the Countries tab.', |
|
114 | - 'event_espresso') . '</p>'; |
|
115 | - } |
|
111 | + protected function _contact_information_stop() |
|
112 | + { |
|
113 | + return '<p>' . __('You can change your business / organization information below. Be sure to keep this information updated as it is used in other areas of the site. Adjusting the country option here will update your currency settings. More options are available in the Countries tab.', |
|
114 | + 'event_espresso') . '</p>'; |
|
115 | + } |
|
116 | 116 | |
117 | - protected function _upload_image_stop() |
|
118 | - { |
|
119 | - return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
120 | - } |
|
117 | + protected function _upload_image_stop() |
|
118 | + { |
|
119 | + return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
120 | + } |
|
121 | 121 | |
122 | - protected function _organization_facebook_stop() |
|
123 | - { |
|
124 | - return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
125 | - } |
|
122 | + protected function _organization_facebook_stop() |
|
123 | + { |
|
124 | + return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
125 | + } |
|
126 | 126 | |
127 | - protected function _ueip_option_stop() |
|
128 | - { |
|
129 | - return '<p>' . __('Help us to help you! Sign up to the User eXperience Improvement Program and send us anonymous data that will help us improve Event Espresso.', |
|
130 | - 'event_espresso') . '</p>'; |
|
131 | - } |
|
127 | + protected function _ueip_option_stop() |
|
128 | + { |
|
129 | + return '<p>' . __('Help us to help you! Sign up to the User eXperience Improvement Program and send us anonymous data that will help us improve Event Espresso.', |
|
130 | + 'event_espresso') . '</p>'; |
|
131 | + } |
|
132 | 132 | |
133 | - protected function _end_tour_stop() |
|
134 | - { |
|
135 | - return '<p>' . __('You are almost done updating Your Organization information. Click on the Save button to save changes and then go to the Payment Methods screen so you can setup a payment gateway.', |
|
136 | - 'event_espresso') . '</p>'; |
|
137 | - } |
|
133 | + protected function _end_tour_stop() |
|
134 | + { |
|
135 | + return '<p>' . __('You are almost done updating Your Organization information. Click on the Save button to save changes and then go to the Payment Methods screen so you can setup a payment gateway.', |
|
136 | + 'event_espresso') . '</p>'; |
|
137 | + } |
|
138 | 138 | } |
139 | 139 | \ No newline at end of file |
@@ -89,50 +89,50 @@ |
||
89 | 89 | ) |
90 | 90 | ); |
91 | 91 | } |
92 | - ksort( $this->_stops ); |
|
92 | + ksort($this->_stops); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
96 | 96 | protected function _start() |
97 | 97 | { |
98 | - $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
99 | - $content .= '<p>' . __('This tour of the Your Organization page will go over different areas of the screen to help you understand what they are used for.', |
|
100 | - 'event_espresso') . '</p>'; |
|
98 | + $content = '<h3>'.__('Organization Settings', 'event_espresso').'</h3>'; |
|
99 | + $content .= '<p>'.__('This tour of the Your Organization page will go over different areas of the screen to help you understand what they are used for.', |
|
100 | + 'event_espresso').'</p>'; |
|
101 | 101 | |
102 | 102 | return $content; |
103 | 103 | } |
104 | 104 | |
105 | 105 | protected function _site_license_key_stop() |
106 | 106 | { |
107 | - return '<p>' . __('Enter your support license key here to enable one-click updates.', |
|
108 | - 'event_espresso') . '</p>'; |
|
107 | + return '<p>'.__('Enter your support license key here to enable one-click updates.', |
|
108 | + 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | protected function _contact_information_stop() |
112 | 112 | { |
113 | - return '<p>' . __('You can change your business / organization information below. Be sure to keep this information updated as it is used in other areas of the site. Adjusting the country option here will update your currency settings. More options are available in the Countries tab.', |
|
114 | - 'event_espresso') . '</p>'; |
|
113 | + return '<p>'.__('You can change your business / organization information below. Be sure to keep this information updated as it is used in other areas of the site. Adjusting the country option here will update your currency settings. More options are available in the Countries tab.', |
|
114 | + 'event_espresso').'</p>'; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | protected function _upload_image_stop() |
118 | 118 | { |
119 | - return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
119 | + return '<p>'.__('Add a logo. This can be used for invoices and tickets.', 'event_espresso').'</p>'; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | protected function _organization_facebook_stop() |
123 | 123 | { |
124 | - return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
124 | + return '<p>'.__('Add links to various social media networks.', 'event_espresso').'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _ueip_option_stop() |
128 | 128 | { |
129 | - return '<p>' . __('Help us to help you! Sign up to the User eXperience Improvement Program and send us anonymous data that will help us improve Event Espresso.', |
|
130 | - 'event_espresso') . '</p>'; |
|
129 | + return '<p>'.__('Help us to help you! Sign up to the User eXperience Improvement Program and send us anonymous data that will help us improve Event Espresso.', |
|
130 | + 'event_espresso').'</p>'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | protected function _end_tour_stop() |
134 | 134 | { |
135 | - return '<p>' . __('You are almost done updating Your Organization information. Click on the Save button to save changes and then go to the Payment Methods screen so you can setup a payment gateway.', |
|
136 | - 'event_espresso') . '</p>'; |
|
135 | + return '<p>'.__('You are almost done updating Your Organization information. Click on the Save button to save changes and then go to the Payment Methods screen so you can setup a payment gateway.', |
|
136 | + 'event_espresso').'</p>'; |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | \ No newline at end of file |