@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed');} |
|
2 | -require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed'); } |
|
2 | +require_once (EE_MODELS.'EEM_Base.model.php'); |
|
3 | 3 | /** |
4 | 4 | * |
5 | 5 | * Transaction Model |
@@ -67,36 +67,36 @@ discard block |
||
67 | 67 | * @return EEM_Transaction |
68 | 68 | * @throws \EE_Error |
69 | 69 | */ |
70 | - protected function __construct( $timezone ) { |
|
71 | - $this->singular_item = __('Transaction','event_espresso'); |
|
72 | - $this->plural_item = __('Transactions','event_espresso'); |
|
70 | + protected function __construct($timezone) { |
|
71 | + $this->singular_item = __('Transaction', 'event_espresso'); |
|
72 | + $this->plural_item = __('Transactions', 'event_espresso'); |
|
73 | 73 | |
74 | 74 | $this->_tables = array( |
75 | - 'TransactionTable'=>new EE_Primary_Table('esp_transaction','TXN_ID') |
|
75 | + 'TransactionTable'=>new EE_Primary_Table('esp_transaction', 'TXN_ID') |
|
76 | 76 | ); |
77 | 77 | $this->_fields = array( |
78 | 78 | 'TransactionTable'=>array( |
79 | - 'TXN_ID'=>new EE_Primary_Key_Int_Field('TXN_ID', __('Transaction ID','event_espresso')), |
|
80 | - 'TXN_timestamp'=>new EE_Datetime_Field('TXN_timestamp', __('date when transaction was created','event_espresso'), false, time(), $timezone ), |
|
81 | - 'TXN_total'=>new EE_Money_Field('TXN_total', __('Total value of Transaction','event_espresso'), false, 0), |
|
82 | - 'TXN_paid'=>new EE_Money_Field('TXN_paid', __('Amount paid towards transaction to date','event_espresso'), false, 0), |
|
83 | - 'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID','event_espresso'), false, EEM_Transaction::failed_status_code, 'Status'), |
|
84 | - 'TXN_session_data'=>new EE_Serialized_Text_Field('TXN_session_data', __('Serialized session data','event_espresso'), true, ''), |
|
85 | - 'TXN_hash_salt'=>new EE_Plain_Text_Field('TXN_hash_salt', __('Transaction Hash Salt','event_espresso'), true, ''), |
|
79 | + 'TXN_ID'=>new EE_Primary_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso')), |
|
80 | + 'TXN_timestamp'=>new EE_Datetime_Field('TXN_timestamp', __('date when transaction was created', 'event_espresso'), false, time(), $timezone), |
|
81 | + 'TXN_total'=>new EE_Money_Field('TXN_total', __('Total value of Transaction', 'event_espresso'), false, 0), |
|
82 | + 'TXN_paid'=>new EE_Money_Field('TXN_paid', __('Amount paid towards transaction to date', 'event_espresso'), false, 0), |
|
83 | + 'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID', 'event_espresso'), false, EEM_Transaction::failed_status_code, 'Status'), |
|
84 | + 'TXN_session_data'=>new EE_Serialized_Text_Field('TXN_session_data', __('Serialized session data', 'event_espresso'), true, ''), |
|
85 | + 'TXN_hash_salt'=>new EE_Plain_Text_Field('TXN_hash_salt', __('Transaction Hash Salt', 'event_espresso'), true, ''), |
|
86 | 86 | 'PMD_ID'=>new EE_Foreign_Key_Int_Field('PMD_ID', __("Last Used Payment Method", 'event_espresso'), true, NULL, 'Payment_Method'), |
87 | - 'TXN_reg_steps' => new EE_Serialized_Text_Field( 'TXN_reg_steps', __( 'Registration Steps', 'event_espresso' ), FALSE, array() ), |
|
87 | + 'TXN_reg_steps' => new EE_Serialized_Text_Field('TXN_reg_steps', __('Registration Steps', 'event_espresso'), FALSE, array()), |
|
88 | 88 | ) |
89 | 89 | ); |
90 | 90 | $this->_model_relations = array( |
91 | 91 | 'Registration'=>new EE_Has_Many_Relation(), |
92 | 92 | 'Payment'=>new EE_Has_Many_Relation(), |
93 | 93 | 'Status'=>new EE_Belongs_To_Relation(), |
94 | - 'Line_Item'=>new EE_Has_Many_Relation(false),//you can delete a transaction without needing to delete its line items |
|
94 | + 'Line_Item'=>new EE_Has_Many_Relation(false), //you can delete a transaction without needing to delete its line items |
|
95 | 95 | 'Payment_Method'=>new EE_Belongs_To_Relation(), |
96 | 96 | 'Message' => new EE_Has_Many_Relation() |
97 | 97 | ); |
98 | 98 | $this->_model_chain_to_wp_user = 'Registration.Event'; |
99 | - parent::__construct( $timezone ); |
|
99 | + parent::__construct($timezone); |
|
100 | 100 | |
101 | 101 | } |
102 | 102 | |
@@ -107,22 +107,22 @@ discard block |
||
107 | 107 | * @param string $period |
108 | 108 | * @return \stdClass[] |
109 | 109 | */ |
110 | - public function get_revenue_per_day_report( $period = '-1 month' ) { |
|
111 | - $sql_date = $this->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', strtotime( $period ) ), 'Y-m-d H:i:s', 'UTC' ); |
|
110 | + public function get_revenue_per_day_report($period = '-1 month') { |
|
111 | + $sql_date = $this->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', strtotime($period)), 'Y-m-d H:i:s', 'UTC'); |
|
112 | 112 | |
113 | - $query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'TXN_timestamp' ); |
|
113 | + $query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'TXN_timestamp'); |
|
114 | 114 | return $this->_get_all_wpdb_results( |
115 | 115 | array( |
116 | 116 | array( |
117 | - 'TXN_timestamp' => array( '>=', $sql_date ) |
|
117 | + 'TXN_timestamp' => array('>=', $sql_date) |
|
118 | 118 | ), |
119 | 119 | 'group_by' => 'txnDate', |
120 | - 'order_by' => array( 'TXN_timestamp' => 'ASC' ) |
|
120 | + 'order_by' => array('TXN_timestamp' => 'ASC') |
|
121 | 121 | ), |
122 | 122 | OBJECT, |
123 | 123 | array( |
124 | - 'txnDate' => array( 'DATE(' . $query_interval . ')', '%s' ), |
|
125 | - 'revenue' => array( 'SUM(TransactionTable.TXN_paid)', '%d' ) |
|
124 | + 'txnDate' => array('DATE('.$query_interval.')', '%s'), |
|
125 | + 'revenue' => array('SUM(TransactionTable.TXN_paid)', '%d') |
|
126 | 126 | ) |
127 | 127 | ); |
128 | 128 | } |
@@ -137,18 +137,18 @@ discard block |
||
137 | 137 | * @throws \EE_Error |
138 | 138 | * @return mixed |
139 | 139 | */ |
140 | - public function get_revenue_per_event_report( $period = '-1 month' ) { |
|
140 | + public function get_revenue_per_event_report($period = '-1 month') { |
|
141 | 141 | global $wpdb; |
142 | - $transaction_table = $wpdb->prefix . 'esp_transaction'; |
|
143 | - $registration_table = $wpdb->prefix . 'esp_registration'; |
|
142 | + $transaction_table = $wpdb->prefix.'esp_transaction'; |
|
143 | + $registration_table = $wpdb->prefix.'esp_registration'; |
|
144 | 144 | $event_table = $wpdb->posts; |
145 | - $payment_table = $wpdb->prefix . 'esp_payment'; |
|
146 | - $sql_date = date( 'Y-m-d H:i:s', strtotime( $period ) ); |
|
145 | + $payment_table = $wpdb->prefix.'esp_payment'; |
|
146 | + $sql_date = date('Y-m-d H:i:s', strtotime($period)); |
|
147 | 147 | $approved_payment_status = EEM_Payment::status_id_approved; |
148 | 148 | $extra_event_on_join = ''; |
149 | 149 | //exclude events not authored by user if permissions in effect |
150 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) { |
|
151 | - $extra_event_on_join = ' AND Event.post_author = ' . get_current_user_id(); |
|
150 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) { |
|
151 | + $extra_event_on_join = ' AND Event.post_author = '.get_current_user_id(); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return $wpdb->get_results( |
@@ -188,10 +188,10 @@ discard block |
||
188 | 188 | * @param string $reg_url_link |
189 | 189 | * @return EE_Transaction |
190 | 190 | */ |
191 | - public function get_transaction_from_reg_url_link( $reg_url_link = '' ){ |
|
192 | - return $this->get_one( array( |
|
191 | + public function get_transaction_from_reg_url_link($reg_url_link = '') { |
|
192 | + return $this->get_one(array( |
|
193 | 193 | array( |
194 | - 'Registration.REG_url_link' => ! empty( $reg_url_link ) ? $reg_url_link : EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' ) |
|
194 | + 'Registration.REG_url_link' => ! empty($reg_url_link) ? $reg_url_link : EE_Registry::instance()->REQ->get('e_reg_url_link', '') |
|
195 | 195 | ) |
196 | 196 | )); |
197 | 197 | } |
@@ -208,16 +208,16 @@ discard block |
||
208 | 208 | * @return boolean |
209 | 209 | * @throws \EE_Error |
210 | 210 | */ |
211 | - public function update_based_on_payments( $transaction_obj_or_id, $save_txn = TRUE ){ |
|
211 | + public function update_based_on_payments($transaction_obj_or_id, $save_txn = TRUE) { |
|
212 | 212 | EE_Error::doing_it_wrong( |
213 | - __CLASS__ . '::' . __FUNCTION__, |
|
214 | - sprintf( __( 'This method is deprecated. Please use "%s" instead', 'event_espresso' ), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()' ), |
|
213 | + __CLASS__.'::'.__FUNCTION__, |
|
214 | + sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'), 'EE_Transaction_Processor::update_transaction_and_registrations_after_checkout_or_payment()'), |
|
215 | 215 | '4.6.0' |
216 | 216 | ); |
217 | 217 | /** @type EE_Transaction_Processor $transaction_processor */ |
218 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
218 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
219 | 219 | return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment( |
220 | - $this->ensure_is_obj( $transaction_obj_or_id ) |
|
220 | + $this->ensure_is_obj($transaction_obj_or_id) |
|
221 | 221 | ); |
222 | 222 | } |
223 | 223 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | array( |
250 | 250 | 0 => array( |
251 | 251 | 'STS_ID' => EEM_Transaction::failed_status_code, |
252 | - 'TXN_timestamp' => array( '<', time() - $time_to_leave_alone ) |
|
252 | + 'TXN_timestamp' => array('<', time() - $time_to_leave_alone) |
|
253 | 253 | ) |
254 | 254 | ), |
255 | 255 | $time_to_leave_alone |
@@ -262,29 +262,29 @@ discard block |
||
262 | 262 | */ |
263 | 263 | $txn_ids = apply_filters( |
264 | 264 | 'FHEE__EEM_Transaction__delete_junk_transactions__transaction_ids_to_delete', |
265 | - EEM_Transaction::instance()->get_col( $ids_query, 'TXN_ID' ), |
|
265 | + EEM_Transaction::instance()->get_col($ids_query, 'TXN_ID'), |
|
266 | 266 | $time_to_leave_alone |
267 | 267 | ); |
268 | 268 | //now that we have the ids to delete |
269 | - if ( ! empty( $txn_ids ) && is_array( $txn_ids ) ) { |
|
269 | + if ( ! empty($txn_ids) && is_array($txn_ids)) { |
|
270 | 270 | // first, make sure these TXN's are removed the "ee_locked_transactions" array |
271 | - EEM_Transaction::unset_locked_transactions( $txn_ids ); |
|
271 | + EEM_Transaction::unset_locked_transactions($txn_ids); |
|
272 | 272 | // let's get deletin'... |
273 | 273 | // Why no wpdb->prepare? Because the data is trusted. |
274 | 274 | // We got the ids from the original query to get them FROM |
275 | 275 | // the db (which is sanitized) so no need to prepare them again. |
276 | - $query = ' |
|
276 | + $query = ' |
|
277 | 277 | DELETE |
278 | - FROM ' . $this->table() . ' |
|
278 | + FROM ' . $this->table().' |
|
279 | 279 | WHERE |
280 | - TXN_ID IN ( ' . implode( ",", $txn_ids ) . ')'; |
|
281 | - $deleted = $wpdb->query( $query ); |
|
280 | + TXN_ID IN ( ' . implode(",", $txn_ids).')'; |
|
281 | + $deleted = $wpdb->query($query); |
|
282 | 282 | } |
283 | - if ( $deleted ) { |
|
283 | + if ($deleted) { |
|
284 | 284 | /** |
285 | 285 | * Allows code to do something after the transactions have been deleted. |
286 | 286 | */ |
287 | - do_action( 'AHEE__EEM_Transaction__delete_junk_transactions__successful_deletion', $txn_ids ); |
|
287 | + do_action('AHEE__EEM_Transaction__delete_junk_transactions__successful_deletion', $txn_ids); |
|
288 | 288 | } |
289 | 289 | return $deleted; |
290 | 290 | } |
@@ -295,17 +295,17 @@ discard block |
||
295 | 295 | * @param array $transaction_IDs |
296 | 296 | * @return bool |
297 | 297 | */ |
298 | - public static function unset_locked_transactions( array $transaction_IDs ) { |
|
299 | - $locked_transactions = get_option( 'ee_locked_transactions', array() ); |
|
298 | + public static function unset_locked_transactions(array $transaction_IDs) { |
|
299 | + $locked_transactions = get_option('ee_locked_transactions', array()); |
|
300 | 300 | $update = false; |
301 | - foreach ( $transaction_IDs as $TXN_ID ) { |
|
302 | - if ( isset( $locked_transactions[ $TXN_ID ] ) ) { |
|
303 | - unset( $locked_transactions[ $TXN_ID ] ); |
|
301 | + foreach ($transaction_IDs as $TXN_ID) { |
|
302 | + if (isset($locked_transactions[$TXN_ID])) { |
|
303 | + unset($locked_transactions[$TXN_ID]); |
|
304 | 304 | $update = true; |
305 | 305 | } |
306 | 306 | } |
307 | - if ( $update ) { |
|
308 | - update_option( 'ee_locked_transactions', $locked_transactions ); |
|
307 | + if ($update) { |
|
308 | + update_option('ee_locked_transactions', $locked_transactions); |
|
309 | 309 | } |
310 | 310 | return $update; |
311 | 311 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public static function instance() { |
42 | 42 | // check if class object is instantiated |
43 | - if ( ! self::$_instance instanceof EE_Admin ) { |
|
43 | + if ( ! self::$_instance instanceof EE_Admin) { |
|
44 | 44 | self::$_instance = new self(); |
45 | 45 | } |
46 | 46 | return self::$_instance; |
@@ -57,30 +57,30 @@ discard block |
||
57 | 57 | // define global EE_Admin constants |
58 | 58 | $this->_define_all_constants(); |
59 | 59 | // set autoloaders for our admin page classes based on included path information |
60 | - EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( EE_ADMIN ); |
|
60 | + EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder(EE_ADMIN); |
|
61 | 61 | // admin hooks |
62 | - add_filter( 'plugin_action_links', array( $this, 'filter_plugin_actions' ), 10, 2 ); |
|
62 | + add_filter('plugin_action_links', array($this, 'filter_plugin_actions'), 10, 2); |
|
63 | 63 | // load EE_Request_Handler early |
64 | - add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'get_request' )); |
|
65 | - add_action( 'AHEE__EE_System__initialize_last', array( $this, 'init' )); |
|
64 | + add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'get_request')); |
|
65 | + add_action('AHEE__EE_System__initialize_last', array($this, 'init')); |
|
66 | 66 | // post shortcode tracking |
67 | 67 | add_action( |
68 | 68 | 'AHEE__EE_System__initialize_last', |
69 | - array( 'EventEspresso\core\admin\PostShortcodeTracking', 'set_hooks_admin' ) |
|
69 | + array('EventEspresso\core\admin\PostShortcodeTracking', 'set_hooks_admin') |
|
70 | 70 | ); |
71 | - add_action( 'AHEE__EE_Admin_Page__route_admin_request', array( $this, 'route_admin_request' ), 100, 2 ); |
|
72 | - add_action( 'wp_loaded', array( $this, 'wp_loaded' ), 100 ); |
|
73 | - add_action( 'admin_init', array( $this, 'admin_init' ), 100 ); |
|
74 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 20 ); |
|
75 | - add_action( 'admin_notices', array( $this, 'display_admin_notices' ), 10 ); |
|
76 | - add_action( 'network_admin_notices', array( $this, 'display_admin_notices' ), 10 ); |
|
77 | - add_filter( 'pre_update_option', array( $this, 'check_for_invalid_datetime_formats' ), 100, 2 ); |
|
78 | - add_filter('admin_footer_text', array( $this, 'espresso_admin_footer' )); |
|
71 | + add_action('AHEE__EE_Admin_Page__route_admin_request', array($this, 'route_admin_request'), 100, 2); |
|
72 | + add_action('wp_loaded', array($this, 'wp_loaded'), 100); |
|
73 | + add_action('admin_init', array($this, 'admin_init'), 100); |
|
74 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'), 20); |
|
75 | + add_action('admin_notices', array($this, 'display_admin_notices'), 10); |
|
76 | + add_action('network_admin_notices', array($this, 'display_admin_notices'), 10); |
|
77 | + add_filter('pre_update_option', array($this, 'check_for_invalid_datetime_formats'), 100, 2); |
|
78 | + add_filter('admin_footer_text', array($this, 'espresso_admin_footer')); |
|
79 | 79 | |
80 | 80 | //reset Environment config (we only do this on admin page loads); |
81 | 81 | EE_Registry::instance()->CFG->environment->recheck_values(); |
82 | 82 | |
83 | - do_action( 'AHEE__EE_Admin__loaded' ); |
|
83 | + do_action('AHEE__EE_Admin__loaded'); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | * @return void |
96 | 96 | */ |
97 | 97 | private function _define_all_constants() { |
98 | - define( 'EE_ADMIN_URL', EE_PLUGIN_DIR_URL . 'core/admin/' ); |
|
99 | - define( 'EE_ADMIN_PAGES_URL', EE_PLUGIN_DIR_URL . 'admin_pages/' ); |
|
100 | - define( 'EE_ADMIN_TEMPLATE', EE_ADMIN . 'templates' . DS ); |
|
101 | - define( 'WP_ADMIN_PATH', ABSPATH . 'wp-admin/' ); |
|
102 | - define( 'WP_AJAX_URL', admin_url( 'admin-ajax.php' )); |
|
98 | + define('EE_ADMIN_URL', EE_PLUGIN_DIR_URL.'core/admin/'); |
|
99 | + define('EE_ADMIN_PAGES_URL', EE_PLUGIN_DIR_URL.'admin_pages/'); |
|
100 | + define('EE_ADMIN_TEMPLATE', EE_ADMIN.'templates'.DS); |
|
101 | + define('WP_ADMIN_PATH', ABSPATH.'wp-admin/'); |
|
102 | + define('WP_AJAX_URL', admin_url('admin-ajax.php')); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -112,23 +112,23 @@ discard block |
||
112 | 112 | * @param string $plugin |
113 | 113 | * @return array |
114 | 114 | */ |
115 | - public function filter_plugin_actions( $links, $plugin ) { |
|
115 | + public function filter_plugin_actions($links, $plugin) { |
|
116 | 116 | // set $main_file in stone |
117 | 117 | static $main_file; |
118 | 118 | // if $main_file is not set yet |
119 | - if ( ! $main_file ) { |
|
120 | - $main_file = plugin_basename( EVENT_ESPRESSO_MAIN_FILE ); |
|
119 | + if ( ! $main_file) { |
|
120 | + $main_file = plugin_basename(EVENT_ESPRESSO_MAIN_FILE); |
|
121 | 121 | } |
122 | - if ( $plugin === $main_file ) { |
|
122 | + if ($plugin === $main_file) { |
|
123 | 123 | // compare current plugin to this one |
124 | - if ( EE_Maintenance_Mode::instance()->level() === EE_Maintenance_Mode::level_2_complete_maintenance ) { |
|
125 | - $maintenance_link = '<a href="admin.php?page=espresso_maintenance_settings" title="Event Espresso is in maintenance mode. Click this link to learn why.">' . __('Maintenance Mode Active', 'event_espresso' ) . '</a>'; |
|
126 | - array_unshift( $links, $maintenance_link ); |
|
124 | + if (EE_Maintenance_Mode::instance()->level() === EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
125 | + $maintenance_link = '<a href="admin.php?page=espresso_maintenance_settings" title="Event Espresso is in maintenance mode. Click this link to learn why.">'.__('Maintenance Mode Active', 'event_espresso').'</a>'; |
|
126 | + array_unshift($links, $maintenance_link); |
|
127 | 127 | } else { |
128 | - $org_settings_link = '<a href="admin.php?page=espresso_general_settings">' . __( 'Settings', 'event_espresso' ) . '</a>'; |
|
129 | - $events_link = '<a href="admin.php?page=espresso_events">' . __( 'Events', 'event_espresso' ) . '</a>'; |
|
128 | + $org_settings_link = '<a href="admin.php?page=espresso_general_settings">'.__('Settings', 'event_espresso').'</a>'; |
|
129 | + $events_link = '<a href="admin.php?page=espresso_events">'.__('Events', 'event_espresso').'</a>'; |
|
130 | 130 | // add before other links |
131 | - array_unshift( $links, $org_settings_link, $events_link ); |
|
131 | + array_unshift($links, $org_settings_link, $events_link); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | return $links; |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | * @return void |
144 | 144 | */ |
145 | 145 | public function get_request() { |
146 | - EE_Registry::instance()->load_core( 'Request_Handler' ); |
|
147 | - EE_Registry::instance()->load_core( 'CPT_Strategy' ); |
|
146 | + EE_Registry::instance()->load_core('Request_Handler'); |
|
147 | + EE_Registry::instance()->load_core('CPT_Strategy'); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -156,11 +156,11 @@ discard block |
||
156 | 156 | * @param array $admin_page_folder_names |
157 | 157 | * @return array |
158 | 158 | */ |
159 | - public function hide_admin_pages_except_maintenance_mode( $admin_page_folder_names = array() ){ |
|
159 | + public function hide_admin_pages_except_maintenance_mode($admin_page_folder_names = array()) { |
|
160 | 160 | return array( |
161 | - 'maintenance' => EE_ADMIN_PAGES . 'maintenance' . DS, |
|
162 | - 'about' => EE_ADMIN_PAGES . 'about' . DS, |
|
163 | - 'support' => EE_ADMIN_PAGES . 'support' . DS |
|
161 | + 'maintenance' => EE_ADMIN_PAGES.'maintenance'.DS, |
|
162 | + 'about' => EE_ADMIN_PAGES.'about'.DS, |
|
163 | + 'support' => EE_ADMIN_PAGES.'support'.DS |
|
164 | 164 | ); |
165 | 165 | } |
166 | 166 | |
@@ -174,31 +174,31 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function init() { |
176 | 176 | //only enable most of the EE_Admin IF we're not in full maintenance mode |
177 | - if ( EE_Maintenance_Mode::instance()->models_can_query() ){ |
|
177 | + if (EE_Maintenance_Mode::instance()->models_can_query()) { |
|
178 | 178 | //ok so we want to enable the entire admin |
179 | - add_action( 'wp_ajax_dismiss_ee_nag_notice', array( $this, 'dismiss_ee_nag_notice_callback' )); |
|
180 | - add_action( 'admin_notices', array( $this, 'get_persistent_admin_notices' ), 9 ); |
|
181 | - add_action( 'network_admin_notices', array( $this, 'get_persistent_admin_notices' ), 9 ); |
|
179 | + add_action('wp_ajax_dismiss_ee_nag_notice', array($this, 'dismiss_ee_nag_notice_callback')); |
|
180 | + add_action('admin_notices', array($this, 'get_persistent_admin_notices'), 9); |
|
181 | + add_action('network_admin_notices', array($this, 'get_persistent_admin_notices'), 9); |
|
182 | 182 | //at a glance dashboard widget |
183 | - add_filter( 'dashboard_glance_items', array( $this, 'dashboard_glance_items' ), 10 ); |
|
183 | + add_filter('dashboard_glance_items', array($this, 'dashboard_glance_items'), 10); |
|
184 | 184 | //filter for get_edit_post_link used on comments for custom post types |
185 | - add_filter( 'get_edit_post_link', array( $this, 'modify_edit_post_link' ), 10, 2 ); |
|
185 | + add_filter('get_edit_post_link', array($this, 'modify_edit_post_link'), 10, 2); |
|
186 | 186 | } |
187 | 187 | // run the admin page factory but ONLY if we are doing an ee admin ajax request |
188 | - if ( !defined('DOING_AJAX') || EE_ADMIN_AJAX ) { |
|
188 | + if ( ! defined('DOING_AJAX') || EE_ADMIN_AJAX) { |
|
189 | 189 | try { |
190 | 190 | //this loads the controller for the admin pages which will setup routing etc |
191 | - EE_Registry::instance()->load_core( 'Admin_Page_Loader' ); |
|
192 | - } catch ( EE_Error $e ) { |
|
191 | + EE_Registry::instance()->load_core('Admin_Page_Loader'); |
|
192 | + } catch (EE_Error $e) { |
|
193 | 193 | $e->get_error(); |
194 | 194 | } |
195 | 195 | } |
196 | - add_filter( 'content_save_pre', array( $this, 'its_eSpresso' ), 10, 1 ); |
|
196 | + add_filter('content_save_pre', array($this, 'its_eSpresso'), 10, 1); |
|
197 | 197 | //make sure our CPTs and custom taxonomy metaboxes get shown for first time users |
198 | - add_action('admin_head', array($this, 'enable_hidden_ee_nav_menu_metaboxes' ), 10 ); |
|
199 | - add_action('admin_head', array( $this, 'register_custom_nav_menu_boxes' ), 10 ); |
|
198 | + add_action('admin_head', array($this, 'enable_hidden_ee_nav_menu_metaboxes'), 10); |
|
199 | + add_action('admin_head', array($this, 'register_custom_nav_menu_boxes'), 10); |
|
200 | 200 | //exclude EE critical pages from all nav menus and wp_list_pages |
201 | - add_filter('nav_menu_meta_box_object', array( $this, 'remove_pages_from_nav_menu'), 10 ); |
|
201 | + add_filter('nav_menu_meta_box_object', array($this, 'remove_pages_from_nav_menu'), 10); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | |
@@ -211,9 +211,9 @@ discard block |
||
211 | 211 | * @param object $post_type WP post type object |
212 | 212 | * @return object WP post type object |
213 | 213 | */ |
214 | - public function remove_pages_from_nav_menu( $post_type ) { |
|
214 | + public function remove_pages_from_nav_menu($post_type) { |
|
215 | 215 | //if this isn't the "pages" post type let's get out |
216 | - if ( $post_type->name !== 'page' ) { |
|
216 | + if ($post_type->name !== 'page') { |
|
217 | 217 | return $post_type; |
218 | 218 | } |
219 | 219 | $critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array(); |
@@ -233,28 +233,28 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function enable_hidden_ee_nav_menu_metaboxes() { |
235 | 235 | global $wp_meta_boxes, $pagenow; |
236 | - if ( ! is_array($wp_meta_boxes) || $pagenow !== 'nav-menus.php' ) { |
|
236 | + if ( ! is_array($wp_meta_boxes) || $pagenow !== 'nav-menus.php') { |
|
237 | 237 | return; |
238 | 238 | } |
239 | 239 | $user = wp_get_current_user(); |
240 | 240 | //has this been done yet? |
241 | - if ( get_user_option( 'ee_nav_menu_initialized', $user->ID ) ) { |
|
241 | + if (get_user_option('ee_nav_menu_initialized', $user->ID)) { |
|
242 | 242 | return; |
243 | 243 | } |
244 | 244 | |
245 | - $hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus', $user->ID ); |
|
246 | - $initial_meta_boxes = apply_filters( 'FHEE__EE_Admin__enable_hidden_ee_nav_menu_boxes__initial_meta_boxes', array( 'nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category', 'add-espresso_events', 'add-espresso_venues', 'add-espresso_event_categories', 'add-espresso_venue_categories', 'add-post-type-post', 'add-post-type-page' ) ); |
|
245 | + $hidden_meta_boxes = get_user_option('metaboxhidden_nav-menus', $user->ID); |
|
246 | + $initial_meta_boxes = apply_filters('FHEE__EE_Admin__enable_hidden_ee_nav_menu_boxes__initial_meta_boxes', array('nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category', 'add-espresso_events', 'add-espresso_venues', 'add-espresso_event_categories', 'add-espresso_venue_categories', 'add-post-type-post', 'add-post-type-page')); |
|
247 | 247 | |
248 | - if ( is_array( $hidden_meta_boxes ) ) { |
|
249 | - foreach ( $hidden_meta_boxes as $key => $meta_box_id ) { |
|
250 | - if ( in_array( $meta_box_id, $initial_meta_boxes ) ) { |
|
251 | - unset( $hidden_meta_boxes[ $key ] ); |
|
248 | + if (is_array($hidden_meta_boxes)) { |
|
249 | + foreach ($hidden_meta_boxes as $key => $meta_box_id) { |
|
250 | + if (in_array($meta_box_id, $initial_meta_boxes)) { |
|
251 | + unset($hidden_meta_boxes[$key]); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | } |
255 | 255 | |
256 | - update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true ); |
|
257 | - update_user_option( $user->ID, 'ee_nav_menu_initialized', 1, true ); |
|
256 | + update_user_option($user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true); |
|
257 | + update_user_option($user->ID, 'ee_nav_menu_initialized', 1, true); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * @return void |
274 | 274 | */ |
275 | 275 | public function register_custom_nav_menu_boxes() { |
276 | - add_meta_box( 'add-extra-nav-menu-pages', __('Event Espresso Pages', 'event_espresso'), array( $this, 'ee_cpt_archive_pages' ), 'nav-menus', 'side', 'core' ); |
|
276 | + add_meta_box('add-extra-nav-menu-pages', __('Event Espresso Pages', 'event_espresso'), array($this, 'ee_cpt_archive_pages'), 'nav-menus', 'side', 'core'); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -289,16 +289,16 @@ discard block |
||
289 | 289 | * |
290 | 290 | * @return string the (maybe) modified link |
291 | 291 | */ |
292 | - public function modify_edit_post_link( $link, $id ) { |
|
293 | - if ( ! $post = get_post( $id ) ){ |
|
292 | + public function modify_edit_post_link($link, $id) { |
|
293 | + if ( ! $post = get_post($id)) { |
|
294 | 294 | return $link; |
295 | 295 | } |
296 | - if ( $post->post_type === 'espresso_attendees' ) { |
|
296 | + if ($post->post_type === 'espresso_attendees') { |
|
297 | 297 | $query_args = array( |
298 | 298 | 'action' => 'edit_attendee', |
299 | 299 | 'post' => $id |
300 | 300 | ); |
301 | - return EEH_URL::add_query_args_and_nonce( $query_args, admin_url('admin.php?page=espresso_registrations') ); |
|
301 | + return EEH_URL::add_query_args_and_nonce($query_args, admin_url('admin.php?page=espresso_registrations')); |
|
302 | 302 | } |
303 | 303 | return $link; |
304 | 304 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | global $nav_menu_selected_id; |
311 | 311 | |
312 | 312 | $db_fields = false; |
313 | - $walker = new Walker_Nav_Menu_Checklist( $db_fields ); |
|
313 | + $walker = new Walker_Nav_Menu_Checklist($db_fields); |
|
314 | 314 | $current_tab = 'event-archives'; |
315 | 315 | |
316 | 316 | /*if ( ! empty( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) { |
@@ -329,9 +329,9 @@ discard block |
||
329 | 329 | ?> |
330 | 330 | <div id="posttype-extra-nav-menu-pages" class="posttypediv"> |
331 | 331 | <ul id="posttype-extra-nav-menu-pages-tabs" class="posttype-tabs add-menu-item-tabs"> |
332 | - <li <?php echo ( 'event-archives' === $current_tab ? ' class="tabs"' : '' ); ?>> |
|
333 | - <a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ( $nav_menu_selected_id ) {echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args)));} ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives"> |
|
334 | - <?php _e( 'Event Archive Pages', 'event_espresso' ); ?> |
|
332 | + <li <?php echo ('event-archives' === $current_tab ? ' class="tabs"' : ''); ?>> |
|
333 | + <a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ($nav_menu_selected_id) {echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args))); } ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives"> |
|
334 | + <?php _e('Event Archive Pages', 'event_espresso'); ?> |
|
335 | 335 | </a> |
336 | 336 | </li> |
337 | 337 | <?php /* // temporarily removing but leaving skeleton in place in case we ever decide to add more tabs. |
@@ -349,13 +349,13 @@ discard block |
||
349 | 349 | <?php */ ?> |
350 | 350 | |
351 | 351 | <div id="tabs-panel-posttype-extra-nav-menu-pages-event-archives" class="tabs-panel <?php |
352 | - echo ( 'event-archives' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); |
|
352 | + echo ('event-archives' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive'); |
|
353 | 353 | ?>"> |
354 | 354 | <ul id="extra-nav-menu-pageschecklist-event-archives" class="categorychecklist form-no-clear"> |
355 | 355 | <?php |
356 | 356 | $pages = $this->_get_extra_nav_menu_pages_items(); |
357 | 357 | $args['walker'] = $walker; |
358 | - echo walk_nav_menu_tree( array_map( array( $this, '_setup_extra_nav_menu_pages_items' ), $pages), 0, (object) $args ); |
|
358 | + echo walk_nav_menu_tree(array_map(array($this, '_setup_extra_nav_menu_pages_items'), $pages), 0, (object) $args); |
|
359 | 359 | ?> |
360 | 360 | </ul> |
361 | 361 | </div><!-- /.tabs-panel --> |
@@ -363,18 +363,18 @@ discard block |
||
363 | 363 | <p class="button-controls"> |
364 | 364 | <span class="list-controls"> |
365 | 365 | <a href="<?php |
366 | - echo esc_url( add_query_arg( |
|
366 | + echo esc_url(add_query_arg( |
|
367 | 367 | array( |
368 | 368 | 'extra-nav-menu-pages-tab' => 'event-archives', |
369 | 369 | 'selectall' => 1, |
370 | 370 | ), |
371 | - remove_query_arg( $removed_args ) |
|
371 | + remove_query_arg($removed_args) |
|
372 | 372 | )); |
373 | 373 | ?>#posttype-extra-nav-menu-pages>" class="select-all"><?php _e('Select All'); ?></a> |
374 | 374 | </span> |
375 | 375 | |
376 | 376 | <span class="add-to-menu"> |
377 | - <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e( 'submit-posttype-extra-nav-menu-pages' ); ?>" /> |
|
377 | + <input type="submit"<?php wp_nav_menu_disabled_check($nav_menu_selected_id); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e(__('Add to Menu')); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e('submit-posttype-extra-nav-menu-pages'); ?>" /> |
|
378 | 378 | <span class="spinner"></span> |
379 | 379 | </span> |
380 | 380 | </p> |
@@ -395,10 +395,10 @@ discard block |
||
395 | 395 | private function _get_extra_nav_menu_pages_items() { |
396 | 396 | $menuitems[] = array( |
397 | 397 | 'title' => __('Event List', 'event_espresso'), |
398 | - 'url' => get_post_type_archive_link( 'espresso_events' ), |
|
398 | + 'url' => get_post_type_archive_link('espresso_events'), |
|
399 | 399 | 'description' => __('Archive page for all events.', 'event_espresso') |
400 | 400 | ); |
401 | - return apply_filters( 'FHEE__EE_Admin__get_extra_nav_menu_pages_items', $menuitems ); |
|
401 | + return apply_filters('FHEE__EE_Admin__get_extra_nav_menu_pages_items', $menuitems); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | * @param $menu_item_values |
411 | 411 | * @return stdClass |
412 | 412 | */ |
413 | - private function _setup_extra_nav_menu_pages_items( $menu_item_values ) { |
|
413 | + private function _setup_extra_nav_menu_pages_items($menu_item_values) { |
|
414 | 414 | $menu_item = new stdClass(); |
415 | 415 | $keys = array( |
416 | 416 | 'ID' => 0, |
@@ -430,8 +430,8 @@ discard block |
||
430 | 430 | 'xfn' => '' |
431 | 431 | ); |
432 | 432 | |
433 | - foreach ( $keys as $key => $value) { |
|
434 | - $menu_item->{$key} = isset( $menu_item_values[ $key]) ? $menu_item_values[ $key] : $value; |
|
433 | + foreach ($keys as $key => $value) { |
|
434 | + $menu_item->{$key} = isset($menu_item_values[$key]) ? $menu_item_values[$key] : $value; |
|
435 | 435 | } |
436 | 436 | return $menu_item; |
437 | 437 | } |
@@ -470,9 +470,9 @@ discard block |
||
470 | 470 | * - check if doing post processing of one of EE CPTs |
471 | 471 | * - instantiate the corresponding EE CPT model for the post_type being processed. |
472 | 472 | */ |
473 | - if ( isset( $_POST['action'], $_POST['post_type'] ) && $_POST['action'] === 'editpost' ) { |
|
474 | - EE_Registry::instance()->load_core( 'Register_CPTs' ); |
|
475 | - EE_Register_CPTs::instantiate_cpt_models( $_POST['post_type'] ); |
|
473 | + if (isset($_POST['action'], $_POST['post_type']) && $_POST['action'] === 'editpost') { |
|
474 | + EE_Registry::instance()->load_core('Register_CPTs'); |
|
475 | + EE_Register_CPTs::instantiate_cpt_models($_POST['post_type']); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | |
@@ -481,8 +481,8 @@ discard block |
||
481 | 481 | * 'options-reading.php' core WordPress admin settings page. This is for user-proofing. |
482 | 482 | */ |
483 | 483 | global $pagenow; |
484 | - if ( $pagenow === 'options-reading.php' ) { |
|
485 | - add_filter( 'wp_dropdown_pages', array( $this, 'modify_dropdown_pages' ) ); |
|
484 | + if ($pagenow === 'options-reading.php') { |
|
485 | + add_filter('wp_dropdown_pages', array($this, 'modify_dropdown_pages')); |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | } |
@@ -494,25 +494,25 @@ discard block |
||
494 | 494 | * @param string $output Current output. |
495 | 495 | * @return string |
496 | 496 | */ |
497 | - public function modify_dropdown_pages( $output ) { |
|
497 | + public function modify_dropdown_pages($output) { |
|
498 | 498 | //get critical pages |
499 | 499 | $critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array(); |
500 | 500 | |
501 | 501 | //split current output by line break for easier parsing. |
502 | - $split_output = explode( "\n", $output ); |
|
502 | + $split_output = explode("\n", $output); |
|
503 | 503 | |
504 | 504 | //loop through to remove any critical pages from the array. |
505 | - foreach ( $critical_pages as $page_id ) { |
|
506 | - $needle = 'value="' . $page_id . '"'; |
|
507 | - foreach( $split_output as $key => $haystack ) { |
|
508 | - if( strpos( $haystack, $needle ) !== false ) { |
|
509 | - unset( $split_output[$key] ); |
|
505 | + foreach ($critical_pages as $page_id) { |
|
506 | + $needle = 'value="'.$page_id.'"'; |
|
507 | + foreach ($split_output as $key => $haystack) { |
|
508 | + if (strpos($haystack, $needle) !== false) { |
|
509 | + unset($split_output[$key]); |
|
510 | 510 | } |
511 | 511 | } |
512 | 512 | } |
513 | 513 | |
514 | 514 | //replace output with the new contents |
515 | - return implode( "\n", $split_output ); |
|
515 | + return implode("\n", $split_output); |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | |
@@ -526,36 +526,36 @@ discard block |
||
526 | 526 | public function enqueue_admin_scripts() { |
527 | 527 | // this javascript is loaded on every admin page to catch any injections ee needs to add to wp run js. |
528 | 528 | // Note: the intention of this script is to only do TARGETED injections. I.E, only injecting on certain script calls. |
529 | - wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL . 'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
529 | + wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL.'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
530 | 530 | // register cookie script for future dependencies |
531 | - wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL . 'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE ); |
|
531 | + wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL.'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE); |
|
532 | 532 | // jquery_validate loading is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again via: add_filter( 'FHEE_load_jquery_validate', '__return_true' ); |
533 | - if ( apply_filters( 'FHEE_load_jquery_validate', FALSE ) ) { |
|
533 | + if (apply_filters('FHEE_load_jquery_validate', FALSE)) { |
|
534 | 534 | // register jQuery Validate |
535 | - wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js', array('jquery'), '1.15.0', TRUE); |
|
535 | + wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL.'scripts/jquery.validate.min.js', array('jquery'), '1.15.0', TRUE); |
|
536 | 536 | } |
537 | 537 | //joyride is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again vai: add_filter('FHEE_load_joyride', '__return_true' ); |
538 | - if ( apply_filters( 'FHEE_load_joyride', FALSE ) ) { |
|
538 | + if (apply_filters('FHEE_load_joyride', FALSE)) { |
|
539 | 539 | //joyride style |
540 | - wp_register_style('joyride-css', EE_THIRD_PARTY_URL . 'joyride/joyride-2.1.css', array(), '2.1'); |
|
541 | - wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL . 'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION ); |
|
542 | - wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL . 'joyride/modernizr.mq.js', array(), '2.1', TRUE ); |
|
540 | + wp_register_style('joyride-css', EE_THIRD_PARTY_URL.'joyride/joyride-2.1.css', array(), '2.1'); |
|
541 | + wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL.'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION); |
|
542 | + wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL.'joyride/modernizr.mq.js', array(), '2.1', TRUE); |
|
543 | 543 | //joyride JS |
544 | - wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL . 'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE ); |
|
544 | + wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL.'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE); |
|
545 | 545 | // wanna go for a joyride? |
546 | 546 | wp_enqueue_style('ee-joyride-css'); |
547 | 547 | wp_enqueue_script('jquery-joyride'); |
548 | 548 | } |
549 | 549 | //qtip is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtips', '__return_true' ); |
550 | - if ( apply_filters( 'FHEE_load_qtip', FALSE ) ) { |
|
550 | + if (apply_filters('FHEE_load_qtip', FALSE)) { |
|
551 | 551 | EEH_Qtip_Loader::instance()->register_and_enqueue(); |
552 | 552 | } |
553 | 553 | //accounting.js library |
554 | 554 | // @link http://josscrowcroft.github.io/accounting.js/ |
555 | - if ( apply_filters( 'FHEE_load_accounting_js', FALSE ) ) { |
|
556 | - wp_register_script( 'ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
557 | - wp_register_script( 'ee-accounting-core', EE_THIRD_PARTY_URL . 'accounting/accounting.js', array('underscore'), '0.3.2', TRUE ); |
|
558 | - wp_enqueue_script( 'ee-accounting' ); |
|
555 | + if (apply_filters('FHEE_load_accounting_js', FALSE)) { |
|
556 | + wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL.'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE); |
|
557 | + wp_register_script('ee-accounting-core', EE_THIRD_PARTY_URL.'accounting/accounting.js', array('underscore'), '0.3.2', TRUE); |
|
558 | + wp_enqueue_script('ee-accounting'); |
|
559 | 559 | // array of settings to get converted to JSON array via wp_localize_script |
560 | 560 | $currency_config = array( |
561 | 561 | 'currency' => array( |
@@ -602,11 +602,11 @@ discard block |
||
602 | 602 | public function get_persistent_admin_notices() { |
603 | 603 | // http://www.example.com/wp-admin/admin.php?page=espresso_general_settings&action=critical_pages&critical_pages_nonce=2831ce0f30 |
604 | 604 | $args = array( |
605 | - 'page' => EE_Registry::instance()->REQ->is_set( 'page' ) ? EE_Registry::instance()->REQ->get( 'page' ) : '', |
|
606 | - 'action' => EE_Registry::instance()->REQ->is_set( 'action' ) ? EE_Registry::instance()->REQ->get( 'action' ) : '', |
|
605 | + 'page' => EE_Registry::instance()->REQ->is_set('page') ? EE_Registry::instance()->REQ->get('page') : '', |
|
606 | + 'action' => EE_Registry::instance()->REQ->is_set('action') ? EE_Registry::instance()->REQ->get('action') : '', |
|
607 | 607 | ); |
608 | - $return_url = EE_Admin_Page::add_query_args_and_nonce( $args, EE_ADMIN_URL ); |
|
609 | - echo EE_Error::get_persistent_admin_notices( $return_url ); |
|
608 | + $return_url = EE_Admin_Page::add_query_args_and_nonce($args, EE_ADMIN_URL); |
|
609 | + echo EE_Error::get_persistent_admin_notices($return_url); |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | |
@@ -627,26 +627,26 @@ discard block |
||
627 | 627 | * @param $elements |
628 | 628 | * @return array |
629 | 629 | */ |
630 | - public function dashboard_glance_items( $elements ) { |
|
630 | + public function dashboard_glance_items($elements) { |
|
631 | 631 | $events = EEM_Event::instance()->count(); |
632 | - $items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_events'), admin_url('admin.php') ); |
|
633 | - $items['events']['text'] = sprintf( _n( '%s Event', '%s Events', $events ), number_format_i18n( $events ) ); |
|
632 | + $items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events'), admin_url('admin.php')); |
|
633 | + $items['events']['text'] = sprintf(_n('%s Event', '%s Events', $events), number_format_i18n($events)); |
|
634 | 634 | $items['events']['title'] = __('Click to view all Events', 'event_espresso'); |
635 | 635 | $registrations = EEM_Registration::instance()->count( |
636 | 636 | array( |
637 | 637 | array( |
638 | - 'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete ) |
|
638 | + 'STS_ID' => array('!=', EEM_Registration::status_id_incomplete) |
|
639 | 639 | ) |
640 | 640 | ) |
641 | 641 | ); |
642 | - $items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_registrations' ), admin_url('admin.php') ); |
|
643 | - $items['registrations']['text'] = sprintf( _n( '%s Registration', '%s Registrations', $registrations ), number_format_i18n($registrations) ); |
|
642 | + $items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_registrations'), admin_url('admin.php')); |
|
643 | + $items['registrations']['text'] = sprintf(_n('%s Registration', '%s Registrations', $registrations), number_format_i18n($registrations)); |
|
644 | 644 | $items['registrations']['title'] = __('Click to view all registrations', 'event_espresso'); |
645 | 645 | |
646 | - $items = apply_filters( 'FHEE__EE_Admin__dashboard_glance_items__items', $items ); |
|
646 | + $items = apply_filters('FHEE__EE_Admin__dashboard_glance_items__items', $items); |
|
647 | 647 | |
648 | - foreach ( $items as $type => $item_properties ) { |
|
649 | - $elements[] = sprintf( '<a class="ee-dashboard-link-' . $type . '" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text'] ); |
|
648 | + foreach ($items as $type => $item_properties) { |
|
649 | + $elements[] = sprintf('<a class="ee-dashboard-link-'.$type.'" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text']); |
|
650 | 650 | } |
651 | 651 | return $elements; |
652 | 652 | } |
@@ -663,31 +663,31 @@ discard block |
||
663 | 663 | * @throws EE_Error |
664 | 664 | * @return string |
665 | 665 | */ |
666 | - public function check_for_invalid_datetime_formats( $value, $option ) { |
|
666 | + public function check_for_invalid_datetime_formats($value, $option) { |
|
667 | 667 | // check for date_format or time_format |
668 | - switch ( $option ) { |
|
668 | + switch ($option) { |
|
669 | 669 | case 'date_format' : |
670 | - $date_time_format = $value . ' ' . get_option('time_format'); |
|
670 | + $date_time_format = $value.' '.get_option('time_format'); |
|
671 | 671 | break; |
672 | 672 | case 'time_format' : |
673 | - $date_time_format = get_option('date_format') . ' ' . $value; |
|
673 | + $date_time_format = get_option('date_format').' '.$value; |
|
674 | 674 | break; |
675 | 675 | default : |
676 | 676 | $date_time_format = FALSE; |
677 | 677 | } |
678 | 678 | // do we have a date_time format to check ? |
679 | - if ( $date_time_format ) { |
|
680 | - $error_msg = EEH_DTT_Helper::validate_format_string( $date_time_format ); |
|
679 | + if ($date_time_format) { |
|
680 | + $error_msg = EEH_DTT_Helper::validate_format_string($date_time_format); |
|
681 | 681 | |
682 | - if ( is_array( $error_msg ) ) { |
|
683 | - $msg = '<p>' . sprintf( __( 'The following date time "%s" ( %s ) is difficult to be properly parsed by PHP for the following reasons:', 'event_espresso' ), date( $date_time_format ) , $date_time_format ) . '</p><p><ul>'; |
|
682 | + if (is_array($error_msg)) { |
|
683 | + $msg = '<p>'.sprintf(__('The following date time "%s" ( %s ) is difficult to be properly parsed by PHP for the following reasons:', 'event_espresso'), date($date_time_format), $date_time_format).'</p><p><ul>'; |
|
684 | 684 | |
685 | 685 | |
686 | - foreach ( $error_msg as $error ) { |
|
687 | - $msg .= '<li>' . $error . '</li>'; |
|
686 | + foreach ($error_msg as $error) { |
|
687 | + $msg .= '<li>'.$error.'</li>'; |
|
688 | 688 | } |
689 | 689 | |
690 | - $msg .= '</ul></p><p>' . sprintf( __( '%sPlease note that your date and time formats have been reset to "F j, Y" and "g:i a" respectively.%s', 'event_espresso' ), '<span style="color:#D54E21;">', '</span>' ) . '</p>'; |
|
690 | + $msg .= '</ul></p><p>'.sprintf(__('%sPlease note that your date and time formats have been reset to "F j, Y" and "g:i a" respectively.%s', 'event_espresso'), '<span style="color:#D54E21;">', '</span>').'</p>'; |
|
691 | 691 | |
692 | 692 | // trigger WP settings error |
693 | 693 | add_settings_error( |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | ); |
698 | 698 | |
699 | 699 | // set format to something valid |
700 | - switch ( $option ) { |
|
700 | + switch ($option) { |
|
701 | 701 | case 'date_format' : |
702 | 702 | $value = 'F j, Y'; |
703 | 703 | break; |
@@ -719,8 +719,8 @@ discard block |
||
719 | 719 | * @param $content |
720 | 720 | * @return string |
721 | 721 | */ |
722 | - public function its_eSpresso( $content ) { |
|
723 | - return str_replace( '[EXPRESSO_', '[ESPRESSO_', $content ); |
|
722 | + public function its_eSpresso($content) { |
|
723 | + return str_replace('[EXPRESSO_', '[ESPRESSO_', $content); |
|
724 | 724 | } |
725 | 725 | |
726 | 726 | |
@@ -733,9 +733,9 @@ discard block |
||
733 | 733 | */ |
734 | 734 | public function espresso_admin_footer() { |
735 | 735 | return sprintf( |
736 | - __( 'Event Registration and Ticketing Powered by %sEvent Registration Powered by Event Espresso%s', 'event_espresso' ), |
|
736 | + __('Event Registration and Ticketing Powered by %sEvent Registration Powered by Event Espresso%s', 'event_espresso'), |
|
737 | 737 | '<a href="https://eventespresso.com/" title="', |
738 | - '">' . EVENT_ESPRESSO_POWERED_BY . '</a>' |
|
738 | + '">'.EVENT_ESPRESSO_POWERED_BY.'</a>' |
|
739 | 739 | ); |
740 | 740 | } |
741 | 741 | |
@@ -755,12 +755,12 @@ discard block |
||
755 | 755 | * @param array $config |
756 | 756 | * @return void |
757 | 757 | */ |
758 | - public static function register_ee_admin_page( $page_basename, $page_path, $config = array() ) { |
|
759 | - EE_Error::doing_it_wrong( __METHOD__, sprintf( __('Usage is deprecated. Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3' ); |
|
760 | - if ( class_exists( 'EE_Register_Admin_Page' ) ) { |
|
758 | + public static function register_ee_admin_page($page_basename, $page_path, $config = array()) { |
|
759 | + EE_Error::doing_it_wrong(__METHOD__, sprintf(__('Usage is deprecated. Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3'); |
|
760 | + if (class_exists('EE_Register_Admin_Page')) { |
|
761 | 761 | $config['page_path'] = $page_path; |
762 | 762 | } |
763 | - EE_Register_Admin_Page::register( $page_basename, $config ); |
|
763 | + EE_Register_Admin_Page::register($page_basename, $config); |
|
764 | 764 | |
765 | 765 | } |
766 | 766 | |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | * @param \WP_Post $post |
774 | 774 | * @return void |
775 | 775 | */ |
776 | - public static function parse_post_content_on_save( $post_ID, $post ) { |
|
776 | + public static function parse_post_content_on_save($post_ID, $post) { |
|
777 | 777 | EE_Error::doing_it_wrong( |
778 | 778 | __METHOD__, |
779 | 779 | __( |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | ), |
783 | 783 | '4.8.41' |
784 | 784 | ); |
785 | - EventEspresso\core\admin\PostShortcodeTracking::parse_post_content_on_save( $post_ID, $post ); |
|
785 | + EventEspresso\core\admin\PostShortcodeTracking::parse_post_content_on_save($post_ID, $post); |
|
786 | 786 | } |
787 | 787 | |
788 | 788 | |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | * @param $value |
796 | 796 | * @return void |
797 | 797 | */ |
798 | - public function reset_page_for_posts_on_change( $option, $old_value, $value ) { |
|
798 | + public function reset_page_for_posts_on_change($option, $old_value, $value) { |
|
799 | 799 | EE_Error::doing_it_wrong( |
800 | 800 | __METHOD__, |
801 | 801 | __( |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | ), |
805 | 805 | '4.8.41' |
806 | 806 | ); |
807 | - EventEspresso\core\admin\PostShortcodeTracking::reset_page_for_posts_on_change( $option, $old_value, $value ); |
|
807 | + EventEspresso\core\admin\PostShortcodeTracking::reset_page_for_posts_on_change($option, $old_value, $value); |
|
808 | 808 | } |
809 | 809 | |
810 | 810 | } |
@@ -167,11 +167,11 @@ discard block |
||
167 | 167 | |
168 | 168 | |
169 | 169 | /** |
170 | - * init- should fire after shortcode, module, addon, other plugin (default priority), and even EE_Front_Controller's init phases have run |
|
171 | - * |
|
172 | - * @access public |
|
173 | - * @return void |
|
174 | - */ |
|
170 | + * init- should fire after shortcode, module, addon, other plugin (default priority), and even EE_Front_Controller's init phases have run |
|
171 | + * |
|
172 | + * @access public |
|
173 | + * @return void |
|
174 | + */ |
|
175 | 175 | public function init() { |
176 | 176 | //only enable most of the EE_Admin IF we're not in full maintenance mode |
177 | 177 | if ( EE_Maintenance_Mode::instance()->models_can_query() ){ |
@@ -456,11 +456,11 @@ discard block |
||
456 | 456 | |
457 | 457 | |
458 | 458 | /** |
459 | - * admin_init |
|
460 | - * |
|
461 | - * @access public |
|
462 | - * @return void |
|
463 | - */ |
|
459 | + * admin_init |
|
460 | + * |
|
461 | + * @access public |
|
462 | + * @return void |
|
463 | + */ |
|
464 | 464 | public function admin_init() { |
465 | 465 | |
466 | 466 | /** |
@@ -612,11 +612,11 @@ discard block |
||
612 | 612 | |
613 | 613 | |
614 | 614 | /** |
615 | - * dismiss_persistent_admin_notice |
|
616 | - * |
|
617 | - * @access public |
|
618 | - * @return void |
|
619 | - */ |
|
615 | + * dismiss_persistent_admin_notice |
|
616 | + * |
|
617 | + * @access public |
|
618 | + * @return void |
|
619 | + */ |
|
620 | 620 | public function dismiss_ee_nag_notice_callback() { |
621 | 621 | EE_Error::dismiss_persistent_admin_notice(); |
622 | 622 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' )) { exit( 'No direct script access allowed' ); } |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * Class EE_Select_Reveal_Input |
4 | 4 | * |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @since 4.6 |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Select_Reveal_Input extends EE_Select_Input{ |
|
14 | +class EE_Select_Reveal_Input extends EE_Select_Input { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @param array $answer_options Array keys which match a sibling section's name |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @param array $input_settings |
28 | 28 | */ |
29 | - public function __construct( $answer_options, $input_settings = array() ){ |
|
30 | - parent::__construct( $answer_options, $input_settings ); |
|
29 | + public function __construct($answer_options, $input_settings = array()) { |
|
30 | + parent::__construct($answer_options, $input_settings); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function sibling_sections_controlled() { |
38 | 38 | $sibling_sections = array(); |
39 | - foreach( $this->options() as $sibling_section_name => $sibling_section ) { |
|
39 | + foreach ($this->options() as $sibling_section_name => $sibling_section) { |
|
40 | 40 | //if it's an empty string just leave it alone |
41 | - if( empty( $sibling_section_name ) ) { |
|
41 | + if (empty($sibling_section_name)) { |
|
42 | 42 | continue; |
43 | 43 | } |
44 | - $sibling_section = $this->find_section_from_path( '../' . $sibling_section_name ); |
|
45 | - if( |
|
44 | + $sibling_section = $this->find_section_from_path('../'.$sibling_section_name); |
|
45 | + if ( |
|
46 | 46 | $sibling_section instanceof EE_Form_Section_Base |
47 | - && ! empty( $sibling_section_name ) |
|
47 | + && ! empty($sibling_section_name) |
|
48 | 48 | ) { |
49 | - $sibling_sections[ $sibling_section_name ] = $sibling_section; |
|
49 | + $sibling_sections[$sibling_section_name] = $sibling_section; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | return $sibling_sections; |
@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | * @param array $form_other_js_data |
60 | 60 | * @return array |
61 | 61 | */ |
62 | - public function get_other_js_data( $form_other_js_data = array() ) { |
|
63 | - $form_other_js_data = parent::get_other_js_data( $form_other_js_data ); |
|
64 | - if( ! isset($form_other_js_data[ 'select_reveal_inputs' ] ) ) { |
|
65 | - $form_other_js_data[ 'select_reveal_inputs' ] = array(); |
|
62 | + public function get_other_js_data($form_other_js_data = array()) { |
|
63 | + $form_other_js_data = parent::get_other_js_data($form_other_js_data); |
|
64 | + if ( ! isset($form_other_js_data['select_reveal_inputs'])) { |
|
65 | + $form_other_js_data['select_reveal_inputs'] = array(); |
|
66 | 66 | } |
67 | 67 | $sibling_input_to_html_id_map = array(); |
68 | - foreach( $this->sibling_sections_controlled() as $sibling_section_path => $sibling_section ) { |
|
69 | - $sibling_input_to_html_id_map[ $sibling_section_path ] = $sibling_section->html_id(); |
|
68 | + foreach ($this->sibling_sections_controlled() as $sibling_section_path => $sibling_section) { |
|
69 | + $sibling_input_to_html_id_map[$sibling_section_path] = $sibling_section->html_id(); |
|
70 | 70 | } |
71 | - $form_other_js_data[ 'select_reveal_inputs' ][ $this->html_id() ] = $sibling_input_to_html_id_map; |
|
71 | + $form_other_js_data['select_reveal_inputs'][$this->html_id()] = $sibling_input_to_html_id_map; |
|
72 | 72 | return $form_other_js_data; |
73 | 73 | } |
74 | 74 |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | * |
14 | 14 | * @return string |
15 | 15 | */ |
16 | - public function layout_form_begin( $additional_args = array() ) { |
|
16 | + public function layout_form_begin($additional_args = array()) { |
|
17 | 17 | $this->_form_section->set_html_class('form-table'); |
18 | - return parent::layout_form_begin( $additional_args ); |
|
18 | + return parent::layout_form_begin($additional_args); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | * @param EE_Form_Section_Proper $form_section |
26 | 26 | * @return string |
27 | 27 | */ |
28 | - public function layout_subsection( $form_section ){ |
|
29 | - if ( $form_section instanceof EE_Form_Section_Proper ) { |
|
30 | - return EEH_HTML::no_row( $form_section->get_html(), 2 ); |
|
31 | - } else if ( $form_section instanceof EE_Form_Section_HTML ) { |
|
28 | + public function layout_subsection($form_section) { |
|
29 | + if ($form_section instanceof EE_Form_Section_Proper) { |
|
30 | + return EEH_HTML::no_row($form_section->get_html(), 2); |
|
31 | + } else if ($form_section instanceof EE_Form_Section_HTML) { |
|
32 | 32 | return $form_section->get_html(); |
33 | 33 | } |
34 | 34 | return ''; |
@@ -41,30 +41,30 @@ discard block |
||
41 | 41 | * @param EE_Form_Input_Base $input |
42 | 42 | * @return string |
43 | 43 | */ |
44 | - public function layout_input( $input ) { |
|
44 | + public function layout_input($input) { |
|
45 | 45 | |
46 | 46 | if ( |
47 | 47 | $input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy || |
48 | 48 | $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy || |
49 | 49 | $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy |
50 | 50 | ) { |
51 | - $input->set_html_class( $input->html_class() . ' large-text' ); |
|
51 | + $input->set_html_class($input->html_class().' large-text'); |
|
52 | 52 | } |
53 | - if ( $input instanceof EE_Text_Area_Input ) { |
|
54 | - $input->set_rows( 4 ); |
|
55 | - $input->set_cols( 60 ); |
|
53 | + if ($input instanceof EE_Text_Area_Input) { |
|
54 | + $input->set_rows(4); |
|
55 | + $input->set_cols(60); |
|
56 | 56 | } |
57 | 57 | $input_html = $input->get_html_for_input(); |
58 | 58 | // maybe add errors and help text ? |
59 | - $input_html .= $input->get_html_for_errors() != '' ? EEH_HTML::nl() . $input->get_html_for_errors() : ''; |
|
60 | - $input_html .= $input->get_html_for_help() != '' ? EEH_HTML::nl() . $input->get_html_for_help() : ''; |
|
59 | + $input_html .= $input->get_html_for_errors() != '' ? EEH_HTML::nl().$input->get_html_for_errors() : ''; |
|
60 | + $input_html .= $input->get_html_for_help() != '' ? EEH_HTML::nl().$input->get_html_for_help() : ''; |
|
61 | 61 | //overriding parent to add wp admin specific things. |
62 | 62 | $html = ''; |
63 | - if ( $input instanceof EE_Hidden_Input ) { |
|
64 | - $html .= EEH_HTML::no_row( $input->get_html_for_input(), 2 ); |
|
63 | + if ($input instanceof EE_Hidden_Input) { |
|
64 | + $html .= EEH_HTML::no_row($input->get_html_for_input(), 2); |
|
65 | 65 | } else { |
66 | 66 | $html .= EEH_HTML::tr( |
67 | - EEH_HTML::th( $input->get_html_for_label(), '', '', '', 'scope="row"' ) . EEH_HTML::td( $input_html ) |
|
67 | + EEH_HTML::th($input->get_html_for_label(), '', '', '', 'scope="row"').EEH_HTML::td($input_html) |
|
68 | 68 | ); |
69 | 69 | } |
70 | 70 | return $html; |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class EE_Two_Column_Layout extends EE_Form_Section_Layout_Base{ |
|
3 | +class EE_Two_Column_Layout extends EE_Form_Section_Layout_Base { |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Should be used to start teh form section (Eg a table tag, or a div tag, etc.) |
7 | 7 | * @param array $additional_args |
8 | 8 | * @return string |
9 | 9 | */ |
10 | - public function layout_form_begin( $additional_args = array() ) { |
|
11 | - return EEH_HTML::table( '', $this->_form_section->html_id(), $this->_form_section->html_class(), $this->_form_section->html_style() ) . EEH_HTML::tbody(); |
|
10 | + public function layout_form_begin($additional_args = array()) { |
|
11 | + return EEH_HTML::table('', $this->_form_section->html_id(), $this->_form_section->html_class(), $this->_form_section->html_style()).EEH_HTML::tbody(); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | * @param array $additional_args |
19 | 19 | * @return string |
20 | 20 | */ |
21 | - public function layout_form_end( $additional_args = array() ) { |
|
22 | - return EEH_HTML::tbodyx() . EEH_HTML::tablex( $this->_form_section->html_id() ); |
|
21 | + public function layout_form_end($additional_args = array()) { |
|
22 | + return EEH_HTML::tbodyx().EEH_HTML::tablex($this->_form_section->html_id()); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | * @param EE_Form_Input_Base $input |
30 | 30 | * @return string |
31 | 31 | */ |
32 | - public function layout_input( $input ) { |
|
32 | + public function layout_input($input) { |
|
33 | 33 | $html = ''; |
34 | - if ( $input instanceof EE_Hidden_Input ) { |
|
34 | + if ($input instanceof EE_Hidden_Input) { |
|
35 | 35 | $html .= $input->get_html_for_input(); |
36 | 36 | } else { |
37 | 37 | $html_for_input = $input->get_html_for_input(); |
38 | - $html_for_input .= $input->get_html_for_errors() != '' ? EEH_HTML::nl() . $input->get_html_for_errors() : ''; |
|
39 | - $html_for_input .= $input->get_html_for_help() != '' ? EEH_HTML::nl() . $input->get_html_for_help() : ''; |
|
38 | + $html_for_input .= $input->get_html_for_errors() != '' ? EEH_HTML::nl().$input->get_html_for_errors() : ''; |
|
39 | + $html_for_input .= $input->get_html_for_help() != '' ? EEH_HTML::nl().$input->get_html_for_help() : ''; |
|
40 | 40 | $html .= EEH_HTML::tr( |
41 | - EEH_HTML::th( $input->get_html_for_label() ) . |
|
42 | - EEH_HTML::td( $html_for_input ) |
|
41 | + EEH_HTML::th($input->get_html_for_label()). |
|
42 | + EEH_HTML::td($html_for_input) |
|
43 | 43 | ); |
44 | 44 | } |
45 | 45 | return $html; |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | * @param EE_Form_Section_Proper $form_section |
53 | 53 | * @return string |
54 | 54 | */ |
55 | - public function layout_subsection( $form_section ){ |
|
55 | + public function layout_subsection($form_section) { |
|
56 | 56 | $html = ''; |
57 | - if ( $form_section instanceof EE_Form_Section_HTML ) { |
|
57 | + if ($form_section instanceof EE_Form_Section_HTML) { |
|
58 | 58 | $html .= $form_section->get_html(); |
59 | 59 | } else { |
60 | 60 | $html .= EEH_HTML::tr( |
61 | - EEH_HTML::td( $form_section->get_html(), '', '', '', 'colspan="2"' ) |
|
61 | + EEH_HTML::td($form_section->get_html(), '', '', '', 'colspan="2"') |
|
62 | 62 | ); |
63 | 63 | } |
64 | 64 | return $html; |
@@ -26,31 +26,31 @@ discard block |
||
26 | 26 | * @param EE_Form_Input_Base $input |
27 | 27 | * @return string |
28 | 28 | */ |
29 | - public function layout_input( $input ) { |
|
29 | + public function layout_input($input) { |
|
30 | 30 | $html = ''; |
31 | - if ( $input instanceof EE_Hidden_Input ) { |
|
32 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
33 | - } else if ( $input instanceof EE_Submit_Input ) { |
|
31 | + if ($input instanceof EE_Hidden_Input) { |
|
32 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
33 | + } else if ($input instanceof EE_Submit_Input) { |
|
34 | 34 | $html .= EEH_HTML::br(); |
35 | 35 | $html .= $input->get_html_for_input(); |
36 | - } else if ( $input instanceof EE_Select_Input ) { |
|
36 | + } else if ($input instanceof EE_Select_Input) { |
|
37 | 37 | $html .= EEH_HTML::br(); |
38 | - $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
39 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
40 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
41 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
38 | + $html .= EEH_HTML::nl(1).$input->get_html_for_label(); |
|
39 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
40 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
41 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
42 | 42 | $html .= EEH_HTML::br(); |
43 | - } else if ( $input instanceof EE_Form_Input_With_Options_Base ) { |
|
43 | + } else if ($input instanceof EE_Form_Input_With_Options_Base) { |
|
44 | 44 | $html .= EEH_HTML::br(); |
45 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
46 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
47 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
45 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
46 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
47 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
48 | 48 | } else { |
49 | 49 | $html .= EEH_HTML::br(); |
50 | - $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
51 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
52 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
53 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
50 | + $html .= EEH_HTML::nl(1).$input->get_html_for_label(); |
|
51 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
52 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
53 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
54 | 54 | } |
55 | 55 | $html .= EEH_HTML::nl(-1); |
56 | 56 | return $html; |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | * @param EE_Form_Section_Proper $form_section |
64 | 64 | * @return string |
65 | 65 | */ |
66 | - public function layout_subsection( $form_section ){ |
|
66 | + public function layout_subsection($form_section) { |
|
67 | 67 | // d( $form_section ); |
68 | - return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1); |
|
68 | + return EEH_HTML::nl(1).$form_section->get_html().EEH_HTML::nl(-1); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * closing div tag for a form |
74 | 74 | * @return string |
75 | 75 | */ |
76 | - public function layout_form_end(){ |
|
76 | + public function layout_form_end() { |
|
77 | 77 | return EEH_HTML::nl(-1); |
78 | 78 | } |
79 | 79 | } |
80 | 80 | \ No newline at end of file |
@@ -10,14 +10,14 @@ discard block |
||
10 | 10 | * @since 4.6.0 |
11 | 11 | * |
12 | 12 | */ |
13 | -class EE_Div_Per_Section_Layout extends EE_Form_Section_Layout_Base{ |
|
13 | +class EE_Div_Per_Section_Layout extends EE_Form_Section_Layout_Base { |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * opening div tag for a form |
17 | 17 | * @return string |
18 | 18 | */ |
19 | 19 | public function layout_form_begin() { |
20 | - return EEH_HTML::div( '', $this->_form_section->html_id(), $this->_form_section->html_class(), $this->_form_section->html_style() ); |
|
20 | + return EEH_HTML::div('', $this->_form_section->html_id(), $this->_form_section->html_class(), $this->_form_section->html_style()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
@@ -26,38 +26,38 @@ discard block |
||
26 | 26 | * @param EE_Form_Input_Base $input |
27 | 27 | * @return string |
28 | 28 | */ |
29 | - public function layout_input( $input ) { |
|
29 | + public function layout_input($input) { |
|
30 | 30 | $html = ''; |
31 | - if ( $input instanceof EE_Hidden_Input ) { |
|
32 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
33 | - } else if ( $input instanceof EE_Submit_Input ) { |
|
34 | - $html .= EEH_HTML::div( $input->get_html_for_input(), $input->html_id() . '-submit-dv', $input->html_class() . '-submit-dv' ); |
|
35 | - } else if ( $input instanceof EE_Select_Input ) { |
|
31 | + if ($input instanceof EE_Hidden_Input) { |
|
32 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
33 | + } else if ($input instanceof EE_Submit_Input) { |
|
34 | + $html .= EEH_HTML::div($input->get_html_for_input(), $input->html_id().'-submit-dv', $input->html_class().'-submit-dv'); |
|
35 | + } else if ($input instanceof EE_Select_Input) { |
|
36 | 36 | $html .= EEH_HTML::div( |
37 | - EEH_HTML::nl(1) . $input->get_html_for_label() . |
|
38 | - EEH_HTML::nl() . $input->get_html_for_errors() . |
|
39 | - EEH_HTML::nl() . $input->get_html_for_input() . |
|
40 | - EEH_HTML::nl() . $input->get_html_for_help(), |
|
41 | - $input->html_id() . '-input-dv', |
|
42 | - $input->html_class() . '-input-dv' |
|
37 | + EEH_HTML::nl(1).$input->get_html_for_label(). |
|
38 | + EEH_HTML::nl().$input->get_html_for_errors(). |
|
39 | + EEH_HTML::nl().$input->get_html_for_input(). |
|
40 | + EEH_HTML::nl().$input->get_html_for_help(), |
|
41 | + $input->html_id().'-input-dv', |
|
42 | + $input->html_class().'-input-dv' |
|
43 | 43 | ); |
44 | - } else if ( $input instanceof EE_Form_Input_With_Options_Base ) { |
|
44 | + } else if ($input instanceof EE_Form_Input_With_Options_Base) { |
|
45 | 45 | $html .= EEH_HTML::div( |
46 | - EEH_HTML::nl() . $this->_display_label_for_option_type_question( $input ) . |
|
47 | - EEH_HTML::nl() . $input->get_html_for_errors() . |
|
48 | - EEH_HTML::nl() . $input->get_html_for_input() . |
|
49 | - EEH_HTML::nl() . $input->get_html_for_help(), |
|
50 | - $input->html_id() . '-input-dv', |
|
51 | - $input->html_class() . '-input-dv' |
|
46 | + EEH_HTML::nl().$this->_display_label_for_option_type_question($input). |
|
47 | + EEH_HTML::nl().$input->get_html_for_errors(). |
|
48 | + EEH_HTML::nl().$input->get_html_for_input(). |
|
49 | + EEH_HTML::nl().$input->get_html_for_help(), |
|
50 | + $input->html_id().'-input-dv', |
|
51 | + $input->html_class().'-input-dv' |
|
52 | 52 | ); |
53 | 53 | } else { |
54 | 54 | $html .= EEH_HTML::div( |
55 | - EEH_HTML::nl(1) . $input->get_html_for_label() . |
|
56 | - EEH_HTML::nl() . $input->get_html_for_errors() . |
|
57 | - EEH_HTML::nl() . $input->get_html_for_input() . |
|
58 | - EEH_HTML::nl() . $input->get_html_for_help(), |
|
59 | - $input->html_id() . '-input-dv', |
|
60 | - $input->html_class() . '-input-dv' |
|
55 | + EEH_HTML::nl(1).$input->get_html_for_label(). |
|
56 | + EEH_HTML::nl().$input->get_html_for_errors(). |
|
57 | + EEH_HTML::nl().$input->get_html_for_input(). |
|
58 | + EEH_HTML::nl().$input->get_html_for_help(), |
|
59 | + $input->html_id().'-input-dv', |
|
60 | + $input->html_class().'-input-dv' |
|
61 | 61 | ); |
62 | 62 | } |
63 | 63 | return $html; |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | * @param EE_Form_Input_With_Options_Base $input |
75 | 75 | * @return string |
76 | 76 | */ |
77 | - protected function _display_label_for_option_type_question( EE_Form_Input_With_Options_Base $input ){ |
|
78 | - if ( $input->display_html_label_text() != '' ) { |
|
79 | - $class = $input->required() ? 'ee-required-label ' . $input->html_label_class() : $input->html_label_class(); |
|
80 | - $label_text = $input->required() ? $input->html_label_text() . '<span class="ee-asterisk">*</span>' : $input->html_label_text(); |
|
81 | - $html = '<div id="' . $input->html_label_id() . '"'; |
|
82 | - $html .= ' class="' . $class . '"'; |
|
83 | - $html .= ' style="' . $input->html_label_style() . '">'; |
|
84 | - $html .= $label_text . '</div>'; |
|
77 | + protected function _display_label_for_option_type_question(EE_Form_Input_With_Options_Base $input) { |
|
78 | + if ($input->display_html_label_text() != '') { |
|
79 | + $class = $input->required() ? 'ee-required-label '.$input->html_label_class() : $input->html_label_class(); |
|
80 | + $label_text = $input->required() ? $input->html_label_text().'<span class="ee-asterisk">*</span>' : $input->html_label_text(); |
|
81 | + $html = '<div id="'.$input->html_label_id().'"'; |
|
82 | + $html .= ' class="'.$class.'"'; |
|
83 | + $html .= ' style="'.$input->html_label_style().'">'; |
|
84 | + $html .= $label_text.'</div>'; |
|
85 | 85 | return $html; |
86 | 86 | } else { |
87 | 87 | return ''; |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | * @param EE_Form_Section_Proper $form_section |
96 | 96 | * @return string |
97 | 97 | */ |
98 | - public function layout_subsection( $form_section ){ |
|
98 | + public function layout_subsection($form_section) { |
|
99 | 99 | // d( $form_section ); |
100 | - return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1); |
|
100 | + return EEH_HTML::nl(1).$form_section->get_html().EEH_HTML::nl(-1); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * closing div tag for a form |
106 | 106 | * @return string |
107 | 107 | */ |
108 | - public function layout_form_end(){ |
|
109 | - return EEH_HTML::divx( $this->_form_section->html_id(), $this->_form_section->html_class() ); |
|
108 | + public function layout_form_end() { |
|
109 | + return EEH_HTML::divx($this->_form_section->html_id(), $this->_form_section->html_class()); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | \ No newline at end of file |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | |
@@ -26,20 +26,20 @@ discard block |
||
26 | 26 | * @param EE_Response $response |
27 | 27 | * @return EE_Response |
28 | 28 | */ |
29 | - public function handle_request( EE_Request $request, EE_Response $response ) { |
|
29 | + public function handle_request(EE_Request $request, EE_Response $response) { |
|
30 | 30 | $this->_request = $request; |
31 | 31 | $this->_response = $response; |
32 | 32 | global $pagenow; |
33 | 33 | if ( |
34 | 34 | in_array( |
35 | 35 | $pagenow, |
36 | - array( 'wp-login.php', 'wp-register.php' ) |
|
36 | + array('wp-login.php', 'wp-register.php') |
|
37 | 37 | ) |
38 | - && ! $request->get( 'ee_load_on_login' ) |
|
38 | + && ! $request->get('ee_load_on_login') |
|
39 | 39 | ) { |
40 | 40 | $this->_response->terminate_request(); |
41 | 41 | } |
42 | - $this->_response = $this->process_request_stack( $this->_request, $this->_response ); |
|
42 | + $this->_response = $this->process_request_stack($this->_request, $this->_response); |
|
43 | 43 | return $this->_response; |
44 | 44 | } |
45 | 45 |
@@ -13,13 +13,13 @@ discard block |
||
13 | 13 | //(all other times it gets resurrected from a wordpress option) |
14 | 14 | $stages = glob(EE_CORE.'data_migration_scripts/4_8_0_stages/*'); |
15 | 15 | $class_to_filepath = array(); |
16 | -foreach($stages as $filepath){ |
|
16 | +foreach ($stages as $filepath) { |
|
17 | 17 | $matches = array(); |
18 | - preg_match('~4_8_0_stages/(.*).dmsstage.php~',$filepath,$matches); |
|
18 | + preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
19 | 19 | $class_to_filepath[$matches[1]] = $filepath; |
20 | 20 | } |
21 | 21 | //give addons a chance to autoload their stages too |
22 | -$class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages',$class_to_filepath); |
|
22 | +$class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages', $class_to_filepath); |
|
23 | 23 | EEH_Autoloader::register_autoloader($class_to_filepath); |
24 | 24 | |
25 | 25 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @since 4.6.0 |
36 | 36 | * |
37 | 37 | */ |
38 | -class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base{ |
|
38 | +class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base { |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * return EE_DMS_Core_4_8_0 |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function can_migrate_from_version($version_array) { |
64 | 64 | $version_string = $version_array['Core']; |
65 | - if( $version_string <= '4.8.0' && $version_string >= '4.7.0' ){ |
|
65 | + if ($version_string <= '4.8.0' && $version_string >= '4.7.0') { |
|
66 | 66 | // echo "$version_string can be migrated from"; |
67 | 67 | return true; |
68 | - }elseif( ! $version_string ){ |
|
68 | + }elseif ( ! $version_string) { |
|
69 | 69 | // echo "no version string provided: $version_string"; |
70 | 70 | //no version string provided... this must be pre 4.3 |
71 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
72 | - }else{ |
|
71 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
72 | + } else { |
|
73 | 73 | // echo "$version_string doesnt apply"; |
74 | 74 | return false; |
75 | 75 | } |
@@ -90,19 +90,19 @@ discard block |
||
90 | 90 | * @return bool |
91 | 91 | */ |
92 | 92 | public function schema_changes_before_migration() { |
93 | - require_once( EE_HELPERS . 'EEH_Activation.helper.php' ); |
|
94 | - $now_in_mysql = current_time( 'mysql', true ); |
|
93 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
94 | + $now_in_mysql = current_time('mysql', true); |
|
95 | 95 | |
96 | - require_once( EE_HELPERS . 'EEH_Activation.helper.php' ); |
|
97 | - $table_name='esp_answer'; |
|
98 | - $sql=" ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
96 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
97 | + $table_name = 'esp_answer'; |
|
98 | + $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
99 | 99 | REG_ID int(10) unsigned NOT NULL, |
100 | 100 | QST_ID int(10) unsigned NOT NULL, |
101 | 101 | ANS_value text NOT NULL, |
102 | 102 | PRIMARY KEY (ANS_ID), |
103 | 103 | KEY REG_ID (REG_ID), |
104 | 104 | KEY QST_ID (QST_ID)"; |
105 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
105 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
106 | 106 | |
107 | 107 | $table_name = 'esp_attendee_meta'; |
108 | 108 | $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | CNT_is_EU tinyint(1) DEFAULT '0', |
143 | 143 | CNT_active tinyint(1) DEFAULT '0', |
144 | 144 | PRIMARY KEY (CNT_ISO)"; |
145 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' ); |
|
145 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
146 | 146 | |
147 | 147 | $table_name = 'esp_currency'; |
148 | 148 | $sql = "CUR_code varchar(6) collate utf8_bin NOT NULL, |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2', |
153 | 153 | CUR_active tinyint(1) DEFAULT '0', |
154 | 154 | PRIMARY KEY (CUR_code)"; |
155 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' ); |
|
155 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
156 | 156 | |
157 | 157 | |
158 | 158 | $table_name = 'esp_currency_payment_method'; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | KEY EVT_ID (EVT_ID), |
183 | 183 | KEY DTT_is_primary (DTT_is_primary)"; |
184 | 184 | |
185 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
185 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
186 | 186 | |
187 | 187 | $table_name = 'esp_event_meta'; |
188 | 188 | $sql = " |
@@ -201,41 +201,41 @@ discard block |
||
201 | 201 | EVT_donations tinyint(1) NULL, |
202 | 202 | PRIMARY KEY (EVTM_ID), |
203 | 203 | KEY EVT_ID (EVT_ID)"; |
204 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
204 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
205 | 205 | |
206 | 206 | |
207 | 207 | |
208 | - $table_name='esp_event_question_group'; |
|
209 | - $sql="EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
208 | + $table_name = 'esp_event_question_group'; |
|
209 | + $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
210 | 210 | EVT_ID bigint(20) unsigned NOT NULL, |
211 | 211 | QSG_ID int(10) unsigned NOT NULL, |
212 | 212 | EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
213 | 213 | PRIMARY KEY (EQG_ID), |
214 | 214 | KEY EVT_ID (EVT_ID), |
215 | 215 | KEY QSG_ID (QSG_ID)"; |
216 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
216 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
217 | 217 | |
218 | 218 | |
219 | 219 | |
220 | - $table_name='esp_event_venue'; |
|
221 | - $sql="EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
220 | + $table_name = 'esp_event_venue'; |
|
221 | + $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
222 | 222 | EVT_ID bigint(20) unsigned NOT NULL, |
223 | 223 | VNU_ID bigint(20) unsigned NOT NULL, |
224 | 224 | EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
225 | 225 | PRIMARY KEY (EVV_ID)"; |
226 | - $this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB'); |
|
226 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
227 | 227 | |
228 | 228 | |
229 | 229 | |
230 | - $table_name='esp_extra_meta'; |
|
231 | - $sql="EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
230 | + $table_name = 'esp_extra_meta'; |
|
231 | + $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
232 | 232 | OBJ_ID int(11) DEFAULT NULL, |
233 | 233 | EXM_type varchar(45) DEFAULT NULL, |
234 | 234 | EXM_key varchar(45) DEFAULT NULL, |
235 | 235 | EXM_value text, |
236 | 236 | PRIMARY KEY (EXM_ID), |
237 | 237 | KEY EXM_type (EXM_type,OBJ_ID,EXM_key)"; |
238 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
238 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
239 | 239 | |
240 | 240 | $table_name = 'esp_extra_join'; |
241 | 241 | $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT, |
@@ -248,8 +248,8 @@ discard block |
||
248 | 248 | KEY second_model (EXJ_second_model_name,EXJ_second_model_id)"; |
249 | 249 | $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
250 | 250 | |
251 | - $table_name='esp_line_item'; |
|
252 | - $sql="LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
251 | + $table_name = 'esp_line_item'; |
|
252 | + $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
253 | 253 | LIN_code varchar(245) NOT NULL DEFAULT '', |
254 | 254 | TXN_ID int(11) DEFAULT NULL, |
255 | 255 | LIN_name varchar(245) NOT NULL DEFAULT '', |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | PRIMARY KEY (LIN_ID), |
269 | 269 | KEY LIN_code (LIN_code(191)), |
270 | 270 | KEY TXN_ID (TXN_ID)"; |
271 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB' ); |
|
271 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
272 | 272 | |
273 | 273 | $table_name = 'esp_log'; |
274 | 274 | $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT, |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | MTP_is_active tinyint(1) NOT NULL DEFAULT '1', |
308 | 308 | PRIMARY KEY (GRP_ID), |
309 | 309 | KEY MTP_user_id (MTP_user_id)"; |
310 | - $this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB'); |
|
310 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
311 | 311 | |
312 | 312 | $table_name = 'esp_event_message_template'; |
313 | 313 | $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | PRIMARY KEY (EMT_ID), |
317 | 317 | KEY EVT_ID (EVT_ID), |
318 | 318 | KEY GRP_ID (GRP_ID)"; |
319 | - $this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB'); |
|
319 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
320 | 320 | |
321 | 321 | |
322 | 322 | $table_name = 'esp_payment'; |
@@ -389,8 +389,8 @@ discard block |
||
389 | 389 | PRIMARY KEY (TTM_ID)"; |
390 | 390 | $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
391 | 391 | |
392 | - $table_name='esp_question'; |
|
393 | - $sql='QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
392 | + $table_name = 'esp_question'; |
|
393 | + $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
394 | 394 | QST_display_text text NOT NULL, |
395 | 395 | QST_admin_label varchar(255) NOT NULL, |
396 | 396 | QST_system varchar(25) NOT NULL DEFAULT "", |
@@ -404,22 +404,22 @@ discard block |
||
404 | 404 | QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0, |
405 | 405 | PRIMARY KEY (QST_ID), |
406 | 406 | KEY QST_order (QST_order)'; |
407 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
407 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
408 | 408 | |
409 | - $table_name='esp_question_group_question'; |
|
410 | - $sql="QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
409 | + $table_name = 'esp_question_group_question'; |
|
410 | + $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
411 | 411 | QSG_ID int(10) unsigned NOT NULL, |
412 | 412 | QST_ID int(10) unsigned NOT NULL, |
413 | 413 | QGQ_order int(10) unsigned NOT NULL DEFAULT 0, |
414 | 414 | PRIMARY KEY (QGQ_ID), |
415 | 415 | KEY QST_ID (QST_ID), |
416 | 416 | KEY QSG_ID_order (QSG_ID,QGQ_order)"; |
417 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
417 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
418 | 418 | |
419 | 419 | |
420 | 420 | |
421 | - $table_name='esp_question_option'; |
|
422 | - $sql="QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
421 | + $table_name = 'esp_question_option'; |
|
422 | + $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
423 | 423 | QSO_value varchar(255) NOT NULL, |
424 | 424 | QSO_desc text NOT NULL, |
425 | 425 | QST_ID int(10) unsigned NOT NULL, |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | PRIMARY KEY (QSO_ID), |
430 | 430 | KEY QST_ID (QST_ID), |
431 | 431 | KEY QSO_order (QSO_order)"; |
432 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
432 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
433 | 433 | |
434 | 434 | |
435 | 435 | |
@@ -475,8 +475,8 @@ discard block |
||
475 | 475 | |
476 | 476 | |
477 | 477 | |
478 | - $table_name='esp_checkin'; |
|
479 | - $sql="CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
478 | + $table_name = 'esp_checkin'; |
|
479 | + $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
480 | 480 | REG_ID int(10) unsigned NOT NULL, |
481 | 481 | DTT_ID int(10) unsigned NOT NULL, |
482 | 482 | CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | PRC_parent int(10) unsigned DEFAULT 0, |
572 | 572 | PRIMARY KEY (PRC_ID), |
573 | 573 | KEY PRT_ID (PRT_ID)"; |
574 | - $this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB'); |
|
574 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
575 | 575 | |
576 | 576 | $table_name = "esp_price_type"; |
577 | 577 | $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
@@ -609,10 +609,10 @@ discard block |
||
609 | 609 | TKT_deleted tinyint(1) NOT NULL DEFAULT '0', |
610 | 610 | PRIMARY KEY (TKT_ID), |
611 | 611 | KEY TKT_start_date (TKT_start_date)"; |
612 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
612 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
613 | 613 | |
614 | 614 | $table_name = 'esp_question_group'; |
615 | - $sql='QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
615 | + $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
616 | 616 | QSG_name varchar(255) NOT NULL, |
617 | 617 | QSG_identifier varchar(100) NOT NULL, |
618 | 618 | QSG_desc text NULL, |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | PRIMARY KEY (QSG_ID), |
626 | 626 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
627 | 627 | KEY QSG_order (QSG_order)'; |
628 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' ); |
|
628 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
629 | 629 | |
630 | 630 | /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
631 | 631 | $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | return $script_4_7_defaults->schema_changes_after_migration(); |
662 | 662 | } |
663 | 663 | |
664 | - public function migration_page_hooks(){ |
|
664 | + public function migration_page_hooks() { |
|
665 | 665 | |
666 | 666 | } |
667 | 667 | |
@@ -675,19 +675,19 @@ discard block |
||
675 | 675 | //CNT_ISO, CNT_ISO3, RGN_ID, CNT_name, CNT_cur_code, CNT_cur_single, CNT_cur_plural, CNT_cur_sign, CNT_cur_sign_b4, CNT_cur_dec_plc, CNT_tel_code, CNT_is_EU, CNT_active |
676 | 676 | //('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0), |
677 | 677 | $newer_countries = array( |
678 | - array( 'AX', 'ALA', 0, 'Alan Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0 ), |
|
679 | - array( 'BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ), |
|
680 | - array( 'CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0 ), |
|
681 | - array( 'GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0 ), |
|
682 | - array( 'IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0 ), |
|
683 | - array( 'JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0 ), |
|
684 | - array( 'MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ), |
|
685 | - array( 'MN', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0 ), |
|
686 | - array( 'RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+941', 1, 0 ), |
|
687 | - array( 'SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0 ), |
|
688 | - array( 'SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0 ), |
|
689 | - array( 'XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+381', 0, 0 ), |
|
690 | - array( 'YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0 ), |
|
678 | + array('AX', 'ALA', 0, 'Alan Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0), |
|
679 | + array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
680 | + array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0), |
|
681 | + array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0), |
|
682 | + array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
683 | + array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
684 | + array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
685 | + array('MN', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0), |
|
686 | + array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+941', 1, 0), |
|
687 | + array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0), |
|
688 | + array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0), |
|
689 | + array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+381', 0, 0), |
|
690 | + array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0), |
|
691 | 691 | ); |
692 | 692 | global $wpdb; |
693 | 693 | $country_table = $wpdb->prefix."esp_country"; |
@@ -706,14 +706,14 @@ discard block |
||
706 | 706 | "CNT_is_EU" => '%d', |
707 | 707 | "CNT_active" => '%d', |
708 | 708 | ); |
709 | - if ( EEH_Activation::table_exists( $country_table ) ) { |
|
710 | - foreach( $newer_countries as $country ) { |
|
711 | - $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1" ; |
|
709 | + if (EEH_Activation::table_exists($country_table)) { |
|
710 | + foreach ($newer_countries as $country) { |
|
711 | + $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1"; |
|
712 | 712 | $countries = $wpdb->get_var($SQL); |
713 | - if ( ! $countries ) { |
|
713 | + if ( ! $countries) { |
|
714 | 714 | |
715 | - $wpdb->insert( $country_table, |
|
716 | - array_combine( array_keys( $country_format), $country ), |
|
715 | + $wpdb->insert($country_table, |
|
716 | + array_combine(array_keys($country_format), $country), |
|
717 | 717 | $country_format |
718 | 718 | ); |
719 | 719 | } |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | // CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active |
732 | 732 | //( 'EUR', 'Euro', 'Euros', '€', 2,1), |
733 | 733 | $newer_currencies = array( |
734 | - array( 'RSD', 'Dinar', 'Dinars', '', 3, 1 ), |
|
734 | + array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
|
735 | 735 | ); |
736 | 736 | global $wpdb; |
737 | 737 | $currency_table = $wpdb->prefix."esp_currency"; |
@@ -743,14 +743,14 @@ discard block |
||
743 | 743 | "CUR_dec_plc" => '%d', |
744 | 744 | "CUR_active" => '%d', |
745 | 745 | ); |
746 | - if ( EEH_Activation::table_exists( $currency_table ) ) { |
|
747 | - foreach( $newer_currencies as $currency ) { |
|
748 | - $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1" ; |
|
746 | + if (EEH_Activation::table_exists($currency_table)) { |
|
747 | + foreach ($newer_currencies as $currency) { |
|
748 | + $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1"; |
|
749 | 749 | $countries = $wpdb->get_var($SQL); |
750 | - if ( ! $countries ) { |
|
750 | + if ( ! $countries) { |
|
751 | 751 | |
752 | - $wpdb->insert( $currency_table, |
|
753 | - array_combine( array_keys( $currency_format), $currency ), |
|
752 | + $wpdb->insert($currency_table, |
|
753 | + array_combine(array_keys($currency_format), $currency), |
|
754 | 754 | $currency_format |
755 | 755 | ); |
756 | 756 | } |
@@ -762,9 +762,9 @@ discard block |
||
762 | 762 | * which should just be a temporary issue for folks who installed 4.8.0-4.8.5; |
763 | 763 | * we should be able to stop doing this in 4.9 |
764 | 764 | */ |
765 | - public function fix_non_default_taxes(){ |
|
765 | + public function fix_non_default_taxes() { |
|
766 | 766 | global $wpdb; |
767 | - $query = $wpdb->prepare( "UPDATE |
|
767 | + $query = $wpdb->prepare("UPDATE |
|
768 | 768 | {$wpdb->prefix}esp_price p INNER JOIN |
769 | 769 | {$wpdb->prefix}esp_price_type pt ON p.PRT_ID = pt.PRT_ID |
770 | 770 | SET |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | WHERE |
773 | 773 | p.PRC_is_default = 0 AND |
774 | 774 | pt.PBT_ID = %d |
775 | - ", EEM_Price_Type::base_type_tax ); |
|
776 | - $wpdb->query( $query ); |
|
775 | + ", EEM_Price_Type::base_type_tax); |
|
776 | + $wpdb->query($query); |
|
777 | 777 | } |
778 | 778 | } |