Completed
Branch BETA-4.9-message-activity (e05538)
by
unknown
392:18 queued 376:05
created
caffeinated/admin/extend/events/qtips/EE_Event_Editor_Tips.lib.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 				),
84 84
 			7 => array(
85 85
 				'content_id' => 'tkt-status-archived',
86
-				'target' => '.ticket-row .tkt-status-' . EE_Ticket::archived,
86
+				'target' => '.ticket-row .tkt-status-'.EE_Ticket::archived,
87 87
 				'content' => $this->_ticket_status_legend(EE_Ticket::archived),
88 88
 				'options' => array(
89 89
 					'position' => array(
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 				),
97 97
 			8 => array(
98 98
 				'content_id' => 'tkt-status-expired',
99
-				'target' => '.ticket-row .tkt-status-' . EE_Ticket::expired,
99
+				'target' => '.ticket-row .tkt-status-'.EE_Ticket::expired,
100 100
 				'content' => $this->_ticket_status_legend(EE_Ticket::expired),
101 101
 				'options' => array(
102 102
 					'position' => array(
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 				),
110 110
 			9 => array(
111 111
 				'content_id' => 'tkt-status-sold_out',
112
-				'target' => '.ticket-row .tkt-status-' . EE_Ticket::sold_out,
112
+				'target' => '.ticket-row .tkt-status-'.EE_Ticket::sold_out,
113 113
 				'content' => $this->_ticket_status_legend(EE_Ticket::sold_out),
114 114
 				'options' => array(
115 115
 					'position' => array(
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 				),
123 123
 			10 => array(
124 124
 				'content_id' => 'tkt-status-pending',
125
-				'target' => '.ticket-row .tkt-status-' . EE_Ticket::pending,
125
+				'target' => '.ticket-row .tkt-status-'.EE_Ticket::pending,
126 126
 				'content' => $this->_ticket_status_legend(EE_Ticket::pending),
127 127
 				'options' => array(
128 128
 					'position' => array(
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 				),
136 136
 			11 => array(
137 137
 				'content_id' => 'tkt-status-onsale',
138
-				'target' => '.ticket-row .tkt-status-' . EE_Ticket::onsale,
138
+				'target' => '.ticket-row .tkt-status-'.EE_Ticket::onsale,
139 139
 				'content' => $this->_ticket_status_legend(EE_Ticket::onsale),
140 140
 				'options' => array(
141 141
 					'position' => array(
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 
179 179
 
180 180
 	private function _get_taxable_info_content() {
181
-		$price_admin_link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), PRICING_ADMIN_URL );
182
-		return '<p>' . sprintf( __('Clicking the taxable ticket toggle checkbox has enabled taxes for this ticket. What this means is that when a person purchases this ticket, the tax will be applied to all prices on this ticket. You can edit the existing tax price modifier that was setup in Event Espresso by going to  %sDefault Pricing Admin Page%s (labelled "Pricing" in the Event Espresso Menu)', 'event_espresso'), '<a href="' . $price_admin_link . '" title="' . esc_attr__('Pricing Admin Page', 'event_espresso') . '">', '</a>' ) . '</p>';
181
+		$price_admin_link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), PRICING_ADMIN_URL);
182
+		return '<p>'.sprintf(__('Clicking the taxable ticket toggle checkbox has enabled taxes for this ticket. What this means is that when a person purchases this ticket, the tax will be applied to all prices on this ticket. You can edit the existing tax price modifier that was setup in Event Espresso by going to  %sDefault Pricing Admin Page%s (labelled "Pricing" in the Event Espresso Menu)', 'event_espresso'), '<a href="'.$price_admin_link.'" title="'.esc_attr__('Pricing Admin Page', 'event_espresso').'">', '</a>').'</p>';
183 183
 	}
184 184
 
185 185
 	/**
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 * @param  EE_Ticket constant $status What status is set (by class)
188 188
 	 * @return string         The status legend with the related status highlighted
189 189
 	 */
190
-	private function _ticket_status_legend( $status ) {
190
+	private function _ticket_status_legend($status) {
191 191
 
192 192
 		$status_array = array(
193 193
 			'archived' => EE_Ticket::archived,
@@ -197,6 +197,6 @@  discard block
 block discarded – undo
197 197
 			'onsale' => EE_Ticket::onsale
198 198
 			);
199 199
 
200
-		return EEH_Template::status_legend( $status_array, $status );
200
+		return EEH_Template::status_legend($status_array, $status);
201 201
 	}
202 202
 }
Please login to merge, or discard this patch.
extend/events/templates/event_datetime_metabox_clone_button.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <a class='clone-date-time dtm-inp-btn' rel='<?php echo $row; ?>' title='<?php esc_attr_e('Clone this Event Date and Time', 'event_espresso'); ?>' style='position:relative; top:5px; margin:0 0 0 10px; font-size:.9em; cursor:pointer;'>
2
-	<img src='<?php echo EE_IMAGES_URL;?>clone-trooper-16x16.png' width='16' height='16' alt='<?php esc_attr_e('clone', 'event_espresso'); ?>'/>
2
+	<img src='<?php echo EE_IMAGES_URL; ?>clone-trooper-16x16.png' width='16' height='16' alt='<?php esc_attr_e('clone', 'event_espresso'); ?>'/>
3 3
 </a>
Please login to merge, or discard this patch.
admin/extend/events/templates/event_datetime_timezones.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php if ( EE_Registry::instance()->CFG->admin->use_event_timezones ) : ?>
1
+<?php if (EE_Registry::instance()->CFG->admin->use_event_timezones) : ?>
2 2
 <div id="timezones-datetimes-dv" class="">
3 3
 	<span class="run-in"> <?php _e('Current Time for Event Timezone:', 'event_espresso'); ?> </span>
4 4
 	<span class="current-date"> <?php echo $current_date; ?></span>
Please login to merge, or discard this patch.
admin/extend/events/templates/event_registration_options.template.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 block discarded – undo
6 6
 <?php
7 7
 	$settings_array = array(
8 8
 		'max_registrants' => '<p>
9
-			<label for="max-registrants">' .  __('Maximum number of tickets allowed per order for this event: ', 'event_espresso') . '</label>
10
-			<input class="ee-numeric" type="text" id="max-registrants" name="additional_limit" value="' . $additional_limit . '" size="4" />
9
+			<label for="max-registrants">' .  __('Maximum number of tickets allowed per order for this event: ', 'event_espresso').'</label>
10
+			<input class="ee-numeric" type="text" id="max-registrants" name="additional_limit" value="' . $additional_limit.'" size="4" />
11 11
 			</p>',
12 12
 		'additional_registration_options' => $additional_registration_options,
13 13
 		'display_ticket_selector' => '<p>
14
-			<label>' . __('Display Ticket Selector', 'event_espresso') . '</label>' . $display_ticket_selector . '</p>',
14
+			<label>' . __('Display Ticket Selector', 'event_espresso').'</label>'.$display_ticket_selector.'</p>',
15 15
 		'alternative_registration_page' => '<p>
16
-			<label>' . __('Alternative Registration Page', 'event_espresso') . '</label>
17
-			<input name="externalURL" size="20" type="text" value="' . $_event->external_url() . '">
16
+			<label>' . __('Alternative Registration Page', 'event_espresso').'</label>
17
+			<input name="externalURL" size="20" type="text" value="' . $_event->external_url().'">
18 18
 			</p>',
19 19
 		'event_phone_number' => '<p>
20
-			<label>' . __('Event Phone Number', 'event_espresso') . '</label>
21
-			<input name="event_phone" size="20" type="text" value="' . $_event->phone() . '">
20
+			<label>' . __('Event Phone Number', 'event_espresso').'</label>
21
+			<input name="event_phone" size="20" type="text" value="' . $_event->phone().'">
22 22
 			</p>',
23 23
 		'default_registration_status' => '<p>
24
-			<label>' . __('Default Registration Status', 'event_espresso') . '</label>' . $EVT_default_registration_status . '</p>'
24
+			<label>' . __('Default Registration Status', 'event_espresso').'</label>'.$EVT_default_registration_status.'</p>'
25 25
 		);
26 26
 	//filter
27
-	$settings_array = apply_filters( 'FHEE__caffeinated_event_registration_options__template__settings', $settings_array );
27
+	$settings_array = apply_filters('FHEE__caffeinated_event_registration_options__template__settings', $settings_array);
28 28
 
29 29
 	//echo
30
-	foreach ( $settings_array as $item ) {
30
+	foreach ($settings_array as $item) {
31 31
 		echo $item;
32 32
 	}
Please login to merge, or discard this patch.
admin/extend/events/templates/event_type_metabox_contents.template.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 	</ul>
5 5
 	<div id="espresso_event_type-all" class="tabs-panel">
6 6
 		<?php
7
-        $name = 'tax_input[espresso_event_type]';
8
-        echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
9
-        ?>
7
+		$name = 'tax_input[espresso_event_type]';
8
+		echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
9
+		?>
10 10
 		<ul id="espresso_event_typechecklist" data-wp-lists="list:espresso_event_type" class="categorychecklist form-no-clear">
11 11
 			<?php echo $radio_list; ?>
12 12
 		</ul>
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 </div>
15 15
 <?php
16 16
 /**
17
- * Template vars in use:
18
- *
19
- * $radio_list;
20
- */
21 17
\ No newline at end of file
18
+		 * Template vars in use:
19
+		 *
20
+		 * $radio_list;
21
+		 */
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/templates/import_page.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <div class="import-area">
2 2
 	<div class="important-notice">
3
-		<?php _e( 'The import feature has been disabled because of bugs. It is expected to be put back in place soon.', 'event_espresso' );?>
3
+		<?php _e('The import feature has been disabled because of bugs. It is expected to be put back in place soon.', 'event_espresso'); ?>
4 4
 	</div>
5 5
 <?php // echo $form?>
6 6
 </div>
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/templates/template_settings.template.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template for General Settings Template Tab
4
- */
3
+		 * Template for General Settings Template Tab
4
+		 */
5 5
 ?>
6 6
 <div class="padding">
7 7
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,6 +5,6 @@
 block discarded – undo
5 5
 ?>
6 6
 <div class="padding">
7 7
 
8
-	<?php do_action( 'AHEE__template_settings__template__before_settings_form' ); ?>
8
+	<?php do_action('AHEE__template_settings__template__before_settings_form'); ?>
9 9
 
10 10
 </div>
Please login to merge, or discard this patch.
admin/extend/general_settings/templates/debug_log_settings.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 				<?php echo EEH_Template::get_help_tab_link('full_logging_info'); ?>
12 12
 			</th>
13 13
 			<td>
14
-				<?php echo EEH_Form_Fields::select_input('use_full_logging', $values, $use_full_logging ); ?>
14
+				<?php echo EEH_Form_Fields::select_input('use_full_logging', $values, $use_full_logging); ?>
15 15
 				<p class="description">
16 16
 					<span class="reminder-spn">
17 17
 						<?php _e('Please use caution when using this feature. These files may be publicly available.', 'event_espresso'); ?>
18 18
 					</span><br/>
19
-					<?php echo sprintf( __('Once saved, this file will be available at: %s', 'event_espresso'), '<br /><b>/wp-content/uploads/espresso/logs/' . EE_Registry::instance()->CFG->admin->log_file_name() . '</b>' ); ?>
19
+					<?php echo sprintf(__('Once saved, this file will be available at: %s', 'event_espresso'), '<br /><b>/wp-content/uploads/espresso/logs/'.EE_Registry::instance()->CFG->admin->log_file_name().'</b>'); ?>
20 20
 				</p>
21 21
 
22 22
 			</td>
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 				<?php echo EEH_Template::get_help_tab_link('remote_logging_info'); ?>
29 29
 			</th>
30 30
 			<td>
31
-				<?php echo EEH_Form_Fields::select_input('use_remote_logging', $values, $use_remote_logging ); ?>
31
+				<?php echo EEH_Form_Fields::select_input('use_remote_logging', $values, $use_remote_logging); ?>
32 32
 				<p class="description">
33 33
 					<?php _e('Send debugging data to the remote URL below.', 'event_espresso'); ?>
34 34
 				</p>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 				<?php echo EEH_Template::get_help_tab_link('remote_logging_url_info'); ?>
42 42
 			</th>
43 43
 			<td>
44
-				<input name="remote_logging_url" id="remote_logging_url" size="20" class="regular-text" type="text" value="<?php echo $remote_logging_url;?>" />
44
+				<input name="remote_logging_url" id="remote_logging_url" size="20" class="regular-text" type="text" value="<?php echo $remote_logging_url; ?>" />
45 45
 				<p class="description">
46 46
 					<?php _e('Example: http://requestb.in/MY_UNIQUE_ID', 'event_espresso'); ?>
47 47
 
Please login to merge, or discard this patch.
admin/extend/messages/Custom_Messages_Template_List_Table.class.php 3 patches
Braces   +13 added lines, -9 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
@@ -144,17 +145,19 @@  discard block
 block discarded – undo
144 145
 		$msgr_filters = !empty($m_values) ? array_merge( $msgr_default, $m_values ) : array();
145 146
 		$mt_filters = !empty($mt_values) ? array_merge( $mt_default, $mt_values ) : array();
146 147
 
147
-		if ( empty( $m_values ) )
148
-			$msgr_filters[0] = array(
148
+		if ( empty( $m_values ) ) {
149
+					$msgr_filters[0] = array(
149 150
 				'id' => 'no_messenger_options',
150 151
 				'text' => __('No Messengers active', 'event_espresso')
151 152
 				);
153
+		}
152 154
 
153
-		if ( empty($mt_values) )
154
-			$mt_filters[0] = array(
155
+		if ( empty($mt_values) ) {
156
+					$mt_filters[0] = array(
155 157
 				'id' => 'no_message_type_options',
156 158
 				'text' => __('No Message Types active', 'event_espresso')
157 159
 				);
160
+		}
158 161
 
159 162
 		if ( count( $messengers ) >= 1  && !empty( $m_values ) ) {
160 163
 			unset( $msgr_filters[0] );
@@ -191,10 +194,11 @@  discard block
 block discarded – undo
191 194
 	 * @return string
192 195
 	 */
193 196
 	public function no_items() {
194
-		if ( $this->_view !== 'trashed' )
195
-			printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' );
196
-		else
197
-			parent::no_items();
197
+		if ( $this->_view !== 'trashed' ) {
198
+					printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' );
199
+		} else {
200
+					parent::no_items();
201
+		}
198 202
 	}
199 203
 
200 204
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 	 *
94 94
 	 * @abstract
95 95
 	 * @access protected
96
-	 * @return array
96
+	 * @return string[]
97 97
 	 */
98 98
 	protected function _get_table_filters() {
99 99
 		$filters = array();
Please login to merge, or discard this patch.
Spacing   +60 added lines, -60 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,7 +30,7 @@  discard block
 block discarded – undo
30 30
 class Custom_Messages_Template_List_Table extends EE_Admin_List_Table {
31 31
 
32 32
 
33
-	public function __construct( $admin_page ) {
33
+	public function __construct($admin_page) {
34 34
 		//Set parent defaults
35 35
 		parent::__construct($admin_page);
36 36
 	}
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 
51 51
 	protected function _setup_data() {
52
-		$this->_data = $this->get_admin_page()->get_message_templates( $this->_per_page, $this->_view, FALSE, FALSE, FALSE );
53
-		$this->_all_data_count = $this->get_admin_page()->get_message_templates( $this->_per_page, $this->_view, TRUE, TRUE, FALSE );
52
+		$this->_data = $this->get_admin_page()->get_message_templates($this->_per_page, $this->_view, FALSE, FALSE, FALSE);
53
+		$this->_all_data_count = $this->get_admin_page()->get_message_templates($this->_per_page, $this->_view, TRUE, TRUE, FALSE);
54 54
 	}
55 55
 
56 56
 
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 
60 60
 	protected function _set_properties() {
61 61
 		$this->_wp_list_args = array(
62
-			'singular' => __('Message Template Group', 'event_espresso' ),
63
-			'plural' => __('Message Template', 'event_espresso' ),
62
+			'singular' => __('Message Template Group', 'event_espresso'),
63
+			'plural' => __('Message Template', 'event_espresso'),
64 64
 			'ajax' => TRUE, //for now,
65 65
 			'screen' => $this->get_admin_page()->get_current_screen()->id
66 66
 			);
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
 			'cb' => '<input type="checkbox" />',
70 70
 			'name' => __('Template Name', 'event_espresso'),
71 71
 			'message_type' => __('Message Type', 'event_espresso'),
72
-			'messenger' => __( 'Messenger', 'event_espresso'),
73
-			'description' => __( 'Description', 'event_espresso' ),
74
-			'events' => __( 'Events', 'event_espresso'), //count of events using this template.
72
+			'messenger' => __('Messenger', 'event_espresso'),
73
+			'description' => __('Description', 'event_espresso'),
74
+			'events' => __('Events', 'event_espresso'), //count of events using this template.
75 75
 			'actions' => ''
76 76
 			//'messages_sent' => __( 'Total Sent', 'event_espresso' ) //todo this will come later when we've got message tracking in place.
77 77
 			);
78 78
 
79 79
 		$this->_sortable_columns = array(
80
-			'messenger' => array( 'MTP_messenger' => TRUE ),
80
+			'messenger' => array('MTP_messenger' => TRUE),
81 81
 			//'message_type' => array( 'MTP_message_type' => FALSE )
82 82
 			);
83 83
 
@@ -96,16 +96,16 @@  discard block
 block discarded – undo
96 96
 	 *
97 97
 	 * @return string
98 98
 	 */
99
-	public function single_row( $item ) {
99
+	public function single_row($item) {
100 100
 		$message_type = $item->message_type_obj();
101 101
 		$messenger = $item->messenger_obj();
102 102
 
103
-		if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger ) {
103
+		if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger) {
104 104
 			echo '';
105 105
 			return;
106 106
 		}
107 107
 
108
-		parent::single_row( $item );
108
+		parent::single_row($item);
109 109
 	}
110 110
 
111 111
 
@@ -115,14 +115,14 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	protected function _get_table_filters() {
117 117
 		$filters = array();
118
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
118
+		EE_Registry::instance()->load_helper('Form_Fields');
119 119
 		//setup messengers for selects
120 120
 		$m_values = $this->get_admin_page()->get_messengers_for_list_table();
121 121
 		//lets do the same for message types
122 122
 		$mt_values = $this->get_admin_page()->get_message_types_for_list_table();
123 123
 		//setup messengers for selects
124 124
 		$m_values[0]['id'] = 'all';
125
-		$m_values[0]['text'] = __('All Messengers', 'event_espresso' );
125
+		$m_values[0]['text'] = __('All Messengers', 'event_espresso');
126 126
 
127 127
 		$msgr_default[0] = array(
128 128
 			'id' => 'none_selected',
@@ -134,28 +134,28 @@  discard block
 block discarded – undo
134 134
 			'text' => __('Show All', 'event_espresso')
135 135
 			);
136 136
 
137
-		$msgr_filters = !empty($m_values) ? array_merge( $msgr_default, $m_values ) : array();
138
-		$mt_filters = !empty($mt_values) ? array_merge( $mt_default, $mt_values ) : array();
137
+		$msgr_filters = ! empty($m_values) ? array_merge($msgr_default, $m_values) : array();
138
+		$mt_filters = ! empty($mt_values) ? array_merge($mt_default, $mt_values) : array();
139 139
 
140
-		if ( empty( $m_values ) )
140
+		if (empty($m_values))
141 141
 			$msgr_filters[0] = array(
142 142
 				'id' => 'no_messenger_options',
143 143
 				'text' => __('No Messengers active', 'event_espresso')
144 144
 				);
145 145
 
146
-		if ( empty($mt_values) )
146
+		if (empty($mt_values))
147 147
 			$mt_filters[0] = array(
148 148
 				'id' => 'no_message_type_options',
149 149
 				'text' => __('No Message Types active', 'event_espresso')
150 150
 				);
151 151
 
152
-		if ( count( $m_values ) >= 1  && !empty( $m_values ) ) {
153
-			unset( $msgr_filters[0] );
154
-			$msgr_filters = array_values( $msgr_filters ); //reindex keys
152
+		if (count($m_values) >= 1 && ! empty($m_values)) {
153
+			unset($msgr_filters[0]);
154
+			$msgr_filters = array_values($msgr_filters); //reindex keys
155 155
 		}
156 156
 
157
-		$filters[] = EEH_Form_Fields::select_input('ee_messenger_filter_by', $msgr_filters, isset($this->_req_data['ee_messenger_filter_by']) ? sanitize_key( $this->_req_data['ee_messenger_filter_by']) : '' );
158
-		$filters[] = EEH_Form_Fields::select_input('ee_message_type_filter_by', $mt_filters, isset($this->_req_data['ee_message_type_filter_by']) ? sanitize_key( $this->_req_data['ee_message_type_filter_by']) : '');
157
+		$filters[] = EEH_Form_Fields::select_input('ee_messenger_filter_by', $msgr_filters, isset($this->_req_data['ee_messenger_filter_by']) ? sanitize_key($this->_req_data['ee_messenger_filter_by']) : '');
158
+		$filters[] = EEH_Form_Fields::select_input('ee_message_type_filter_by', $mt_filters, isset($this->_req_data['ee_message_type_filter_by']) ? sanitize_key($this->_req_data['ee_message_type_filter_by']) : '');
159 159
 		return $filters;
160 160
 	}
161 161
 
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 	 * we're just removing the search box for message templates, not needed.
164 164
 	 * @return string (empty);
165 165
 	 */
166
-	function search_box( $text, $input_id ) {
166
+	function search_box($text, $input_id) {
167 167
 		return '';
168 168
 	}
169 169
 
170 170
 
171 171
 	protected function _add_view_counts() {
172
-		foreach ( $this->_views as $view => $args )  {
173
-			$this->_views[$view]['count'] = $this->get_admin_page()->get_message_templates( $this->_per_page, $view, TRUE, TRUE, FALSE );
172
+		foreach ($this->_views as $view => $args) {
173
+			$this->_views[$view]['count'] = $this->get_admin_page()->get_message_templates($this->_per_page, $view, TRUE, TRUE, FALSE);
174 174
 		}
175 175
 	}
176 176
 
@@ -184,16 +184,16 @@  discard block
 block discarded – undo
184 184
 	 * @return string
185 185
 	 */
186 186
 	public function no_items() {
187
-		if ( $this->_view !== 'trashed' )
188
-			printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' );
187
+		if ($this->_view !== 'trashed')
188
+			printf(__('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>');
189 189
 		else
190 190
 			parent::no_items();
191 191
 	}
192 192
 
193 193
 
194 194
 
195
-	public function column_cb( $item ) {
196
-		return sprintf( '<input type="checkbox" name="checkbox[%s] value="1" />', $item->GRP_ID() );
195
+	public function column_cb($item) {
196
+		return sprintf('<input type="checkbox" name="checkbox[%s] value="1" />', $item->GRP_ID());
197 197
 	}
198 198
 
199 199
 
@@ -201,29 +201,29 @@  discard block
 block discarded – undo
201 201
 
202 202
 
203 203
 
204
-	function column_name( $item ) {
205
-		return '<p>' . $item->name() . '</p>';
204
+	function column_name($item) {
205
+		return '<p>'.$item->name().'</p>';
206 206
 	}
207 207
 
208 208
 
209 209
 
210 210
 
211
-	function column_description( $item ) {
212
-		return '<p>' . $item->description() . '</p>';
211
+	function column_description($item) {
212
+		return '<p>'.$item->description().'</p>';
213 213
 	}
214 214
 
215 215
 
216 216
 
217
-	function column_actions( $item ) {
218
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'espresso_messages_add_new_message_template' ) ) {
217
+	function column_actions($item) {
218
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messages_add_new_message_template')) {
219 219
 			$create_args = array(
220 220
 				'GRP_ID' => $item->ID(),
221 221
 				'messenger' => $item->messenger(),
222 222
 				'message_type' => $item->message_type(),
223 223
 				'action' => 'add_new_message_template'
224 224
 				);
225
-			$create_link = EE_Admin_Page::add_query_args_and_nonce( $create_args, EE_MSG_ADMIN_URL );
226
-			return sprintf( '<p><a href="%s" class="button button-small">%s</a></p>', $create_link, __('Create Custom', 'event_espresso') );
225
+			$create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL);
226
+			return sprintf('<p><a href="%s" class="button button-small">%s</a></p>', $create_link, __('Create Custom', 'event_espresso'));
227 227
 		}
228 228
 		return '';
229 229
 	}
@@ -240,27 +240,27 @@  discard block
 block discarded – undo
240 240
 		$actions = array();
241 241
 
242 242
 		// edit link but only if item isn't trashed.
243
-		if ( !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ) {
244
-			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_message_template', 'id'=>$item->GRP_ID() ), EE_MSG_ADMIN_URL );
245
-			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Template', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>';
243
+		if ( ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID())) {
244
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_message_template', 'id'=>$item->GRP_ID()), EE_MSG_ADMIN_URL);
245
+			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Template', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
246 246
 		}
247 247
 
248
-		$name_link = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() )? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Template', 'event_espresso' ) . '">' . ucwords( $item->messenger_obj()->label['singular'] ) . '</a>' : ucwords( $item->messenger_obj()->label['singular'] );
249
-		$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL );
248
+		$name_link = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Template', 'event_espresso').'">'.ucwords($item->messenger_obj()->label['singular']).'</a>' : ucwords($item->messenger_obj()->label['singular']);
249
+		$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL);
250 250
 		// restore link
251
-		$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL );
251
+		$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL);
252 252
 		// delete price link
253
-		$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL );
253
+		$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL);
254 254
 
255
-		if ( !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_trash_message_template', $item->ID() ) ) {
256
-			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Template Group to Trash', 'event_espresso' ) . '">' . __( 'Move to Trash', 'event_espresso' ) . '</a>';
255
+		if ( ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_trash_message_template', $item->ID())) {
256
+			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Template Group to Trash', 'event_espresso').'">'.__('Move to Trash', 'event_espresso').'</a>';
257 257
 		} else {
258
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_restore_message_template', $item->ID() ) ) {
259
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Message Template', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
258
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_restore_message_template', $item->ID())) {
259
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Message Template', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
260 260
 			}
261 261
 
262
-			if ( $this->_view == 'trashed' && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_delete_message_template', $item->ID() ) ) {
263
-				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Template Group Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>';
262
+			if ($this->_view == 'trashed' && EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_delete_message_template', $item->ID())) {
263
+				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Template Group Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
264 264
 			}
265 265
 		}
266 266
 
@@ -269,15 +269,15 @@  discard block
 block discarded – undo
269 269
 		$c_configs = $item->contexts_config();
270 270
 		$ctxt = array();
271 271
 		$context_templates = $item->context_templates();
272
-		foreach ( $context_templates as $context => $template_fields ) {
273
-			$mtp_to = !empty( $context_templates[$context]['to'] ) && $context_templates[$context]['to'] instanceof EE_Message_Template ? $context_templates[$context]['to']->get('MTP_content') : NULL;
274
-			$inactive = empty( $mtp_to ) && !empty( $context_templates[$context]['to'] ) ? ' class="mtp-inactive"' : '';
272
+		foreach ($context_templates as $context => $template_fields) {
273
+			$mtp_to = ! empty($context_templates[$context]['to']) && $context_templates[$context]['to'] instanceof EE_Message_Template ? $context_templates[$context]['to']->get('MTP_content') : NULL;
274
+			$inactive = empty($mtp_to) && ! empty($context_templates[$context]['to']) ? ' class="mtp-inactive"' : '';
275 275
 			$context_title = ucwords($c_configs[$context]['label']);
276
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( array('action'=>'edit_message_template', 'id'=>$item->GRP_ID(), 'context' => $context), EE_MSG_ADMIN_URL );
277
-			$ctxt[] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? '<a' . $inactive . ' href="'. $edit_link . '" title="' . esc_attr__('Edit Context', 'event_espresso') . '">' . $context_title . '</a>' : $context_title;
276
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_message_template', 'id'=>$item->GRP_ID(), 'context' => $context), EE_MSG_ADMIN_URL);
277
+			$ctxt[] = EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? '<a'.$inactive.' href="'.$edit_link.'" title="'.esc_attr__('Edit Context', 'event_espresso').'">'.$context_title.'</a>' : $context_title;
278 278
 		}
279 279
 
280
-		$ctx_content = !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? sprintf( __('<strong>%s:</strong> ', 'event_espresso'), ucwords($c_label['plural']) ) . implode(' | ', $ctxt) : '';
280
+		$ctx_content = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? sprintf(__('<strong>%s:</strong> ', 'event_espresso'), ucwords($c_label['plural'])).implode(' | ', $ctxt) : '';
281 281
 
282 282
 
283 283
 		//Return the name contents
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 										/* $1%s */ $name_link,
286 286
 										/* $2%s */ $item->GRP_ID(),
287 287
 										/* %4$s */ $ctx_content,
288
-										/* $3%s */ $this->row_actions( $actions )
288
+										/* $3%s */ $this->row_actions($actions)
289 289
 		);
290 290
 	}
291 291
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 * @return string       message_type name
307 307
 	 */
308 308
 	function column_message_type($item) {
309
-		return ucwords($item->message_type_obj()->label['singular'] );
309
+		return ucwords($item->message_type_obj()->label['singular']);
310 310
 	}
311 311
 
312 312
 
Please login to merge, or discard this patch.