Completed
Branch FET-8162-relation-exists (8f4753)
by
unknown
95:43 queued 85:25
created
templates/txn_admin_details_side_meta_box_billing_info.template.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,27 +1,27 @@
 block discarded – undo
1 1
 	<div id="admin-side-mbox-billing-info-dv" class="admin-side-mbox-dv">
2
-<?php if ( empty($billing_form) ) : ?>
2
+<?php if (empty($billing_form)) : ?>
3 3
 		<div class="clearfix">
4
-			<?php _e( 'There is no billing info for this transaction.', 'event_espresso' );?><br/>
4
+			<?php _e('There is no billing info for this transaction.', 'event_espresso'); ?><br/>
5 5
 		</div>
6 6
 <?php else :
7
-	function ee_show_billing_info_cleaned( EE_Form_Section_Proper $form_section ) {
8
-		foreach( $form_section->subsections() as $subsection ) {
9
-			if( $subsection instanceof EE_Form_Input_Base ) {
10
-				if( $subsection->get_sensitive_data_removal_strategy() instanceof EE_All_Sensitive_Data_Removal ||
11
-					$subsection->get_sensitive_data_removal_strategy() instanceof EE_CCV_Sensitive_Data_Removal ){
7
+	function ee_show_billing_info_cleaned(EE_Form_Section_Proper $form_section) {
8
+		foreach ($form_section->subsections() as $subsection) {
9
+			if ($subsection instanceof EE_Form_Input_Base) {
10
+				if ($subsection->get_sensitive_data_removal_strategy() instanceof EE_All_Sensitive_Data_Removal ||
11
+					$subsection->get_sensitive_data_removal_strategy() instanceof EE_CCV_Sensitive_Data_Removal) {
12 12
 					continue;
13 13
 				}
14 14
 				?>
15 15
 					<div class="clearfix">
16
-						<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php echo $subsection->get_html_for_label();?></span><?php echo $subsection->pretty_value();?>
16
+						<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php echo $subsection->get_html_for_label(); ?></span><?php echo $subsection->pretty_value(); ?>
17 17
 					</div><?php
18
-			} elseif( $subsection instanceof EE_Form_Section_Proper ) {
19
-				ee_show_billing_info_cleaned( $subsection );
18
+			} elseif ($subsection instanceof EE_Form_Section_Proper) {
19
+				ee_show_billing_info_cleaned($subsection);
20 20
 			}
21 21
 		}
22 22
 	}
23
-	ee_show_billing_info_cleaned( $billing_form ); ?>
24
-		<p class="help"><?php _e( 'Note: Card expiry dates and CCV are not stored. Only the last 4 digits of card numbers are stored.', 'event_espresso' );?></p>
23
+	ee_show_billing_info_cleaned($billing_form); ?>
24
+		<p class="help"><?php _e('Note: Card expiry dates and CCV are not stored. Only the last 4 digits of card numbers are stored.', 'event_espresso'); ?></p>
25 25
 <?php endif; ?>
26 26
 
27 27
 	</div>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,13 +3,15 @@
 block discarded – undo
3 3
 		<div class="clearfix">
4 4
 			<?php _e( 'There is no billing info for this transaction.', 'event_espresso' );?><br/>
5 5
 		</div>
6
-<?php else :
6
+<?php else {
7
+	:
7 8
 	function ee_show_billing_info_cleaned( EE_Form_Section_Proper $form_section ) {
8 9
 		foreach( $form_section->subsections() as $subsection ) {
9 10
 			if( $subsection instanceof EE_Form_Input_Base ) {
10 11
 				if( $subsection->get_sensitive_data_removal_strategy() instanceof EE_All_Sensitive_Data_Removal ||
11 12
 					$subsection->get_sensitive_data_removal_strategy() instanceof EE_CCV_Sensitive_Data_Removal ){
12 13
 					continue;
14
+}
13 15
 				}
14 16
 				?>
15 17
 					<div class="clearfix">
Please login to merge, or discard this patch.
templates/txn_admin_details_side_meta_box_registrant.template.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,23 +9,23 @@  discard block
 block discarded – undo
9 9
 /** @type string $edit_attendee_url */
10 10
 ?>
11 11
 <div id="admin-side-mbox-primary-registrant-dv" class="admin-side-mbox-dv">
12
-<?php if ( ! empty( $no_attendee_message ) ) : ?>
12
+<?php if ( ! empty($no_attendee_message)) : ?>
13 13
 	<p class="clearfix">
14 14
 		<?php echo $no_attendee_message; ?>
15 15
 	</p>
16 16
 </div> <!-- end #admin-side-mbox-primary-registrant-dv -->
17 17
 <?php else : ?>
18 18
 	<p class="clearfix">
19
-		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e( 'Name', 'event_espresso' );?></span><?php 	echo $prime_reg_fname . ' ' . $prime_reg_lname;?>
19
+		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Name', 'event_espresso'); ?></span><?php 	echo $prime_reg_fname.' '.$prime_reg_lname; ?>
20 20
 	</p>
21 21
 	<p class="clearfix">
22
-		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e( 'Email', 'event_espresso' );?></span><a href="mailto:<?php echo $prime_reg_email;?>"><?php echo $prime_reg_email;?></a>
22
+		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Email', 'event_espresso'); ?></span><a href="mailto:<?php echo $prime_reg_email; ?>"><?php echo $prime_reg_email; ?></a>
23 23
 	</p>
24 24
 	<p class="clearfix">
25
-		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e( 'Phone #', 'event_espresso' );?></span><?php echo $prime_reg_phone;?>
25
+		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Phone #', 'event_espresso'); ?></span><?php echo $prime_reg_phone; ?>
26 26
 	</p>
27 27
 	<p class="clearfix">
28
-		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e( 'Address', 'event_espresso' );?></span>
28
+		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Address', 'event_espresso'); ?></span>
29 29
 		<div class="admin-side-mbox-text-dv">
30 30
 			<?php echo $formatted_address; ?>
31 31
 		</div>
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 
35 35
 
36 36
 <p style="text-align:right;">
37
-	<a class="button button-small" href="<?php echo $edit_attendee_url; ?>" title="<?php esc_attr_e( 'View details for this contact.', 'event_espresso' );?>">
37
+	<a class="button button-small" href="<?php echo $edit_attendee_url; ?>" title="<?php esc_attr_e('View details for this contact.', 'event_espresso'); ?>">
38 38
 		<span class="ee-icon ee-icon-user-edit"></span><?php _e('View / Edit this Contact', 'event_espresso'); ?>
39 39
 	</a>
40 40
 </p>
41
-<?php endif;  //end no attendee check?>
41
+<?php endif; //end no attendee check?>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,12 @@
 block discarded – undo
14 14
 		<?php echo $no_attendee_message; ?>
15 15
 	</p>
16 16
 </div> <!-- end #admin-side-mbox-primary-registrant-dv -->
17
-<?php else : ?>
17
+<?php else {
18
+	: ?>
18 19
 	<p class="clearfix">
19
-		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e( 'Name', 'event_espresso' );?></span><?php 	echo $prime_reg_fname . ' ' . $prime_reg_lname;?>
20
+		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e( 'Name', 'event_espresso' );
21
+}
22
+?></span><?php 	echo $prime_reg_fname . ' ' . $prime_reg_lname;?>
20 23
 	</p>
21 24
 	<p class="clearfix">
22 25
 		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e( 'Email', 'event_espresso' );?></span><a href="mailto:<?php echo $prime_reg_email;?>"><?php echo $prime_reg_email;?></a>
Please login to merge, or discard this patch.
templates/txn_admin_details_side_meta_box_txn_number.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@
 block discarded – undo
2 2
 
3 3
 	<table id="admin-primary-mbox-txn-details-tbl" class="form-table">
4 4
 		<tbody>
5
-		<?php foreach ( $txn_details as $key => $txn_detail ) : ?>
5
+		<?php foreach ($txn_details as $key => $txn_detail) : ?>
6 6
 			<tr>
7 7
 				<th>
8
-					<label for="<?php echo $key;?>"><?php echo $txn_detail['label'];?></label>
8
+					<label for="<?php echo $key; ?>"><?php echo $txn_detail['label']; ?></label>
9 9
 				</th>
10 10
 				<td>
11
-					<?php echo $txn_detail['value'];?>
11
+					<?php echo $txn_detail['value']; ?>
12 12
 				</td>
13 13
 			</tr>
14 14
 		<?php endforeach; // $txn_details?>
Please login to merge, or discard this patch.
admin_pages/transactions/templates/txn_admin_overview.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 
2 2
 		<ul class="subsubsub">
3
-			<li class="all"><a class="current" href="<?php echo $view_all_url;?>">View All <span class="count">(<?php echo $table_rows; ?>)</span></a></li>
3
+			<li class="all"><a class="current" href="<?php echo $view_all_url; ?>">View All <span class="count">(<?php echo $table_rows; ?>)</span></a></li>
4 4
 		</ul>
5 5
 
6 6
 		<div id="txn-filters-dv">
7
-			<form id="txn-filters-frm" action="<?php echo $txn_overview_url;?>" method="post" name="txn-filters-frm">
8
-				<label for="txn-filter-start-date"><?php _e( 'Display Transactions from ', 'event_espresso' ); ?></label>
7
+			<form id="txn-filters-frm" action="<?php echo $txn_overview_url; ?>" method="post" name="txn-filters-frm">
8
+				<label for="txn-filter-start-date"><?php _e('Display Transactions from ', 'event_espresso'); ?></label>
9 9
 				<input id="txn-filter-start-date" class="datepicker" type="text" value="<?php echo $start_date; ?>" name="txn-filter-start-date" size="15"/>	
10
-				<label for="txn-filter-end-date"> <?php _e( 'until', 'event_espresso' ); ?> </label>
10
+				<label for="txn-filter-end-date"> <?php _e('until', 'event_espresso'); ?> </label>
11 11
 				<input id="txn-filter-end-date" class="datepicker" type="text" value="<?php echo $end_date; ?>" name="txn-filter-end-date" size="15"/>	
12 12
 				<input id="submit-txn-filters-sbmt" class="button-secondary" type="submit" value="Filter Months">
13 13
 			</form>
14 14
 		</div>
15 15
 
16
-        <form id="transactions-overview-frm" action="<?php echo $txn_overview_url;?>" method="get">
16
+        <form id="transactions-overview-frm" action="<?php echo $txn_overview_url; ?>" method="get">
17 17
             <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" />
18 18
             <input type="hidden" id="per_page" name="per_page" value="" />
19 19
             <?php echo $list_table->display(); ?>
Please login to merge, or discard this patch.
admin_pages/transactions/templates/txn_admin_wrapper.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <div class="wrap">
2 2
 
3
-	<h2><?php esc_attr_e( 'Event Espresso', 'event_espresso' ); ?>&nbsp;-&nbsp;<?php esc_attr_e( $admin_page_title, 'event_espresso' ); ?></h2>
3
+	<h2><?php esc_attr_e('Event Espresso', 'event_espresso'); ?>&nbsp;-&nbsp;<?php esc_attr_e($admin_page_title, 'event_espresso'); ?></h2>
4 4
 
5 5
 	<h2 class="nav-tab-wrapper">
6 6
 		<a class="nav-tab<?php echo $tab_active_overview; ?>" href="<?php echo $tab_url_overview; ?>"><?php echo $tab_lnk_overview; ?></a>
7
-		<?php if ( $tab_details ) : ?>
7
+		<?php if ($tab_details) : ?>
8 8
 			<a class="nav-tab<?php echo $tab_active_details; ?>" href="<?php echo $tab_url_details; ?>"><?php echo $tab_lnk_details; ?></a>
9 9
 		<?php endif; ?>
10 10
 		<a class="nav-tab<?php echo $tab_active_reports; ?>" href="<?php echo $tab_url_reports; ?>"><?php echo $tab_lnk_reports; ?></a>
Please login to merge, or discard this patch.
caffeinated/admin/extend/about/Extend_About_Admin_Page.core.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
 
33 33
 
34 34
 
35
-	public function __construct( $routing = TRUE ) {
36
-		parent::__construct( $routing );
37
-		define( 'EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'about/templates/' );
35
+	public function __construct($routing = TRUE) {
36
+		parent::__construct($routing);
37
+		define('EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'about/templates/');
38 38
 	}
39 39
 
40 40
 
41 41
 
42 42
 	protected function _extend_page_config() {
43
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'about';
43
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'about';
44 44
 	}
45 45
 
46 46
 	protected function _set_page_routes() {
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 	protected function _whats_new() {
90 90
 		$steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE;
91 91
 		$steps = $steps !== FALSE ? $steps : '';
92
-		$this->_admin_page_title = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
92
+		$this->_admin_page_title = sprintf(__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION);
93 93
 		$settings_message = $steps;
94
-		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso'). $settings_message ;
95
-		$template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH . 'whats_new.template.php';
96
-		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
94
+		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso').$settings_message;
95
+		$template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH.'whats_new.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH.'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH.'whats_new.template.php';
96
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE);
97 97
 		$this->display_about_admin_page();
98 98
 	}
99 99
 
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
 	protected function _overview() {
102 102
 		$this->_admin_page_title = __('About Event Espresso', 'event_espresso');
103 103
 		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso');
104
-		$template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php' : EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
105
-		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
104
+		$template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH.'ee4-overview.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH.'ee4-overview.template.php' : EE_ABOUT_TEMPLATE_PATH.'ee4-overview.template.php';
105
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE);
106 106
 		$this->display_about_admin_page();
107 107
 	}
108 108
 
109 109
 	protected function _credits() {
110 110
 	//	$this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
111 111
 		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso');
112
-		$template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
113
-		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
112
+		$template = EE_ABOUT_TEMPLATE_PATH.'credits.template.php';
113
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE);
114 114
 		$this->display_about_admin_page();
115 115
 	}
116 116
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
caffeinated/admin/extend/about/templates/whats_new.template.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@
 block discarded – undo
1 1
 <div class="changelog point-releases">
2
-	<!-- <h3><?php echo _n( 'Minor Release Information', 'Minor Releases', 1 ); ?></h3> -->
3
-	<h3><?php echo _n( 'Major Release Information', 'Major Releases', 1 ); ?></h3>
2
+	<!-- <h3><?php echo _n('Minor Release Information', 'Minor Releases', 1); ?></h3> -->
3
+	<h3><?php echo _n('Major Release Information', 'Major Releases', 1); ?></h3>
4 4
 	<?php //$type = 'minor'; ?>
5 5
 	<?php $type = 'major'; ?>
6
-	<p><?php printf( __( '<strong>Version %1$s</strong> is a %2$s release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type ); ?>
6
+	<p><?php printf(__('<strong>Version %1$s</strong> is a %2$s release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type); ?>
7 7
 		<?php
8
-			$ver = explode( '.', EVENT_ESPRESSO_VERSION );
9
-			array_pop( $ver );
10
-			$ver = implode( '.', $ver );
8
+			$ver = explode('.', EVENT_ESPRESSO_VERSION);
9
+			array_pop($ver);
10
+			$ver = implode('.', $ver);
11 11
 		?>
12
-		<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://eventespresso.com/wiki/ee4-changelog/#' . $ver ); ?>
12
+		<?php printf(__('For more information, see <a href="%s">the release notes</a>.'), 'http://eventespresso.com/wiki/ee4-changelog/#'.$ver); ?>
13 13
  	</p>
14 14
 </div>
15 15
 
16 16
 <div class="changelog">
17 17
 	<?php
18 18
 	//maintenance mode on?
19
-	if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
19
+	if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
20 20
 		?>
21 21
 		<div class="ee-attention">
22
-			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2>
22
+			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2>
23 23
 			<p>
24 24
 			<?php
25 25
 				printf(
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/Extend_Events_Admin_List_Table.class.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@
 block discarded – undo
17 17
  */
18 18
 class Extend_Events_Admin_List_Table extends Events_Admin_List_Table {
19 19
 
20
-	protected function _column_name_action_setup( EE_Event $item ) {
20
+	protected function _column_name_action_setup(EE_Event $item) {
21 21
 		$export_query_args = array(
22 22
 				'action' => 'export_events',
23 23
 				'EVT_ID' => $item->ID()
24 24
 			);
25
-		$export_event_link = EE_Admin_Page::add_query_args_and_nonce( $export_query_args, EVENTS_ADMIN_URL );
25
+		$export_event_link = EE_Admin_Page::add_query_args_and_nonce($export_query_args, EVENTS_ADMIN_URL);
26 26
 
27
-		$actions = parent::_column_name_action_setup( $item );
27
+		$actions = parent::_column_name_action_setup($item);
28 28
 //		$actions['export'] = '<a href="' . $export_event_link . '" title="' . __('Export Event', 'event_espresso') . '">' . __('Export', 'event_espresso') . '</a>';
29 29
 		return $actions;
30 30
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
  * @subpackage admin
6 6
  * @since           4.4.9
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * This is the caffeinated class for the event list table.  It is only loaded in caffeinated versions of Event
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php 2 patches
Braces   +52 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -435,8 +436,9 @@  discard block
 block discarded – undo
435 436
 		//k we've got EVT_ID so let's use that to get the event we'll duplicate
436 437
 		$orig_event = EEM_Event::instance()->get_one_by_ID( $this->_req_data['EVT_ID'] );
437 438
 
438
-		if ( ! $orig_event instanceof EE_Event )
439
-			throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) );
439
+		if ( ! $orig_event instanceof EE_Event ) {
440
+					throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) );
441
+		}
440 442
 
441 443
 		//k now let's clone the $orig_event before getting relations
442 444
 		$new_event = clone $orig_event;
@@ -510,8 +512,9 @@  discard block
 block discarded – undo
510 512
 			//now let's get the ticket relations setup.
511 513
 			foreach ( (array) $orig_tkts as $orig_tkt ) {
512 514
 				//it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
513
-				if ( ! $orig_tkt instanceof EE_Ticket )
514
-					continue;
515
+				if ( ! $orig_tkt instanceof EE_Ticket ) {
516
+									continue;
517
+				}
515 518
 
516 519
 				//is this ticket archived?  If it is then let's skip
517 520
 				if ( $orig_tkt->get( 'TKT_deleted' ) ) {
@@ -620,9 +623,9 @@  discard block
 block discarded – undo
620 623
 	protected function _events_export() {
621 624
 		if(isset($this->_req_data['EVT_ID'])){
622 625
 			$event_ids = $this->_req_data['EVT_ID'];
623
-		}elseif(isset($this->_req_data['EVT_IDs'])){
626
+		} elseif(isset($this->_req_data['EVT_IDs'])){
624 627
 			$event_ids = $this->_req_data['EVT_IDs'];
625
-		}else{
628
+		} else{
626 629
 			$event_ids = NULL;
627 630
 		}
628 631
 		//todo: I don't like doing this but it'll do until we modify EE_Export Class.
@@ -811,8 +814,9 @@  discard block
 block discarded – undo
811 814
 
812 815
 		extract( wp_parse_args($args, $defaults), EXTR_SKIP );
813 816
 
814
-		if ( empty($walker) || !is_a($walker, 'Walker') )
815
-			$walker = new Walker_Radio_Checklist;
817
+		if ( empty($walker) || !is_a($walker, 'Walker') ) {
818
+					$walker = new Walker_Radio_Checklist;
819
+		}
816 820
 
817 821
 		$descendants_and_self = (int) $descendants_and_self;
818 822
 
@@ -821,17 +825,19 @@  discard block
 block discarded – undo
821 825
 		$tax = get_taxonomy($taxonomy);
822 826
 		$args['disabled'] = !current_user_can($tax->cap->assign_terms);
823 827
 
824
-		if ( is_array( $selected_cats ) )
825
-			$args['selected_cats'] = $selected_cats;
826
-		elseif ( $post_id )
827
-			$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
828
-		else
829
-			$args['selected_cats'] = array();
828
+		if ( is_array( $selected_cats ) ) {
829
+					$args['selected_cats'] = $selected_cats;
830
+		} elseif ( $post_id ) {
831
+					$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
832
+		} else {
833
+					$args['selected_cats'] = array();
834
+		}
830 835
 
831
-		if ( is_array( $popular_cats ) )
832
-			$args['popular_cats'] = $popular_cats;
833
-		else
834
-			$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
836
+		if ( is_array( $popular_cats ) ) {
837
+					$args['popular_cats'] = $popular_cats;
838
+		} else {
839
+					$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
840
+		}
835 841
 
836 842
 		if ( $descendants_and_self ) {
837 843
 			$categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) );
@@ -884,8 +890,9 @@  discard block
 block discarded – undo
884 890
 		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
885 891
 
886 892
 		//active status dropdown
887
-		if ( $status !== 'draft' )
888
-			$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
893
+		if ( $status !== 'draft' ) {
894
+					$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
895
+		}
889 896
 
890 897
 		//category filter
891 898
 		$filters[] = $this->category_dropdown();
@@ -1064,7 +1071,7 @@  discard block
 block discarded – undo
1064 1071
 
1065 1072
 		if($count){
1066 1073
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
1067
-		}else{
1074
+		} else{
1068 1075
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
1069 1076
 		}
1070 1077
 
@@ -1087,11 +1094,13 @@  discard block
 block discarded – undo
1087 1094
 			//cycle thru the boxes
1088 1095
 			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1089 1096
 				if ( $trash ) {
1090
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1091
-						$success = 0;
1097
+					if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
1098
+											$success = 0;
1099
+					}
1092 1100
 				} else {
1093
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1094
-						$success = 0;
1101
+					if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
1102
+											$success = 0;
1103
+					}
1095 1104
 				}
1096 1105
 			}
1097 1106
 		} else {
@@ -1099,11 +1108,13 @@  discard block
 block discarded – undo
1099 1108
 			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1100 1109
 
1101 1110
 			if ( $trash ) {
1102
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1103
-					$success = 0;
1111
+				if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
1112
+									$success = 0;
1113
+				}
1104 1114
 			} else {
1105
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1106
-					$success = 0;
1115
+				if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
1116
+									$success = 0;
1117
+				}
1107 1118
 			}
1108 1119
 		}
1109 1120
 
@@ -1151,8 +1162,9 @@  discard block
 block discarded – undo
1151 1162
 			);
1152 1163
 
1153 1164
 		//failsafe.  If the default ticket count === 1 then we need to redirect to event overview.
1154
-		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) )
1155
-			$query_args = array();
1165
+		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) ) {
1166
+					$query_args = array();
1167
+		}
1156 1168
 		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1157 1169
 	}
1158 1170
 
@@ -1176,13 +1188,15 @@  discard block
 block discarded – undo
1176 1188
 
1177 1189
 	function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
1178 1190
 		extract($args);
1179
-		if ( empty($taxonomy) )
1180
-			$taxonomy = 'category';
1191
+		if ( empty($taxonomy) ) {
1192
+					$taxonomy = 'category';
1193
+		}
1181 1194
 
1182
-		if ( $taxonomy == 'category' )
1183
-			$name = 'post_category';
1184
-		else
1185
-			$name = 'tax_input['.$taxonomy.']';
1195
+		if ( $taxonomy == 'category' ) {
1196
+					$name = 'post_category';
1197
+		} else {
1198
+					$name = 'tax_input['.$taxonomy.']';
1199
+		}
1186 1200
 
1187 1201
 		$class = '';
1188 1202
 		$output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="radio" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';
Please login to merge, or discard this patch.
Spacing   +197 added lines, -197 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 class Extend_Events_Admin_Page extends Events_Admin_Page {
31 31
 
32 32
 
33
-	public function __construct( $routing = TRUE ) {
34
-		parent::__construct( $routing );
35
-		define( 'EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'events/templates/');
36
-		define( 'EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'events/assets/');
37
-		define( 'EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'events/assets/');
33
+	public function __construct($routing = TRUE) {
34
+		parent::__construct($routing);
35
+		define('EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'events/templates/');
36
+		define('EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'events/assets/');
37
+		define('EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'events/assets/');
38 38
 	}
39 39
 
40 40
 
41 41
 	protected function _extend_page_config() {
42 42
 
43
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'events';
43
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'events';
44 44
 		$default_espresso_boxes = $this->_default_espresso_metaboxes;
45 45
 
46 46
 		//is there a evt_id in the request?
47
-		$evt_id = ! empty( $this->_req_data['EVT_ID'] ) && ! is_array( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : 0;
48
-		$evt_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $evt_id;
47
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : 0;
48
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
49 49
 
50 50
 		//tkt_id?
51
-		$tkt_id = !empty( $this->_req_data['TKT_ID'] ) && ! is_array( $this->_req_data['TKT_ID'] ) ? $this->_req_data['TKT_ID'] : 0;
51
+		$tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID']) ? $this->_req_data['TKT_ID'] : 0;
52 52
 
53 53
 		$new_page_routes = array(
54 54
 			'duplicate_event' => array(
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 				'capability' => 'ee_delete_default_ticket',
67 67
 				'obj_id' => $tkt_id,
68 68
 				'noheader' => TRUE,
69
-				'args' => array( 'trash' => TRUE )
69
+				'args' => array('trash' => TRUE)
70 70
 				),
71 71
 			'trash_tickets' => array(
72 72
 				'func' => '_trash_or_restore_ticket',
73 73
 				'capability' => 'ee_delete_default_tickets',
74 74
 				'noheader' => TRUE,
75
-				'args' => array( 'trash' => TRUE )
75
+				'args' => array('trash' => TRUE)
76 76
 				),
77 77
 			'restore_ticket' => array(
78 78
 				'func' => '_trash_or_restore_ticket',
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 				)
128 128
 			);
129 129
 
130
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
130
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
131 131
 
132 132
 
133 133
 		//partial route/config override
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 		$this->_page_config['default']['list_table'] = 'Extend_Events_Admin_List_Table';
140 140
 
141 141
 		//add tickets tab but only if there are more than one default ticket!
142
-		$tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(array( array('TKT_is_default' => 1 ) ), 'TKT_ID', TRUE );
143
-		if ( $tkt_count > 1 ) {
142
+		$tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(array(array('TKT_is_default' => 1)), 'TKT_ID', TRUE);
143
+		if ($tkt_count > 1) {
144 144
 			$new_page_config = array(
145 145
 				'ticket_list_table' => array(
146 146
 					'nav' => array(
@@ -168,24 +168,24 @@  discard block
 block discarded – undo
168 168
 				'metaboxes' => $default_espresso_boxes,
169 169
 				'require_nonce' => FALSE
170 170
 		);
171
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
171
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
172 172
 
173 173
 		//add filters and actions
174 174
 		//modifying _views
175
-		add_filter('FHEE_event_datetime_metabox_add_additional_date_time_template', array( $this, 'add_additional_datetime_button' ), 10, 2 );
176
-		add_filter('FHEE_event_datetime_metabox_clone_button_template', array( $this, 'add_datetime_clone_button' ), 10, 2 );
177
-		add_filter('FHEE_event_datetime_metabox_timezones_template', array( $this, 'datetime_timezones_template'), 10, 2 );
175
+		add_filter('FHEE_event_datetime_metabox_add_additional_date_time_template', array($this, 'add_additional_datetime_button'), 10, 2);
176
+		add_filter('FHEE_event_datetime_metabox_clone_button_template', array($this, 'add_datetime_clone_button'), 10, 2);
177
+		add_filter('FHEE_event_datetime_metabox_timezones_template', array($this, 'datetime_timezones_template'), 10, 2);
178 178
 
179 179
 
180 180
 		//filters for event list table
181
-		add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array( $this, 'list_table_filters'), 10, 2);
182
-		add_filter('FHEE__Extend_Events_Admin_List_Table__column_actions__action_links', array( $this, 'extra_list_table_actions'), 10, 2 );
181
+		add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array($this, 'list_table_filters'), 10, 2);
182
+		add_filter('FHEE__Extend_Events_Admin_List_Table__column_actions__action_links', array($this, 'extra_list_table_actions'), 10, 2);
183 183
 
184 184
 		//legend item
185
-		add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array( $this, 'additional_legend_items') );
185
+		add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array($this, 'additional_legend_items'));
186 186
 
187 187
 		//heartbeat stuff
188
-		add_filter( 'heartbeat_received', array( $this, 'heartbeat_response' ), 10, 2 );
188
+		add_filter('heartbeat_received', array($this, 'heartbeat_response'), 10, 2);
189 189
 
190 190
 	}
191 191
 
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 	 *
200 200
 	 * @return array  possibly appended response.
201 201
 	 */
202
-	public function heartbeat_response( $response, $data ) {
202
+	public function heartbeat_response($response, $data) {
203 203
 		/**
204 204
 		 * check whether count of tickets is approaching the potential
205 205
 		 * limits for the server.
206 206
 		 */
207
-		if ( ! empty( $data['input_count'] ) ) {
207
+		if ( ! empty($data['input_count'])) {
208 208
 			$response['max_input_vars_check'] = EE_Registry::instance()->CFG->environment->max_input_vars_limit_check($data['input_count']);
209 209
 		}
210 210
 
@@ -219,13 +219,13 @@  discard block
 block discarded – undo
219 219
 
220 220
 
221 221
 
222
-	public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) {
223
-		$return = parent::extra_permalink_field_buttons( $return, $id, $new_title, $new_slug );
222
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) {
223
+		$return = parent::extra_permalink_field_buttons($return, $id, $new_title, $new_slug);
224 224
 		//make sure this is only when editing
225
-		if ( !empty( $id ) ) {
226
-			$href = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'duplicate_event', 'EVT_ID' => $id), $this->_admin_base_url );
225
+		if ( ! empty($id)) {
226
+			$href = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_event', 'EVT_ID' => $id), $this->_admin_base_url);
227 227
 			$title = esc_attr__('Duplicate Event', 'event_espresso');
228
-			$return .= '<a href="' . $href . '" title="' . $title . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">' . $title  . '</button>';
228
+			$return .= '<a href="'.$href.'" title="'.$title.'" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'.$title.'</button>';
229 229
 		}
230 230
 		return $return;
231 231
 	}
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 				'label' => __('Trash', 'event_espresso'),
249 249
 				'count' => 0,
250 250
 				'bulk_action' => array(
251
-					'restore_tickets' => __('Restore from Trash' , 'event_espresso'),
251
+					'restore_tickets' => __('Restore from Trash', 'event_espresso'),
252 252
 					'delete_tickets' => __('Delete Permanently', 'event_espresso')
253 253
 					)
254 254
 				)
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 
260 260
 	public function load_scripts_styles_edit() {
261
-		wp_register_script( 'ee-event-editor-heartbeat', EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js', array( 'ee_admin_js', 'heartbeat' ), EVENT_ESPRESSO_VERSION, TRUE );
261
+		wp_register_script('ee-event-editor-heartbeat', EVENTS_CAF_ASSETS_URL.'event-editor-heartbeat.js', array('ee_admin_js', 'heartbeat'), EVENT_ESPRESSO_VERSION, TRUE);
262 262
 
263 263
 		/**
264 264
 		 * load accounting js.
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 			'event_clone_dt_msg' => __('Clone this Event Date and Time', 'event_espresso'),
279 279
 			'remove_event_dt_msg' => __('Remove this Event Time', 'event_espresso')
280 280
 		);
281
-		EE_Registry::$i18n_js_strings = array_merge( EE_Registry::$i18n_js_strings, $new_strings);
282
-		wp_localize_script( 'event_editor_js', 'eei18n', EE_Registry::$i18n_js_strings );
281
+		EE_Registry::$i18n_js_strings = array_merge(EE_Registry::$i18n_js_strings, $new_strings);
282
+		wp_localize_script('event_editor_js', 'eei18n', EE_Registry::$i18n_js_strings);
283 283
 
284 284
 	}
285 285
 
@@ -288,20 +288,20 @@  discard block
 block discarded – undo
288 288
 
289 289
 
290 290
 
291
-	public function add_additional_datetime_button( $template, $template_args ) {
292
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_add_additional_time.template.php', $template_args, TRUE);
291
+	public function add_additional_datetime_button($template, $template_args) {
292
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_add_additional_time.template.php', $template_args, TRUE);
293 293
 	}
294 294
 
295 295
 
296 296
 
297
-	public function add_datetime_clone_button( $template, $template_args ) {
298
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_metabox_clone_button.template.php', $template_args, TRUE );
297
+	public function add_datetime_clone_button($template, $template_args) {
298
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_metabox_clone_button.template.php', $template_args, TRUE);
299 299
 	}
300 300
 
301 301
 
302 302
 
303
-	public function datetime_timezones_template( $template, $template_args ) {
304
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_timezones.template.php', $template_args, TRUE );
303
+	public function datetime_timezones_template($template, $template_args) {
304
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_timezones.template.php', $template_args, TRUE);
305 305
 	}
306 306
 
307 307
 
@@ -310,11 +310,11 @@  discard block
 block discarded – undo
310 310
 	protected function _set_list_table_views_default() {
311 311
 		parent::_set_list_table_views_default();
312 312
 		$export_label = __('Export Events', 'event_espresso');
313
-		if ( EE_Registry::instance()->CAP->current_user_can( 'export', 'espresso_events_export' ) ) {
313
+		if (EE_Registry::instance()->CAP->current_user_can('export', 'espresso_events_export')) {
314 314
 //			$this->_views['all']['bulk_action']['export_events'] = $export_label;
315 315
 //			$this->_views['draft']['bulk_action']['export_events'] = $export_label;
316 316
 
317
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
317
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
318 318
 //				$this->_views['trash']['bulk_action']['export_events'] = $export_label;
319 319
 			}
320 320
 		}
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 			)
341 341
 		);
342 342
 
343
-		$this->_views = array_merge( $this->_views, $new_views);
343
+		$this->_views = array_merge($this->_views, $new_views);
344 344
 	}
345 345
 
346 346
 
@@ -354,14 +354,14 @@  discard block
 block discarded – undo
354 354
 
355 355
 
356 356
 
357
-	public function extra_list_table_actions( $actionlinks, $event ) {
358
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_reports', $event->ID() ) ) {
357
+	public function extra_list_table_actions($actionlinks, $event) {
358
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_reports', $event->ID())) {
359 359
 			$reports_query_args = array(
360 360
 					'action' => 'reports',
361 361
 					'EVT_ID' => $event->ID()
362 362
 				);
363
-			$reports_link = EE_Admin_Page::add_query_args_and_nonce( $reports_query_args, REG_ADMIN_URL );
364
-			$actionlinks[] = '<a href="' . $reports_link . '" title="' .  esc_attr__('View Report', 'event_espresso') . '"><div class="dashicons dashicons-chart-bar"></div></a>' . "\n\t";
363
+			$reports_link = EE_Admin_Page::add_query_args_and_nonce($reports_query_args, REG_ADMIN_URL);
364
+			$actionlinks[] = '<a href="'.$reports_link.'" title="'.esc_attr__('View Report', 'event_espresso').'"><div class="dashicons dashicons-chart-bar"></div></a>'."\n\t";
365 365
 		}
366 366
 		return $actionlinks;
367 367
 	}
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 
370 370
 
371 371
 	public function additional_legend_items($items) {
372
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_reports' ) ) {
372
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_reports')) {
373 373
 			$items['reports'] = array(
374 374
 					'class' => 'dashicons dashicons-chart-bar',
375 375
 					'desc' => __('Event Reports', 'event_espresso')
@@ -394,17 +394,17 @@  discard block
 block discarded – undo
394 394
 	 */
395 395
 	protected function _duplicate_event() {
396 396
 		//first make sure the ID for the event is in the request.  If it isnt' then we need to bail and redirect back to overview list table (cause how did we get here?)
397
-		if ( !isset( $this->_req_data['EVT_ID'] ) ) {
398
-			EE_Error::add_error( __('In order to duplicate an event an Event ID is required.  None was given.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
399
-			$this->_redirect_after_action( FALSE, '', '', array(), TRUE );
397
+		if ( ! isset($this->_req_data['EVT_ID'])) {
398
+			EE_Error::add_error(__('In order to duplicate an event an Event ID is required.  None was given.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
399
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
400 400
 			return;
401 401
 		}
402 402
 
403 403
 		//k we've got EVT_ID so let's use that to get the event we'll duplicate
404
-		$orig_event = EEM_Event::instance()->get_one_by_ID( $this->_req_data['EVT_ID'] );
404
+		$orig_event = EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']);
405 405
 
406
-		if ( ! $orig_event instanceof EE_Event )
407
-			throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) );
406
+		if ( ! $orig_event instanceof EE_Event)
407
+			throw new EE_Error(sprintf(__('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID']));
408 408
 
409 409
 		//k now let's clone the $orig_event before getting relations
410 410
 		$new_event = clone $orig_event;
@@ -417,43 +417,43 @@  discard block
 block discarded – undo
417 417
 
418 418
 
419 419
 		//reset the ID and modify other details to make it clear this is a dupe
420
-		$new_event->set( 'EVT_ID', 0 );
421
-		$new_name = $new_event->name() . ' ' . __('**DUPLICATE**', 'event_espresso');
422
-		$new_event->set( 'EVT_name',  $new_name );
423
-		$new_event->set( 'EVT_slug',  sanitize_title_with_dashes( $new_name ) );
424
-		$new_event->set( 'status', 'draft' );
420
+		$new_event->set('EVT_ID', 0);
421
+		$new_name = $new_event->name().' '.__('**DUPLICATE**', 'event_espresso');
422
+		$new_event->set('EVT_name', $new_name);
423
+		$new_event->set('EVT_slug', sanitize_title_with_dashes($new_name));
424
+		$new_event->set('status', 'draft');
425 425
 
426 426
 		//duplicate discussion settings
427
-		$new_event->set( 'comment_status', $orig_event->get('comment_status') );
428
-		$new_event->set( 'ping_status', $orig_event->get( 'ping_status' ) );
427
+		$new_event->set('comment_status', $orig_event->get('comment_status'));
428
+		$new_event->set('ping_status', $orig_event->get('ping_status'));
429 429
 
430 430
 		//save the new event
431 431
 		$new_event->save();
432 432
 
433 433
 		//venues
434
-		foreach( $orig_ven as $ven ) {
435
-			$new_event->_add_relation_to( $ven, 'Venue' );
434
+		foreach ($orig_ven as $ven) {
435
+			$new_event->_add_relation_to($ven, 'Venue');
436 436
 		}
437 437
 		$new_event->save();
438 438
 
439 439
 
440 440
 		//now we need to get the question group relations and handle that
441 441
 		//first primary question groups
442
-		$orig_primary_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 1 ) ) );
443
-		if ( !empty( $orig_primary_qgs ) ) {
444
-			foreach ( $orig_primary_qgs as $id => $obj ) {
445
-				if ( $obj instanceof EE_Question_Group ) {
446
-					$new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 1 ) );
442
+		$orig_primary_qgs = $orig_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 1)));
443
+		if ( ! empty($orig_primary_qgs)) {
444
+			foreach ($orig_primary_qgs as $id => $obj) {
445
+				if ($obj instanceof EE_Question_Group) {
446
+					$new_event->_add_relation_to($obj, 'Question_Group', array('EQG_primary' => 1));
447 447
 				}
448 448
 			}
449 449
 		}
450 450
 
451 451
 		//next additional attendee question groups
452
-		$orig_additional_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 0 ) ) );
453
-		if ( !empty( $orig_additional_qgs ) ) {
454
-			foreach ( $orig_additional_qgs as $id => $obj ) {
455
-				if ( $obj instanceof EE_Question_Group ) {
456
-					$new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 0 ) );
452
+		$orig_additional_qgs = $orig_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0)));
453
+		if ( ! empty($orig_additional_qgs)) {
454
+			foreach ($orig_additional_qgs as $id => $obj) {
455
+				if ($obj instanceof EE_Question_Group) {
456
+					$new_event->_add_relation_to($obj, 'Question_Group', array('EQG_primary' => 0));
457 457
 				}
458 458
 			}
459 459
 		}
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 
465 465
 		//k now that we have the new event saved we can loop through the datetimes and start adding relations.
466 466
 		$cloned_tickets = array();
467
-		foreach ( $orig_datetimes as $orig_dtt ) {
467
+		foreach ($orig_datetimes as $orig_dtt) {
468 468
 			$new_dtt = clone $orig_dtt;
469 469
 			$orig_tkts = $orig_dtt->tickets();
470 470
 
@@ -472,22 +472,22 @@  discard block
 block discarded – undo
472 472
 			$new_dtt->set('DTT_ID', 0);
473 473
 			$new_dtt->set('DTT_sold', 0);
474 474
 			$new_dtt->save();
475
-			$new_event->_add_relation_to( $new_dtt, 'Datetime');
475
+			$new_event->_add_relation_to($new_dtt, 'Datetime');
476 476
 			$new_event->save();
477 477
 
478 478
 			//now let's get the ticket relations setup.
479
-			foreach ( (array) $orig_tkts as $orig_tkt ) {
479
+			foreach ((array) $orig_tkts as $orig_tkt) {
480 480
 				//it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
481
-				if ( ! $orig_tkt instanceof EE_Ticket )
481
+				if ( ! $orig_tkt instanceof EE_Ticket)
482 482
 					continue;
483 483
 
484 484
 				//is this ticket archived?  If it is then let's skip
485
-				if ( $orig_tkt->get( 'TKT_deleted' ) ) {
485
+				if ($orig_tkt->get('TKT_deleted')) {
486 486
 					continue;
487 487
 				}
488 488
 
489 489
 				//does this original ticket already exist in the clone_tickets cache?  If so we'll just use the new ticket from it.
490
-				if ( isset( $cloned_tickets[$orig_tkt->ID()] ) ) {
490
+				if (isset($cloned_tickets[$orig_tkt->ID()])) {
491 491
 					$new_tkt = $cloned_tickets[$orig_tkt->ID()];
492 492
 				} else {
493 493
 					$new_tkt = clone $orig_tkt;
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 					$new_tkt->save(); //make sure new ticket has ID.
500 500
 
501 501
 					//price relations on new ticket need to be setup.
502
-					foreach ( $orig_prices as $orig_price ) {
502
+					foreach ($orig_prices as $orig_price) {
503 503
 						$new_price = clone $orig_price;
504 504
 						$new_price->set('PRC_ID', 0);
505 505
 						$new_price->save();
@@ -516,39 +516,39 @@  discard block
 block discarded – undo
516 516
 		}
517 517
 
518 518
 		//clone taxonomy information
519
-		$taxonomies_to_clone_with = apply_filters( 'FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone', array( 'espresso_event_categories', 'espresso_event_type', 'post_tag' ) );
519
+		$taxonomies_to_clone_with = apply_filters('FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone', array('espresso_event_categories', 'espresso_event_type', 'post_tag'));
520 520
 
521 521
 		//get terms for original event (notice)
522
-		$orig_terms = wp_get_object_terms( $orig_event->ID(), $taxonomies_to_clone_with );
522
+		$orig_terms = wp_get_object_terms($orig_event->ID(), $taxonomies_to_clone_with);
523 523
 
524 524
 		//loop through terms and add them to new event.
525
-		foreach ( $orig_terms as $term ) {
526
-			wp_set_object_terms( $new_event->ID(), $term->term_id, $term->taxonomy, true );
525
+		foreach ($orig_terms as $term) {
526
+			wp_set_object_terms($new_event->ID(), $term->term_id, $term->taxonomy, true);
527 527
 		}
528 528
 
529 529
 
530
-		do_action( 'AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event );
530
+		do_action('AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event);
531 531
 
532 532
 		//now let's redirect to the edit page for this duplicated event if we have a new event id.
533
-		if ( $new_event->ID() ) {
533
+		if ($new_event->ID()) {
534 534
 			$redirect_args = array(
535 535
 				'post' => $new_event->ID(),
536 536
 				'action' => 'edit'
537 537
 			);
538
-			EE_Error::add_success( __('Event successfully duplicated.  Please review the details below and make any necessary edits', 'event_espresso') );
538
+			EE_Error::add_success(__('Event successfully duplicated.  Please review the details below and make any necessary edits', 'event_espresso'));
539 539
 		} else {
540 540
 			$redirect_args = array(
541 541
 				'action' => 'default'
542 542
 				);
543
-			EE_Error::add_error( __('Not able to duplicate event.  Something went wrong.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
543
+			EE_Error::add_error(__('Not able to duplicate event.  Something went wrong.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
544 544
 		}
545 545
 
546
-		$this->_redirect_after_action(FALSE, '', '', $redirect_args, TRUE );
546
+		$this->_redirect_after_action(FALSE, '', '', $redirect_args, TRUE);
547 547
 	}
548 548
 
549 549
 
550 550
 
551
-	protected function _import_page(){
551
+	protected function _import_page() {
552 552
 
553 553
 		$title = __('Import', 'event_espresso');
554 554
 		$intro = __('If you have a previously exported Event Espresso 4 information in a Comma Separated Value (CSV) file format, you can upload the file here: ', 'event_espresso');
@@ -556,8 +556,8 @@  discard block
 block discarded – undo
556 556
 		$action = 'import_events';
557 557
 		$type = 'csv';
558 558
 		$this->_template_args['form'] = EE_Import::instance()->upload_form($title, $intro, $form_url, $action, $type);
559
-		$this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'sample_export_file'),$this->_admin_base_url);
560
-		$content = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH . 'import_page.template.php',$this->_template_args,true);
559
+		$this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'sample_export_file'), $this->_admin_base_url);
560
+		$content = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'import_page.template.php', $this->_template_args, true);
561 561
 
562 562
 
563 563
 		$this->_template_args['admin_page_content'] = $content;
@@ -570,9 +570,9 @@  discard block
 block discarded – undo
570 570
 	 * @return string html
571 571
 	 */
572 572
 	protected function _import_events() {
573
-		require_once(EE_CLASSES . 'EE_Import.class.php');
573
+		require_once(EE_CLASSES.'EE_Import.class.php');
574 574
 		$success = EE_Import::instance()->import();
575
-		$this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'),true);
575
+		$this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'), true);
576 576
 
577 577
 	}
578 578
 
@@ -586,24 +586,24 @@  discard block
 block discarded – undo
586 586
 	 * @return file
587 587
 	 */
588 588
 	protected function _events_export() {
589
-		if(isset($this->_req_data['EVT_ID'])){
589
+		if (isset($this->_req_data['EVT_ID'])) {
590 590
 			$event_ids = $this->_req_data['EVT_ID'];
591
-		}elseif(isset($this->_req_data['EVT_IDs'])){
591
+		}elseif (isset($this->_req_data['EVT_IDs'])) {
592 592
 			$event_ids = $this->_req_data['EVT_IDs'];
593
-		}else{
593
+		} else {
594 594
 			$event_ids = NULL;
595 595
 		}
596 596
 		//todo: I don't like doing this but it'll do until we modify EE_Export Class.
597 597
 		$new_request_args = array(
598 598
 			'export' => 'report',
599 599
 			'action' => 'all_event_data',
600
-			'EVT_ID' => $event_ids ,
600
+			'EVT_ID' => $event_ids,
601 601
 		);
602 602
 		$this->_req_data = array_merge($this->_req_data, $new_request_args);
603 603
 
604
-		EE_Registry::instance()->load_helper( 'File' );
605
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
606
-			require_once(EE_CLASSES . 'EE_Export.class.php');
604
+		EE_Registry::instance()->load_helper('File');
605
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
606
+			require_once(EE_CLASSES.'EE_Export.class.php');
607 607
 			$EE_Export = EE_Export::instance($this->_req_data);
608 608
 			$EE_Export->export();
609 609
 		}
@@ -625,12 +625,12 @@  discard block
 block discarded – undo
625 625
 			'category_ids' => $this->_req_data['EVT_CAT_ID']
626 626
 			);
627 627
 
628
-		$this->_req_data = array_merge( $this->_req_data, $new_request_args );
628
+		$this->_req_data = array_merge($this->_req_data, $new_request_args);
629 629
 
630
-		EE_Registry::instance()->load_helper( 'File' );
631
-		if ( is_readable( EE_CLASSES . 'EE_Export.class.php') ) {
632
-			require_once( EE_CLASSES . 'EE_Export.class.php');
633
-			$EE_Export = EE_Export::instance( $this->_req_data );
630
+		EE_Registry::instance()->load_helper('File');
631
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
632
+			require_once(EE_CLASSES.'EE_Export.class.php');
633
+			$EE_Export = EE_Export::instance($this->_req_data);
634 634
 			$EE_Export->export();
635 635
 		}
636 636
 
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 	/**
642 642
 	 * Creates a sample CSV file for importing
643 643
 	 */
644
-	protected function _sample_export_file(){
644
+	protected function _sample_export_file() {
645 645
 //		require_once(EE_CLASSES . 'EE_Export.class.php');
646 646
 		EE_Export::instance()->export_sample();
647 647
 	}
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 
660 660
 		$this->verify_cpt_object();
661 661
 
662
-		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array( $this, 'registration_options_meta_box' ), $this->page_slug, 'side', 'core');
662
+		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array($this, 'registration_options_meta_box'), $this->page_slug, 'side', 'core');
663 663
 		//add_meta_box('espresso_event_types', __('Event Type', 'event_espresso'), array( $this, 'event_type_meta_box' ), $this->page_slug, 'side', 'default' ); //add this back in when the feature is ready.
664 664
 
665 665
 		//todo feature in progress
@@ -683,16 +683,16 @@  discard block
 block discarded – undo
683 683
 			array('id' => true, 'text' => __('Yes', 'event_espresso')),
684 684
 			array('id' => false, 'text' => __('No', 'event_espresso'))
685 685
 		);
686
-		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete ), TRUE);
686
+		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete), TRUE);
687 687
 		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(FALSE);
688 688
 		$template_args['_event'] = $this->_cpt_model_obj;
689 689
 		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
690 690
 		$template_args['default_registration_status'] = EEH_Form_Fields::select_input('default_reg_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
691 691
 		$template_args['display_description'] = EEH_Form_Fields::select_input('display_desc', $yes_no_values, $this->_cpt_model_obj->display_description());
692 692
 		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input('display_ticket_selector', $yes_no_values, $this->_cpt_model_obj->display_ticket_selector(), '', '', false);
693
-		$template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input('EVT_default_registration_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status() );
694
-		$template_args['additional_registration_options'] = apply_filters( 'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values );
695
-		$templatepath = EVENTS_CAF_TEMPLATE_PATH . 'event_registration_options.template.php';
693
+		$template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input('EVT_default_registration_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
694
+		$template_args['additional_registration_options'] = apply_filters('FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values);
695
+		$templatepath = EVENTS_CAF_TEMPLATE_PATH.'event_registration_options.template.php';
696 696
 		EEH_Template::display_template($templatepath, $template_args);
697 697
 	}
698 698
 
@@ -705,9 +705,9 @@  discard block
 block discarded – undo
705 705
 	 * @param  array  $box  metabox args
706 706
 	 * @return string       metabox contents
707 707
 	 */
708
-	public function event_type_meta_box( $post, $box ) {
709
-		$template_args['radio_list'] = $this->wp_terms_radio($post->ID, array( 'taxonomy' => 'espresso_event_type' ) );
710
-		$template = EVENTS_CAF_TEMPLATE_PATH . 'event_type_metabox_contents.template.php';
708
+	public function event_type_meta_box($post, $box) {
709
+		$template_args['radio_list'] = $this->wp_terms_radio($post->ID, array('taxonomy' => 'espresso_event_type'));
710
+		$template = EVENTS_CAF_TEMPLATE_PATH.'event_type_metabox_contents.template.php';
711 711
 		EEH_Template::display_template($template, $template_args);
712 712
 	}
713 713
 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 
718 718
 
719 719
 
720
-	public function wp_terms_radio( $post_id = 0, $args = array() ) {
720
+	public function wp_terms_radio($post_id = 0, $args = array()) {
721 721
 		$defaults = array(
722 722
 			'descendants_and_self' => 0,
723 723
 			'selected_cats' => false,
@@ -726,11 +726,11 @@  discard block
 block discarded – undo
726 726
 			'taxonomy' => 'category',
727 727
 			'checked_ontop' => true
728 728
 		);
729
-		$args = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
729
+		$args = apply_filters('wp_terms_checklist_args', $args, $post_id);
730 730
 
731
-		extract( wp_parse_args($args, $defaults), EXTR_SKIP );
731
+		extract(wp_parse_args($args, $defaults), EXTR_SKIP);
732 732
 
733
-		if ( empty($walker) || !is_a($walker, 'Walker') )
733
+		if (empty($walker) || ! is_a($walker, 'Walker'))
734 734
 			$walker = new Walker_Radio_Checklist;
735 735
 
736 736
 		$descendants_and_self = (int) $descendants_and_self;
@@ -738,37 +738,37 @@  discard block
 block discarded – undo
738 738
 		$args = array('taxonomy' => $taxonomy);
739 739
 
740 740
 		$tax = get_taxonomy($taxonomy);
741
-		$args['disabled'] = !current_user_can($tax->cap->assign_terms);
741
+		$args['disabled'] = ! current_user_can($tax->cap->assign_terms);
742 742
 
743
-		if ( is_array( $selected_cats ) )
743
+		if (is_array($selected_cats))
744 744
 			$args['selected_cats'] = $selected_cats;
745
-		elseif ( $post_id )
745
+		elseif ($post_id)
746 746
 			$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
747 747
 		else
748 748
 			$args['selected_cats'] = array();
749 749
 
750
-		if ( is_array( $popular_cats ) )
750
+		if (is_array($popular_cats))
751 751
 			$args['popular_cats'] = $popular_cats;
752 752
 		else
753
-			$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
753
+			$args['popular_cats'] = get_terms($taxonomy, array('fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false));
754 754
 
755
-		if ( $descendants_and_self ) {
756
-			$categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) );
757
-			$self = get_term( $descendants_and_self, $taxonomy );
758
-			array_unshift( $categories, $self );
755
+		if ($descendants_and_self) {
756
+			$categories = (array) get_terms($taxonomy, array('child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0));
757
+			$self = get_term($descendants_and_self, $taxonomy);
758
+			array_unshift($categories, $self);
759 759
 		} else {
760 760
 			$categories = (array) get_terms($taxonomy, array('get' => 'all'));
761 761
 		}
762 762
 
763
-		if ( $checked_ontop ) {
763
+		if ($checked_ontop) {
764 764
 			// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
765 765
 			$checked_categories = array();
766
-			$keys = array_keys( $categories );
766
+			$keys = array_keys($categories);
767 767
 
768
-			foreach( $keys as $k ) {
769
-				if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
768
+			foreach ($keys as $k) {
769
+				if (in_array($categories[$k]->term_id, $args['selected_cats'])) {
770 770
 					$checked_categories[] = $categories[$k];
771
-					unset( $categories[$k] );
771
+					unset($categories[$k]);
772 772
 				}
773 773
 			}
774 774
 
@@ -793,18 +793,18 @@  discard block
 block discarded – undo
793 793
 	 * @param  array  $list_table_obj the list table object
794 794
 	 * @return array                  new filters
795 795
 	 */
796
-	public function list_table_filters( $oldfilters, $list_table_obj ) {
796
+	public function list_table_filters($oldfilters, $list_table_obj) {
797 797
 		$filters = array();
798 798
 
799 799
 		//first month/year filters
800 800
 		$filters[] = $this->espresso_event_months_dropdown();
801 801
 
802 802
 
803
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
803
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
804 804
 
805 805
 		//active status dropdown
806
-		if ( $status !== 'draft' )
807
-			$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
806
+		if ($status !== 'draft')
807
+			$filter[] = $this->active_status_dropdown(isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : '');
808 808
 
809 809
 		//category filter
810 810
 		$filters[] = $this->category_dropdown();
@@ -826,17 +826,17 @@  discard block
 block discarded – undo
826 826
 	 */
827 827
 	public function espresso_event_months_dropdown() {
828 828
 		//what we need to do is get all PRIMARY datetimes for all events to filter on. Note we need to include any other filters that are set!
829
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
829
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
830 830
 
831 831
 		//categories?
832
-		$category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
832
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
833 833
 
834 834
 		//active status?
835
-		$active_status = isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : NULL;
835
+		$active_status = isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : NULL;
836 836
 
837 837
 		$cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : '';
838 838
 
839
-		return EEH_Form_Fields::generate_event_months_dropdown( $cur_date, $status, $category, $active_status );
839
+		return EEH_Form_Fields::generate_event_months_dropdown($cur_date, $status, $category, $active_status);
840 840
 	}
841 841
 
842 842
 
@@ -847,12 +847,12 @@  discard block
 block discarded – undo
847 847
 	 * @param  string $current_value whatever the ucrrent active status is
848 848
 	 * @return string                html dropdown.
849 849
 	 */
850
-	public function  active_status_dropdown( $current_value = '' ) {
850
+	public function  active_status_dropdown($current_value = '') {
851 851
 		$select_name = 'active_status';
852
-		$values = array('none' => __('Show Active/Inactive', 'event_espresso'), 'active' => __('Active', 'event_espresso'), 'upcoming' => __('Upcoming', 'event_espresso'), 'expired' => __('Expired', 'event_espresso'), 'inactive' => __('Inactive', 'event_espresso') );
852
+		$values = array('none' => __('Show Active/Inactive', 'event_espresso'), 'active' => __('Active', 'event_espresso'), 'upcoming' => __('Upcoming', 'event_espresso'), 'expired' => __('Expired', 'event_espresso'), 'inactive' => __('Inactive', 'event_espresso'));
853 853
 		$id = 'id="espresso-active-status-dropdown-filter"';
854 854
 		$class = 'wide';
855
-		echo EEH_Form_Fields::select_input( $select_name, $values, $current_value, $id, $class );
855
+		echo EEH_Form_Fields::select_input($select_name, $values, $current_value, $id, $class);
856 856
 	}
857 857
 
858 858
 
@@ -864,9 +864,9 @@  discard block
 block discarded – undo
864 864
 	 * @return string html
865 865
 	 */
866 866
 	public function category_dropdown() {
867
-		$cur_cat = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1;
867
+		$cur_cat = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1;
868 868
 
869
-		return EEH_Form_Fields::generate_event_category_dropdown( $cur_cat );
869
+		return EEH_Form_Fields::generate_event_category_dropdown($cur_cat);
870 870
 	}
871 871
 
872 872
 
@@ -882,10 +882,10 @@  discard block
 block discarded – undo
882 882
 		$end = ' 23:59:59';
883 883
 
884 884
 		$where = array(
885
-			'Datetime.DTT_EVT_start' => array( 'BETWEEN', array(strtotime(date('Y-m-d') . $start), strtotime(date('Y-m-d') . $end) ) )
885
+			'Datetime.DTT_EVT_start' => array('BETWEEN', array(strtotime(date('Y-m-d').$start), strtotime(date('Y-m-d').$end)))
886 886
 			);
887 887
 
888
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' );
888
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID');
889 889
 		return $count;
890 890
 	}
891 891
 
@@ -904,10 +904,10 @@  discard block
 block discarded – undo
904 904
 		$end = ' 23:59:59';
905 905
 
906 906
 		$where = array(
907
-			'Datetime.DTT_EVT_start' => array( 'BETWEEN', array(strtotime($this_year_r . '-' . $this_month_r . '-01' . $start), strtotime($this_year_r . '-' . $this_month_r . '-' . $days_this_month . $end) ) )
907
+			'Datetime.DTT_EVT_start' => array('BETWEEN', array(strtotime($this_year_r.'-'.$this_month_r.'-01'.$start), strtotime($this_year_r.'-'.$this_month_r.'-'.$days_this_month.$end)))
908 908
 			);
909 909
 
910
-		$count = EEM_Event::instance()->count( array( $where ), 'EVT_ID', TRUE );
910
+		$count = EEM_Event::instance()->count(array($where), 'EVT_ID', TRUE);
911 911
 		return $count;
912 912
 	}
913 913
 
@@ -924,53 +924,53 @@  discard block
 block discarded – undo
924 924
 
925 925
 
926 926
 
927
-	public function get_default_tickets( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
927
+	public function get_default_tickets($per_page = 10, $count = FALSE, $trashed = FALSE) {
928 928
 
929
-		$orderby= empty( $this->_req_data['orderby'] ) ? 'TKT_name' : $this->_req_data['orderby'];
930
-		$order = empty( $this->_req_data['order'] ) ? 'ASC' : $this->_req_data['order'];
929
+		$orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
930
+		$order = empty($this->_req_data['order']) ? 'ASC' : $this->_req_data['order'];
931 931
 
932
-		switch ( $orderby ) {
932
+		switch ($orderby) {
933 933
 			case 'TKT_name' :
934
-				$orderby = array( 'TKT_name' => $order );
934
+				$orderby = array('TKT_name' => $order);
935 935
 				break;
936 936
 
937 937
 			case 'TKT_price' :
938
-				$orderby = array( 'TKT_price' => $order );
938
+				$orderby = array('TKT_price' => $order);
939 939
 				break;
940 940
 
941 941
 			case 'TKT_uses' :
942
-				$orderby = array( 'TKT_uses' => $order );
942
+				$orderby = array('TKT_uses' => $order);
943 943
 				break;
944 944
 
945 945
 			case 'TKT_min' :
946
-				$orderby = array( 'TKT_min' => $order );
946
+				$orderby = array('TKT_min' => $order);
947 947
 				break;
948 948
 
949 949
 			case 'TKT_max' :
950
-				$orderby = array( 'TKT_max' => $order );
950
+				$orderby = array('TKT_max' => $order);
951 951
 				break;
952 952
 
953 953
 			case 'TKT_qty' :
954
-				$orderby = array( 'TKT_qty' => $order );
954
+				$orderby = array('TKT_qty' => $order);
955 955
 				break;
956 956
 		}
957 957
 
958
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
959
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
958
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
959
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
960 960
 
961 961
 		$_where = array(
962 962
 			'TKT_is_default' => 1,
963 963
 			'TKT_deleted' => $trashed
964 964
 			);
965 965
 
966
-		$offset = ($current_page-1)*$per_page;
967
-		$limit = array( $offset, $per_page );
966
+		$offset = ($current_page - 1) * $per_page;
967
+		$limit = array($offset, $per_page);
968 968
 
969
-		if ( isset( $this->_req_data['s'] ) ) {
970
-			$sstr = '%' . $this->_req_data['s'] . '%';
969
+		if (isset($this->_req_data['s'])) {
970
+			$sstr = '%'.$this->_req_data['s'].'%';
971 971
 			$_where['OR'] = array(
972
-				'TKT_name' => array('LIKE',$sstr ),
973
-				'TKT_description' => array('LIKE',$sstr )
972
+				'TKT_name' => array('LIKE', $sstr),
973
+				'TKT_description' => array('LIKE', $sstr)
974 974
 				);
975 975
 		}
976 976
 
@@ -981,9 +981,9 @@  discard block
 block discarded – undo
981 981
 			'group_by'=>'TKT_ID'
982 982
 			);
983 983
 
984
-		if($count){
984
+		if ($count) {
985 985
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
986
-		}else{
986
+		} else {
987 987
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
988 988
 		}
989 989
 
@@ -993,35 +993,35 @@  discard block
 block discarded – undo
993 993
 
994 994
 
995 995
 
996
-	protected function _trash_or_restore_ticket(  $trash = FALSE ) {
996
+	protected function _trash_or_restore_ticket($trash = FALSE) {
997 997
 		$success = 1;
998 998
 
999 999
 		$TKT = EEM_Ticket::instance();
1000 1000
 
1001 1001
 		//checkboxes?
1002
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
1002
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1003 1003
 			//if array has more than one element then success message should be plural
1004
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1004
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1005 1005
 
1006 1006
 			//cycle thru the boxes
1007
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1008
-				if ( $trash ) {
1009
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1007
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
1008
+				if ($trash) {
1009
+					if ( ! $TKT->delete_by_ID($TKT_ID))
1010 1010
 						$success = 0;
1011 1011
 				} else {
1012
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1012
+					if ( ! $TKT->restore_by_ID($TKT_ID))
1013 1013
 						$success = 0;
1014 1014
 				}
1015 1015
 			}
1016 1016
 		} else {
1017 1017
 			//grab single id and trash
1018
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1018
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
1019 1019
 
1020
-			if ( $trash ) {
1021
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1020
+			if ($trash) {
1021
+				if ( ! $TKT->delete_by_ID($TKT_ID))
1022 1022
 					$success = 0;
1023 1023
 			} else {
1024
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1024
+				if ( ! $TKT->restore_by_ID($TKT_ID))
1025 1025
 					$success = 0;
1026 1026
 			}
1027 1027
 		}
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 			'action' => 'ticket_list_table',
1032 1032
 			'status' => $trash ? '' : 'trashed'
1033 1033
 			);
1034
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1034
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1035 1035
 	}
1036 1036
 
1037 1037
 
@@ -1044,21 +1044,21 @@  discard block
 block discarded – undo
1044 1044
 		$TKT = EEM_Ticket::instance();
1045 1045
 
1046 1046
 		//checkboxes?
1047
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
1047
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1048 1048
 			//if array has more than one element then success message should be plural
1049
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1049
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1050 1050
 
1051 1051
 			//cycle thru the boxes
1052
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1052
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
1053 1053
 				//delete
1054
-				if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
1054
+				if ( ! $this->_delete_the_ticket($TKT_ID)) {
1055 1055
 					$success = 0;
1056 1056
 				}
1057 1057
 			}
1058 1058
 		} else {
1059 1059
 			//grab single id and trash
1060
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1061
-			if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
1060
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
1061
+			if ( ! $this->_delete_the_ticket($TKT_ID)) {
1062 1062
 					$success = 0;
1063 1063
 				}
1064 1064
 		}
@@ -1070,16 +1070,16 @@  discard block
 block discarded – undo
1070 1070
 			);
1071 1071
 
1072 1072
 		//failsafe.  If the default ticket count === 1 then we need to redirect to event overview.
1073
-		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) )
1073
+		if (EEM_Ticket::instance()->count_deleted_and_undeleted(array(array('TKT_is_default' => 1)), 'TKT_ID', TRUE))
1074 1074
 			$query_args = array();
1075
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1075
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1076 1076
 	}
1077 1077
 
1078 1078
 
1079 1079
 
1080 1080
 
1081
-	protected function _delete_the_ticket( $TKT_ID ) {
1082
-		$tkt = EEM_Ticket::instance()->get_one_by_ID( $TKT_ID );
1081
+	protected function _delete_the_ticket($TKT_ID) {
1082
+		$tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
1083 1083
 		$tkt->_remove_relations('Datetime');
1084 1084
 		//delete all related prices first
1085 1085
 		$tkt->delete_related_permanently('Price');
@@ -1090,20 +1090,20 @@  discard block
 block discarded – undo
1090 1090
 
1091 1091
 } //end class Events_Admin_Page
1092 1092
 
1093
-require_once ABSPATH . 'wp-admin/includes/template.php';
1093
+require_once ABSPATH.'wp-admin/includes/template.php';
1094 1094
 class Walker_Radio_Checklist extends Walker_Category_Checklist {
1095 1095
 
1096
-	function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
1096
+	function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0) {
1097 1097
 		extract($args);
1098
-		if ( empty($taxonomy) )
1098
+		if (empty($taxonomy))
1099 1099
 			$taxonomy = 'category';
1100 1100
 
1101
-		if ( $taxonomy == 'category' )
1101
+		if ($taxonomy == 'category')
1102 1102
 			$name = 'post_category';
1103 1103
 		else
1104 1104
 			$name = 'tax_input['.$taxonomy.']';
1105 1105
 
1106 1106
 		$class = '';
1107
-		$output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="radio" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';
1107
+		$output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>".'<label class="selectit"><input value="'.$category->term_id.'" type="radio" name="'.$name.'[]" id="in-'.$taxonomy.'-'.$category->term_id.'"'.checked(in_array($category->term_id, $selected_cats), true, false).disabled(empty($args['disabled']), false, false).' /> '.esc_html(apply_filters('the_category', $category->name)).'</label>';
1108 1108
 	}
1109 1109
 }
Please login to merge, or discard this patch.