@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
4 | - exit('NO direct script access allowed'); |
|
4 | + exit('NO direct script access allowed'); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | /** |
@@ -36,82 +36,82 @@ discard block |
||
36 | 36 | { |
37 | 37 | |
38 | 38 | |
39 | - /** |
|
40 | - * _init_props |
|
41 | - * |
|
42 | - * @access protected |
|
43 | - * @return void |
|
44 | - */ |
|
45 | - protected function _init_props() |
|
46 | - { |
|
47 | - $this->label = __('Attendee Shortcodes', 'event_espresso'); |
|
48 | - $this->description = __('All shortcodes specific to attendee related data', 'event_espresso'); |
|
49 | - $this->_shortcodes = array( |
|
50 | - '[QUESTION]' => __('Will parse to a question.', 'event_espresso'), |
|
51 | - '[ANSWER]' => __('Will parse to the answer for a question', 'event_espresso') |
|
52 | - ); |
|
53 | - } |
|
39 | + /** |
|
40 | + * _init_props |
|
41 | + * |
|
42 | + * @access protected |
|
43 | + * @return void |
|
44 | + */ |
|
45 | + protected function _init_props() |
|
46 | + { |
|
47 | + $this->label = __('Attendee Shortcodes', 'event_espresso'); |
|
48 | + $this->description = __('All shortcodes specific to attendee related data', 'event_espresso'); |
|
49 | + $this->_shortcodes = array( |
|
50 | + '[QUESTION]' => __('Will parse to a question.', 'event_espresso'), |
|
51 | + '[ANSWER]' => __('Will parse to the answer for a question', 'event_espresso') |
|
52 | + ); |
|
53 | + } |
|
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * This method will give parsing instructions for each shortcode defined in the _shortcodes array. Child methods |
|
58 | - * will have to take care of handling. |
|
59 | - * |
|
60 | - * @access protected |
|
61 | - * |
|
62 | - * @param string $shortcode the shortcode to be parsed. |
|
63 | - * |
|
64 | - * @return string parsed shortcode |
|
65 | - */ |
|
66 | - protected function _parser($shortcode) |
|
67 | - { |
|
56 | + /** |
|
57 | + * This method will give parsing instructions for each shortcode defined in the _shortcodes array. Child methods |
|
58 | + * will have to take care of handling. |
|
59 | + * |
|
60 | + * @access protected |
|
61 | + * |
|
62 | + * @param string $shortcode the shortcode to be parsed. |
|
63 | + * |
|
64 | + * @return string parsed shortcode |
|
65 | + */ |
|
66 | + protected function _parser($shortcode) |
|
67 | + { |
|
68 | 68 | |
69 | - if ( ! $this->_data instanceof EE_Answer || ! isset($this->_extra_data['data']) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee) { |
|
70 | - return ''; |
|
71 | - } |
|
69 | + if ( ! $this->_data instanceof EE_Answer || ! isset($this->_extra_data['data']) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee) { |
|
70 | + return ''; |
|
71 | + } |
|
72 | 72 | |
73 | - switch ($shortcode) { |
|
73 | + switch ($shortcode) { |
|
74 | 74 | |
75 | - case '[QUESTION]' : |
|
76 | - $question = isset($this->_extra_data['data']->questions[$this->_data->ID()]) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question(); |
|
77 | - if ( ! $question instanceof EE_Question) { |
|
78 | - return ''; //get out because we can't figure out what the question is. |
|
79 | - } |
|
75 | + case '[QUESTION]' : |
|
76 | + $question = isset($this->_extra_data['data']->questions[$this->_data->ID()]) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question(); |
|
77 | + if ( ! $question instanceof EE_Question) { |
|
78 | + return ''; //get out because we can't figure out what the question is. |
|
79 | + } |
|
80 | 80 | |
81 | - return $question->get_pretty('QST_display_text', 'no_wpautop'); |
|
82 | - break; |
|
81 | + return $question->get_pretty('QST_display_text', 'no_wpautop'); |
|
82 | + break; |
|
83 | 83 | |
84 | - case '[ANSWER]' : |
|
85 | - //need to get the question to determine the type of question (some questions require translation of the answer). |
|
86 | - $question = isset($this->_extra_data['data']->questions[$this->_data->ID()]) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question(); |
|
87 | - if ( ! $question instanceof EE_Question) { |
|
88 | - return ''; //get out cause we can't figure out what the question type is! |
|
89 | - } |
|
84 | + case '[ANSWER]' : |
|
85 | + //need to get the question to determine the type of question (some questions require translation of the answer). |
|
86 | + $question = isset($this->_extra_data['data']->questions[$this->_data->ID()]) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question(); |
|
87 | + if ( ! $question instanceof EE_Question) { |
|
88 | + return ''; //get out cause we can't figure out what the question type is! |
|
89 | + } |
|
90 | 90 | |
91 | - //what we show for the answer depends on the question type! |
|
92 | - switch ($question->get('QST_type')) { |
|
91 | + //what we show for the answer depends on the question type! |
|
92 | + switch ($question->get('QST_type')) { |
|
93 | 93 | |
94 | - case 'STATE' : |
|
95 | - $state = EEM_State::instance()->get_one_by_ID($this->_data->get('ANS_value')); |
|
96 | - $answer = $state instanceof EE_State ? $state->name() : ''; |
|
97 | - break; |
|
94 | + case 'STATE' : |
|
95 | + $state = EEM_State::instance()->get_one_by_ID($this->_data->get('ANS_value')); |
|
96 | + $answer = $state instanceof EE_State ? $state->name() : ''; |
|
97 | + break; |
|
98 | 98 | |
99 | - case 'COUNTRY' : |
|
100 | - $country = EEM_Country::instance()->get_one_by_ID($this->_data->get('ANS_value')); |
|
101 | - $answer = $country instanceof EE_Country ? $country->name() : ''; |
|
102 | - break; |
|
99 | + case 'COUNTRY' : |
|
100 | + $country = EEM_Country::instance()->get_one_by_ID($this->_data->get('ANS_value')); |
|
101 | + $answer = $country instanceof EE_Country ? $country->name() : ''; |
|
102 | + break; |
|
103 | 103 | |
104 | - default : |
|
105 | - $answer = $this->_data->get_pretty('ANS_value', 'no_wpautop'); |
|
106 | - break; |
|
107 | - } |
|
104 | + default : |
|
105 | + $answer = $this->_data->get_pretty('ANS_value', 'no_wpautop'); |
|
106 | + break; |
|
107 | + } |
|
108 | 108 | |
109 | - return $answer; |
|
110 | - break; |
|
109 | + return $answer; |
|
110 | + break; |
|
111 | 111 | |
112 | - } |
|
112 | + } |
|
113 | 113 | |
114 | - return ''; |
|
115 | - } |
|
114 | + return ''; |
|
115 | + } |
|
116 | 116 | |
117 | 117 | } //end EE_Question_Shortcodes class |
@@ -91,7 +91,7 @@ |
||
91 | 91 | * |
92 | 92 | * @param array $dir_ref original array of paths |
93 | 93 | * |
94 | - * @return array appended paths |
|
94 | + * @return string[] appended paths |
|
95 | 95 | */ |
96 | 96 | public function messages_autoload_paths($dir_ref) |
97 | 97 | { |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * @since 4.3.2 |
8 | 8 | */ |
9 | 9 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
10 | - exit('No direct script access allowed'); |
|
10 | + exit('No direct script access allowed'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | /** |
@@ -22,651 +22,651 @@ discard block |
||
22 | 22 | { |
23 | 23 | |
24 | 24 | |
25 | - /** |
|
26 | - * constructor. |
|
27 | - */ |
|
28 | - public function __construct() |
|
29 | - { |
|
30 | - $this->_caf_hooks(); |
|
31 | - } |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * Contains all the hooks filters for setting up caffeinated messages functionality. |
|
36 | - * |
|
37 | - * @since 4.3.2 |
|
38 | - * |
|
39 | - * @return void |
|
40 | - */ |
|
41 | - private function _caf_hooks() |
|
42 | - { |
|
43 | - add_filter('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', array($this, 'messages_autoload_paths'), 5); |
|
44 | - add_filter('FHEE__EE_Email_messenger__get_validator_config', array($this, 'email_messenger_validator_config'), |
|
45 | - 5, 2); |
|
46 | - add_filter('FHEE__EE_Email_messenger__get_template_fields', array($this, 'email_messenger_template_fields'), 5, |
|
47 | - 2); |
|
48 | - add_filter('FHEE__EE_Html_messenger__get_template_fields', array($this, 'html_messenger_template_fields'), 5, |
|
49 | - 2); |
|
50 | - add_filter('FHEE__EE_Html_messenger__get_validator_config', array($this, 'html_messenger_validator_config'), 5, |
|
51 | - 2); |
|
52 | - add_filter('FHEE__EE_Pdf_messenger__get_template_fields', array($this, 'pdf_messenger_template_fields'), 5, 2); |
|
53 | - add_filter('FHEE__EE_Pdf_messenger__get_validator_config', array($this, 'pdf_messenger_validator_config'), 5, |
|
54 | - 2); |
|
55 | - add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', |
|
56 | - array($this, 'new_default_templates'), 5, 7); |
|
57 | - add_filter('FHEE__EE_Messages_Base__get_valid_shortcodes', array($this, 'message_types_valid_shortcodes'), 5, |
|
58 | - 2); |
|
59 | - |
|
60 | - //shortcode parsers |
|
61 | - add_filter('FHEE__EE_Attendee_Shortcodes__shortcodes', array($this, 'additional_attendee_shortcodes'), 5, 2); |
|
62 | - add_filter('FHEE__EE_Attendee_Shortcodes__parser_after', array($this, 'additional_attendee_parser'), 5, 5); |
|
63 | - add_filter('FHEE__EE_Recipient_List_Shortcodes__shortcodes', |
|
64 | - array($this, 'additional_recipient_details_shortcodes'), 5, 2); |
|
65 | - add_filter('FHEE__EE_Recipient_List_Shortcodes__parser_after', |
|
66 | - array($this, 'additional_recipient_details_parser'), 5, 5); |
|
67 | - add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__shortcodes', |
|
68 | - array($this, 'additional_primary_registration_details_shortcodes'), 5, 2); |
|
69 | - add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__parser_after', |
|
70 | - array($this, 'additional_primary_registration_details_parser'), 5, 5); |
|
71 | - |
|
72 | - /** |
|
73 | - * @since 4.2.0 |
|
74 | - */ |
|
75 | - add_filter('FHEE__EE_Datetime_Shortcodes__shortcodes', array($this, 'additional_datetime_shortcodes'), 10, 2); |
|
76 | - add_filter('FHEE__EE_Datetime_Shortcodes__parser_after', array($this, 'additional_datetime_parser'), 10, 5); |
|
77 | - |
|
78 | - /** |
|
79 | - * @since 4.3.0 |
|
80 | - */ |
|
81 | - //eat our own dog food! |
|
82 | - add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_message_types')); |
|
83 | - add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_shortcodes')); |
|
84 | - do_action('EE_Brewing_Regular___messages_caf'); |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - /** |
|
89 | - * This just allows us to add additional paths to the autoloader (EED_Messages::autoload_messages()) for the |
|
90 | - * messages system. |
|
91 | - * |
|
92 | - * @param array $dir_ref original array of paths |
|
93 | - * |
|
94 | - * @return array appended paths |
|
95 | - */ |
|
96 | - public function messages_autoload_paths($dir_ref) |
|
97 | - { |
|
98 | - $dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/'; |
|
99 | - |
|
100 | - return $dir_ref; |
|
101 | - } |
|
102 | - |
|
103 | - |
|
104 | - public function email_messenger_validator_config($validator_config, EE_Email_messenger $messenger) |
|
105 | - { |
|
106 | - $validator_config['attendee_list'] = array( |
|
107 | - 'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'), |
|
108 | - 'required' => array('[ATTENDEE_LIST]') |
|
109 | - ); |
|
110 | - $validator_config['question_list'] = array( |
|
111 | - 'shortcodes' => array('question'), |
|
112 | - 'required' => array('[QUESTION_LIST]') |
|
113 | - ); |
|
114 | - |
|
115 | - return $validator_config; |
|
116 | - } |
|
117 | - |
|
118 | - |
|
119 | - public function html_messenger_validator_config($validator_config, EE_Html_messenger $messenger) |
|
120 | - { |
|
121 | - $validator_config['attendee_list'] = array( |
|
122 | - 'shortcodes' => array('attendee', 'question_list'), |
|
123 | - 'required' => array('[ATTENDEE_LIST]') |
|
124 | - ); |
|
125 | - $validator_config['question_list'] = array( |
|
126 | - 'shortcodes' => array('question'), |
|
127 | - 'required' => array('[QUESTION_LIST]') |
|
128 | - ); |
|
129 | - |
|
130 | - return $validator_config; |
|
131 | - } |
|
132 | - |
|
133 | - |
|
134 | - public function pdf_messenger_validator_config($validator_config, EE_Pdf_messenger $messenger) |
|
135 | - { |
|
136 | - $validator_config['attendee_list'] = array( |
|
137 | - 'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'), |
|
138 | - 'required' => array('[ATTENDEE_LIST]') |
|
139 | - ); |
|
140 | - $validator_config['question_list'] = array( |
|
141 | - 'shortcodes' => array('question'), |
|
142 | - 'required' => array('[QUESTION_LIST]') |
|
143 | - ); |
|
144 | - |
|
145 | - return $validator_config; |
|
146 | - } |
|
147 | - |
|
148 | - |
|
149 | - public function email_messenger_template_fields($template_fields, EE_Email_messenger $messenger) |
|
150 | - { |
|
151 | - $template_fields['extra']['content']['question_list'] = array( |
|
152 | - 'input' => 'textarea', |
|
153 | - 'label' => '[QUESTION_LIST]', |
|
154 | - 'type' => 'string', |
|
155 | - 'required' => true, |
|
156 | - 'validation' => true, |
|
157 | - 'format' => '%s', |
|
158 | - 'css_class' => 'large-text', |
|
159 | - 'rows' => '5', |
|
160 | - 'shortcodes_required' => array('[QUESTION_LIST]') |
|
161 | - ); |
|
162 | - |
|
163 | - return $template_fields; |
|
164 | - } |
|
165 | - |
|
166 | - |
|
167 | - public function html_messenger_template_fields($template_fields, EE_Html_messenger $messenger) |
|
168 | - { |
|
169 | - $template_fields['extra']['content']['question_list'] = array( |
|
170 | - 'input' => 'textarea', |
|
171 | - 'label' => '[QUESTION_LIST]', |
|
172 | - 'type' => 'string', |
|
173 | - 'required' => true, |
|
174 | - 'validation' => true, |
|
175 | - 'format' => '%s', |
|
176 | - 'css_class' => 'large-text', |
|
177 | - 'rows' => '5', |
|
178 | - 'shortcodes_required' => array('[QUESTION_LIST]') |
|
179 | - ); |
|
180 | - |
|
181 | - return $template_fields; |
|
182 | - } |
|
183 | - |
|
184 | - |
|
185 | - public function pdf_messenger_template_fields($template_fields, EE_Pdf_messenger $messenger) |
|
186 | - { |
|
187 | - $template_fields['extra']['content']['question_list'] = array( |
|
188 | - 'input' => 'textarea', |
|
189 | - 'label' => '[QUESTION_LIST]', |
|
190 | - 'type' => 'string', |
|
191 | - 'required' => true, |
|
192 | - 'validation' => true, |
|
193 | - 'format' => '%s', |
|
194 | - 'css_class' => 'large-text', |
|
195 | - 'rows' => '5', |
|
196 | - 'shortcodes_required' => array('[QUESTION_LIST]') |
|
197 | - ); |
|
198 | - |
|
199 | - return $template_fields; |
|
200 | - } |
|
201 | - |
|
202 | - |
|
203 | - public function new_default_templates( |
|
204 | - $contents, |
|
205 | - $actual_path, |
|
206 | - EE_messenger $messenger, |
|
207 | - EE_message_type $message_type, |
|
208 | - $field, |
|
209 | - $context, |
|
210 | - EE_Messages_Template_Pack $template_pack |
|
211 | - ) { |
|
212 | - |
|
213 | - //we're only modifying templates for the default template pack |
|
214 | - if ( ! $template_pack instanceof EE_Messages_Template_Pack_Default) { |
|
215 | - return $contents; |
|
216 | - } |
|
217 | - |
|
218 | - //the template file name we're replacing contents for. |
|
219 | - $template_file_prefix = $field . '_' . $context; |
|
220 | - $msg_prefix = $messenger->name . '_' . $message_type->name . '_'; |
|
221 | - |
|
222 | - $base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/'; |
|
223 | - |
|
224 | - if ($messenger->name == 'email' && $message_type->name == 'registration') { |
|
25 | + /** |
|
26 | + * constructor. |
|
27 | + */ |
|
28 | + public function __construct() |
|
29 | + { |
|
30 | + $this->_caf_hooks(); |
|
31 | + } |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * Contains all the hooks filters for setting up caffeinated messages functionality. |
|
36 | + * |
|
37 | + * @since 4.3.2 |
|
38 | + * |
|
39 | + * @return void |
|
40 | + */ |
|
41 | + private function _caf_hooks() |
|
42 | + { |
|
43 | + add_filter('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', array($this, 'messages_autoload_paths'), 5); |
|
44 | + add_filter('FHEE__EE_Email_messenger__get_validator_config', array($this, 'email_messenger_validator_config'), |
|
45 | + 5, 2); |
|
46 | + add_filter('FHEE__EE_Email_messenger__get_template_fields', array($this, 'email_messenger_template_fields'), 5, |
|
47 | + 2); |
|
48 | + add_filter('FHEE__EE_Html_messenger__get_template_fields', array($this, 'html_messenger_template_fields'), 5, |
|
49 | + 2); |
|
50 | + add_filter('FHEE__EE_Html_messenger__get_validator_config', array($this, 'html_messenger_validator_config'), 5, |
|
51 | + 2); |
|
52 | + add_filter('FHEE__EE_Pdf_messenger__get_template_fields', array($this, 'pdf_messenger_template_fields'), 5, 2); |
|
53 | + add_filter('FHEE__EE_Pdf_messenger__get_validator_config', array($this, 'pdf_messenger_validator_config'), 5, |
|
54 | + 2); |
|
55 | + add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', |
|
56 | + array($this, 'new_default_templates'), 5, 7); |
|
57 | + add_filter('FHEE__EE_Messages_Base__get_valid_shortcodes', array($this, 'message_types_valid_shortcodes'), 5, |
|
58 | + 2); |
|
59 | + |
|
60 | + //shortcode parsers |
|
61 | + add_filter('FHEE__EE_Attendee_Shortcodes__shortcodes', array($this, 'additional_attendee_shortcodes'), 5, 2); |
|
62 | + add_filter('FHEE__EE_Attendee_Shortcodes__parser_after', array($this, 'additional_attendee_parser'), 5, 5); |
|
63 | + add_filter('FHEE__EE_Recipient_List_Shortcodes__shortcodes', |
|
64 | + array($this, 'additional_recipient_details_shortcodes'), 5, 2); |
|
65 | + add_filter('FHEE__EE_Recipient_List_Shortcodes__parser_after', |
|
66 | + array($this, 'additional_recipient_details_parser'), 5, 5); |
|
67 | + add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__shortcodes', |
|
68 | + array($this, 'additional_primary_registration_details_shortcodes'), 5, 2); |
|
69 | + add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__parser_after', |
|
70 | + array($this, 'additional_primary_registration_details_parser'), 5, 5); |
|
71 | + |
|
72 | + /** |
|
73 | + * @since 4.2.0 |
|
74 | + */ |
|
75 | + add_filter('FHEE__EE_Datetime_Shortcodes__shortcodes', array($this, 'additional_datetime_shortcodes'), 10, 2); |
|
76 | + add_filter('FHEE__EE_Datetime_Shortcodes__parser_after', array($this, 'additional_datetime_parser'), 10, 5); |
|
77 | + |
|
78 | + /** |
|
79 | + * @since 4.3.0 |
|
80 | + */ |
|
81 | + //eat our own dog food! |
|
82 | + add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_message_types')); |
|
83 | + add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_shortcodes')); |
|
84 | + do_action('EE_Brewing_Regular___messages_caf'); |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + /** |
|
89 | + * This just allows us to add additional paths to the autoloader (EED_Messages::autoload_messages()) for the |
|
90 | + * messages system. |
|
91 | + * |
|
92 | + * @param array $dir_ref original array of paths |
|
93 | + * |
|
94 | + * @return array appended paths |
|
95 | + */ |
|
96 | + public function messages_autoload_paths($dir_ref) |
|
97 | + { |
|
98 | + $dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/'; |
|
99 | + |
|
100 | + return $dir_ref; |
|
101 | + } |
|
102 | + |
|
103 | + |
|
104 | + public function email_messenger_validator_config($validator_config, EE_Email_messenger $messenger) |
|
105 | + { |
|
106 | + $validator_config['attendee_list'] = array( |
|
107 | + 'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'), |
|
108 | + 'required' => array('[ATTENDEE_LIST]') |
|
109 | + ); |
|
110 | + $validator_config['question_list'] = array( |
|
111 | + 'shortcodes' => array('question'), |
|
112 | + 'required' => array('[QUESTION_LIST]') |
|
113 | + ); |
|
114 | + |
|
115 | + return $validator_config; |
|
116 | + } |
|
117 | + |
|
118 | + |
|
119 | + public function html_messenger_validator_config($validator_config, EE_Html_messenger $messenger) |
|
120 | + { |
|
121 | + $validator_config['attendee_list'] = array( |
|
122 | + 'shortcodes' => array('attendee', 'question_list'), |
|
123 | + 'required' => array('[ATTENDEE_LIST]') |
|
124 | + ); |
|
125 | + $validator_config['question_list'] = array( |
|
126 | + 'shortcodes' => array('question'), |
|
127 | + 'required' => array('[QUESTION_LIST]') |
|
128 | + ); |
|
129 | + |
|
130 | + return $validator_config; |
|
131 | + } |
|
132 | + |
|
133 | + |
|
134 | + public function pdf_messenger_validator_config($validator_config, EE_Pdf_messenger $messenger) |
|
135 | + { |
|
136 | + $validator_config['attendee_list'] = array( |
|
137 | + 'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'), |
|
138 | + 'required' => array('[ATTENDEE_LIST]') |
|
139 | + ); |
|
140 | + $validator_config['question_list'] = array( |
|
141 | + 'shortcodes' => array('question'), |
|
142 | + 'required' => array('[QUESTION_LIST]') |
|
143 | + ); |
|
144 | + |
|
145 | + return $validator_config; |
|
146 | + } |
|
147 | + |
|
148 | + |
|
149 | + public function email_messenger_template_fields($template_fields, EE_Email_messenger $messenger) |
|
150 | + { |
|
151 | + $template_fields['extra']['content']['question_list'] = array( |
|
152 | + 'input' => 'textarea', |
|
153 | + 'label' => '[QUESTION_LIST]', |
|
154 | + 'type' => 'string', |
|
155 | + 'required' => true, |
|
156 | + 'validation' => true, |
|
157 | + 'format' => '%s', |
|
158 | + 'css_class' => 'large-text', |
|
159 | + 'rows' => '5', |
|
160 | + 'shortcodes_required' => array('[QUESTION_LIST]') |
|
161 | + ); |
|
162 | + |
|
163 | + return $template_fields; |
|
164 | + } |
|
165 | + |
|
166 | + |
|
167 | + public function html_messenger_template_fields($template_fields, EE_Html_messenger $messenger) |
|
168 | + { |
|
169 | + $template_fields['extra']['content']['question_list'] = array( |
|
170 | + 'input' => 'textarea', |
|
171 | + 'label' => '[QUESTION_LIST]', |
|
172 | + 'type' => 'string', |
|
173 | + 'required' => true, |
|
174 | + 'validation' => true, |
|
175 | + 'format' => '%s', |
|
176 | + 'css_class' => 'large-text', |
|
177 | + 'rows' => '5', |
|
178 | + 'shortcodes_required' => array('[QUESTION_LIST]') |
|
179 | + ); |
|
180 | + |
|
181 | + return $template_fields; |
|
182 | + } |
|
183 | + |
|
184 | + |
|
185 | + public function pdf_messenger_template_fields($template_fields, EE_Pdf_messenger $messenger) |
|
186 | + { |
|
187 | + $template_fields['extra']['content']['question_list'] = array( |
|
188 | + 'input' => 'textarea', |
|
189 | + 'label' => '[QUESTION_LIST]', |
|
190 | + 'type' => 'string', |
|
191 | + 'required' => true, |
|
192 | + 'validation' => true, |
|
193 | + 'format' => '%s', |
|
194 | + 'css_class' => 'large-text', |
|
195 | + 'rows' => '5', |
|
196 | + 'shortcodes_required' => array('[QUESTION_LIST]') |
|
197 | + ); |
|
198 | + |
|
199 | + return $template_fields; |
|
200 | + } |
|
201 | + |
|
202 | + |
|
203 | + public function new_default_templates( |
|
204 | + $contents, |
|
205 | + $actual_path, |
|
206 | + EE_messenger $messenger, |
|
207 | + EE_message_type $message_type, |
|
208 | + $field, |
|
209 | + $context, |
|
210 | + EE_Messages_Template_Pack $template_pack |
|
211 | + ) { |
|
212 | + |
|
213 | + //we're only modifying templates for the default template pack |
|
214 | + if ( ! $template_pack instanceof EE_Messages_Template_Pack_Default) { |
|
215 | + return $contents; |
|
216 | + } |
|
217 | + |
|
218 | + //the template file name we're replacing contents for. |
|
219 | + $template_file_prefix = $field . '_' . $context; |
|
220 | + $msg_prefix = $messenger->name . '_' . $message_type->name . '_'; |
|
221 | + |
|
222 | + $base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/'; |
|
223 | + |
|
224 | + if ($messenger->name == 'email' && $message_type->name == 'registration') { |
|
225 | 225 | |
226 | - switch ($template_file_prefix) { |
|
226 | + switch ($template_file_prefix) { |
|
227 | 227 | |
228 | - case 'question_list_admin' : |
|
229 | - case 'question_list_attendee' : |
|
230 | - case 'question_list_primary_attendee' : |
|
231 | - $path = $base_path . $msg_prefix . 'question_list.template.php'; |
|
232 | - $contents = EEH_Template::display_template($path, array(), true); |
|
233 | - break; |
|
228 | + case 'question_list_admin' : |
|
229 | + case 'question_list_attendee' : |
|
230 | + case 'question_list_primary_attendee' : |
|
231 | + $path = $base_path . $msg_prefix . 'question_list.template.php'; |
|
232 | + $contents = EEH_Template::display_template($path, array(), true); |
|
233 | + break; |
|
234 | 234 | |
235 | - case 'attendee_list_primary_attendee' : |
|
236 | - $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
237 | - $contents = EEH_Template::display_template($path, array(), true); |
|
238 | - break; |
|
235 | + case 'attendee_list_primary_attendee' : |
|
236 | + $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
237 | + $contents = EEH_Template::display_template($path, array(), true); |
|
238 | + break; |
|
239 | 239 | |
240 | - case 'attendee_list_admin' : |
|
241 | - $path = $base_path . $msg_prefix . 'attendee_list_admin.template.php'; |
|
242 | - $contents = EEH_Template::display_template($path, |
|
243 | - array(), true); |
|
244 | - break; |
|
240 | + case 'attendee_list_admin' : |
|
241 | + $path = $base_path . $msg_prefix . 'attendee_list_admin.template.php'; |
|
242 | + $contents = EEH_Template::display_template($path, |
|
243 | + array(), true); |
|
244 | + break; |
|
245 | 245 | |
246 | - case 'attendee_list_attendee' : |
|
247 | - $contents = ''; |
|
248 | - break; |
|
246 | + case 'attendee_list_attendee' : |
|
247 | + $contents = ''; |
|
248 | + break; |
|
249 | 249 | |
250 | - case 'event_list_attendee' : |
|
251 | - $path = $base_path . $msg_prefix . 'event_list_attendee.template.php'; |
|
252 | - $contents = EEH_Template::display_template($path, array(), true); |
|
253 | - break; |
|
254 | - } |
|
255 | - } elseif ($messenger->name == 'email' && $message_type->name == 'newsletter') { |
|
256 | - switch ($template_file_prefix) { |
|
250 | + case 'event_list_attendee' : |
|
251 | + $path = $base_path . $msg_prefix . 'event_list_attendee.template.php'; |
|
252 | + $contents = EEH_Template::display_template($path, array(), true); |
|
253 | + break; |
|
254 | + } |
|
255 | + } elseif ($messenger->name == 'email' && $message_type->name == 'newsletter') { |
|
256 | + switch ($template_file_prefix) { |
|
257 | 257 | |
258 | - case 'content_attendee' : |
|
259 | - $path = $base_path . $msg_prefix . 'content.template.php'; |
|
260 | - $contents = EEH_Template::display_template($path, array(), true); |
|
261 | - break; |
|
258 | + case 'content_attendee' : |
|
259 | + $path = $base_path . $msg_prefix . 'content.template.php'; |
|
260 | + $contents = EEH_Template::display_template($path, array(), true); |
|
261 | + break; |
|
262 | 262 | |
263 | - case 'newsletter_content_attendee' : |
|
264 | - $path = $base_path . $msg_prefix . 'newsletter_content.template.php'; |
|
265 | - $contents = EEH_Template::display_template($path, array(), true); |
|
266 | - break; |
|
263 | + case 'newsletter_content_attendee' : |
|
264 | + $path = $base_path . $msg_prefix . 'newsletter_content.template.php'; |
|
265 | + $contents = EEH_Template::display_template($path, array(), true); |
|
266 | + break; |
|
267 | 267 | |
268 | - case 'newsletter_subject_attendee' : |
|
269 | - $path = $base_path . $msg_prefix . 'subject.template.php'; |
|
270 | - $contents = EEH_Template::display_template($path, array(), true); |
|
271 | - break; |
|
272 | - } |
|
273 | - } elseif ($messenger->name == 'html' && $message_type->name == 'receipt') { |
|
274 | - switch ($template_file_prefix) { |
|
275 | - case 'attendee_list_purchaser' : |
|
276 | - $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
277 | - $contents = EEH_Template::display_template($path, array(), true); |
|
278 | - break; |
|
279 | - } |
|
280 | - } |
|
281 | - |
|
282 | - return $contents; |
|
283 | - |
|
284 | - } |
|
285 | - |
|
286 | - |
|
287 | - public function message_types_valid_shortcodes($valid_shortcodes, EE_Messages_Base $msg) |
|
288 | - { |
|
289 | - //make sure question_list and question are ONLY added for the core message types. Any other message types will have to explicitly set question_list as a valid shortcode. |
|
290 | - $include_with = array( |
|
291 | - 'registration', |
|
292 | - 'cancelled_registration', |
|
293 | - 'declined_registration', |
|
294 | - 'not_approved_registration', |
|
295 | - 'payment_declined', |
|
296 | - 'payment_failed', |
|
297 | - 'payment_cancelled', |
|
298 | - 'payment', |
|
299 | - 'payment_reminder', |
|
300 | - 'pending_approval', |
|
301 | - 'registration_summary', |
|
302 | - 'invoice', |
|
303 | - 'receipt' |
|
304 | - ); |
|
305 | - if ($msg instanceof EE_message_type && in_array($msg->name, $include_with)) { |
|
306 | - $contexts = array_keys($msg->get_contexts()); |
|
307 | - foreach ($contexts as $context) { |
|
308 | - $valid_shortcodes[$context][] = 'question_list'; |
|
309 | - $valid_shortcodes[$context][] = 'question'; |
|
310 | - } |
|
311 | - } |
|
312 | - |
|
313 | - return $valid_shortcodes; |
|
314 | - } |
|
315 | - |
|
316 | - |
|
317 | - public function additional_attendee_shortcodes($shortcodes, $shortcode_parser) |
|
318 | - { |
|
319 | - $shortcodes['[ANSWER_*]'] = __('This is a special dynamic shortcode. Right after the "*", add the exact text of a existing question, and if there is an answer for that question for this registrant, that will take the place of this shortcode.', |
|
320 | - 'event_espresso'); |
|
321 | - |
|
322 | - return $shortcodes; |
|
323 | - } |
|
324 | - |
|
325 | - |
|
326 | - public function additional_attendee_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
327 | - { |
|
328 | - |
|
329 | - if (strpos($shortcode, |
|
330 | - '[ANSWER_*') === false || ! isset($extra_data['data']->questions) || ! isset($extra_data['data']->registrations) |
|
331 | - ) { |
|
332 | - return $parsed; |
|
333 | - } |
|
334 | - |
|
335 | - //let's get the question from the code. |
|
336 | - $shortcode = str_replace('[ANSWER_*', '', $shortcode); |
|
337 | - $shortcode = trim(str_replace(']', '', $shortcode)); |
|
338 | - |
|
339 | - $registration = $data instanceof EE_Registration ? $data : null; |
|
340 | - $registration = ! $registration instanceof EE_Registration && is_array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Registration ? $extra_data['data'] : $registration; |
|
341 | - |
|
342 | - $aee = $data instanceof EE_Messages_Addressee ? $data : null; |
|
343 | - $aee = ! $aee instanceof EE_Messages_Addressee && is_array($extra_data) && isset($extra_data['data']) ? $extra_data['data'] : $aee; |
|
344 | - |
|
345 | - if ( ! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee) { |
|
346 | - return $parsed; |
|
347 | - } |
|
348 | - |
|
349 | - //now let's figure out which question has this text. |
|
350 | - foreach ($aee->questions as $ansid => $question) { |
|
351 | - if ( |
|
352 | - $question instanceof EE_Question |
|
353 | - && trim($question->display_text()) == trim($shortcode) |
|
354 | - && isset($aee->registrations[$registration->ID()]['ans_objs'][$ansid]) |
|
355 | - ) { |
|
356 | - return $aee->registrations[$registration->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', |
|
357 | - 'no_wpautop'); |
|
358 | - } |
|
359 | - } |
|
360 | - |
|
361 | - //nothing! |
|
362 | - return $parsed; |
|
363 | - } |
|
364 | - |
|
365 | - |
|
366 | - /** |
|
367 | - * Callback for additional shortcodes filter for adding additional datetime shortcodes. |
|
368 | - * |
|
369 | - * @since 4.2 |
|
370 | - * |
|
371 | - * @param array $shortcodes array of shortcodes and |
|
372 | - * descriptions |
|
373 | - * @param EE_Datetime_Shortcodes $shortcode_parser EE_Shortcodes object |
|
374 | - * |
|
375 | - * @return array array of shortcodes and |
|
376 | - * descriptions |
|
377 | - */ |
|
378 | - public function additional_datetime_shortcodes($shortcodes, $shortcode_parser) |
|
379 | - { |
|
380 | - $shortcodes['[DTT_NAME]'] = __('This will be parsed to the Title given for a Datetime', |
|
381 | - 'event_espresso'); |
|
382 | - $shortcodes['[DTT_DESCRIPTION]'] = __('This will be parsed to the description for a Datetime', |
|
383 | - 'event_espresso'); |
|
384 | - $shortcodes['[DTT_NAME_OR_DATES]'] = __('When parsed, if the Datetime has a name, it is used, otherwise a formatted string including the start date and end date will be used.', |
|
385 | - 'event_espresso'); |
|
386 | - |
|
387 | - return $shortcodes; |
|
388 | - } |
|
389 | - |
|
390 | - |
|
391 | - /** |
|
392 | - * Callback for additional shortcodes parser filter used for adding parser for new |
|
393 | - * Datetime shortcodes |
|
394 | - * |
|
395 | - * @since 4.2 |
|
396 | - * |
|
397 | - * @param string $parsed The finished parsed string for the given shortcode. |
|
398 | - * @param string $shortcode The shortcode being parsed. |
|
399 | - * @param object $data The incoming data object for the Shortcode Parser. |
|
400 | - * @param object $extra_data The incoming extra date object for the Shortcode |
|
401 | - * Parser. |
|
402 | - * @param EE_Datetime_Shortcodes $shortcode_parser |
|
403 | - * |
|
404 | - * @return string The new parsed string. |
|
405 | - */ |
|
406 | - public function additional_datetime_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
407 | - { |
|
408 | - |
|
409 | - if ( ! $data instanceof EE_Datetime) { |
|
410 | - return ''; //get out because we can only parse with the datetime object. |
|
411 | - } |
|
412 | - |
|
413 | - switch ($shortcode) { |
|
414 | - case '[DTT_NAME]' : |
|
415 | - return $data->name(); |
|
416 | - break; |
|
417 | - case '[DTT_DESCRIPTION]' : |
|
418 | - return $data->description(); |
|
419 | - break; |
|
420 | - case '[DTT_NAME_OR_DATES]' : |
|
421 | - return $data->get_dtt_display_name(true); |
|
422 | - break; |
|
423 | - default : |
|
424 | - return $parsed; |
|
425 | - break; |
|
426 | - } |
|
427 | - } |
|
428 | - |
|
429 | - |
|
430 | - public function additional_recipient_details_shortcodes($shortcodes, $shortcode_parser) |
|
431 | - { |
|
432 | - $shortcodes['[RECIPIENT_QUESTION_LIST]'] = __('This is used to indicate where you want the list of questions and answers to show for the person receiving the message.', |
|
433 | - 'event_espresso'); |
|
434 | - |
|
435 | - return $shortcodes; |
|
436 | - } |
|
437 | - |
|
438 | - |
|
439 | - public function additional_recipient_details_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
440 | - { |
|
441 | - |
|
442 | - if (array($data) && ! isset($data['data'])) { |
|
443 | - return $parsed; |
|
444 | - } |
|
445 | - |
|
446 | - $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
|
447 | - $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
|
448 | - |
|
449 | - if ( ! $recipient instanceof EE_Messages_Addressee) { |
|
450 | - return $parsed; |
|
451 | - } |
|
452 | - |
|
453 | - switch ($shortcode) { |
|
454 | - case '[RECIPIENT_QUESTION_LIST]' : |
|
455 | - $att = $recipient->att_obj; |
|
456 | - $registrations_on_attendee = $att instanceof EE_Attendee ? $recipient->attendees[$att->ID()]['reg_objs'] : array(); |
|
457 | - $registrations_on_attendee = empty($registrations_on_attendee) && $recipient->reg_obj instanceof EE_Registration ? array($recipient->reg_obj) : $registrations_on_attendee; |
|
458 | - $answers = array(); |
|
268 | + case 'newsletter_subject_attendee' : |
|
269 | + $path = $base_path . $msg_prefix . 'subject.template.php'; |
|
270 | + $contents = EEH_Template::display_template($path, array(), true); |
|
271 | + break; |
|
272 | + } |
|
273 | + } elseif ($messenger->name == 'html' && $message_type->name == 'receipt') { |
|
274 | + switch ($template_file_prefix) { |
|
275 | + case 'attendee_list_purchaser' : |
|
276 | + $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
277 | + $contents = EEH_Template::display_template($path, array(), true); |
|
278 | + break; |
|
279 | + } |
|
280 | + } |
|
281 | + |
|
282 | + return $contents; |
|
283 | + |
|
284 | + } |
|
285 | + |
|
286 | + |
|
287 | + public function message_types_valid_shortcodes($valid_shortcodes, EE_Messages_Base $msg) |
|
288 | + { |
|
289 | + //make sure question_list and question are ONLY added for the core message types. Any other message types will have to explicitly set question_list as a valid shortcode. |
|
290 | + $include_with = array( |
|
291 | + 'registration', |
|
292 | + 'cancelled_registration', |
|
293 | + 'declined_registration', |
|
294 | + 'not_approved_registration', |
|
295 | + 'payment_declined', |
|
296 | + 'payment_failed', |
|
297 | + 'payment_cancelled', |
|
298 | + 'payment', |
|
299 | + 'payment_reminder', |
|
300 | + 'pending_approval', |
|
301 | + 'registration_summary', |
|
302 | + 'invoice', |
|
303 | + 'receipt' |
|
304 | + ); |
|
305 | + if ($msg instanceof EE_message_type && in_array($msg->name, $include_with)) { |
|
306 | + $contexts = array_keys($msg->get_contexts()); |
|
307 | + foreach ($contexts as $context) { |
|
308 | + $valid_shortcodes[$context][] = 'question_list'; |
|
309 | + $valid_shortcodes[$context][] = 'question'; |
|
310 | + } |
|
311 | + } |
|
312 | + |
|
313 | + return $valid_shortcodes; |
|
314 | + } |
|
315 | + |
|
316 | + |
|
317 | + public function additional_attendee_shortcodes($shortcodes, $shortcode_parser) |
|
318 | + { |
|
319 | + $shortcodes['[ANSWER_*]'] = __('This is a special dynamic shortcode. Right after the "*", add the exact text of a existing question, and if there is an answer for that question for this registrant, that will take the place of this shortcode.', |
|
320 | + 'event_espresso'); |
|
321 | + |
|
322 | + return $shortcodes; |
|
323 | + } |
|
324 | + |
|
325 | + |
|
326 | + public function additional_attendee_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
327 | + { |
|
328 | + |
|
329 | + if (strpos($shortcode, |
|
330 | + '[ANSWER_*') === false || ! isset($extra_data['data']->questions) || ! isset($extra_data['data']->registrations) |
|
331 | + ) { |
|
332 | + return $parsed; |
|
333 | + } |
|
334 | + |
|
335 | + //let's get the question from the code. |
|
336 | + $shortcode = str_replace('[ANSWER_*', '', $shortcode); |
|
337 | + $shortcode = trim(str_replace(']', '', $shortcode)); |
|
338 | + |
|
339 | + $registration = $data instanceof EE_Registration ? $data : null; |
|
340 | + $registration = ! $registration instanceof EE_Registration && is_array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Registration ? $extra_data['data'] : $registration; |
|
341 | + |
|
342 | + $aee = $data instanceof EE_Messages_Addressee ? $data : null; |
|
343 | + $aee = ! $aee instanceof EE_Messages_Addressee && is_array($extra_data) && isset($extra_data['data']) ? $extra_data['data'] : $aee; |
|
344 | + |
|
345 | + if ( ! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee) { |
|
346 | + return $parsed; |
|
347 | + } |
|
348 | + |
|
349 | + //now let's figure out which question has this text. |
|
350 | + foreach ($aee->questions as $ansid => $question) { |
|
351 | + if ( |
|
352 | + $question instanceof EE_Question |
|
353 | + && trim($question->display_text()) == trim($shortcode) |
|
354 | + && isset($aee->registrations[$registration->ID()]['ans_objs'][$ansid]) |
|
355 | + ) { |
|
356 | + return $aee->registrations[$registration->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', |
|
357 | + 'no_wpautop'); |
|
358 | + } |
|
359 | + } |
|
360 | + |
|
361 | + //nothing! |
|
362 | + return $parsed; |
|
363 | + } |
|
364 | + |
|
365 | + |
|
366 | + /** |
|
367 | + * Callback for additional shortcodes filter for adding additional datetime shortcodes. |
|
368 | + * |
|
369 | + * @since 4.2 |
|
370 | + * |
|
371 | + * @param array $shortcodes array of shortcodes and |
|
372 | + * descriptions |
|
373 | + * @param EE_Datetime_Shortcodes $shortcode_parser EE_Shortcodes object |
|
374 | + * |
|
375 | + * @return array array of shortcodes and |
|
376 | + * descriptions |
|
377 | + */ |
|
378 | + public function additional_datetime_shortcodes($shortcodes, $shortcode_parser) |
|
379 | + { |
|
380 | + $shortcodes['[DTT_NAME]'] = __('This will be parsed to the Title given for a Datetime', |
|
381 | + 'event_espresso'); |
|
382 | + $shortcodes['[DTT_DESCRIPTION]'] = __('This will be parsed to the description for a Datetime', |
|
383 | + 'event_espresso'); |
|
384 | + $shortcodes['[DTT_NAME_OR_DATES]'] = __('When parsed, if the Datetime has a name, it is used, otherwise a formatted string including the start date and end date will be used.', |
|
385 | + 'event_espresso'); |
|
386 | + |
|
387 | + return $shortcodes; |
|
388 | + } |
|
389 | + |
|
390 | + |
|
391 | + /** |
|
392 | + * Callback for additional shortcodes parser filter used for adding parser for new |
|
393 | + * Datetime shortcodes |
|
394 | + * |
|
395 | + * @since 4.2 |
|
396 | + * |
|
397 | + * @param string $parsed The finished parsed string for the given shortcode. |
|
398 | + * @param string $shortcode The shortcode being parsed. |
|
399 | + * @param object $data The incoming data object for the Shortcode Parser. |
|
400 | + * @param object $extra_data The incoming extra date object for the Shortcode |
|
401 | + * Parser. |
|
402 | + * @param EE_Datetime_Shortcodes $shortcode_parser |
|
403 | + * |
|
404 | + * @return string The new parsed string. |
|
405 | + */ |
|
406 | + public function additional_datetime_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
407 | + { |
|
408 | + |
|
409 | + if ( ! $data instanceof EE_Datetime) { |
|
410 | + return ''; //get out because we can only parse with the datetime object. |
|
411 | + } |
|
412 | + |
|
413 | + switch ($shortcode) { |
|
414 | + case '[DTT_NAME]' : |
|
415 | + return $data->name(); |
|
416 | + break; |
|
417 | + case '[DTT_DESCRIPTION]' : |
|
418 | + return $data->description(); |
|
419 | + break; |
|
420 | + case '[DTT_NAME_OR_DATES]' : |
|
421 | + return $data->get_dtt_display_name(true); |
|
422 | + break; |
|
423 | + default : |
|
424 | + return $parsed; |
|
425 | + break; |
|
426 | + } |
|
427 | + } |
|
428 | + |
|
429 | + |
|
430 | + public function additional_recipient_details_shortcodes($shortcodes, $shortcode_parser) |
|
431 | + { |
|
432 | + $shortcodes['[RECIPIENT_QUESTION_LIST]'] = __('This is used to indicate where you want the list of questions and answers to show for the person receiving the message.', |
|
433 | + 'event_espresso'); |
|
434 | + |
|
435 | + return $shortcodes; |
|
436 | + } |
|
437 | + |
|
438 | + |
|
439 | + public function additional_recipient_details_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) |
|
440 | + { |
|
441 | + |
|
442 | + if (array($data) && ! isset($data['data'])) { |
|
443 | + return $parsed; |
|
444 | + } |
|
445 | + |
|
446 | + $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
|
447 | + $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
|
448 | + |
|
449 | + if ( ! $recipient instanceof EE_Messages_Addressee) { |
|
450 | + return $parsed; |
|
451 | + } |
|
452 | + |
|
453 | + switch ($shortcode) { |
|
454 | + case '[RECIPIENT_QUESTION_LIST]' : |
|
455 | + $att = $recipient->att_obj; |
|
456 | + $registrations_on_attendee = $att instanceof EE_Attendee ? $recipient->attendees[$att->ID()]['reg_objs'] : array(); |
|
457 | + $registrations_on_attendee = empty($registrations_on_attendee) && $recipient->reg_obj instanceof EE_Registration ? array($recipient->reg_obj) : $registrations_on_attendee; |
|
458 | + $answers = array(); |
|
459 | 459 | |
460 | - $template = is_array($data['template']) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list']; |
|
461 | - $valid_shortcodes = array('question'); |
|
460 | + $template = is_array($data['template']) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list']; |
|
461 | + $valid_shortcodes = array('question'); |
|
462 | 462 | |
463 | - //if the context is main_content then get all answers for all registrations on this attendee |
|
464 | - if ($data['data'] instanceof EE_Messages_Addressee) { |
|
465 | - foreach ($registrations_on_attendee as $reg) { |
|
466 | - if ($reg instanceof EE_Registration) { |
|
467 | - $anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array(); |
|
468 | - foreach ($anss as $ans) { |
|
469 | - if ($ans instanceof EE_Answer) { |
|
470 | - $answers[$ans->ID()] = $ans; |
|
471 | - } |
|
472 | - } |
|
473 | - } |
|
474 | - } |
|
475 | - } |
|
463 | + //if the context is main_content then get all answers for all registrations on this attendee |
|
464 | + if ($data['data'] instanceof EE_Messages_Addressee) { |
|
465 | + foreach ($registrations_on_attendee as $reg) { |
|
466 | + if ($reg instanceof EE_Registration) { |
|
467 | + $anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array(); |
|
468 | + foreach ($anss as $ans) { |
|
469 | + if ($ans instanceof EE_Answer) { |
|
470 | + $answers[$ans->ID()] = $ans; |
|
471 | + } |
|
472 | + } |
|
473 | + } |
|
474 | + } |
|
475 | + } |
|
476 | 476 | |
477 | - //if the context is the event list parser, then let's return just the answers for all registrations attached to the recipient for that event. |
|
478 | - if ($data['data'] instanceof EE_Event) { |
|
479 | - $event = $data['data']; |
|
480 | - foreach ($registrations_on_attendee as $reg) { |
|
481 | - if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) { |
|
482 | - $anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array(); |
|
483 | - foreach ($anss as $ans) { |
|
484 | - if ($ans instanceof EE_Answer) { |
|
485 | - $answers[$ans->ID()] = $ans; |
|
486 | - } |
|
487 | - } |
|
488 | - } |
|
489 | - } |
|
490 | - } |
|
477 | + //if the context is the event list parser, then let's return just the answers for all registrations attached to the recipient for that event. |
|
478 | + if ($data['data'] instanceof EE_Event) { |
|
479 | + $event = $data['data']; |
|
480 | + foreach ($registrations_on_attendee as $reg) { |
|
481 | + if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) { |
|
482 | + $anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array(); |
|
483 | + foreach ($anss as $ans) { |
|
484 | + if ($ans instanceof EE_Answer) { |
|
485 | + $answers[$ans->ID()] = $ans; |
|
486 | + } |
|
487 | + } |
|
488 | + } |
|
489 | + } |
|
490 | + } |
|
491 | 491 | |
492 | - $question_list = ''; |
|
493 | - $shortcode_helper = $shortcode_parser->get_shortcode_helper(); |
|
494 | - foreach ($answers as $answer) { |
|
495 | - if ($answer instanceof EE_Answer) { |
|
496 | - $question = $answer->question(); |
|
497 | - if ( ! $question instanceof EE_Question || ($question instanceof EE_Question && $question->admin_only())) { |
|
498 | - continue; |
|
499 | - } |
|
500 | - $question_list .= $shortcode_helper->parse_question_list_template($template, $answer, |
|
501 | - $valid_shortcodes, $extra_data); |
|
502 | - } |
|
503 | - } |
|
492 | + $question_list = ''; |
|
493 | + $shortcode_helper = $shortcode_parser->get_shortcode_helper(); |
|
494 | + foreach ($answers as $answer) { |
|
495 | + if ($answer instanceof EE_Answer) { |
|
496 | + $question = $answer->question(); |
|
497 | + if ( ! $question instanceof EE_Question || ($question instanceof EE_Question && $question->admin_only())) { |
|
498 | + continue; |
|
499 | + } |
|
500 | + $question_list .= $shortcode_helper->parse_question_list_template($template, $answer, |
|
501 | + $valid_shortcodes, $extra_data); |
|
502 | + } |
|
503 | + } |
|
504 | 504 | |
505 | - return $question_list; |
|
506 | - break; |
|
505 | + return $question_list; |
|
506 | + break; |
|
507 | 507 | |
508 | - default : |
|
509 | - return $parsed; |
|
510 | - break; |
|
511 | - } |
|
512 | - } |
|
513 | - |
|
514 | - |
|
515 | - public function additional_primary_registration_details_shortcodes($shortcodes, $shortcode_parser) |
|
516 | - { |
|
517 | - $shortcodes['[PRIMARY_REGISTRANT_QUESTION_LIST]'] = __('This is used to indicate the questions and answers for the primary_registrant. It should be placed in the "[attendee_list]" field', |
|
518 | - 'event_espresso'); |
|
519 | - |
|
520 | - return $shortcodes; |
|
521 | - } |
|
522 | - |
|
523 | - |
|
524 | - public function additional_primary_registration_details_parser( |
|
525 | - $parsed, |
|
526 | - $shortcode, |
|
527 | - $data, |
|
528 | - $extra_data, |
|
529 | - $shortcode_parser |
|
530 | - ) { |
|
531 | - if (array($data) && ! isset($data['data'])) { |
|
532 | - return $parsed; |
|
533 | - } |
|
534 | - |
|
535 | - $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
|
536 | - $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
|
537 | - |
|
538 | - if ( ! $recipient instanceof EE_Messages_Addressee) { |
|
539 | - return $parsed; |
|
540 | - } |
|
541 | - |
|
542 | - $send_data = ! $data['data'] instanceof EE_Messages_Addressee ? $extra_data : $data; |
|
543 | - |
|
544 | - switch ($shortcode) { |
|
545 | - case '[RECIPIENT_QUESTION_LIST]' : |
|
546 | - if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration) { |
|
547 | - return ''; |
|
548 | - } |
|
549 | - $registration = $recipient->primary_reg_obj; |
|
550 | - $template = is_array($data['template']) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list']; |
|
551 | - $valid_shortcodes = array('question'); |
|
552 | - $shortcode_helper = $shortcode_parser->get_shortcode_helper(); |
|
553 | - $answers = $recipient->registrations[$registration->ID()]['ans_objs']; |
|
554 | - $question_list = ''; |
|
555 | - foreach ($answers as $answer) { |
|
556 | - if ($answer instanceof EE_Answer) { |
|
557 | - $question = $answer->question(); |
|
558 | - if ($question instanceof EE_Question and $question->admin_only()) { |
|
559 | - continue; |
|
560 | - } |
|
561 | - $question_list .= $shortcode_helper->parse_question_list_template($template, $answer, |
|
562 | - $valid_shortcodes, $send_data); |
|
563 | - } |
|
564 | - } |
|
508 | + default : |
|
509 | + return $parsed; |
|
510 | + break; |
|
511 | + } |
|
512 | + } |
|
513 | + |
|
514 | + |
|
515 | + public function additional_primary_registration_details_shortcodes($shortcodes, $shortcode_parser) |
|
516 | + { |
|
517 | + $shortcodes['[PRIMARY_REGISTRANT_QUESTION_LIST]'] = __('This is used to indicate the questions and answers for the primary_registrant. It should be placed in the "[attendee_list]" field', |
|
518 | + 'event_espresso'); |
|
519 | + |
|
520 | + return $shortcodes; |
|
521 | + } |
|
522 | + |
|
523 | + |
|
524 | + public function additional_primary_registration_details_parser( |
|
525 | + $parsed, |
|
526 | + $shortcode, |
|
527 | + $data, |
|
528 | + $extra_data, |
|
529 | + $shortcode_parser |
|
530 | + ) { |
|
531 | + if (array($data) && ! isset($data['data'])) { |
|
532 | + return $parsed; |
|
533 | + } |
|
534 | + |
|
535 | + $recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : null; |
|
536 | + $recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient; |
|
537 | + |
|
538 | + if ( ! $recipient instanceof EE_Messages_Addressee) { |
|
539 | + return $parsed; |
|
540 | + } |
|
541 | + |
|
542 | + $send_data = ! $data['data'] instanceof EE_Messages_Addressee ? $extra_data : $data; |
|
543 | + |
|
544 | + switch ($shortcode) { |
|
545 | + case '[RECIPIENT_QUESTION_LIST]' : |
|
546 | + if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration) { |
|
547 | + return ''; |
|
548 | + } |
|
549 | + $registration = $recipient->primary_reg_obj; |
|
550 | + $template = is_array($data['template']) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list']; |
|
551 | + $valid_shortcodes = array('question'); |
|
552 | + $shortcode_helper = $shortcode_parser->get_shortcode_helper(); |
|
553 | + $answers = $recipient->registrations[$registration->ID()]['ans_objs']; |
|
554 | + $question_list = ''; |
|
555 | + foreach ($answers as $answer) { |
|
556 | + if ($answer instanceof EE_Answer) { |
|
557 | + $question = $answer->question(); |
|
558 | + if ($question instanceof EE_Question and $question->admin_only()) { |
|
559 | + continue; |
|
560 | + } |
|
561 | + $question_list .= $shortcode_helper->parse_question_list_template($template, $answer, |
|
562 | + $valid_shortcodes, $send_data); |
|
563 | + } |
|
564 | + } |
|
565 | 565 | |
566 | - return $question_list; |
|
567 | - break; |
|
566 | + return $question_list; |
|
567 | + break; |
|
568 | 568 | |
569 | - default : |
|
570 | - return $parsed; |
|
571 | - break; |
|
572 | - } |
|
573 | - } |
|
574 | - |
|
575 | - |
|
576 | - /** |
|
577 | - * Takes care of registering the message types that are only available in caffeinated EE. |
|
578 | - * |
|
579 | - * @since 4.3.2 |
|
580 | - * |
|
581 | - * @return void |
|
582 | - */ |
|
583 | - public function register_caf_message_types() |
|
584 | - { |
|
585 | - //register newsletter message type |
|
586 | - $setup_args = array( |
|
587 | - 'mtfilename' => 'EE_Newsletter_message_type.class.php', |
|
588 | - 'autoloadpaths' => array( |
|
589 | - EE_CAF_LIBRARIES . 'messages/message_type/newsletter/' |
|
590 | - ), |
|
591 | - 'messengers_to_activate_with' => array('email'), |
|
592 | - 'messengers_to_validate_with' => array('email') |
|
593 | - ); |
|
594 | - EE_Register_Message_Type::register('newsletter', $setup_args); |
|
595 | - |
|
596 | - //register payment reminder message type |
|
597 | - $setup_args = array( |
|
598 | - 'mtfilename' => 'EE_Payment_Reminder_message_type.class.php', |
|
599 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_reminder/'), |
|
600 | - 'messengers_to_activate_with' => array('email'), |
|
601 | - 'messengers_to_validate_with' => array('email') |
|
602 | - ); |
|
603 | - EE_Register_Message_Type::register('payment_reminder', $setup_args); |
|
604 | - |
|
605 | - //register payment declined message type |
|
606 | - $setup_args = array( |
|
607 | - 'mtfilename' => 'EE_Payment_Declined_message_type.class.php', |
|
608 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_declined/'), |
|
609 | - 'messengers_to_activate_with' => array('email'), |
|
610 | - 'messengers_to_validate_with' => array('email') |
|
611 | - ); |
|
612 | - EE_Register_Message_Type::register('payment_declined', $setup_args); |
|
613 | - |
|
614 | - //register registration declined message type |
|
615 | - $setup_args = array( |
|
616 | - 'mtfilename' => 'EE_Declined_Registration_message_type.class.php', |
|
617 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/declined_registration/'), |
|
618 | - 'messengers_to_activate_with' => array('email'), |
|
619 | - 'messengers_to_validate_with' => array('email') |
|
620 | - ); |
|
621 | - EE_Register_Message_Type::register('declined_registration', $setup_args); |
|
622 | - |
|
623 | - //register registration cancelled message type |
|
624 | - $setup_args = array( |
|
625 | - 'mtfilename' => 'EE_Cancelled_Registration_message_type.class.php', |
|
626 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/cancelled_registration/'), |
|
627 | - 'messengers_to_activate_with' => array('email'), |
|
628 | - 'messengers_to_validate_with' => array('email') |
|
629 | - ); |
|
630 | - EE_Register_Message_Type::register('cancelled_registration', $setup_args); |
|
631 | - |
|
632 | - |
|
633 | - //register payment failed message type |
|
634 | - $setup_args = array( |
|
635 | - 'mtfilename' => 'EE_Payment_Failed_message_type.class.php', |
|
636 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_failed/'), |
|
637 | - 'messengers_to_activate_with' => array('email'), |
|
638 | - 'messengers_to_validate_with' => array('email') |
|
639 | - ); |
|
640 | - EE_Register_Message_Type::register('payment_failed', $setup_args); |
|
641 | - |
|
642 | - //register payment declined message type |
|
643 | - $setup_args = array( |
|
644 | - 'mtfilename' => 'EE_Payment_Cancelled_message_type.class.php', |
|
645 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_cancelled/'), |
|
646 | - 'messengers_to_activate_with' => array('email'), |
|
647 | - 'messengers_to_validate_with' => array('email') |
|
648 | - ); |
|
649 | - EE_Register_Message_Type::register('payment_cancelled', $setup_args); |
|
650 | - } |
|
651 | - |
|
652 | - |
|
653 | - /** |
|
654 | - * Takes care of registering the shortcode libraries implemented with caffeinated EE and set up related items. |
|
655 | - * |
|
656 | - * @since 4.3.2 |
|
657 | - * |
|
658 | - * @return void |
|
659 | - */ |
|
660 | - public function register_caf_shortcodes() |
|
661 | - { |
|
662 | - $setup_args = array( |
|
663 | - 'autoloadpaths' => array( |
|
664 | - EE_CAF_LIBRARIES . 'shortcodes/' |
|
665 | - ), |
|
666 | - 'msgr_validator_callback' => array('EE_Newsletter_Shortcodes', 'messenger_validator_config'), |
|
667 | - 'msgr_template_fields_callback' => array('EE_Newsletter_Shortcodes', 'messenger_template_fields'), |
|
668 | - 'list_type_shortcodes' => array('[NEWSLETTER_CONTENT]') |
|
669 | - ); |
|
670 | - EE_Register_Messages_Shortcode_Library::register('newsletter', $setup_args); |
|
671 | - } |
|
569 | + default : |
|
570 | + return $parsed; |
|
571 | + break; |
|
572 | + } |
|
573 | + } |
|
574 | + |
|
575 | + |
|
576 | + /** |
|
577 | + * Takes care of registering the message types that are only available in caffeinated EE. |
|
578 | + * |
|
579 | + * @since 4.3.2 |
|
580 | + * |
|
581 | + * @return void |
|
582 | + */ |
|
583 | + public function register_caf_message_types() |
|
584 | + { |
|
585 | + //register newsletter message type |
|
586 | + $setup_args = array( |
|
587 | + 'mtfilename' => 'EE_Newsletter_message_type.class.php', |
|
588 | + 'autoloadpaths' => array( |
|
589 | + EE_CAF_LIBRARIES . 'messages/message_type/newsletter/' |
|
590 | + ), |
|
591 | + 'messengers_to_activate_with' => array('email'), |
|
592 | + 'messengers_to_validate_with' => array('email') |
|
593 | + ); |
|
594 | + EE_Register_Message_Type::register('newsletter', $setup_args); |
|
595 | + |
|
596 | + //register payment reminder message type |
|
597 | + $setup_args = array( |
|
598 | + 'mtfilename' => 'EE_Payment_Reminder_message_type.class.php', |
|
599 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_reminder/'), |
|
600 | + 'messengers_to_activate_with' => array('email'), |
|
601 | + 'messengers_to_validate_with' => array('email') |
|
602 | + ); |
|
603 | + EE_Register_Message_Type::register('payment_reminder', $setup_args); |
|
604 | + |
|
605 | + //register payment declined message type |
|
606 | + $setup_args = array( |
|
607 | + 'mtfilename' => 'EE_Payment_Declined_message_type.class.php', |
|
608 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_declined/'), |
|
609 | + 'messengers_to_activate_with' => array('email'), |
|
610 | + 'messengers_to_validate_with' => array('email') |
|
611 | + ); |
|
612 | + EE_Register_Message_Type::register('payment_declined', $setup_args); |
|
613 | + |
|
614 | + //register registration declined message type |
|
615 | + $setup_args = array( |
|
616 | + 'mtfilename' => 'EE_Declined_Registration_message_type.class.php', |
|
617 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/declined_registration/'), |
|
618 | + 'messengers_to_activate_with' => array('email'), |
|
619 | + 'messengers_to_validate_with' => array('email') |
|
620 | + ); |
|
621 | + EE_Register_Message_Type::register('declined_registration', $setup_args); |
|
622 | + |
|
623 | + //register registration cancelled message type |
|
624 | + $setup_args = array( |
|
625 | + 'mtfilename' => 'EE_Cancelled_Registration_message_type.class.php', |
|
626 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/cancelled_registration/'), |
|
627 | + 'messengers_to_activate_with' => array('email'), |
|
628 | + 'messengers_to_validate_with' => array('email') |
|
629 | + ); |
|
630 | + EE_Register_Message_Type::register('cancelled_registration', $setup_args); |
|
631 | + |
|
632 | + |
|
633 | + //register payment failed message type |
|
634 | + $setup_args = array( |
|
635 | + 'mtfilename' => 'EE_Payment_Failed_message_type.class.php', |
|
636 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_failed/'), |
|
637 | + 'messengers_to_activate_with' => array('email'), |
|
638 | + 'messengers_to_validate_with' => array('email') |
|
639 | + ); |
|
640 | + EE_Register_Message_Type::register('payment_failed', $setup_args); |
|
641 | + |
|
642 | + //register payment declined message type |
|
643 | + $setup_args = array( |
|
644 | + 'mtfilename' => 'EE_Payment_Cancelled_message_type.class.php', |
|
645 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_cancelled/'), |
|
646 | + 'messengers_to_activate_with' => array('email'), |
|
647 | + 'messengers_to_validate_with' => array('email') |
|
648 | + ); |
|
649 | + EE_Register_Message_Type::register('payment_cancelled', $setup_args); |
|
650 | + } |
|
651 | + |
|
652 | + |
|
653 | + /** |
|
654 | + * Takes care of registering the shortcode libraries implemented with caffeinated EE and set up related items. |
|
655 | + * |
|
656 | + * @since 4.3.2 |
|
657 | + * |
|
658 | + * @return void |
|
659 | + */ |
|
660 | + public function register_caf_shortcodes() |
|
661 | + { |
|
662 | + $setup_args = array( |
|
663 | + 'autoloadpaths' => array( |
|
664 | + EE_CAF_LIBRARIES . 'shortcodes/' |
|
665 | + ), |
|
666 | + 'msgr_validator_callback' => array('EE_Newsletter_Shortcodes', 'messenger_validator_config'), |
|
667 | + 'msgr_template_fields_callback' => array('EE_Newsletter_Shortcodes', 'messenger_template_fields'), |
|
668 | + 'list_type_shortcodes' => array('[NEWSLETTER_CONTENT]') |
|
669 | + ); |
|
670 | + EE_Register_Messages_Shortcode_Library::register('newsletter', $setup_args); |
|
671 | + } |
|
672 | 672 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function messages_autoload_paths($dir_ref) |
97 | 97 | { |
98 | - $dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/'; |
|
98 | + $dir_ref[] = EE_CAF_LIBRARIES.'shortcodes/'; |
|
99 | 99 | |
100 | 100 | return $dir_ref; |
101 | 101 | } |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | //the template file name we're replacing contents for. |
219 | - $template_file_prefix = $field . '_' . $context; |
|
220 | - $msg_prefix = $messenger->name . '_' . $message_type->name . '_'; |
|
219 | + $template_file_prefix = $field.'_'.$context; |
|
220 | + $msg_prefix = $messenger->name.'_'.$message_type->name.'_'; |
|
221 | 221 | |
222 | - $base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/'; |
|
222 | + $base_path = EE_CAF_LIBRARIES.'messages/defaults/default/'; |
|
223 | 223 | |
224 | 224 | if ($messenger->name == 'email' && $message_type->name == 'registration') { |
225 | 225 | |
@@ -228,17 +228,17 @@ discard block |
||
228 | 228 | case 'question_list_admin' : |
229 | 229 | case 'question_list_attendee' : |
230 | 230 | case 'question_list_primary_attendee' : |
231 | - $path = $base_path . $msg_prefix . 'question_list.template.php'; |
|
231 | + $path = $base_path.$msg_prefix.'question_list.template.php'; |
|
232 | 232 | $contents = EEH_Template::display_template($path, array(), true); |
233 | 233 | break; |
234 | 234 | |
235 | 235 | case 'attendee_list_primary_attendee' : |
236 | - $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
236 | + $path = $base_path.$msg_prefix.'attendee_list.template.php'; |
|
237 | 237 | $contents = EEH_Template::display_template($path, array(), true); |
238 | 238 | break; |
239 | 239 | |
240 | 240 | case 'attendee_list_admin' : |
241 | - $path = $base_path . $msg_prefix . 'attendee_list_admin.template.php'; |
|
241 | + $path = $base_path.$msg_prefix.'attendee_list_admin.template.php'; |
|
242 | 242 | $contents = EEH_Template::display_template($path, |
243 | 243 | array(), true); |
244 | 244 | break; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | break; |
249 | 249 | |
250 | 250 | case 'event_list_attendee' : |
251 | - $path = $base_path . $msg_prefix . 'event_list_attendee.template.php'; |
|
251 | + $path = $base_path.$msg_prefix.'event_list_attendee.template.php'; |
|
252 | 252 | $contents = EEH_Template::display_template($path, array(), true); |
253 | 253 | break; |
254 | 254 | } |
@@ -256,24 +256,24 @@ discard block |
||
256 | 256 | switch ($template_file_prefix) { |
257 | 257 | |
258 | 258 | case 'content_attendee' : |
259 | - $path = $base_path . $msg_prefix . 'content.template.php'; |
|
259 | + $path = $base_path.$msg_prefix.'content.template.php'; |
|
260 | 260 | $contents = EEH_Template::display_template($path, array(), true); |
261 | 261 | break; |
262 | 262 | |
263 | 263 | case 'newsletter_content_attendee' : |
264 | - $path = $base_path . $msg_prefix . 'newsletter_content.template.php'; |
|
264 | + $path = $base_path.$msg_prefix.'newsletter_content.template.php'; |
|
265 | 265 | $contents = EEH_Template::display_template($path, array(), true); |
266 | 266 | break; |
267 | 267 | |
268 | 268 | case 'newsletter_subject_attendee' : |
269 | - $path = $base_path . $msg_prefix . 'subject.template.php'; |
|
269 | + $path = $base_path.$msg_prefix.'subject.template.php'; |
|
270 | 270 | $contents = EEH_Template::display_template($path, array(), true); |
271 | 271 | break; |
272 | 272 | } |
273 | 273 | } elseif ($messenger->name == 'html' && $message_type->name == 'receipt') { |
274 | 274 | switch ($template_file_prefix) { |
275 | 275 | case 'attendee_list_purchaser' : |
276 | - $path = $base_path . $msg_prefix . 'attendee_list.template.php'; |
|
276 | + $path = $base_path.$msg_prefix.'attendee_list.template.php'; |
|
277 | 277 | $contents = EEH_Template::display_template($path, array(), true); |
278 | 278 | break; |
279 | 279 | } |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | $setup_args = array( |
587 | 587 | 'mtfilename' => 'EE_Newsletter_message_type.class.php', |
588 | 588 | 'autoloadpaths' => array( |
589 | - EE_CAF_LIBRARIES . 'messages/message_type/newsletter/' |
|
589 | + EE_CAF_LIBRARIES.'messages/message_type/newsletter/' |
|
590 | 590 | ), |
591 | 591 | 'messengers_to_activate_with' => array('email'), |
592 | 592 | 'messengers_to_validate_with' => array('email') |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | //register payment reminder message type |
597 | 597 | $setup_args = array( |
598 | 598 | 'mtfilename' => 'EE_Payment_Reminder_message_type.class.php', |
599 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_reminder/'), |
|
599 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_reminder/'), |
|
600 | 600 | 'messengers_to_activate_with' => array('email'), |
601 | 601 | 'messengers_to_validate_with' => array('email') |
602 | 602 | ); |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | //register payment declined message type |
606 | 606 | $setup_args = array( |
607 | 607 | 'mtfilename' => 'EE_Payment_Declined_message_type.class.php', |
608 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_declined/'), |
|
608 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_declined/'), |
|
609 | 609 | 'messengers_to_activate_with' => array('email'), |
610 | 610 | 'messengers_to_validate_with' => array('email') |
611 | 611 | ); |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | //register registration declined message type |
615 | 615 | $setup_args = array( |
616 | 616 | 'mtfilename' => 'EE_Declined_Registration_message_type.class.php', |
617 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/declined_registration/'), |
|
617 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/declined_registration/'), |
|
618 | 618 | 'messengers_to_activate_with' => array('email'), |
619 | 619 | 'messengers_to_validate_with' => array('email') |
620 | 620 | ); |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | //register registration cancelled message type |
624 | 624 | $setup_args = array( |
625 | 625 | 'mtfilename' => 'EE_Cancelled_Registration_message_type.class.php', |
626 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/cancelled_registration/'), |
|
626 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/cancelled_registration/'), |
|
627 | 627 | 'messengers_to_activate_with' => array('email'), |
628 | 628 | 'messengers_to_validate_with' => array('email') |
629 | 629 | ); |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | //register payment failed message type |
634 | 634 | $setup_args = array( |
635 | 635 | 'mtfilename' => 'EE_Payment_Failed_message_type.class.php', |
636 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_failed/'), |
|
636 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_failed/'), |
|
637 | 637 | 'messengers_to_activate_with' => array('email'), |
638 | 638 | 'messengers_to_validate_with' => array('email') |
639 | 639 | ); |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | //register payment declined message type |
643 | 643 | $setup_args = array( |
644 | 644 | 'mtfilename' => 'EE_Payment_Cancelled_message_type.class.php', |
645 | - 'autoloadpaths' => array(EE_CAF_LIBRARIES . 'messages/message_type/payment_cancelled/'), |
|
645 | + 'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_cancelled/'), |
|
646 | 646 | 'messengers_to_activate_with' => array('email'), |
647 | 647 | 'messengers_to_validate_with' => array('email') |
648 | 648 | ); |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | { |
662 | 662 | $setup_args = array( |
663 | 663 | 'autoloadpaths' => array( |
664 | - EE_CAF_LIBRARIES . 'shortcodes/' |
|
664 | + EE_CAF_LIBRARIES.'shortcodes/' |
|
665 | 665 | ), |
666 | 666 | 'msgr_validator_callback' => array('EE_Newsletter_Shortcodes', 'messenger_validator_config'), |
667 | 667 | 'msgr_template_fields_callback' => array('EE_Newsletter_Shortcodes', 'messenger_template_fields'), |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
4 | - exit('NO direct script access allowed'); |
|
4 | + exit('NO direct script access allowed'); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | /** |
@@ -36,77 +36,77 @@ discard block |
||
36 | 36 | { |
37 | 37 | |
38 | 38 | |
39 | - public function __construct() |
|
40 | - { |
|
41 | - parent::__construct(); |
|
42 | - } |
|
39 | + public function __construct() |
|
40 | + { |
|
41 | + parent::__construct(); |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | - protected function _init_props() |
|
46 | - { |
|
47 | - $this->label = __('Questions and Answers Shortcodes', 'event_espresso'); |
|
48 | - $this->description = __('All shortcodes related to custom questions and answers', 'event_espresso'); |
|
49 | - $this->_shortcodes = array( |
|
50 | - '[QUESTION_LIST]' => __('This is used to indicate where you want the list of questions and answers to show for the registrant. You place this within the "[attendee_list]" field.', |
|
51 | - 'event_espresso') |
|
52 | - ); |
|
53 | - } |
|
45 | + protected function _init_props() |
|
46 | + { |
|
47 | + $this->label = __('Questions and Answers Shortcodes', 'event_espresso'); |
|
48 | + $this->description = __('All shortcodes related to custom questions and answers', 'event_espresso'); |
|
49 | + $this->_shortcodes = array( |
|
50 | + '[QUESTION_LIST]' => __('This is used to indicate where you want the list of questions and answers to show for the registrant. You place this within the "[attendee_list]" field.', |
|
51 | + 'event_espresso') |
|
52 | + ); |
|
53 | + } |
|
54 | 54 | |
55 | 55 | |
56 | - protected function _parser($shortcode) |
|
57 | - { |
|
56 | + protected function _parser($shortcode) |
|
57 | + { |
|
58 | 58 | |
59 | 59 | |
60 | - switch ($shortcode) { |
|
61 | - case '[QUESTION_LIST]' : |
|
62 | - return $this->_get_question_list(); |
|
63 | - break; |
|
64 | - } |
|
60 | + switch ($shortcode) { |
|
61 | + case '[QUESTION_LIST]' : |
|
62 | + return $this->_get_question_list(); |
|
63 | + break; |
|
64 | + } |
|
65 | 65 | |
66 | - return ''; |
|
67 | - } |
|
66 | + return ''; |
|
67 | + } |
|
68 | 68 | |
69 | 69 | |
70 | - protected function _get_question_list() |
|
71 | - { |
|
72 | - $this->_validate_list_requirements(); |
|
70 | + protected function _get_question_list() |
|
71 | + { |
|
72 | + $this->_validate_list_requirements(); |
|
73 | 73 | |
74 | - //for when [QUESTION_LIST] is used in the [attendee_list] field. |
|
75 | - if ($this->_data['data'] instanceof EE_Registration) { |
|
76 | - return $this->_get_question_answer_list_for_attendee(); |
|
77 | - } //for when [QUESTION_LIST] is used in the main content field. |
|
78 | - else if ($this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration) { |
|
79 | - return $this->_get_question_answer_list_for_attendee($this->_data['data']->reg_obj); |
|
80 | - } else { |
|
81 | - return ''; |
|
82 | - } |
|
83 | - } |
|
74 | + //for when [QUESTION_LIST] is used in the [attendee_list] field. |
|
75 | + if ($this->_data['data'] instanceof EE_Registration) { |
|
76 | + return $this->_get_question_answer_list_for_attendee(); |
|
77 | + } //for when [QUESTION_LIST] is used in the main content field. |
|
78 | + else if ($this->_data['data'] instanceof EE_Messages_Addressee && $this->_data['data']->reg_obj instanceof EE_Registration) { |
|
79 | + return $this->_get_question_answer_list_for_attendee($this->_data['data']->reg_obj); |
|
80 | + } else { |
|
81 | + return ''; |
|
82 | + } |
|
83 | + } |
|
84 | 84 | |
85 | 85 | |
86 | - /** |
|
87 | - * Note when we parse the "[question_list]" shortcode for attendees we're actually going to retrieve the list of |
|
88 | - * answers for that attendee since that is what we really need (we can derive the questions from the answers); |
|
89 | - * @return string parsed template. |
|
90 | - */ |
|
91 | - private function _get_question_answer_list_for_attendee($reg_obj = null) |
|
92 | - { |
|
93 | - $valid_shortcodes = array('question'); |
|
94 | - $reg_obj = $reg_obj instanceof EE_Registration ? $reg_obj : $this->_data['data']; |
|
95 | - $template = is_array($this->_data['template']) && isset($this->_data['template']['question_list']) ? $this->_data['template']['question_list'] : ''; |
|
96 | - $template = empty($template) && isset($this->_extra_data['template']['question_list']) ? $this->_extra_data['template']['question_list'] : $template; |
|
97 | - $ans_result = ''; |
|
98 | - $answers = ! empty($this->_extra_data['data']->registrations[$reg_obj->ID()]['ans_objs']) ? $this->_extra_data['data']->registrations[$reg_obj->ID()]['ans_objs'] : array(); |
|
99 | - foreach ($answers as $answer) { |
|
100 | - $question = $answer->question(); |
|
101 | - if ($question instanceof EE_Question and $question->admin_only()) { |
|
102 | - continue; |
|
103 | - } |
|
104 | - $ans_result .= $this->_shortcode_helper->parse_question_list_template($template, $answer, $valid_shortcodes, |
|
105 | - $this->_extra_data); |
|
106 | - } |
|
86 | + /** |
|
87 | + * Note when we parse the "[question_list]" shortcode for attendees we're actually going to retrieve the list of |
|
88 | + * answers for that attendee since that is what we really need (we can derive the questions from the answers); |
|
89 | + * @return string parsed template. |
|
90 | + */ |
|
91 | + private function _get_question_answer_list_for_attendee($reg_obj = null) |
|
92 | + { |
|
93 | + $valid_shortcodes = array('question'); |
|
94 | + $reg_obj = $reg_obj instanceof EE_Registration ? $reg_obj : $this->_data['data']; |
|
95 | + $template = is_array($this->_data['template']) && isset($this->_data['template']['question_list']) ? $this->_data['template']['question_list'] : ''; |
|
96 | + $template = empty($template) && isset($this->_extra_data['template']['question_list']) ? $this->_extra_data['template']['question_list'] : $template; |
|
97 | + $ans_result = ''; |
|
98 | + $answers = ! empty($this->_extra_data['data']->registrations[$reg_obj->ID()]['ans_objs']) ? $this->_extra_data['data']->registrations[$reg_obj->ID()]['ans_objs'] : array(); |
|
99 | + foreach ($answers as $answer) { |
|
100 | + $question = $answer->question(); |
|
101 | + if ($question instanceof EE_Question and $question->admin_only()) { |
|
102 | + continue; |
|
103 | + } |
|
104 | + $ans_result .= $this->_shortcode_helper->parse_question_list_template($template, $answer, $valid_shortcodes, |
|
105 | + $this->_extra_data); |
|
106 | + } |
|
107 | 107 | |
108 | - return $ans_result; |
|
109 | - } |
|
108 | + return $ans_result; |
|
109 | + } |
|
110 | 110 | |
111 | 111 | |
112 | 112 | } //end EE_Question_List_Shortcodes class |
@@ -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 | /** |
@@ -16,109 +16,109 @@ discard block |
||
16 | 16 | class Your_Organization_Help_Tour extends EE_Help_Tour |
17 | 17 | { |
18 | 18 | |
19 | - protected function _set_tour_properties() |
|
20 | - { |
|
21 | - $this->_label = __('Your Organization Tour', 'event_espresso'); |
|
22 | - $this->_slug = 'your-organization-joyride'; |
|
23 | - } |
|
19 | + protected function _set_tour_properties() |
|
20 | + { |
|
21 | + $this->_label = __('Your Organization Tour', 'event_espresso'); |
|
22 | + $this->_slug = 'your-organization-joyride'; |
|
23 | + } |
|
24 | 24 | |
25 | 25 | |
26 | - protected function _set_tour_stops() |
|
27 | - { |
|
28 | - $this->_stops = array( |
|
29 | - 10 => array( |
|
30 | - 'content' => $this->_start(), |
|
31 | - ), |
|
26 | + protected function _set_tour_stops() |
|
27 | + { |
|
28 | + $this->_stops = array( |
|
29 | + 10 => array( |
|
30 | + 'content' => $this->_start(), |
|
31 | + ), |
|
32 | 32 | |
33 | - 30 => array( |
|
34 | - 'id' => 'contact_info_h4', |
|
35 | - 'content' => $this->_contact_information_stop(), |
|
36 | - 'options' => array( |
|
37 | - 'tipLocation' => 'left', |
|
38 | - 'tipAdjustmentY' => -50, |
|
39 | - 'tipAdjustmentX' => 15 |
|
40 | - ) |
|
41 | - ), |
|
42 | - 40 => array( |
|
43 | - 'id' => 'upload_image', |
|
44 | - 'content' => $this->_upload_image_stop(), |
|
45 | - 'options' => array( |
|
46 | - 'tipLocation' => 'right', |
|
47 | - 'tipAdjustmentY' => -50, |
|
48 | - 'tipAdjustmentX' => 15 |
|
49 | - ) |
|
50 | - ), |
|
51 | - 50 => array( |
|
52 | - 'id' => 'organization_facebook', |
|
53 | - 'content' => $this->_organization_facebook_stop(), |
|
54 | - 'options' => array( |
|
55 | - 'tipLocation' => 'right', |
|
56 | - 'tipAdjustmentY' => -50, |
|
57 | - 'tipAdjustmentX' => 15 |
|
58 | - ) |
|
59 | - ), |
|
60 | - 60 => array( |
|
61 | - 'id' => 'ueip_optin', |
|
62 | - 'content' => $this->_ueip_option_stop(), |
|
63 | - 'options' => array( |
|
64 | - 'tipLocation' => 'right', |
|
65 | - 'tipAdjustmentY' => -50, |
|
66 | - 'tipAdjustmentX' => 15 |
|
67 | - ) |
|
68 | - ), |
|
69 | - 70 => array( |
|
70 | - 'id' => 'espresso_major_buttons_wrapper', |
|
71 | - 'content' => $this->_end_tour_stop(), |
|
72 | - 'options' => array( |
|
73 | - 'tipLocation' => 'right', |
|
74 | - 'tipAdjustmentY' => -50, |
|
75 | - 'tipAdjustmentX' => 185 |
|
76 | - ) |
|
77 | - ) |
|
78 | - ); |
|
79 | - } |
|
33 | + 30 => array( |
|
34 | + 'id' => 'contact_info_h4', |
|
35 | + 'content' => $this->_contact_information_stop(), |
|
36 | + 'options' => array( |
|
37 | + 'tipLocation' => 'left', |
|
38 | + 'tipAdjustmentY' => -50, |
|
39 | + 'tipAdjustmentX' => 15 |
|
40 | + ) |
|
41 | + ), |
|
42 | + 40 => array( |
|
43 | + 'id' => 'upload_image', |
|
44 | + 'content' => $this->_upload_image_stop(), |
|
45 | + 'options' => array( |
|
46 | + 'tipLocation' => 'right', |
|
47 | + 'tipAdjustmentY' => -50, |
|
48 | + 'tipAdjustmentX' => 15 |
|
49 | + ) |
|
50 | + ), |
|
51 | + 50 => array( |
|
52 | + 'id' => 'organization_facebook', |
|
53 | + 'content' => $this->_organization_facebook_stop(), |
|
54 | + 'options' => array( |
|
55 | + 'tipLocation' => 'right', |
|
56 | + 'tipAdjustmentY' => -50, |
|
57 | + 'tipAdjustmentX' => 15 |
|
58 | + ) |
|
59 | + ), |
|
60 | + 60 => array( |
|
61 | + 'id' => 'ueip_optin', |
|
62 | + 'content' => $this->_ueip_option_stop(), |
|
63 | + 'options' => array( |
|
64 | + 'tipLocation' => 'right', |
|
65 | + 'tipAdjustmentY' => -50, |
|
66 | + 'tipAdjustmentX' => 15 |
|
67 | + ) |
|
68 | + ), |
|
69 | + 70 => array( |
|
70 | + 'id' => 'espresso_major_buttons_wrapper', |
|
71 | + 'content' => $this->_end_tour_stop(), |
|
72 | + 'options' => array( |
|
73 | + 'tipLocation' => 'right', |
|
74 | + 'tipAdjustmentY' => -50, |
|
75 | + 'tipAdjustmentX' => 185 |
|
76 | + ) |
|
77 | + ) |
|
78 | + ); |
|
79 | + } |
|
80 | 80 | |
81 | 81 | |
82 | - protected function _start() |
|
83 | - { |
|
84 | - $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
85 | - $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.', |
|
86 | - 'event_espresso') . '</p>'; |
|
82 | + protected function _start() |
|
83 | + { |
|
84 | + $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
85 | + $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.', |
|
86 | + 'event_espresso') . '</p>'; |
|
87 | 87 | |
88 | - return $content; |
|
89 | - } |
|
88 | + return $content; |
|
89 | + } |
|
90 | 90 | |
91 | - protected function _site_license_key_stop() |
|
92 | - { |
|
93 | - return '<p>' . __('Enter your support license key here to enable one-click updates.', |
|
94 | - 'event_espresso') . '</p>'; |
|
95 | - } |
|
91 | + protected function _site_license_key_stop() |
|
92 | + { |
|
93 | + return '<p>' . __('Enter your support license key here to enable one-click updates.', |
|
94 | + 'event_espresso') . '</p>'; |
|
95 | + } |
|
96 | 96 | |
97 | - protected function _contact_information_stop() |
|
98 | - { |
|
99 | - 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.', |
|
100 | - 'event_espresso') . '</p>'; |
|
101 | - } |
|
97 | + protected function _contact_information_stop() |
|
98 | + { |
|
99 | + 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.', |
|
100 | + 'event_espresso') . '</p>'; |
|
101 | + } |
|
102 | 102 | |
103 | - protected function _upload_image_stop() |
|
104 | - { |
|
105 | - return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
106 | - } |
|
103 | + protected function _upload_image_stop() |
|
104 | + { |
|
105 | + return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
106 | + } |
|
107 | 107 | |
108 | - protected function _organization_facebook_stop() |
|
109 | - { |
|
110 | - return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
111 | - } |
|
108 | + protected function _organization_facebook_stop() |
|
109 | + { |
|
110 | + return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
111 | + } |
|
112 | 112 | |
113 | - protected function _ueip_option_stop() |
|
114 | - { |
|
115 | - 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.', |
|
116 | - 'event_espresso') . '</p>'; |
|
117 | - } |
|
113 | + protected function _ueip_option_stop() |
|
114 | + { |
|
115 | + 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.', |
|
116 | + 'event_espresso') . '</p>'; |
|
117 | + } |
|
118 | 118 | |
119 | - protected function _end_tour_stop() |
|
120 | - { |
|
121 | - 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.', |
|
122 | - 'event_espresso') . '</p>'; |
|
123 | - } |
|
119 | + protected function _end_tour_stop() |
|
120 | + { |
|
121 | + 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.', |
|
122 | + 'event_espresso') . '</p>'; |
|
123 | + } |
|
124 | 124 | } |
125 | 125 | \ No newline at end of file |
@@ -81,44 +81,44 @@ |
||
81 | 81 | |
82 | 82 | protected function _start() |
83 | 83 | { |
84 | - $content = '<h3>' . __('Organization Settings', 'event_espresso') . '</h3>'; |
|
85 | - $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.', |
|
86 | - 'event_espresso') . '</p>'; |
|
84 | + $content = '<h3>'.__('Organization Settings', 'event_espresso').'</h3>'; |
|
85 | + $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.', |
|
86 | + 'event_espresso').'</p>'; |
|
87 | 87 | |
88 | 88 | return $content; |
89 | 89 | } |
90 | 90 | |
91 | 91 | protected function _site_license_key_stop() |
92 | 92 | { |
93 | - return '<p>' . __('Enter your support license key here to enable one-click updates.', |
|
94 | - 'event_espresso') . '</p>'; |
|
93 | + return '<p>'.__('Enter your support license key here to enable one-click updates.', |
|
94 | + 'event_espresso').'</p>'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | protected function _contact_information_stop() |
98 | 98 | { |
99 | - 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.', |
|
100 | - 'event_espresso') . '</p>'; |
|
99 | + 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.', |
|
100 | + 'event_espresso').'</p>'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | protected function _upload_image_stop() |
104 | 104 | { |
105 | - return '<p>' . __('Add a logo. This can be used for invoices and tickets.', 'event_espresso') . '</p>'; |
|
105 | + return '<p>'.__('Add a logo. This can be used for invoices and tickets.', 'event_espresso').'</p>'; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | protected function _organization_facebook_stop() |
109 | 109 | { |
110 | - return '<p>' . __('Add links to various social media networks.', 'event_espresso') . '</p>'; |
|
110 | + return '<p>'.__('Add links to various social media networks.', 'event_espresso').'</p>'; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | protected function _ueip_option_stop() |
114 | 114 | { |
115 | - 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.', |
|
116 | - 'event_espresso') . '</p>'; |
|
115 | + 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.', |
|
116 | + 'event_espresso').'</p>'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | protected function _end_tour_stop() |
120 | 120 | { |
121 | - 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.', |
|
122 | - 'event_espresso') . '</p>'; |
|
121 | + 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.', |
|
122 | + 'event_espresso').'</p>'; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | \ 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,145 +18,145 @@ 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[15] = array( |
|
38 | - 'id' => 'id', |
|
39 | - 'content' => $this->_id_stop(), |
|
40 | - 'options' => array( |
|
41 | - 'tipLocation' => 'top', |
|
42 | - 'tipAdjustmentY' => -30, |
|
43 | - 'tipAdjustmentX' => -15 |
|
44 | - ) |
|
45 | - ); |
|
46 | - $this->_stops[20] = array( |
|
47 | - 'id' => 'name', |
|
48 | - 'content' => $this->_name_stop(), |
|
49 | - 'options' => array( |
|
50 | - 'tipLocation' => 'top', |
|
51 | - 'tipAdjustmentY' => -30, |
|
52 | - 'tipAdjustmentX' => 25 |
|
53 | - ) |
|
54 | - ); |
|
55 | - $this->_stops[30] = array( |
|
56 | - 'id' => 'description', |
|
57 | - 'content' => $this->_description_stop(), |
|
58 | - 'options' => array( |
|
59 | - 'tipLocation' => 'top', |
|
60 | - 'tipAdjustmentY' => -30, |
|
61 | - 'tipAdjustmentX' => 20 |
|
62 | - ) |
|
63 | - ); |
|
64 | - $this->_stops[40] = array( |
|
65 | - 'id' => 'show_group_name', |
|
66 | - 'content' => $this->_show_group_name_stop(), |
|
67 | - 'options' => array( |
|
68 | - 'tipLocation' => 'top', |
|
69 | - 'tipAdjustmentY' => -30, |
|
70 | - 'tipAdjustmentX' => 20 |
|
71 | - ) |
|
72 | - ); |
|
73 | - $this->_stops[50] = array( |
|
74 | - 'id' => 'show_group_desc', |
|
75 | - 'content' => $this->_show_group_description_stop(), |
|
76 | - 'options' => array( |
|
77 | - 'tipLocation' => 'top', |
|
78 | - 'tipAdjustmentY' => -30, |
|
79 | - 'tipAdjustmentX' => 20 |
|
80 | - ) |
|
81 | - ); |
|
82 | - $this->_stops[60] = array( |
|
83 | - 'class' => 'bulkactions', |
|
84 | - 'content' => $this->_bulk_actions_stop(), |
|
85 | - 'options' => array( |
|
86 | - 'tipLocation' => 'left', |
|
87 | - 'tipAdjustmentY' => -50, |
|
88 | - 'tipAdjustmentX' => -80 |
|
89 | - ) |
|
90 | - ); |
|
91 | - $this->_stops[70] = array( |
|
92 | - 'id' => 'add-new-question-group', |
|
93 | - 'content' => $this->_add_new_question_group_stop(), |
|
94 | - 'options' => array( |
|
95 | - 'tipLocation' => 'right', |
|
96 | - 'tipAdjustmentY' => -50, |
|
97 | - 'tipAdjustmentX' => 15 |
|
98 | - ) |
|
99 | - ); |
|
100 | - } |
|
101 | - } |
|
36 | + if ($this->_is_caf) { |
|
37 | + $this->_stops[15] = array( |
|
38 | + 'id' => 'id', |
|
39 | + 'content' => $this->_id_stop(), |
|
40 | + 'options' => array( |
|
41 | + 'tipLocation' => 'top', |
|
42 | + 'tipAdjustmentY' => -30, |
|
43 | + 'tipAdjustmentX' => -15 |
|
44 | + ) |
|
45 | + ); |
|
46 | + $this->_stops[20] = array( |
|
47 | + 'id' => 'name', |
|
48 | + 'content' => $this->_name_stop(), |
|
49 | + 'options' => array( |
|
50 | + 'tipLocation' => 'top', |
|
51 | + 'tipAdjustmentY' => -30, |
|
52 | + 'tipAdjustmentX' => 25 |
|
53 | + ) |
|
54 | + ); |
|
55 | + $this->_stops[30] = array( |
|
56 | + 'id' => 'description', |
|
57 | + 'content' => $this->_description_stop(), |
|
58 | + 'options' => array( |
|
59 | + 'tipLocation' => 'top', |
|
60 | + 'tipAdjustmentY' => -30, |
|
61 | + 'tipAdjustmentX' => 20 |
|
62 | + ) |
|
63 | + ); |
|
64 | + $this->_stops[40] = array( |
|
65 | + 'id' => 'show_group_name', |
|
66 | + 'content' => $this->_show_group_name_stop(), |
|
67 | + 'options' => array( |
|
68 | + 'tipLocation' => 'top', |
|
69 | + 'tipAdjustmentY' => -30, |
|
70 | + 'tipAdjustmentX' => 20 |
|
71 | + ) |
|
72 | + ); |
|
73 | + $this->_stops[50] = array( |
|
74 | + 'id' => 'show_group_desc', |
|
75 | + 'content' => $this->_show_group_description_stop(), |
|
76 | + 'options' => array( |
|
77 | + 'tipLocation' => 'top', |
|
78 | + 'tipAdjustmentY' => -30, |
|
79 | + 'tipAdjustmentX' => 20 |
|
80 | + ) |
|
81 | + ); |
|
82 | + $this->_stops[60] = array( |
|
83 | + 'class' => 'bulkactions', |
|
84 | + 'content' => $this->_bulk_actions_stop(), |
|
85 | + 'options' => array( |
|
86 | + 'tipLocation' => 'left', |
|
87 | + 'tipAdjustmentY' => -50, |
|
88 | + 'tipAdjustmentX' => -80 |
|
89 | + ) |
|
90 | + ); |
|
91 | + $this->_stops[70] = array( |
|
92 | + 'id' => 'add-new-question-group', |
|
93 | + 'content' => $this->_add_new_question_group_stop(), |
|
94 | + 'options' => array( |
|
95 | + 'tipLocation' => 'right', |
|
96 | + 'tipAdjustmentY' => -50, |
|
97 | + 'tipAdjustmentX' => 15 |
|
98 | + ) |
|
99 | + ); |
|
100 | + } |
|
101 | + } |
|
102 | 102 | |
103 | 103 | |
104 | - protected function _start() |
|
105 | - { |
|
106 | - $content = '<h3>' . __('Question Groups', 'event_espresso') . '</h3>'; |
|
107 | - if ($this->_is_caf) { |
|
108 | - $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.', |
|
109 | - 'event_espresso') . '</p>'; |
|
110 | - } else { |
|
111 | - $content .= '<p>' . __('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', |
|
112 | - 'event_espresso') . '</p>'; |
|
113 | - } |
|
104 | + protected function _start() |
|
105 | + { |
|
106 | + $content = '<h3>' . __('Question Groups', 'event_espresso') . '</h3>'; |
|
107 | + if ($this->_is_caf) { |
|
108 | + $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.', |
|
109 | + 'event_espresso') . '</p>'; |
|
110 | + } else { |
|
111 | + $content .= '<p>' . __('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', |
|
112 | + 'event_espresso') . '</p>'; |
|
113 | + } |
|
114 | 114 | |
115 | - return $content; |
|
116 | - } |
|
115 | + return $content; |
|
116 | + } |
|
117 | 117 | |
118 | - protected function _id_stop() |
|
119 | - { |
|
120 | - return '<p>' . __('View the ID of the question group. Can be sorted in ascending or descending order.', |
|
121 | - 'event_espresso') . '</p>'; |
|
122 | - } |
|
118 | + protected function _id_stop() |
|
119 | + { |
|
120 | + return '<p>' . __('View the ID of the question group. Can be sorted in ascending or descending order.', |
|
121 | + 'event_espresso') . '</p>'; |
|
122 | + } |
|
123 | 123 | |
124 | - protected function _name_stop() |
|
125 | - { |
|
126 | - return '<p>' . __('View available questions groups. You can reorder your questions by dragging and dropping them.', |
|
127 | - 'event_espresso') . '</p>'; |
|
128 | - } |
|
124 | + protected function _name_stop() |
|
125 | + { |
|
126 | + return '<p>' . __('View available questions groups. You can reorder your questions by dragging and dropping them.', |
|
127 | + 'event_espresso') . '</p>'; |
|
128 | + } |
|
129 | 129 | |
130 | - protected function _description_stop() |
|
131 | - { |
|
132 | - return '<p>' . __('View the question group description.', 'event_espresso') . '</p>'; |
|
133 | - } |
|
130 | + protected function _description_stop() |
|
131 | + { |
|
132 | + return '<p>' . __('View the question group description.', 'event_espresso') . '</p>'; |
|
133 | + } |
|
134 | 134 | |
135 | - protected function _show_group_name_stop() |
|
136 | - { |
|
137 | - return '<p>' . __('View if the name of the question group should be shown to customers.', |
|
138 | - 'event_espresso') . '</p>'; |
|
139 | - } |
|
135 | + protected function _show_group_name_stop() |
|
136 | + { |
|
137 | + return '<p>' . __('View if the name of the question group should be shown to customers.', |
|
138 | + 'event_espresso') . '</p>'; |
|
139 | + } |
|
140 | 140 | |
141 | - protected function _show_group_description_stop() |
|
142 | - { |
|
143 | - return '<p>' . __('View if the description of the question group should be shown to customers.', |
|
144 | - 'event_espresso') . '</p>'; |
|
145 | - } |
|
141 | + protected function _show_group_description_stop() |
|
142 | + { |
|
143 | + return '<p>' . __('View if the description of the question group should be shown to customers.', |
|
144 | + 'event_espresso') . '</p>'; |
|
145 | + } |
|
146 | 146 | |
147 | - protected function _bulk_actions_stop() |
|
148 | - { |
|
149 | - return '<p>' . __('Perform bulk actions to multiple question groups.', 'event_espresso') . '</p>'; |
|
150 | - } |
|
147 | + protected function _bulk_actions_stop() |
|
148 | + { |
|
149 | + return '<p>' . __('Perform bulk actions to multiple question groups.', 'event_espresso') . '</p>'; |
|
150 | + } |
|
151 | 151 | |
152 | - protected function _search_stop() |
|
153 | - { |
|
154 | - return '<p>' . __('Search through questions. The following sources will be searched: question group name and question group description.', |
|
155 | - 'event_espresso') . '</p>'; |
|
156 | - } |
|
152 | + protected function _search_stop() |
|
153 | + { |
|
154 | + return '<p>' . __('Search through questions. The following sources will be searched: question group name and question group description.', |
|
155 | + 'event_espresso') . '</p>'; |
|
156 | + } |
|
157 | 157 | |
158 | - protected function _add_new_question_group_stop() |
|
159 | - { |
|
160 | - return '<p>' . __('Click here to create a new question group.', 'event_espresso') . '</p>'; |
|
161 | - } |
|
158 | + protected function _add_new_question_group_stop() |
|
159 | + { |
|
160 | + return '<p>' . __('Click here to create a new question group.', 'event_espresso') . '</p>'; |
|
161 | + } |
|
162 | 162 | } |
163 | 163 | \ No newline at end of file |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | |
104 | 104 | protected function _start() |
105 | 105 | { |
106 | - $content = '<h3>' . __('Question Groups', 'event_espresso') . '</h3>'; |
|
106 | + $content = '<h3>'.__('Question Groups', 'event_espresso').'</h3>'; |
|
107 | 107 | if ($this->_is_caf) { |
108 | - $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.', |
|
109 | - 'event_espresso') . '</p>'; |
|
108 | + $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.', |
|
109 | + 'event_espresso').'</p>'; |
|
110 | 110 | } else { |
111 | - $content .= '<p>' . __('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', |
|
112 | - 'event_espresso') . '</p>'; |
|
111 | + $content .= '<p>'.__('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', |
|
112 | + 'event_espresso').'</p>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return $content; |
@@ -117,46 +117,46 @@ discard block |
||
117 | 117 | |
118 | 118 | protected function _id_stop() |
119 | 119 | { |
120 | - return '<p>' . __('View the ID of the question group. Can be sorted in ascending or descending order.', |
|
121 | - 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('View the ID of the question group. Can be sorted in ascending or descending order.', |
|
121 | + 'event_espresso').'</p>'; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | protected function _name_stop() |
125 | 125 | { |
126 | - return '<p>' . __('View available questions groups. You can reorder your questions by dragging and dropping them.', |
|
127 | - 'event_espresso') . '</p>'; |
|
126 | + return '<p>'.__('View available questions groups. You can reorder your questions by dragging and dropping them.', |
|
127 | + 'event_espresso').'</p>'; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | protected function _description_stop() |
131 | 131 | { |
132 | - return '<p>' . __('View the question group description.', 'event_espresso') . '</p>'; |
|
132 | + return '<p>'.__('View the question group description.', 'event_espresso').'</p>'; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | protected function _show_group_name_stop() |
136 | 136 | { |
137 | - return '<p>' . __('View if the name of the question group should be shown to customers.', |
|
138 | - 'event_espresso') . '</p>'; |
|
137 | + return '<p>'.__('View if the name of the question group should be shown to customers.', |
|
138 | + 'event_espresso').'</p>'; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | protected function _show_group_description_stop() |
142 | 142 | { |
143 | - return '<p>' . __('View if the description of the question group should be shown to customers.', |
|
144 | - 'event_espresso') . '</p>'; |
|
143 | + return '<p>'.__('View if the description of the question group should be shown to customers.', |
|
144 | + 'event_espresso').'</p>'; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | protected function _bulk_actions_stop() |
148 | 148 | { |
149 | - return '<p>' . __('Perform bulk actions to multiple question groups.', 'event_espresso') . '</p>'; |
|
149 | + return '<p>'.__('Perform bulk actions to multiple question groups.', 'event_espresso').'</p>'; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | protected function _search_stop() |
153 | 153 | { |
154 | - return '<p>' . __('Search through questions. The following sources will be searched: question group name and question group description.', |
|
155 | - 'event_espresso') . '</p>'; |
|
154 | + return '<p>'.__('Search through questions. The following sources will be searched: question group name and question group description.', |
|
155 | + 'event_espresso').'</p>'; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | protected function _add_new_question_group_stop() |
159 | 159 | { |
160 | - return '<p>' . __('Click here to create a new question group.', 'event_espresso') . '</p>'; |
|
160 | + return '<p>'.__('Click here to create a new question group.', 'event_espresso').'</p>'; |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | \ 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,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,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'ABSPATH' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('ABSPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /* |
5 | 5 | Plugin Name: Event Espresso |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @link {@link http://www.eventespresso.com} |
40 | 40 | * @since 4.0 |
41 | 41 | */ |
42 | -if ( function_exists( 'espresso_version' ) ) { |
|
42 | +if (function_exists('espresso_version')) { |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * espresso_duplicate_plugin_error |
@@ -56,15 +56,15 @@ discard block |
||
56 | 56 | </p> |
57 | 57 | </div> |
58 | 58 | <?php |
59 | - espresso_deactivate_plugin( plugin_basename( __FILE__ ) ); |
|
59 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | 60 | } |
61 | - add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 ); |
|
61 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
62 | 62 | |
63 | 63 | } else { |
64 | 64 | |
65 | - define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' ); |
|
65 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.0'); |
|
66 | 66 | |
67 | - if ( ! version_compare( PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=' ) ) { |
|
67 | + if ( ! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * espresso_minimum_php_version_error |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | </p> |
91 | 91 | </div> |
92 | 92 | <?php |
93 | - espresso_deactivate_plugin( plugin_basename( __FILE__ ) ); |
|
93 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
94 | 94 | } |
95 | - add_action( 'admin_notices', 'espresso_minimum_php_version_error', 1 ); |
|
95 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
96 | 96 | |
97 | 97 | } else { |
98 | 98 | |
@@ -103,99 +103,99 @@ discard block |
||
103 | 103 | * @return string |
104 | 104 | */ |
105 | 105 | function espresso_version() { |
106 | - return apply_filters( 'FHEE__espresso__espresso_version', '4.9.21.rc.011' ); |
|
106 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.21.rc.011'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | // define versions |
110 | - define( 'EVENT_ESPRESSO_VERSION', espresso_version() ); |
|
111 | - define( 'EE_MIN_WP_VER_REQUIRED', '4.1' ); |
|
112 | - define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' ); |
|
113 | - define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' ); |
|
114 | - define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ ); |
|
110 | + define('EVENT_ESPRESSO_VERSION', espresso_version()); |
|
111 | + define('EE_MIN_WP_VER_REQUIRED', '4.1'); |
|
112 | + define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2'); |
|
113 | + define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44'); |
|
114 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
115 | 115 | |
116 | 116 | //used to be DIRECTORY_SEPARATOR, but that caused issues on windows |
117 | - if ( ! defined( 'DS' ) ) { |
|
118 | - define( 'DS', '/' ); |
|
117 | + if ( ! defined('DS')) { |
|
118 | + define('DS', '/'); |
|
119 | 119 | } |
120 | - if ( ! defined( 'PS' ) ) { |
|
121 | - define( 'PS', PATH_SEPARATOR ); |
|
120 | + if ( ! defined('PS')) { |
|
121 | + define('PS', PATH_SEPARATOR); |
|
122 | 122 | } |
123 | - if ( ! defined( 'SP' ) ) { |
|
124 | - define( 'SP', ' ' ); |
|
123 | + if ( ! defined('SP')) { |
|
124 | + define('SP', ' '); |
|
125 | 125 | } |
126 | - if ( ! defined( 'EENL' ) ) { |
|
127 | - define( 'EENL', "\n" ); |
|
126 | + if ( ! defined('EENL')) { |
|
127 | + define('EENL', "\n"); |
|
128 | 128 | } |
129 | - define( 'EE_SUPPORT_EMAIL', '[email protected]' ); |
|
129 | + define('EE_SUPPORT_EMAIL', '[email protected]'); |
|
130 | 130 | // define the plugin directory and URL |
131 | - define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
132 | - define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
133 | - define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
131 | + define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE)); |
|
132 | + define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE)); |
|
133 | + define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE)); |
|
134 | 134 | // main root folder paths |
135 | - define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS ); |
|
136 | - define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS ); |
|
137 | - define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS ); |
|
138 | - define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS ); |
|
139 | - define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS ); |
|
140 | - define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS ); |
|
141 | - define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS ); |
|
142 | - define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS ); |
|
135 | + define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS); |
|
136 | + define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS); |
|
137 | + define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS); |
|
138 | + define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS); |
|
139 | + define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS); |
|
140 | + define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS); |
|
141 | + define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS); |
|
142 | + define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS); |
|
143 | 143 | // core system paths |
144 | - define( 'EE_ADMIN', EE_CORE . 'admin' . DS ); |
|
145 | - define( 'EE_CPTS', EE_CORE . 'CPTs' . DS ); |
|
146 | - define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS ); |
|
147 | - define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS ); |
|
148 | - define( 'EE_BUSINESS', EE_CORE . 'business' . DS ); |
|
149 | - define( 'EE_MODELS', EE_CORE . 'db_models' . DS ); |
|
150 | - define( 'EE_HELPERS', EE_CORE . 'helpers' . DS ); |
|
151 | - define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS ); |
|
152 | - define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS ); |
|
153 | - define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS ); |
|
154 | - define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS ); |
|
155 | - define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS ); |
|
144 | + define('EE_ADMIN', EE_CORE.'admin'.DS); |
|
145 | + define('EE_CPTS', EE_CORE.'CPTs'.DS); |
|
146 | + define('EE_CLASSES', EE_CORE.'db_classes'.DS); |
|
147 | + define('EE_INTERFACES', EE_CORE.'interfaces'.DS); |
|
148 | + define('EE_BUSINESS', EE_CORE.'business'.DS); |
|
149 | + define('EE_MODELS', EE_CORE.'db_models'.DS); |
|
150 | + define('EE_HELPERS', EE_CORE.'helpers'.DS); |
|
151 | + define('EE_LIBRARIES', EE_CORE.'libraries'.DS); |
|
152 | + define('EE_TEMPLATES', EE_CORE.'templates'.DS); |
|
153 | + define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS); |
|
154 | + define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS); |
|
155 | + define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS); |
|
156 | 156 | // gateways |
157 | - define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS ); |
|
158 | - define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS ); |
|
157 | + define('EE_GATEWAYS', EE_MODULES.'gateways'.DS); |
|
158 | + define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS); |
|
159 | 159 | // asset URL paths |
160 | - define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS ); |
|
161 | - define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS ); |
|
162 | - define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS ); |
|
163 | - define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS ); |
|
164 | - define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' ); |
|
165 | - define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' ); |
|
160 | + define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS); |
|
161 | + define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS); |
|
162 | + define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS); |
|
163 | + define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS); |
|
164 | + define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/'); |
|
165 | + define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/'); |
|
166 | 166 | // define upload paths |
167 | 167 | $uploads = wp_upload_dir(); |
168 | 168 | // define the uploads directory and URL |
169 | - define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS ); |
|
170 | - define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS ); |
|
169 | + define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS); |
|
170 | + define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS); |
|
171 | 171 | // define the templates directory and URL |
172 | - define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS ); |
|
173 | - define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS ); |
|
172 | + define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS); |
|
173 | + define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS); |
|
174 | 174 | // define the gateway directory and URL |
175 | - define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
176 | - define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
175 | + define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS); |
|
176 | + define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS); |
|
177 | 177 | // languages folder/path |
178 | - define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS ); |
|
179 | - define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS ); |
|
178 | + define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS); |
|
179 | + define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS); |
|
180 | 180 | //check for dompdf fonts in uploads |
181 | - if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) { |
|
182 | - define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ); |
|
181 | + if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) { |
|
182 | + define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS); |
|
183 | 183 | } |
184 | 184 | //ajax constants |
185 | 185 | define( |
186 | 186 | 'EE_FRONT_AJAX', |
187 | - isset( $_REQUEST['ee_front_ajax'] ) || isset( $_REQUEST['data']['ee_front_ajax'] ) ? true : false |
|
187 | + isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false |
|
188 | 188 | ); |
189 | 189 | define( |
190 | 190 | 'EE_ADMIN_AJAX', |
191 | - isset( $_REQUEST['ee_admin_ajax'] ) || isset( $_REQUEST['data']['ee_admin_ajax'] ) ? true : false |
|
191 | + isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false |
|
192 | 192 | ); |
193 | 193 | //just a handy constant occasionally needed for finding values representing infinity in the DB |
194 | 194 | //you're better to use this than its straight value (currently -1) in case you ever |
195 | 195 | //want to change its default value! or find when -1 means infinity |
196 | - define( 'EE_INF_IN_DB', -1 ); |
|
197 | - define( 'EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX ); |
|
198 | - define( 'EE_DEBUG', false ); |
|
196 | + define('EE_INF_IN_DB', -1); |
|
197 | + define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX); |
|
198 | + define('EE_DEBUG', false); |
|
199 | 199 | |
200 | 200 | |
201 | 201 | /** |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
204 | 204 | */ |
205 | 205 | function espresso_plugin_activation() { |
206 | - update_option( 'ee_espresso_activation', true ); |
|
206 | + update_option('ee_espresso_activation', true); |
|
207 | 207 | } |
208 | - register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' ); |
|
208 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
209 | 209 | |
210 | 210 | |
211 | 211 | |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | */ |
216 | 216 | function espresso_load_error_handling() { |
217 | 217 | // load debugging tools |
218 | - if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) { |
|
219 | - require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ); |
|
218 | + if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) { |
|
219 | + require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php'); |
|
220 | 220 | EEH_Debug_Tools::instance(); |
221 | 221 | } |
222 | 222 | // load error handling |
223 | - if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) { |
|
224 | - require_once( EE_CORE . 'EE_Error.core.php' ); |
|
223 | + if (is_readable(EE_CORE.'EE_Error.core.php')) { |
|
224 | + require_once(EE_CORE.'EE_Error.core.php'); |
|
225 | 225 | } else { |
226 | - wp_die( esc_html__( 'The EE_Error core class could not be loaded.', 'event_espresso' ) ); |
|
226 | + wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
227 | 227 | } |
228 | 228 | } |
229 | 229 | |
@@ -237,16 +237,16 @@ discard block |
||
237 | 237 | * @param string $full_path_to_file |
238 | 238 | * @throws EE_Error |
239 | 239 | */ |
240 | - function espresso_load_required( $classname, $full_path_to_file ) { |
|
240 | + function espresso_load_required($classname, $full_path_to_file) { |
|
241 | 241 | static $error_handling_loaded = false; |
242 | - if ( ! $error_handling_loaded ) { |
|
242 | + if ( ! $error_handling_loaded) { |
|
243 | 243 | espresso_load_error_handling(); |
244 | 244 | $error_handling_loaded = true; |
245 | 245 | } |
246 | - if ( is_readable( $full_path_to_file ) ) { |
|
247 | - require_once( $full_path_to_file ); |
|
246 | + if (is_readable($full_path_to_file)) { |
|
247 | + require_once($full_path_to_file); |
|
248 | 248 | } else { |
249 | - throw new EE_Error ( |
|
249 | + throw new EE_Error( |
|
250 | 250 | sprintf( |
251 | 251 | esc_html__( |
252 | 252 | 'The %s class file could not be located or is not readable due to file permissions.', |
@@ -258,15 +258,15 @@ discard block |
||
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
261 | - espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' ); |
|
262 | - espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' ); |
|
263 | - espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' ); |
|
261 | + espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php'); |
|
262 | + espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php'); |
|
263 | + espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php'); |
|
264 | 264 | new EE_Bootstrap(); |
265 | 265 | |
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | -if ( ! function_exists( 'espresso_deactivate_plugin' ) ) { |
|
269 | +if ( ! function_exists('espresso_deactivate_plugin')) { |
|
270 | 270 | |
271 | 271 | /** |
272 | 272 | * deactivate_plugin |
@@ -276,12 +276,12 @@ discard block |
||
276 | 276 | * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
277 | 277 | * @return void |
278 | 278 | */ |
279 | - function espresso_deactivate_plugin( $plugin_basename = '' ) { |
|
280 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
281 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
279 | + function espresso_deactivate_plugin($plugin_basename = '') { |
|
280 | + if ( ! function_exists('deactivate_plugins')) { |
|
281 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
282 | 282 | } |
283 | - unset( $_GET['activate'], $_REQUEST['activate'] ); |
|
284 | - deactivate_plugins( $plugin_basename ); |
|
283 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
284 | + deactivate_plugins($plugin_basename); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | } |
@@ -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) { |