@@ -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.17.rc.023' ); |
|
106 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.17.rc.023'); |
|
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 | } |
@@ -22,32 +22,32 @@ discard block |
||
22 | 22 | * @param EE_Response $response |
23 | 23 | * @return EE_Response |
24 | 24 | */ |
25 | - public function handle_request( EE_Request $request, EE_Response $response ) { |
|
25 | + public function handle_request(EE_Request $request, EE_Response $response) { |
|
26 | 26 | $this->_request = $request; |
27 | 27 | $this->_response = $response; |
28 | 28 | //$this->_response->add_output( "\n\t IN >> " . __CLASS__ ); |
29 | 29 | //$this->_response->set_notice( 1, 'hey look at this' ); |
30 | 30 | // check required WP version |
31 | - if ( ! $this->_minimum_wp_version_required() ) { |
|
32 | - $this->_request->un_set( 'activate', true ); |
|
33 | - add_action( 'admin_notices', array( $this, 'minimum_wp_version_error' ), 1 ); |
|
31 | + if ( ! $this->_minimum_wp_version_required()) { |
|
32 | + $this->_request->un_set('activate', true); |
|
33 | + add_action('admin_notices', array($this, 'minimum_wp_version_error'), 1); |
|
34 | 34 | //$this->_response->add_output( "\n<br />" . 'minimum_wp_version_error' ); |
35 | 35 | $this->_response->terminate_request(); |
36 | 36 | $this->_response->deactivate_plugin(); |
37 | 37 | } |
38 | 38 | // check required PHP version |
39 | - if ( ! $this->_minimum_php_version_required() ) { |
|
40 | - $this->_request->un_set( 'activate', true ); |
|
41 | - add_action( 'admin_notices', array( $this, 'minimum_php_version_error' ), 1 ); |
|
39 | + if ( ! $this->_minimum_php_version_required()) { |
|
40 | + $this->_request->un_set('activate', true); |
|
41 | + add_action('admin_notices', array($this, 'minimum_php_version_error'), 1); |
|
42 | 42 | //$this->_response->add_output( "\n<br />" . 'minimum_php_version_error' ); |
43 | 43 | $this->_response->terminate_request(); |
44 | 44 | $this->_response->deactivate_plugin(); |
45 | 45 | } |
46 | 46 | // check recommended PHP version |
47 | - if ( ! $this->_minimum_php_version_recommended() ) { |
|
47 | + if ( ! $this->_minimum_php_version_recommended()) { |
|
48 | 48 | $this->_display_minimum_recommended_php_version_notice(); |
49 | 49 | } |
50 | - $this->_response = $this->process_request_stack( $this->_request, $this->_response ); |
|
50 | + $this->_response = $this->process_request_stack($this->_request, $this->_response); |
|
51 | 51 | //$this->_response->add_output( "\n\t OUT << " . __CLASS__ ); |
52 | 52 | return $this->_response; |
53 | 53 | } |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | * @param string $min_version |
62 | 62 | * @return boolean |
63 | 63 | */ |
64 | - private function _check_wp_version( $min_version = EE_MIN_WP_VER_REQUIRED ) { |
|
64 | + private function _check_wp_version($min_version = EE_MIN_WP_VER_REQUIRED) { |
|
65 | 65 | global $wp_version; |
66 | - return version_compare( $wp_version, $min_version, '>=' ) ? true : false; |
|
66 | + return version_compare($wp_version, $min_version, '>=') ? true : false; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @return boolean |
76 | 76 | */ |
77 | 77 | private function _minimum_wp_version_required() { |
78 | - return $this->_check_wp_version( EE_MIN_WP_VER_REQUIRED ); |
|
78 | + return $this->_check_wp_version(EE_MIN_WP_VER_REQUIRED); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | * @param string $min_version |
88 | 88 | * @return boolean |
89 | 89 | */ |
90 | - private function _check_php_version( $min_version = EE_MIN_PHP_VER_RECOMMENDED ) { |
|
91 | - return version_compare( PHP_VERSION, $min_version, '>=' ) ? true : false; |
|
90 | + private function _check_php_version($min_version = EE_MIN_PHP_VER_RECOMMENDED) { |
|
91 | + return version_compare(PHP_VERSION, $min_version, '>=') ? true : false; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @return boolean |
101 | 101 | */ |
102 | 102 | private function _minimum_php_version_required() { |
103 | - return $this->_check_php_version( EE_MIN_PHP_VER_REQUIRED ); |
|
103 | + return $this->_check_php_version(EE_MIN_PHP_VER_REQUIRED); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * @return boolean |
113 | 113 | */ |
114 | 114 | private function _minimum_php_version_recommended() { |
115 | - return $this->_check_php_version( EE_MIN_PHP_VER_RECOMMENDED ); |
|
115 | + return $this->_check_php_version(EE_MIN_PHP_VER_RECOMMENDED); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | <p> |
130 | 130 | <?php |
131 | 131 | printf( |
132 | - __( 'We\'re sorry, but Event Espresso requires WordPress version %1$s or greater in order to operate. You are currently running version %2$s.%3$sFor information on how to update your version of WordPress, please go to %4$s.', 'event_espresso' ), |
|
132 | + __('We\'re sorry, but Event Espresso requires WordPress version %1$s or greater in order to operate. You are currently running version %2$s.%3$sFor information on how to update your version of WordPress, please go to %4$s.', 'event_espresso'), |
|
133 | 133 | EE_MIN_WP_VER_REQUIRED, |
134 | 134 | $wp_version, |
135 | 135 | '<br/>', |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | */ |
153 | 153 | private function _display_minimum_recommended_php_version_notice() { |
154 | 154 | EE_Error::add_persistent_admin_notice( |
155 | - 'php_version_' . str_replace( '.', '-', EE_MIN_PHP_VER_RECOMMENDED ) . '_recommended', |
|
155 | + 'php_version_'.str_replace('.', '-', EE_MIN_PHP_VER_RECOMMENDED).'_recommended', |
|
156 | 156 | sprintf( |
157 | - __( 'Event Espresso recommends PHP version %1$s or greater for optimal performance. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', 'event_espresso' ), |
|
157 | + __('Event Espresso recommends PHP version %1$s or greater for optimal performance. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', 'event_espresso'), |
|
158 | 158 | EE_MIN_PHP_VER_RECOMMENDED, |
159 | 159 | PHP_VERSION, |
160 | 160 | '<br/>', |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->_columns = array_merge( $columns, $this->_columns ); |
88 | 88 | $this->_primary_column = '_REG_att_checked_in'; |
89 | 89 | if ( ! empty( $evt_id ) |
90 | - && EE_Registry::instance()->CAP->current_user_can( |
|
90 | + && EE_Registry::instance()->CAP->current_user_can( |
|
91 | 91 | 'ee_read_registrations', |
92 | 92 | 'espresso_registrations_registrations_reports', |
93 | 93 | $evt_id |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | if ( count( $this->_dtts_for_event ) > 1 ) { |
190 | 190 | $dtts[0] = __( 'To toggle check-in status, select a datetime.', 'event_espresso' ); |
191 | 191 | foreach ( $this->_dtts_for_event as $dtt ) { |
192 | - $datetime_string = $dtt->name(); |
|
193 | - $datetime_string = ! empty($datetime_string ) ? ' (' . $datetime_string . ')' : ''; |
|
192 | + $datetime_string = $dtt->name(); |
|
193 | + $datetime_string = ! empty($datetime_string ) ? ' (' . $datetime_string . ')' : ''; |
|
194 | 194 | $datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time() . $datetime_string; |
195 | 195 | $dtts[ $dtt->ID() ] = $datetime_string; |
196 | 196 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $checkinstatus = $item->check_in_status_for_datetime( $this->_cur_dtt_id ); |
285 | 285 | $nonce = wp_create_nonce( 'checkin_nonce' ); |
286 | 286 | $toggle_active = ! empty ( $this->_cur_dtt_id ) |
287 | - && EE_Registry::instance()->CAP->current_user_can( |
|
287 | + && EE_Registry::instance()->CAP->current_user_can( |
|
288 | 288 | 'ee_edit_checkin', |
289 | 289 | 'espresso_registrations_toggle_checkin_status', |
290 | 290 | $item->ID() |
@@ -293,11 +293,11 @@ discard block |
||
293 | 293 | : ''; |
294 | 294 | $mobile_view_content = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
295 | 295 | return '<span class="checkin-icons checkedin-status-' . $checkinstatus . $toggle_active . '"' |
296 | - . ' data-_regid="' . $item->ID() . '"' |
|
297 | - . ' data-dttid="' . $this->_cur_dtt_id . '"' |
|
298 | - . ' data-nonce="' . $nonce . '">' |
|
299 | - . '</span>' |
|
300 | - . $mobile_view_content; |
|
296 | + . ' data-_regid="' . $item->ID() . '"' |
|
297 | + . ' data-dttid="' . $this->_cur_dtt_id . '"' |
|
298 | + . ' data-nonce="' . $nonce . '">' |
|
299 | + . '</span>' |
|
300 | + . $mobile_view_content; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
@@ -322,8 +322,8 @@ discard block |
||
322 | 322 | 'espresso_registrations_edit_attendee' |
323 | 323 | ) |
324 | 324 | ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' |
325 | - . $item->attendee()->full_name() |
|
326 | - . '</a>' |
|
325 | + . $item->attendee()->full_name() |
|
326 | + . '</a>' |
|
327 | 327 | : $item->attendee()->full_name(); |
328 | 328 | $name_link .= $item->count() === 1 |
329 | 329 | ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup> ' |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | ? $latest_related_datetime->ID() |
359 | 359 | : $DTT_ID; |
360 | 360 | if ( ! empty( $DTT_ID ) |
361 | - && EE_Registry::instance()->CAP->current_user_can( |
|
361 | + && EE_Registry::instance()->CAP->current_user_can( |
|
362 | 362 | 'ee_read_checkins', |
363 | 363 | 'espresso_registrations_registration_checkins' |
364 | 364 | ) |
@@ -458,15 +458,15 @@ discard block |
||
458 | 458 | ) ? ' |
459 | 459 | <span class="reg-pad-rght"> |
460 | 460 | <a class="status-' |
461 | - . $item->transaction()->status_ID() |
|
462 | - . '" href="' |
|
463 | - . $view_txn_lnk_url |
|
464 | - . '" title="' |
|
465 | - . esc_attr__( 'View Transaction', 'event_espresso' ) |
|
466 | - . '"> |
|
461 | + . $item->transaction()->status_ID() |
|
462 | + . '" href="' |
|
463 | + . $view_txn_lnk_url |
|
464 | + . '" title="' |
|
465 | + . esc_attr__( 'View Transaction', 'event_espresso' ) |
|
466 | + . '"> |
|
467 | 467 | ' |
468 | - . $item->transaction()->pretty_paid() |
|
469 | - . ' |
|
468 | + . $item->transaction()->pretty_paid() |
|
469 | + . ' |
|
470 | 470 | </a> |
471 | 471 | <span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
472 | 472 | } |
@@ -499,12 +499,12 @@ discard block |
||
499 | 499 | 'ee_read_transaction', |
500 | 500 | 'espresso_transactions_view_transaction' |
501 | 501 | ) ? '<a href="' |
502 | - . $view_txn_url |
|
503 | - . '" title="' |
|
504 | - . esc_attr__( 'View Transaction', 'event_espresso' ) |
|
505 | - . '"><span class="reg-pad-rght">' |
|
506 | - . $txn_total |
|
507 | - . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>'; |
|
502 | + . $view_txn_url |
|
503 | + . '" title="' |
|
504 | + . esc_attr__( 'View Transaction', 'event_espresso' ) |
|
505 | + . '"><span class="reg-pad-rght">' |
|
506 | + . $txn_total |
|
507 | + . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>'; |
|
508 | 508 | } else { |
509 | 509 | return '<span class="reg-pad-rght"></span>'; |
510 | 510 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | |
5 | 5 | |
@@ -42,51 +42,51 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @param \Registrations_Admin_Page $admin_page |
44 | 44 | */ |
45 | - public function __construct( $admin_page ) { |
|
46 | - parent::__construct( $admin_page ); |
|
45 | + public function __construct($admin_page) { |
|
46 | + parent::__construct($admin_page); |
|
47 | 47 | $this->_status = $this->_admin_page->get_registration_status_array(); |
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | |
52 | 52 | protected function _setup_data() { |
53 | - $this->_data = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees( $this->_per_page ) |
|
54 | - : $this->_admin_page->get_event_attendees( $this->_per_page, false, true ); |
|
53 | + $this->_data = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees($this->_per_page) |
|
54 | + : $this->_admin_page->get_event_attendees($this->_per_page, false, true); |
|
55 | 55 | $this->_all_data_count = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees( |
56 | 56 | $this->_per_page, |
57 | 57 | true |
58 | - ) : $this->_admin_page->get_event_attendees( $this->_per_page, true, true ); |
|
58 | + ) : $this->_admin_page->get_event_attendees($this->_per_page, true, true); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | 63 | protected function _set_properties() { |
64 | - $evt_id = isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null; |
|
64 | + $evt_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null; |
|
65 | 65 | $this->_wp_list_args = array( |
66 | - 'singular' => __( 'registrant', 'event_espresso' ), |
|
67 | - 'plural' => __( 'registrants', 'event_espresso' ), |
|
66 | + 'singular' => __('registrant', 'event_espresso'), |
|
67 | + 'plural' => __('registrants', 'event_espresso'), |
|
68 | 68 | 'ajax' => true, |
69 | 69 | 'screen' => $this->_admin_page->get_current_screen()->id, |
70 | 70 | ); |
71 | 71 | $columns = array(); |
72 | 72 | //$columns['_Reg_Status'] = ''; |
73 | - if ( ! empty( $evt_id ) ) { |
|
73 | + if ( ! empty($evt_id)) { |
|
74 | 74 | $columns['cb'] = '<input type="checkbox" />'; //Render a checkbox instead of text |
75 | 75 | $this->_has_checkbox_column = true; |
76 | 76 | } |
77 | 77 | $this->_columns = array( |
78 | 78 | '_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>', |
79 | - 'ATT_name' => __( 'Registrant', 'event_espresso' ), |
|
80 | - 'ATT_email' => __( 'Email Address', 'event_espresso' ), |
|
81 | - 'Event' => __( 'Event', 'event_espresso' ), |
|
82 | - 'PRC_name' => __( 'TKT Option', 'event_espresso' ), |
|
83 | - '_REG_final_price' => __( 'Price', 'event_espresso' ), |
|
84 | - 'TXN_paid' => __( 'Paid', 'event_espresso' ), |
|
85 | - 'TXN_total' => __( 'Total', 'event_espresso' ), |
|
79 | + 'ATT_name' => __('Registrant', 'event_espresso'), |
|
80 | + 'ATT_email' => __('Email Address', 'event_espresso'), |
|
81 | + 'Event' => __('Event', 'event_espresso'), |
|
82 | + 'PRC_name' => __('TKT Option', 'event_espresso'), |
|
83 | + '_REG_final_price' => __('Price', 'event_espresso'), |
|
84 | + 'TXN_paid' => __('Paid', 'event_espresso'), |
|
85 | + 'TXN_total' => __('Total', 'event_espresso'), |
|
86 | 86 | ); |
87 | - $this->_columns = array_merge( $columns, $this->_columns ); |
|
87 | + $this->_columns = array_merge($columns, $this->_columns); |
|
88 | 88 | $this->_primary_column = '_REG_att_checked_in'; |
89 | - if ( ! empty( $evt_id ) |
|
89 | + if ( ! empty($evt_id) |
|
90 | 90 | && EE_Registry::instance()->CAP->current_user_can( |
91 | 91 | 'ee_read_registrations', |
92 | 92 | 'espresso_registrations_registrations_reports', |
@@ -99,18 +99,18 @@ discard block |
||
99 | 99 | 'extra_request' => |
100 | 100 | array( |
101 | 101 | 'EVT_ID' => $evt_id, |
102 | - 'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ), |
|
102 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
103 | 103 | ), |
104 | 104 | ), |
105 | 105 | ); |
106 | 106 | } |
107 | 107 | $this->_sortable_columns = array( |
108 | 108 | //true means its already sorted |
109 | - 'ATT_name' => array( 'ATT_name' => true ), |
|
110 | - 'Event' => array( 'Event.EVT.Name' => false ), |
|
109 | + 'ATT_name' => array('ATT_name' => true), |
|
110 | + 'Event' => array('Event.EVT.Name' => false), |
|
111 | 111 | ); |
112 | 112 | $this->_hidden_columns = array(); |
113 | - $this->_evt = EEM_Event::instance()->get_one_by_ID( $evt_id ); |
|
113 | + $this->_evt = EEM_Event::instance()->get_one_by_ID($evt_id); |
|
114 | 114 | $this->_dtts_for_event = $this->_evt instanceof EE_Event ? $this->_evt->datetimes_ordered() : array(); |
115 | 115 | } |
116 | 116 | |
@@ -120,11 +120,11 @@ discard block |
||
120 | 120 | * @param \EE_Registration $item |
121 | 121 | * @return string |
122 | 122 | */ |
123 | - protected function _get_row_class( $item ) { |
|
124 | - $class = parent::_get_row_class( $item ); |
|
123 | + protected function _get_row_class($item) { |
|
124 | + $class = parent::_get_row_class($item); |
|
125 | 125 | //add status class |
126 | - $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
127 | - if ( $this->_has_checkbox_column ) { |
|
126 | + $class .= ' ee-status-strip reg-status-'.$item->status_ID(); |
|
127 | + if ($this->_has_checkbox_column) { |
|
128 | 128 | $class .= ' has-checkbox-column'; |
129 | 129 | } |
130 | 130 | return $class; |
@@ -138,61 +138,61 @@ discard block |
||
138 | 138 | */ |
139 | 139 | protected function _get_table_filters() { |
140 | 140 | $filters = $where = array(); |
141 | - $current_EVT_ID = isset( $this->_req_data['event_id'] ) ? (int) $this->_req_data['event_id'] : 0; |
|
142 | - if ( empty( $this->_dtts_for_event ) || count( $this->_dtts_for_event ) === 1 ) { |
|
141 | + $current_EVT_ID = isset($this->_req_data['event_id']) ? (int) $this->_req_data['event_id'] : 0; |
|
142 | + if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) { |
|
143 | 143 | //this means we don't have an event so let's setup a filter dropdown for all the events to select |
144 | 144 | //note possible capability restrictions |
145 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events' ) ) { |
|
146 | - $where['status**'] = array( '!=', 'private' ); |
|
145 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) { |
|
146 | + $where['status**'] = array('!=', 'private'); |
|
147 | 147 | } |
148 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) { |
|
148 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) { |
|
149 | 149 | $where['EVT_wp_user'] = get_current_user_id(); |
150 | 150 | } |
151 | 151 | $events = EEM_Event::instance()->get_all( |
152 | 152 | array( |
153 | 153 | $where, |
154 | - 'order_by' => array( 'Datetime.DTT_EVT_start' => 'DESC' ), |
|
154 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'DESC'), |
|
155 | 155 | ) |
156 | 156 | ); |
157 | 157 | $evts[] = array( |
158 | 158 | 'id' => 0, |
159 | - 'text' => __( 'To toggle Check-in status, select an event', 'event_espresso' ), |
|
159 | + 'text' => __('To toggle Check-in status, select an event', 'event_espresso'), |
|
160 | 160 | ); |
161 | 161 | $checked = 'checked'; |
162 | 162 | /** @var EE_Event $evt */ |
163 | - foreach ( $events as $evt ) { |
|
163 | + foreach ($events as $evt) { |
|
164 | 164 | //any registrations for this event? |
165 | - if ( ! $evt->get_count_of_all_registrations() ) { |
|
165 | + if ( ! $evt->get_count_of_all_registrations()) { |
|
166 | 166 | continue; |
167 | 167 | } |
168 | 168 | $evts[] = array( |
169 | 169 | 'id' => $evt->ID(), |
170 | - 'text' => $evt->get( 'EVT_name' ), |
|
170 | + 'text' => $evt->get('EVT_name'), |
|
171 | 171 | 'class' => $evt->is_expired() ? 'ee-expired-event' : '', |
172 | 172 | ); |
173 | - if ( $evt->ID() === $current_EVT_ID && $evt->is_expired() ) { |
|
173 | + if ($evt->ID() === $current_EVT_ID && $evt->is_expired()) { |
|
174 | 174 | $checked = ''; |
175 | 175 | } |
176 | 176 | } |
177 | 177 | $event_filter = '<div class="ee-event-filter">'; |
178 | - $event_filter .= EEH_Form_Fields::select_input( 'event_id', $evts, $current_EVT_ID ); |
|
178 | + $event_filter .= EEH_Form_Fields::select_input('event_id', $evts, $current_EVT_ID); |
|
179 | 179 | $event_filter .= '<span class="ee-event-filter-toggle">'; |
180 | - $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> '; |
|
181 | - $event_filter .= __( 'Hide Expired Events', 'event_espresso' ); |
|
180 | + $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" '.$checked.'> '; |
|
181 | + $event_filter .= __('Hide Expired Events', 'event_espresso'); |
|
182 | 182 | $event_filter .= '</span>'; |
183 | 183 | $event_filter .= '</div>'; |
184 | 184 | $filters[] = $event_filter; |
185 | 185 | } |
186 | - if ( ! empty( $this->_dtts_for_event ) ) { |
|
186 | + if ( ! empty($this->_dtts_for_event)) { |
|
187 | 187 | //DTT datetimes filter |
188 | - $this->_cur_dtt_id = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0; |
|
189 | - if ( count( $this->_dtts_for_event ) > 1 ) { |
|
190 | - $dtts[0] = __( 'To toggle check-in status, select a datetime.', 'event_espresso' ); |
|
191 | - foreach ( $this->_dtts_for_event as $dtt ) { |
|
188 | + $this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0; |
|
189 | + if (count($this->_dtts_for_event) > 1) { |
|
190 | + $dtts[0] = __('To toggle check-in status, select a datetime.', 'event_espresso'); |
|
191 | + foreach ($this->_dtts_for_event as $dtt) { |
|
192 | 192 | $datetime_string = $dtt->name(); |
193 | - $datetime_string = ! empty($datetime_string ) ? ' (' . $datetime_string . ')' : ''; |
|
194 | - $datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time() . $datetime_string; |
|
195 | - $dtts[ $dtt->ID() ] = $datetime_string; |
|
193 | + $datetime_string = ! empty($datetime_string) ? ' ('.$datetime_string.')' : ''; |
|
194 | + $datetime_string = $dtt->start_date_and_time().' - '.$dtt->end_date_and_time().$datetime_string; |
|
195 | + $dtts[$dtt->ID()] = $datetime_string; |
|
196 | 196 | } |
197 | 197 | $input = new EE_Select_Input( |
198 | 198 | $dtts, |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | ) |
204 | 204 | ); |
205 | 205 | $filters[] = $input->get_html_for_input(); |
206 | - $filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">'; |
|
206 | + $filters[] = '<input type="hidden" name="event_id" value="'.$current_EVT_ID.'">'; |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | return $filters; |
@@ -222,22 +222,22 @@ discard block |
||
222 | 222 | * @throws \EE_Error |
223 | 223 | */ |
224 | 224 | protected function _get_total_event_attendees() { |
225 | - $EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : false; |
|
225 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
226 | 226 | $DTT_ID = $this->_cur_dtt_id; |
227 | 227 | $query_params = array(); |
228 | - if ( $EVT_ID ) { |
|
228 | + if ($EVT_ID) { |
|
229 | 229 | $query_params[0]['EVT_ID'] = $EVT_ID; |
230 | 230 | } |
231 | 231 | //if DTT is included we only show for that datetime. Otherwise we're showing for all datetimes (the event). |
232 | - if ( $DTT_ID ) { |
|
232 | + if ($DTT_ID) { |
|
233 | 233 | $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID; |
234 | 234 | } |
235 | 235 | $status_ids_array = apply_filters( |
236 | 236 | 'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', |
237 | - array( EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved ) |
|
237 | + array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved) |
|
238 | 238 | ); |
239 | - $query_params[0]['STS_ID'] = array( 'IN', $status_ids_array ); |
|
240 | - return EEM_Registration::instance()->count( $query_params ); |
|
239 | + $query_params[0]['STS_ID'] = array('IN', $status_ids_array); |
|
240 | + return EEM_Registration::instance()->count($query_params); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | |
@@ -246,8 +246,8 @@ discard block |
||
246 | 246 | * @param \EE_Registration $item |
247 | 247 | * @return string |
248 | 248 | */ |
249 | - public function column__Reg_Status( EE_Registration $item ) { |
|
250 | - return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>'; |
|
249 | + public function column__Reg_Status(EE_Registration $item) { |
|
250 | + return '<span class="ee-status-strip ee-status-strip-td reg-status-'.$item->status_ID().'"></span>'; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | * @return string |
258 | 258 | * @throws \EE_Error |
259 | 259 | */ |
260 | - public function column_cb( $item ) { |
|
261 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID() ); |
|
260 | + public function column_cb($item) { |
|
261 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID()); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | |
@@ -270,20 +270,20 @@ discard block |
||
270 | 270 | * @return string |
271 | 271 | * @throws \EE_Error |
272 | 272 | */ |
273 | - public function column__REG_att_checked_in( EE_Registration $item ) { |
|
273 | + public function column__REG_att_checked_in(EE_Registration $item) { |
|
274 | 274 | $attendee = $item->attendee(); |
275 | 275 | $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
276 | 276 | |
277 | - if ( $this->_cur_dtt_id === 0 && count( $this->_dtts_for_event ) === 1 ) { |
|
277 | + if ($this->_cur_dtt_id === 0 && count($this->_dtts_for_event) === 1) { |
|
278 | 278 | $latest_related_datetime = $item->get_latest_related_datetime(); |
279 | - if ( $latest_related_datetime instanceof EE_Datetime ) { |
|
279 | + if ($latest_related_datetime instanceof EE_Datetime) { |
|
280 | 280 | $this->_cur_dtt_id = $latest_related_datetime->ID(); |
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
284 | - $checkinstatus = $item->check_in_status_for_datetime( $this->_cur_dtt_id ); |
|
285 | - $nonce = wp_create_nonce( 'checkin_nonce' ); |
|
286 | - $toggle_active = ! empty ( $this->_cur_dtt_id ) |
|
284 | + $checkinstatus = $item->check_in_status_for_datetime($this->_cur_dtt_id); |
|
285 | + $nonce = wp_create_nonce('checkin_nonce'); |
|
286 | + $toggle_active = ! empty ($this->_cur_dtt_id) |
|
287 | 287 | && EE_Registry::instance()->CAP->current_user_can( |
288 | 288 | 'ee_edit_checkin', |
289 | 289 | 'espresso_registrations_toggle_checkin_status', |
@@ -291,11 +291,11 @@ discard block |
||
291 | 291 | ) |
292 | 292 | ? ' clickable trigger-checkin' |
293 | 293 | : ''; |
294 | - $mobile_view_content = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
|
295 | - return '<span class="checkin-icons checkedin-status-' . $checkinstatus . $toggle_active . '"' |
|
296 | - . ' data-_regid="' . $item->ID() . '"' |
|
297 | - . ' data-dttid="' . $this->_cur_dtt_id . '"' |
|
298 | - . ' data-nonce="' . $nonce . '">' |
|
294 | + $mobile_view_content = ' <span class="show-on-mobile-view-only">'.$attendee_name.'</span>'; |
|
295 | + return '<span class="checkin-icons checkedin-status-'.$checkinstatus.$toggle_active.'"' |
|
296 | + . ' data-_regid="'.$item->ID().'"' |
|
297 | + . ' data-dttid="'.$this->_cur_dtt_id.'"' |
|
298 | + . ' data-nonce="'.$nonce.'">' |
|
299 | 299 | . '</span>' |
300 | 300 | . $mobile_view_content; |
301 | 301 | } |
@@ -307,21 +307,21 @@ discard block |
||
307 | 307 | * @return mixed|string|void |
308 | 308 | * @throws \EE_Error |
309 | 309 | */ |
310 | - public function column_ATT_name( EE_Registration $item ) { |
|
310 | + public function column_ATT_name(EE_Registration $item) { |
|
311 | 311 | $attendee = $item->attendee(); |
312 | - if ( ! $attendee instanceof EE_Attendee ) { |
|
313 | - return __( 'No contact record for this registration.', 'event_espresso' ); |
|
312 | + if ( ! $attendee instanceof EE_Attendee) { |
|
313 | + return __('No contact record for this registration.', 'event_espresso'); |
|
314 | 314 | } |
315 | 315 | // edit attendee link |
316 | 316 | $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
317 | - array( 'action' => 'view_registration', '_REG_ID' => $item->ID() ), |
|
317 | + array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
|
318 | 318 | REG_ADMIN_URL |
319 | 319 | ); |
320 | 320 | $name_link = EE_Registry::instance()->CAP->current_user_can( |
321 | 321 | 'ee_edit_contacts', |
322 | 322 | 'espresso_registrations_edit_attendee' |
323 | 323 | ) |
324 | - ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' |
|
324 | + ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">' |
|
325 | 325 | . $item->attendee()->full_name() |
326 | 326 | . '</a>' |
327 | 327 | : $item->attendee()->full_name(); |
@@ -329,10 +329,10 @@ discard block |
||
329 | 329 | ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup> ' |
330 | 330 | : ''; |
331 | 331 | //add group details |
332 | - $name_link .= ' ' . sprintf( __( '(%s of %s)', 'event_espresso' ), $item->count(), $item->group_size() ); |
|
332 | + $name_link .= ' '.sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
333 | 333 | //add regcode |
334 | 334 | $link = EE_Admin_Page::add_query_args_and_nonce( |
335 | - array( 'action' => 'view_registration', '_REG_ID' => $item->ID() ), |
|
335 | + array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
|
336 | 336 | REG_ADMIN_URL |
337 | 337 | ); |
338 | 338 | $name_link .= '<br>'; |
@@ -341,37 +341,37 @@ discard block |
||
341 | 341 | 'view_registration', |
342 | 342 | $item->ID() |
343 | 343 | ) |
344 | - ? '<a href="' . $link . '" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' |
|
344 | + ? '<a href="'.$link.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">' |
|
345 | 345 | . $item->reg_code() |
346 | 346 | . '</a>' |
347 | 347 | : $item->reg_code(); |
348 | 348 | //status |
349 | 349 | $name_link .= '<br><span class="ee-status-text-small">'; |
350 | - $name_link .= EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ); |
|
350 | + $name_link .= EEH_Template::pretty_status($item->status_ID(), false, 'sentence'); |
|
351 | 351 | $name_link .= '</span>'; |
352 | 352 | $actions = array(); |
353 | 353 | $DTT_ID = $this->_cur_dtt_id; |
354 | - $latest_related_datetime = empty( $DTT_ID ) && ! empty( $this->_req_data['event_id'] ) && $item instanceof EE_Registration |
|
354 | + $latest_related_datetime = empty($DTT_ID) && ! empty($this->_req_data['event_id']) && $item instanceof EE_Registration |
|
355 | 355 | ? $item->get_latest_related_datetime() |
356 | 356 | : null; |
357 | 357 | $DTT_ID = $latest_related_datetime instanceof EE_Datetime |
358 | 358 | ? $latest_related_datetime->ID() |
359 | 359 | : $DTT_ID; |
360 | - if ( ! empty( $DTT_ID ) |
|
360 | + if ( ! empty($DTT_ID) |
|
361 | 361 | && EE_Registry::instance()->CAP->current_user_can( |
362 | 362 | 'ee_read_checkins', |
363 | 363 | 'espresso_registrations_registration_checkins' |
364 | 364 | ) |
365 | 365 | ) { |
366 | 366 | $checkin_list_url = EE_Admin_Page::add_query_args_and_nonce( |
367 | - array( 'action' => 'registration_checkins', '_REGID' => $item->ID(), 'DTT_ID' => $DTT_ID ) |
|
367 | + array('action' => 'registration_checkins', '_REGID' => $item->ID(), 'DTT_ID' => $DTT_ID) |
|
368 | 368 | ); |
369 | - $actions['checkin'] = '<a href="' . $checkin_list_url . '" title="' . esc_attr__( |
|
369 | + $actions['checkin'] = '<a href="'.$checkin_list_url.'" title="'.esc_attr__( |
|
370 | 370 | 'View all the check-ins/checkouts for this registrant', |
371 | 371 | 'event_espresso' |
372 | - ) . '">' . __( 'View', 'event_espresso' ) . '</a>'; |
|
372 | + ).'">'.__('View', 'event_espresso').'</a>'; |
|
373 | 373 | } |
374 | - return ! empty( $DTT_ID ) ? sprintf( '%1$s %2$s', $name_link, $this->row_actions( $actions ) ) : $name_link; |
|
374 | + return ! empty($DTT_ID) ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions)) : $name_link; |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | * @param \EE_Registration $item |
381 | 381 | * @return string |
382 | 382 | */ |
383 | - public function column_ATT_email( EE_Registration $item ) { |
|
383 | + public function column_ATT_email(EE_Registration $item) { |
|
384 | 384 | $attendee = $item->attendee(); |
385 | 385 | return $attendee instanceof EE_Attendee ? $attendee->email() : ''; |
386 | 386 | } |
@@ -392,22 +392,22 @@ discard block |
||
392 | 392 | * @return bool|string |
393 | 393 | * @throws \EE_Error |
394 | 394 | */ |
395 | - public function column_Event( EE_Registration $item ) { |
|
395 | + public function column_Event(EE_Registration $item) { |
|
396 | 396 | try { |
397 | 397 | $event = $this->_evt instanceof EE_Event ? $this->_evt : $item->event(); |
398 | 398 | $chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
399 | - array( 'action' => 'event_registrations', 'event_id' => $event->ID() ), |
|
399 | + array('action' => 'event_registrations', 'event_id' => $event->ID()), |
|
400 | 400 | REG_ADMIN_URL |
401 | 401 | ); |
402 | 402 | $event_label = EE_Registry::instance()->CAP->current_user_can( |
403 | 403 | 'ee_read_checkins', |
404 | 404 | 'espresso_registrations_registration_checkins' |
405 | - ) ? '<a href="' . $chkin_lnk_url . '" title="' . esc_attr__( |
|
405 | + ) ? '<a href="'.$chkin_lnk_url.'" title="'.esc_attr__( |
|
406 | 406 | 'View Checkins for this Event', |
407 | 407 | 'event_espresso' |
408 | - ) . '">' . $event->name() . '</a>' : $event->name(); |
|
409 | - } catch ( \EventEspresso\core\exceptions\EntityNotFoundException $e ) { |
|
410 | - $event_label = esc_html__( 'Unknown', 'event_espresso' ); |
|
408 | + ).'">'.$event->name().'</a>' : $event->name(); |
|
409 | + } catch (\EventEspresso\core\exceptions\EntityNotFoundException $e) { |
|
410 | + $event_label = esc_html__('Unknown', 'event_espresso'); |
|
411 | 411 | } |
412 | 412 | return $event_label; |
413 | 413 | } |
@@ -418,8 +418,8 @@ discard block |
||
418 | 418 | * @param \EE_Registration $item |
419 | 419 | * @return mixed|string|void |
420 | 420 | */ |
421 | - public function column_PRC_name( EE_Registration $item ) { |
|
422 | - return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __( "Unknown", "event_espresso" ); |
|
421 | + public function column_PRC_name(EE_Registration $item) { |
|
422 | + return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __("Unknown", "event_espresso"); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | |
@@ -430,8 +430,8 @@ discard block |
||
430 | 430 | * @param \EE_Registration $item |
431 | 431 | * @return string |
432 | 432 | */ |
433 | - public function column__REG_final_price( EE_Registration $item ) { |
|
434 | - return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>'; |
|
433 | + public function column__REG_final_price(EE_Registration $item) { |
|
434 | + return '<span class="reg-pad-rght">'.' '.$item->pretty_final_price().'</span>'; |
|
435 | 435 | } |
436 | 436 | |
437 | 437 | |
@@ -443,13 +443,13 @@ discard block |
||
443 | 443 | * @return string |
444 | 444 | * @throws \EE_Error |
445 | 445 | */ |
446 | - public function column_TXN_paid( EE_Registration $item ) { |
|
447 | - if ( $item->count() === 1 ) { |
|
448 | - if ( $item->transaction()->paid() >= $item->transaction()->total() ) { |
|
446 | + public function column_TXN_paid(EE_Registration $item) { |
|
447 | + if ($item->count() === 1) { |
|
448 | + if ($item->transaction()->paid() >= $item->transaction()->total()) { |
|
449 | 449 | return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>'; |
450 | 450 | } else { |
451 | 451 | $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
452 | - array( 'action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID() ), |
|
452 | + array('action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()), |
|
453 | 453 | TXN_ADMIN_URL |
454 | 454 | ); |
455 | 455 | return EE_Registry::instance()->CAP->current_user_can( |
@@ -462,13 +462,13 @@ discard block |
||
462 | 462 | . '" href="' |
463 | 463 | . $view_txn_lnk_url |
464 | 464 | . '" title="' |
465 | - . esc_attr__( 'View Transaction', 'event_espresso' ) |
|
465 | + . esc_attr__('View Transaction', 'event_espresso') |
|
466 | 466 | . '"> |
467 | 467 | ' |
468 | 468 | . $item->transaction()->pretty_paid() |
469 | 469 | . ' |
470 | 470 | </a> |
471 | - <span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
|
471 | + <span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>'; |
|
472 | 472 | } |
473 | 473 | } else { |
474 | 474 | return '<span class="reg-pad-rght"></span>'; |
@@ -484,13 +484,13 @@ discard block |
||
484 | 484 | * @return string |
485 | 485 | * @throws \EE_Error |
486 | 486 | */ |
487 | - public function column_TXN_total( EE_Registration $item ) { |
|
487 | + public function column_TXN_total(EE_Registration $item) { |
|
488 | 488 | $txn = $item->transaction(); |
489 | - $view_txn_url = add_query_arg( array( 'action' => 'view_transaction', 'TXN_ID' => $txn->ID() ), TXN_ADMIN_URL ); |
|
490 | - if ( $item->get( 'REG_count' ) === 1 ) { |
|
489 | + $view_txn_url = add_query_arg(array('action' => 'view_transaction', 'TXN_ID' => $txn->ID()), TXN_ADMIN_URL); |
|
490 | + if ($item->get('REG_count') === 1) { |
|
491 | 491 | $line_total_obj = $txn->total_line_item(); |
492 | 492 | $txn_total = $line_total_obj instanceof EE_Line_Item |
493 | - ? $line_total_obj->get_pretty( 'LIN_total' ) |
|
493 | + ? $line_total_obj->get_pretty('LIN_total') |
|
494 | 494 | : __( |
495 | 495 | 'View Transaction', |
496 | 496 | 'event_espresso' |
@@ -501,10 +501,10 @@ discard block |
||
501 | 501 | ) ? '<a href="' |
502 | 502 | . $view_txn_url |
503 | 503 | . '" title="' |
504 | - . esc_attr__( 'View Transaction', 'event_espresso' ) |
|
504 | + . esc_attr__('View Transaction', 'event_espresso') |
|
505 | 505 | . '"><span class="reg-pad-rght">' |
506 | 506 | . $txn_total |
507 | - . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>'; |
|
507 | + . '</span></a>' : '<span class="reg-pad-rght">'.$txn_total.'</span>'; |
|
508 | 508 | } else { |
509 | 509 | return '<span class="reg-pad-rght"></span>'; |
510 | 510 | } |