Completed
Branch DECAF-4.7 (a62460)
by
unknown
113:29 queued 104:52
created
caffeinated/admin/new/tickets/Tickets_Admin_Page.core.php 2 patches
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	protected function _set_page_routes() {
54 54
 
55
-		$tkt_id = ! empty( $this->_req_data['TKT_ID'] )  && ! is_array( $this->_req_data['TKT_ID'] ) ? $this->_req_data['TKT_ID'] : 0;
55
+		$tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID']) ? $this->_req_data['TKT_ID'] : 0;
56 56
 
57 57
 		$this->_page_routes = array(
58 58
 			'default' => array(
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
 			'trash_ticket' => array(
63 63
 				'func' => '_trash_or_restore_ticket',
64 64
 				'noheader' => TRUE,
65
-				'args' => array( 'trash' => TRUE ),
65
+				'args' => array('trash' => TRUE),
66 66
 				'capability' => 'ee_delete_default_ticket',
67 67
 				'obj_id' => $tkt_id
68 68
 				),
69 69
 			'trash_tickets' => array(
70 70
 				'func' => '_trash_or_restore_ticket',
71 71
 				'noheader' => TRUE,
72
-				'args' => array( 'trash' => TRUE ),
72
+				'args' => array('trash' => TRUE),
73 73
 				'capability' => 'ee_delete_default_tickets'
74 74
 				),
75 75
 			'restore_ticket' => array(
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 				'label' => __('Trash', 'event_espresso'),
144 144
 				'count' => 0,
145 145
 				'bulk_action' => array(
146
-					'restore_tickets' => __('Restore from Trash' , 'event_espresso'),
146
+					'restore_tickets' => __('Restore from Trash', 'event_espresso'),
147 147
 					'delete_tickets' => __('Delete Permanently', 'event_espresso')
148 148
 					)
149 149
 				)
@@ -161,53 +161,53 @@  discard block
 block discarded – undo
161 161
 
162 162
 
163 163
 
164
-	public function get_default_tickets( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
164
+	public function get_default_tickets($per_page = 10, $count = FALSE, $trashed = FALSE) {
165 165
 
166
-		$orderby= empty( $this->_req_data['orderby'] ) ? 'TKT_name' : $this->_req_data['orderby'];
167
-		$order = empty( $this->_req_data['order'] ) ? 'ASC' : $order;
166
+		$orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
167
+		$order = empty($this->_req_data['order']) ? 'ASC' : $order;
168 168
 
169
-		switch ( $orderby ) {
169
+		switch ($orderby) {
170 170
 			case 'TKT_name' :
171
-				$orderby = array( 'TKT_name' => $order );
171
+				$orderby = array('TKT_name' => $order);
172 172
 				break;
173 173
 
174 174
 			case 'TKT_price' :
175
-				$orderby = array( 'TKT_price' => $order );
175
+				$orderby = array('TKT_price' => $order);
176 176
 				break;
177 177
 
178 178
 			case 'TKT_uses' :
179
-				$orderby = array( 'TKT_uses' => $order );
179
+				$orderby = array('TKT_uses' => $order);
180 180
 				break;
181 181
 
182 182
 			case 'TKT_min' :
183
-				$orderby = array( 'TKT_min' => $order );
183
+				$orderby = array('TKT_min' => $order);
184 184
 				break;
185 185
 
186 186
 			case 'TKT_max' :
187
-				$orderby = array( 'TKT_max' => $order );
187
+				$orderby = array('TKT_max' => $order);
188 188
 				break;
189 189
 
190 190
 			case 'TKT_qty' :
191
-				$orderby = array( 'TKT_qty' => $order );
191
+				$orderby = array('TKT_qty' => $order);
192 192
 				break;
193 193
 		}
194 194
 
195
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
196
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
195
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
196
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
197 197
 
198 198
 		$_where = array(
199 199
 			'TKT_is_default' => 1,
200 200
 			'TKT_deleted' => $trashed
201 201
 			);
202 202
 
203
-		$offset = ($current_page-1)*$per_page;
204
-		$limit = array( $offset, $per_page );
203
+		$offset = ($current_page - 1) * $per_page;
204
+		$limit = array($offset, $per_page);
205 205
 
206
-		if ( isset( $this->_req_data['s'] ) ) {
207
-			$sstr = '%' . $this->_req_data['s'] . '%';
206
+		if (isset($this->_req_data['s'])) {
207
+			$sstr = '%'.$this->_req_data['s'].'%';
208 208
 			$_where['OR'] = array(
209
-				'TKT_name' => array('LIKE',$sstr ),
210
-				'TKT_description' => array('LIKE',$sstr )
209
+				'TKT_name' => array('LIKE', $sstr),
210
+				'TKT_description' => array('LIKE', $sstr)
211 211
 				);
212 212
 		}
213 213
 
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 			'group_by'=>'TKT_ID'
219 219
 			);
220 220
 
221
-		if($count){
221
+		if ($count) {
222 222
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
223
-		}else{
223
+		} else {
224 224
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
225 225
 		}
226 226
 
@@ -230,41 +230,41 @@  discard block
 block discarded – undo
230 230
 
231 231
 
232 232
 
233
-	protected function _trash_or_restore_ticket(  $trash = FALSE ) {
233
+	protected function _trash_or_restore_ticket($trash = FALSE) {
234 234
 		$success = 1;
235 235
 
236 236
 		$TKT = EEM_Ticket::instance();
237 237
 
238 238
 		//checkboxes?
239
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
239
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
240 240
 			//if array has more than one element then success message should be plural
241
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
241
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
242 242
 
243 243
 			//cycle thru the boxes
244
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
245
-				if ( $trash ) {
246
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
244
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
245
+				if ($trash) {
246
+					if ( ! $TKT->delete_by_ID($TKT_ID))
247 247
 						$success = 0;
248 248
 				} else {
249
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
249
+					if ( ! $TKT->restore_by_ID($TKT_ID))
250 250
 						$success = 0;
251 251
 				}
252 252
 			}
253 253
 		} else {
254 254
 			//grab single id and trash
255
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
255
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
256 256
 
257
-			if ( $trash ) {
258
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
257
+			if ($trash) {
258
+				if ( ! $TKT->delete_by_ID($TKT_ID))
259 259
 					$success = 0;
260 260
 			} else {
261
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
261
+				if ( ! $TKT->restore_by_ID($TKT_ID))
262 262
 					$success = 0;
263 263
 			}
264 264
 		}
265 265
 
266 266
 		$action_desc = $trash ? 'moved to the trash' : 'restored';
267
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, array() );
267
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, array());
268 268
 	}
269 269
 
270 270
 
@@ -277,34 +277,34 @@  discard block
 block discarded – undo
277 277
 		$TKT = EEM_Ticket::instance();
278 278
 
279 279
 		//checkboxes?
280
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
280
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
281 281
 			//if array has more than one element then success message should be plural
282
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
282
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
283 283
 
284 284
 			//cycle thru the boxes
285
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
285
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
286 286
 				//delete
287
-				if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
287
+				if ( ! $this->_delete_the_ticket($TKT_ID)) {
288 288
 					$success = 0;
289 289
 				}
290 290
 			}
291 291
 		} else {
292 292
 			//grab single id and trash
293
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
294
-			if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
293
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
294
+			if ( ! $this->_delete_the_ticket($TKT_ID)) {
295 295
 					$success = 0;
296 296
 				}
297 297
 		}
298 298
 
299 299
 		$action_desc = 'deleted';
300
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, array() );
300
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, array());
301 301
 	}
302 302
 
303 303
 
304 304
 
305 305
 
306
-	protected function _delete_the_ticket( $TKT_ID ) {
307
-		$tkt = EEM_Ticket::instance()->get_one_by_ID( $TKT_ID );
306
+	protected function _delete_the_ticket($TKT_ID) {
307
+		$tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
308 308
 
309 309
 		//delete all related prices first
310 310
 		$tkt->delete_related_permanently('Price');
Please login to merge, or discard this patch.
Braces   +16 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -220,7 +222,7 @@  discard block
 block discarded – undo
220 222
 
221 223
 		if($count){
222 224
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
223
-		}else{
225
+		} else{
224 226
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
225 227
 		}
226 228
 
@@ -243,11 +245,13 @@  discard block
 block discarded – undo
243 245
 			//cycle thru the boxes
244 246
 			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
245 247
 				if ( $trash ) {
246
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
247
-						$success = 0;
248
+					if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
249
+											$success = 0;
250
+					}
248 251
 				} else {
249
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
250
-						$success = 0;
252
+					if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
253
+											$success = 0;
254
+					}
251 255
 				}
252 256
 			}
253 257
 		} else {
@@ -255,11 +259,13 @@  discard block
 block discarded – undo
255 259
 			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
256 260
 
257 261
 			if ( $trash ) {
258
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
259
-					$success = 0;
262
+				if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
263
+									$success = 0;
264
+				}
260 265
 			} else {
261
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
262
-					$success = 0;
266
+				if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
267
+									$success = 0;
268
+				}
263 269
 			}
264 270
 		}
265 271
 
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_Admin_Page_Init.core.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 *
24 24
 * ------------------------------------------------------------------------
25 25
 */
26
-class Tickets_Admin_Page_Init extends EE_Admin_Page_Init  {
26
+class Tickets_Admin_Page_Init extends EE_Admin_Page_Init {
27 27
 
28 28
 
29 29
 
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function __construct() {
38 38
 
39
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
39
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
40 40
 
41
-		define( 'TICKETS_PG_SLUG', 'tickets' );
42
-		define( 'TICKETS_LABEL', __('Default Tickets', 'event_espresso'));
43
-		define( 'TICKETS_ADMIN', EE_CORE_CAF_ADMIN . 'new' . DS . TICKETS_PG_SLUG . DS );
44
-		define( 'TICKETS_ADMIN_URL', admin_url( 'admin.php?page=' . TICKETS_PG_SLUG ));
45
-		define( 'TICKETS_ASSETS_PATH', TICKETS_ADMIN . 'assets' . DS );
46
-		define( 'TICKETS_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new' . DS . TICKETS_PG_SLUG .'/assets/' );
47
-		define( 'TICKETS_TEMPLATE_PATH', TICKETS_ADMIN . 'templates' . DS );
48
-		define( 'TICKETS_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new' . DS . TICKETS_PG_SLUG . DS . 'templates/' );
41
+		define('TICKETS_PG_SLUG', 'tickets');
42
+		define('TICKETS_LABEL', __('Default Tickets', 'event_espresso'));
43
+		define('TICKETS_ADMIN', EE_CORE_CAF_ADMIN.'new'.DS.TICKETS_PG_SLUG.DS);
44
+		define('TICKETS_ADMIN_URL', admin_url('admin.php?page='.TICKETS_PG_SLUG));
45
+		define('TICKETS_ASSETS_PATH', TICKETS_ADMIN.'assets'.DS);
46
+		define('TICKETS_ASSETS_URL', EE_CORE_CAF_ADMIN_URL.'new'.DS.TICKETS_PG_SLUG.'/assets/');
47
+		define('TICKETS_TEMPLATE_PATH', TICKETS_ADMIN.'templates'.DS);
48
+		define('TICKETS_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL.'new'.DS.TICKETS_PG_SLUG.DS.'templates/');
49 49
 
50 50
 		parent::__construct();
51
-		$this->_folder_path = EE_CORE_CAF_ADMIN . 'new' . DS . $this->_folder_name . DS;
51
+		$this->_folder_path = EE_CORE_CAF_ADMIN.'new'.DS.$this->_folder_name.DS;
52 52
 
53 53
 	}
54 54
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 
64 64
 	protected function _set_menu_map() {
65
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
65
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
66 66
 			'menu_group' => 'management',
67 67
 			'menu_order' => 15,
68 68
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_List_Table.class.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 				'TKT_taxable' => __('Taxable', 'event_espresso')
60 60
 			);
61 61
 
62
-        $this->_sortable_columns = array(
62
+		$this->_sortable_columns = array(
63 63
 				// TRUE means its already sorted
64 64
 				'TKT_name' => array( 'TKT_name', TRUE ),
65 65
 				'TKT_description' => array( 'TKT_description', FALSE ),
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 				'TKT_min' => array( 'TKT_min', FALSE ),
69 69
 				'TKT_max' => array( 'TKT_max', FALSE ),
70 70
 				'TKT_price' => array( 'TKT_price', FALSE )
71
-	        	);
71
+				);
72 72
 
73
-        $this->_hidden_columns = array(
73
+		$this->_hidden_columns = array(
74 74
 			);
75 75
 
76 76
 	}
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 
32 32
 	protected function _setup_data() {
33 33
 		$trashed = $this->_admin_page->get_view() == 'trashed' ? TRUE : FALSE;
34
-		$this->_data = $this->_admin_page->get_default_tickets( $this->_per_page, FALSE, $trashed );
35
-		$this->_all_data_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, FALSE );
36
-		$this->_trashed_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, TRUE );
34
+		$this->_data = $this->_admin_page->get_default_tickets($this->_per_page, FALSE, $trashed);
35
+		$this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, FALSE);
36
+		$this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, TRUE);
37 37
 	}
38 38
 
39 39
 
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 
62 62
         $this->_sortable_columns = array(
63 63
 				// TRUE means its already sorted
64
-				'TKT_name' => array( 'TKT_name', TRUE ),
65
-				'TKT_description' => array( 'TKT_description', FALSE ),
66
-				'TKT_qty' => array( 'TKT_qty', FALSE ),
67
-				'TKT_uses' => array( 'TKT_uses', FALSE ),
68
-				'TKT_min' => array( 'TKT_min', FALSE ),
69
-				'TKT_max' => array( 'TKT_max', FALSE ),
70
-				'TKT_price' => array( 'TKT_price', FALSE )
64
+				'TKT_name' => array('TKT_name', TRUE),
65
+				'TKT_description' => array('TKT_description', FALSE),
66
+				'TKT_qty' => array('TKT_qty', FALSE),
67
+				'TKT_uses' => array('TKT_uses', FALSE),
68
+				'TKT_min' => array('TKT_min', FALSE),
69
+				'TKT_max' => array('TKT_max', FALSE),
70
+				'TKT_price' => array('TKT_price', FALSE)
71 71
 	        	);
72 72
 
73 73
         $this->_hidden_columns = array(
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
 
88 88
 	protected function _add_view_counts() {
89 89
 		$this->_views['all']['count'] = $this->_all_data_count;
90
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket'))
90
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket'))
91 91
 		$this->_views['trashed']['count'] = $this->_trashed_count;
92 92
 	}
93 93
 
94 94
 
95 95
 
96 96
 	function column_cb($item) {
97
-		return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() );
97
+		return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID());
98 98
 
99 99
 	}
100 100
 
@@ -105,21 +105,21 @@  discard block
 block discarded – undo
105 105
 		$actions = array();
106 106
 
107 107
 		//trash links
108
-		if ( $item->ID() !== 1 ) {
109
-			if ( $this->_view == 'all' ) {
110
-				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'trash_ticket', 'TKT_ID' => $item->ID() ), TICKETS_ADMIN_URL );
111
-				$actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
108
+		if ($item->ID() !== 1) {
109
+			if ($this->_view == 'all') {
110
+				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_ticket', 'TKT_ID' => $item->ID()), TICKETS_ADMIN_URL);
111
+				$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Ticket to trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
112 112
 			} else {
113 113
 				// restore price link
114
-				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_ticket', 'TKT_ID'=>$item->ID() ), TICKETS_ADMIN_URL );
115
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Ticket', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
114
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_ticket', 'TKT_ID'=>$item->ID()), TICKETS_ADMIN_URL);
115
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Ticket', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
116 116
 				// delete price link
117
-				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_ticket', 'TKT_ID'=>$item->ID() ), TICKETS_ADMIN_URL );
118
-				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Ticket Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>';
117
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_ticket', 'TKT_ID'=>$item->ID()), TICKETS_ADMIN_URL);
118
+				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
119 119
 			}
120 120
 		}
121 121
 
122
-		return $item->get('TKT_name') . $this->row_actions( $actions );
122
+		return $item->get('TKT_name').$this->row_actions($actions);
123 123
 	}
124 124
 
125 125
 
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 
133 133
 
134 134
 	function column_TKT_qty($item) {
135
-		return $item->get_pretty('TKT_qty','text');
135
+		return $item->get_pretty('TKT_qty', 'text');
136 136
 	}
137 137
 
138 138
 
139 139
 
140 140
 	function column_TKT_uses($item) {
141
-		return $item->get_pretty('TKT_uses','text');
141
+		return $item->get_pretty('TKT_uses', 'text');
142 142
 	}
143 143
 
144 144
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 
151 151
 	function column_TKT_max($item) {
152
-		return $item->get_pretty('TKT_max','text');
152
+		return $item->get_pretty('TKT_max', 'text');
153 153
 	}
154 154
 
155 155
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 
3 5
 /**
4 6
  * Event Espresso
@@ -87,8 +89,9 @@  discard block
 block discarded – undo
87 89
 
88 90
 	protected function _add_view_counts() {
89 91
 		$this->_views['all']['count'] = $this->_all_data_count;
90
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket'))
91
-		$this->_views['trashed']['count'] = $this->_trashed_count;
92
+		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_tickets', 'trash_ticket')) {
93
+				$this->_views['trashed']['count'] = $this->_trashed_count;
94
+		}
92 95
 	}
93 96
 
94 97
 
Please login to merge, or discard this patch.
caffeinated/admin/new/venues/Venue_Categories_Admin_List_Table.class.php 2 patches
Spacing   +18 added lines, -18 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
 /**
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 
36 36
 
37 37
 	protected function _setup_data() {
38
-		$this->_data = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page);
39
-		$this->_all_data_count = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page, TRUE );
38
+		$this->_data = $this->_admin_page->get_categories($this->_per_page, $this->_current_page);
39
+		$this->_all_data_count = $this->_admin_page->get_categories($this->_per_page, $this->_current_page, TRUE);
40 40
 	}
41 41
 
42 42
 
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 
46 46
 	protected function _set_properties() {
47 47
 		$this->_wp_list_args = array(
48
-			'singular' => __('venue category', 'event_espresso' ),
49
-			'plural' => __('venue categories', 'event_espresso' ),
48
+			'singular' => __('venue category', 'event_espresso'),
49
+			'plural' => __('venue categories', 'event_espresso'),
50 50
 			'ajax' => TRUE, //for now,
51 51
 			'screen' => $this->_admin_page->get_current_screen()->id
52 52
 			);
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 			);
61 61
 
62 62
 		$this->_sortable_columns = array(
63
-			'id' => array( 'Term.term_id' => true ),
64
-			'name' => array( 'Term.slug' => false ),
65
-			'count' => array( 'term_count' => false )
63
+			'id' => array('Term.term_id' => true),
64
+			'name' => array('Term.slug' => false),
65
+			'count' => array('term_count' => false)
66 66
 			);
67 67
 
68 68
 		$this->_hidden_columns = array();
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 	public function column_cb($item) {
95
-		return sprintf( '<input type="checkbox" name="VEN_CAT_ID[]" value="%s" />', $item->get('term_id') );
95
+		return sprintf('<input type="checkbox" name="VEN_CAT_ID[]" value="%s" />', $item->get('term_id'));
96 96
 	}
97 97
 
98 98
 
@@ -120,17 +120,17 @@  discard block
 block discarded – undo
120 120
 			'VEN_CAT_ID' => $item->get('term_id')
121 121
 		);
122 122
 
123
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_VENUES_ADMIN_URL );
124
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_VENUES_ADMIN_URL );
123
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_VENUES_ADMIN_URL);
124
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_VENUES_ADMIN_URL);
125 125
 
126 126
 		$actions = array(
127
-			'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
127
+			'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
128 128
 			);
129 129
 
130 130
 
131
-		$actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>';
131
+		$actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>';
132 132
 
133
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>';
133
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>';
134 134
 		$content .= $this->row_actions($actions);
135 135
 		return $content;
136 136
 	}
@@ -139,20 +139,20 @@  discard block
 block discarded – undo
139 139
 
140 140
 
141 141
 	public function column_shortcode($item) {
142
-		$content = '[EVENT_ESPRESSO_CATEGORY category_id="' . $item->get_first_related('Term')->get('slug') . '"]';
142
+		$content = '[EVENT_ESPRESSO_CATEGORY category_id="'.$item->get_first_related('Term')->get('slug').'"]';
143 143
 		return $content;
144 144
 	}
145 145
 
146 146
 
147 147
 
148 148
 
149
-	public function column_count( $item ) {
149
+	public function column_count($item) {
150 150
 		$e_args = array(
151 151
 			'action' => 'default',
152 152
 			'category' => $item->get_first_related('Term')->ID()
153 153
 			);
154
-		$e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EE_VENUES_ADMIN_URL );
155
-		$content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>';
154
+		$e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EE_VENUES_ADMIN_URL);
155
+		$content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>';
156 156
 		return $content;
157 157
 	}
158 158
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
caffeinated/admin/new/venues/Venues_Admin_List_Table.class.php 2 patches
Spacing   +35 added lines, -35 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
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 class Venues_Admin_List_Table extends EE_Admin_List_Table {
33 33
 
34
-	public function __construct( $admin_page ) {
34
+	public function __construct($admin_page) {
35 35
 		parent::__construct($admin_page);
36 36
 	}
37 37
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 	protected function _setup_data() {
42
-		$this->_data = $this->_admin_page->get_venues( $this->_per_page);
43
-		$this->_all_data_count = $this->_admin_page->get_venues( $this->_per_page, TRUE );
42
+		$this->_data = $this->_admin_page->get_venues($this->_per_page);
43
+		$this->_all_data_count = $this->_admin_page->get_venues($this->_per_page, TRUE);
44 44
 	}
45 45
 
46 46
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	protected function _set_properties() {
51 51
 		$this->_wp_list_args = array(
52
-			'singular' => __('Event Venue', 'event_espresso' ),
53
-			'plural' => __('Event Venues', 'event_espresso' ),
52
+			'singular' => __('Event Venue', 'event_espresso'),
53
+			'plural' => __('Event Venues', 'event_espresso'),
54 54
 			'ajax' => TRUE, //for now,
55 55
 			'screen' => $this->_admin_page->get_current_screen()->id
56 56
 			);
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
 			);
67 67
 
68 68
 		$this->_sortable_columns = array(
69
-			'id' => array( 'id' => true ),
70
-			'name' => array( 'name' => false ),
71
-			'city' => array( 'city' => false ),
72
-			'capacity' => array( 'capacity' => false )
69
+			'id' => array('id' => true),
70
+			'name' => array('name' => false),
71
+			'city' => array('city' => false),
72
+			'capacity' => array('capacity' => false)
73 73
 			);
74 74
 
75 75
 		$this->_hidden_columns = array();
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 	protected function _add_view_counts() {
93 93
 		$this->_views['all']['count'] = EEM_Venue::instance()->count();
94
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venues', 'espresso_venues_trash_venues' ) ) {
94
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venues', 'espresso_venues_trash_venues')) {
95 95
 			$this->_views['trash']['count'] = EEM_Venue::instance()->count_deleted();
96 96
 		}
97 97
 	}
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 	public function column_cb($item) {
105 105
 
106
-		return $item->count_related('Event') > 0 && $item->get( 'status' ) === 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="venue_id[]" value="%s" />', $item->ID());
106
+		return $item->count_related('Event') > 0 && $item->get('status') === 'trash' ? '<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="venue_id[]" value="%s" />', $item->ID());
107 107
 	}
108 108
 
109 109
 
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 			'post' => $item->ID()
121 121
 		);
122 122
 
123
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_VENUES_ADMIN_URL );
123
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_VENUES_ADMIN_URL);
124 124
 
125 125
 		$statuses = EEM_Venue::instance()->get_status_array();
126
-		$actions = $this->_column_name_action_setup( $item );
127
-		$content = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_venue', 'espresso_venues_edit', $item->ID() ) ? '<strong><a class="row-title" href="' . $edit_link . '">' . stripslashes_deep($item->name()) . '</a></strong>' : $item->name();
128
-		$content .= $item->status() == 'draft' ? ' - <span class="post-state">' . $statuses['draft'] . '</span>' : '';
126
+		$actions = $this->_column_name_action_setup($item);
127
+		$content = EE_Registry::instance()->CAP->current_user_can('ee_edit_venue', 'espresso_venues_edit', $item->ID()) ? '<strong><a class="row-title" href="'.$edit_link.'">'.stripslashes_deep($item->name()).'</a></strong>' : $item->name();
128
+		$content .= $item->status() == 'draft' ? ' - <span class="post-state">'.$statuses['draft'].'</span>' : '';
129 129
 		$content .= $this->row_actions($actions);
130 130
 		return $content;
131 131
 	}
@@ -136,59 +136,59 @@  discard block
 block discarded – undo
136 136
 	 * @param EE_Venue $item
137 137
 	 * @return array()
138 138
 	 */
139
-	protected function _column_name_action_setup( EE_Venue $item ) {
139
+	protected function _column_name_action_setup(EE_Venue $item) {
140 140
 		$actions = array();
141 141
 
142
-		if ( EE_Registry::instance()->CAP->current_user_can('ee_edit_venue', 'espresso_venues_edit', $item->ID() ) ) {
142
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_venue', 'espresso_venues_edit', $item->ID())) {
143 143
 			$edit_query_args = array(
144 144
 				'action' => 'edit',
145 145
 				'post' => $item->ID()
146 146
 			);
147
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_VENUES_ADMIN_URL );
148
-			$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Venue', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
147
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_VENUES_ADMIN_URL);
148
+			$actions['edit'] = '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Venue', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
149 149
 
150 150
 		}
151 151
 
152 152
 
153
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_trash_venue', $item->ID() ) ) {
153
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_trash_venue', $item->ID())) {
154 154
 			$trash_event_query_arg = array(
155 155
 				'action' => 'trash_venue',
156 156
 				'VNU_ID' => $item->ID()
157 157
 			);
158
-			$trash_venue_link = EE_Admin_Page::add_query_args_and_nonce( $trash_event_query_arg, EE_VENUES_ADMIN_URL );
158
+			$trash_venue_link = EE_Admin_Page::add_query_args_and_nonce($trash_event_query_arg, EE_VENUES_ADMIN_URL);
159 159
 		}
160 160
 
161
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_restore_venue', $item->ID() ) ) {
161
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_restore_venue', $item->ID())) {
162 162
 			$restore_venue_query_args = array(
163 163
 				'action' => 'restore_venue',
164 164
 				'VNU_ID' => $item->ID()
165 165
 			);
166
-			$restore_venue_link = EE_Admin_Page::add_query_args_and_nonce( $restore_venue_query_args, EE_VENUES_ADMIN_URL );
166
+			$restore_venue_link = EE_Admin_Page::add_query_args_and_nonce($restore_venue_query_args, EE_VENUES_ADMIN_URL);
167 167
 		}
168 168
 
169
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_delete_venue', $item->ID() ) ) {
169
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_delete_venue', $item->ID())) {
170 170
 			$delete_venue_query_args = array(
171 171
 				'action' => 'delete_venue',
172 172
 				'VNU_ID' => $item->ID()
173 173
 			);
174
-			$delete_venue_link = EE_Admin_Page::add_query_args_and_nonce( $delete_venue_query_args, EE_VENUES_ADMIN_URL );
174
+			$delete_venue_link = EE_Admin_Page::add_query_args_and_nonce($delete_venue_query_args, EE_VENUES_ADMIN_URL);
175 175
 		}
176 176
 
177 177
 		$view_link = get_permalink($item->ID());
178 178
 
179
-		switch ( $item->get( 'status' ) ) {
179
+		switch ($item->get('status')) {
180 180
 			case 'trash' :
181
-				if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_restore_venue', $item->ID() ) ) {
182
-					$actions['restore_from_trash'] = '<a href="' . $restore_venue_link . '" title="' . esc_attr__('Restore from Trash', 'event_espresso') . '">' . __('Restore from Trash', 'event_espresso') . '</a>';
181
+				if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_restore_venue', $item->ID())) {
182
+					$actions['restore_from_trash'] = '<a href="'.$restore_venue_link.'" title="'.esc_attr__('Restore from Trash', 'event_espresso').'">'.__('Restore from Trash', 'event_espresso').'</a>';
183 183
 				}
184
-				if (  $item->count_related('Event') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_delete_venue', $item->ID() ) ) {
185
-					$actions['delete permanently'] = '<a href="' . $delete_venue_link . '" title="' . esc_attr__('Delete Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
184
+				if ($item->count_related('Event') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_delete_venue', $item->ID())) {
185
+					$actions['delete permanently'] = '<a href="'.$delete_venue_link.'" title="'.esc_attr__('Delete Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
186 186
 				}
187 187
 				break;
188 188
 			default :
189
-				$actions['view'] = '<a href="' . $view_link . '" title="' . esc_attr__('View Venue', 'event_espresso') . '">' . __('View', 'event_espresso') . '</a>';
190
-				if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_venue', 'espresso_venues_trash_venue', $item->ID() ) ) {
191
-					$actions['move to trash'] = '<a href="' . $trash_venue_link . '" title="' . esc_attr__('Trash Event', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
189
+				$actions['view'] = '<a href="'.$view_link.'" title="'.esc_attr__('View Venue', 'event_espresso').'">'.__('View', 'event_espresso').'</a>';
190
+				if (EE_Registry::instance()->CAP->current_user_can('ee_delete_venue', 'espresso_venues_trash_venue', $item->ID())) {
191
+					$actions['move to trash'] = '<a href="'.$trash_venue_link.'" title="'.esc_attr__('Trash Event', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
192 192
 				}
193 193
 		}
194 194
 		return $actions;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
 
217 217
 	public function column_shortcode($item) {
218
-		$content = '[ESPRESSO_VENUE id=' . $item->ID() . ']';
218
+		$content = '[ESPRESSO_VENUE id='.$item->ID().']';
219 219
 		return $content;
220 220
 	}
221 221
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
caffeinated/admin/new/venues/Venues_Admin_Page_Init.core.php 2 patches
Spacing   +7 added lines, -7 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,13 +32,13 @@  discard block
 block discarded – undo
32 32
 
33 33
 	public function __construct() {
34 34
 		//define some event categories related constants
35
-		define( 'EE_VENUES_PG_SLUG', 'espresso_venues' );
36
-		define( 'EE_VENUES_ADMIN_URL', admin_url('admin.php?page=' . EE_VENUES_PG_SLUG ));
37
-		define( 'EE_VENUES_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new/venues/assets/');
38
-		define( 'EE_VENUES_TEMPLATE_PATH', EE_CORE_CAF_ADMIN . 'new/venues/templates/' );
35
+		define('EE_VENUES_PG_SLUG', 'espresso_venues');
36
+		define('EE_VENUES_ADMIN_URL', admin_url('admin.php?page='.EE_VENUES_PG_SLUG));
37
+		define('EE_VENUES_ASSETS_URL', EE_CORE_CAF_ADMIN_URL.'new/venues/assets/');
38
+		define('EE_VENUES_TEMPLATE_PATH', EE_CORE_CAF_ADMIN.'new/venues/templates/');
39 39
 
40 40
 		parent::__construct();
41
-		$this->_folder_path = EE_CORE_CAF_ADMIN . 'new/' . $this->_folder_name . DS;
41
+		$this->_folder_path = EE_CORE_CAF_ADMIN.'new/'.$this->_folder_name.DS;
42 42
 	}
43 43
 
44 44
 	protected function _set_init_properties() {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 
51 51
 	protected function _set_menu_map() {
52
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
52
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
53 53
 			'menu_group' => 'management',
54 54
 			'menu_order' => 40,
55 55
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
caffeinated/admin/new/venues/espresso_events_Venues_Hooks.class.php 2 patches
Spacing   +37 added lines, -37 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
 /**
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 	protected $_event;
34 34
 
35 35
 
36
-	public function __construct( EE_Admin_Page $admin_page ) {
37
-		parent::__construct( $admin_page );
36
+	public function __construct(EE_Admin_Page $admin_page) {
37
+		parent::__construct($admin_page);
38 38
 	}
39 39
 
40 40
 
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 		$this->_name = 'venues';
43 43
 		$this->_remove_metaboxes = array(
44 44
 			0 => array(
45
-				'page_route' => array( 'create_new', 'edit' ),
45
+				'page_route' => array('create_new', 'edit'),
46 46
 				'id' => 'espresso_event_editor_venue',
47 47
 				'context' => 'normal'
48 48
 				)
49
-			);/**/
49
+			); /**/
50 50
 		$this->_metaboxes = array(
51 51
 			0 => array(
52 52
 				'page_route' => array('edit', 'create_new'),
@@ -55,18 +55,18 @@  discard block
 block discarded – undo
55 55
 				'priority' => 'high',
56 56
 				'context' => 'normal'
57 57
 				)
58
-		);/**/
58
+		); /**/
59 59
 
60 60
 		$this->_scripts_styles = array(
61 61
 			'registers' => array(
62 62
 				'ee_event_venues' => array(
63 63
 					'type' => 'js',
64
-					'url' => EE_VENUES_ASSETS_URL . 'ee-event-venues-admin.js',
64
+					'url' => EE_VENUES_ASSETS_URL.'ee-event-venues-admin.js',
65 65
 					'depends' => array('jquery')
66 66
 					),
67 67
 				'ee_event_venues_css' => array(
68 68
 					'type' => 'css',
69
-					'url' => EE_VENUES_ASSETS_URL . 'ee-event-venues-admin.css',
69
+					'url' => EE_VENUES_ASSETS_URL.'ee-event-venues-admin.css',
70 70
 					)
71 71
 				),
72 72
 			'enqueues' => array(
@@ -76,24 +76,24 @@  discard block
 block discarded – undo
76 76
 			);
77 77
 
78 78
 		//hook into the handler for saving venue
79
-		add_filter( 'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array( $this, 'modify_callbacks' ), 10 );
79
+		add_filter('FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array($this, 'modify_callbacks'), 10);
80 80
 
81 81
 		//remove default ee_autosave returns for DECAF venues (not needed for CAF venues cause we have a dropdown selector)
82
-		add_filter( 'FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', '__return_false' );
82
+		add_filter('FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', '__return_false');
83 83
 
84 84
 	}
85 85
 
86 86
 
87
-	public function modify_callbacks( $callbacks ) {
87
+	public function modify_callbacks($callbacks) {
88 88
 		// first remove default venue callback
89
-		foreach ( $callbacks as $key => $callback ) {
90
-			if ( $callback[1] == '_default_venue_update' ) {
91
-				unset( $callbacks[$key] );
89
+		foreach ($callbacks as $key => $callback) {
90
+			if ($callback[1] == '_default_venue_update') {
91
+				unset($callbacks[$key]);
92 92
 			}
93 93
 		}
94 94
 
95 95
 		//now let's add the caf version
96
-		$callbacks[] = array( $this, 'caf_venue_update' );
96
+		$callbacks[] = array($this, 'caf_venue_update');
97 97
 		return $callbacks;
98 98
 	}
99 99
 
@@ -109,69 +109,69 @@  discard block
 block discarded – undo
109 109
 		$evt_id = $evt_obj->ID();
110 110
 
111 111
 		//first let's see if we have a venue already
112
-		$evt_venues = !empty( $evt_id ) ? $evt_obj->venues() : array();
113
-		$evt_venue = $evt_venues && is_array( $evt_venues ) ? reset( $evt_venues ) : null;
112
+		$evt_venues = ! empty($evt_id) ? $evt_obj->venues() : array();
113
+		$evt_venue = $evt_venues && is_array($evt_venues) ? reset($evt_venues) : null;
114 114
 		$evt_venue_id = $evt_venue instanceof EE_Venue ? $evt_venue->ID() : null;
115 115
 
116 116
 		//possibly private venues.
117
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_venues', 'get_venues' ) ) {
118
-			$vnu_where['status']= array( 'IN' , array( 'publish', 'private' ) );
117
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')) {
118
+			$vnu_where['status'] = array('IN', array('publish', 'private'));
119 119
 		} else {
120 120
 			$vnu_where['status'] = 'publish';
121 121
 		}
122 122
 
123 123
 		//cap checks
124
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_venues', 'get_venues' ) ) {
124
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_venues', 'get_venues')) {
125 125
 			$vnu_where['VNU_wp_user'] = get_current_user_id();
126 126
 		}
127 127
 
128
-		$vnumdl = EE_Registry::instance()->load_model( 'Venue' );
129
-		$venues = $vnumdl->get_all( array( $vnu_where, 'order_by' => array( 'VNU_name' => 'ASC' ) ) );
128
+		$vnumdl = EE_Registry::instance()->load_model('Venue');
129
+		$venues = $vnumdl->get_all(array($vnu_where, 'order_by' => array('VNU_name' => 'ASC')));
130 130
 
131 131
 		$ven_select = array();
132 132
 		$ven_select[0] = __('Select a Venue', 'event_espresso');
133 133
 		//setup venues for selector
134
-		foreach ( $venues as $venue ) {
134
+		foreach ($venues as $venue) {
135 135
 			$ven_select[$venue->ID()] = $venue->name();
136 136
 		}
137 137
 
138 138
 		//if $ven_select does not have the existing venue attached to event then let's add that because we'll always
139 139
 		//show existing attached venues even if it's trashed (or some other restricted status).
140 140
 
141
-		if ( $evt_venue_id && ! isset( $ven_select[$evt_venue_id] ) ) {
141
+		if ($evt_venue_id && ! isset($ven_select[$evt_venue_id])) {
142 142
 			$ven_select[$evt_venue_id] = $evt_venue->name();
143
-			$venues = array_merge( $venues, array( $evt_venue ) );
143
+			$venues = array_merge($venues, array($evt_venue));
144 144
 		}
145 145
 
146 146
 		$template_args['venues'] = $venues;
147 147
 		$template_args['evt_venue_id'] = $evt_venue_id;
148
-		$template_args['venue_selector'] = EEH_Form_Fields::select_input('venue_id', $ven_select, $evt_venue_id, 'id="venue_id"' );
149
-		$template_args['enable_for_gmap'] = EEH_Form_Fields::select_input('enable_for_gmap', $values, is_object( $evt_venue ) ? $evt_venue->enable_for_gmap() : NULL, 'id="enable_for_gmap"');
150
-		$template_path = empty( $venues ) ? EE_VENUES_TEMPLATE_PATH . 'event_venues_metabox_content.template.php' : EE_VENUES_TEMPLATE_PATH . 'event_venues_metabox_content_from_manager.template.php';
151
-		EEH_Template::display_template( $template_path, $template_args );
148
+		$template_args['venue_selector'] = EEH_Form_Fields::select_input('venue_id', $ven_select, $evt_venue_id, 'id="venue_id"');
149
+		$template_args['enable_for_gmap'] = EEH_Form_Fields::select_input('enable_for_gmap', $values, is_object($evt_venue) ? $evt_venue->enable_for_gmap() : NULL, 'id="enable_for_gmap"');
150
+		$template_path = empty($venues) ? EE_VENUES_TEMPLATE_PATH.'event_venues_metabox_content.template.php' : EE_VENUES_TEMPLATE_PATH.'event_venues_metabox_content_from_manager.template.php';
151
+		EEH_Template::display_template($template_path, $template_args);
152 152
 	}
153 153
 
154 154
 
155 155
 
156 156
 
157
-	public function caf_venue_update( $evtobj, $data ) {
157
+	public function caf_venue_update($evtobj, $data) {
158 158
 		EE_Registry::instance()->load_model('Venue');
159
-		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
159
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : NULL;
160 160
 
161 161
 
162 162
 		//first let's check if the selected venue matches any existing venue attached to the event
163 163
 		$evt_venue = $evtobj->venues();
164
-		$evt_venue = !empty( $evt_venue ) ? array_shift( $evt_venue ) : NULL;
164
+		$evt_venue = ! empty($evt_venue) ? array_shift($evt_venue) : NULL;
165 165
 
166
-		if ( !empty( $evt_venue ) && $evt_venue->ID() != $venue_id )
167
-			$evtobj->_remove_relation_to( $evt_venue->ID(), 'Venue' );
166
+		if ( ! empty($evt_venue) && $evt_venue->ID() != $venue_id)
167
+			$evtobj->_remove_relation_to($evt_venue->ID(), 'Venue');
168 168
 
169
-		if ( empty( $venue_id ) )
169
+		if (empty($venue_id))
170 170
 			return TRUE; //no venue to attach
171 171
 
172 172
 		// this should take care of adding to revisions as well as main post object
173
-		$success = $evtobj->_add_relation_to( $venue_id, 'Venue' );
174
-		return !empty($success) ? TRUE : FALSE;
173
+		$success = $evtobj->_add_relation_to($venue_id, 'Venue');
174
+		return ! empty($success) ? TRUE : FALSE;
175 175
 	}
176 176
 
177 177
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 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
@@ -163,11 +164,14 @@  discard block
 block discarded – undo
163 164
 		$evt_venue = $evtobj->venues();
164 165
 		$evt_venue = !empty( $evt_venue ) ? array_shift( $evt_venue ) : NULL;
165 166
 
166
-		if ( !empty( $evt_venue ) && $evt_venue->ID() != $venue_id )
167
-			$evtobj->_remove_relation_to( $evt_venue->ID(), 'Venue' );
167
+		if ( !empty( $evt_venue ) && $evt_venue->ID() != $venue_id ) {
168
+					$evtobj->_remove_relation_to( $evt_venue->ID(), 'Venue' );
169
+		}
168 170
 
169
-		if ( empty( $venue_id ) )
170
-			return TRUE; //no venue to attach
171
+		if ( empty( $venue_id ) ) {
172
+					return TRUE;
173
+		}
174
+		//no venue to attach
171 175
 
172 176
 		// this should take care of adding to revisions as well as main post object
173 177
 		$success = $evtobj->_add_relation_to( $venue_id, 'Venue' );
Please login to merge, or discard this patch.
venues_editor_physical_location_google_map_virtual_location.help_tab.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <h3><?php _e('Physical Location', 'event_espresso'); ?></h3>
2 2
 <p>
3 3
 <?php _e('Enter the physical address for this venue. This field is optional.', 'event_espresso'); ?><br />
4
-<?php echo sprintf(__('The countries that are shown in the dropdown are controlled through the "Country Appears in Dropdown Select Lists" setting which is in the %sCountries tab%s on the General Settings page. Once on this page, you can specify whether to show a country in this dropdown by selecting yes or no and saving changes.', 'event_espresso'),'<a href="admin.php?page=espresso_general_settings&action=country_settings">','</a>'); ?>
4
+<?php echo sprintf(__('The countries that are shown in the dropdown are controlled through the "Country Appears in Dropdown Select Lists" setting which is in the %sCountries tab%s on the General Settings page. Once on this page, you can specify whether to show a country in this dropdown by selecting yes or no and saving changes.', 'event_espresso'), '<a href="admin.php?page=espresso_general_settings&action=country_settings">', '</a>'); ?>
5 5
 </p>
6 6
 </p>
7 7
 <h3><?php _e('Google Map', 'event_espresso'); ?></h3>
Please login to merge, or discard this patch.
caffeinated/admin/new/venues/help_tours/Google_Maps_Help_Tour.class.php 2 patches
Spacing   +6 added lines, -6 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
 /**
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
 
72 72
 
73 73
 	protected function _start() {
74
-		$content = '<h3>' . __('Google Maps Settings', 'event_espresso') . '</h3>';
75
-		$content .= '<p>' . __('This tour of the Google Maps page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
74
+		$content = '<h3>'.__('Google Maps Settings', 'event_espresso').'</h3>';
75
+		$content .= '<p>'.__('This tour of the Google Maps page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
76 76
 		return $content;
77 77
 	}
78 78
 
79 79
 	protected function _use_google_maps_stop() {
80
-		return '<p>' . __('Turn Google maps on or off site wide for Event Espresso.', 'event_espresso') . '</p>';
80
+		return '<p>'.__('Turn Google maps on or off site wide for Event Espresso.', 'event_espresso').'</p>';
81 81
 	}
82 82
 
83 83
 	protected function _reg_page_map_settings_stop() {
84
-		return '<p>' . __('These settings affect the single registration page maps only.', 'event_espresso') . '</p>';
84
+		return '<p>'.__('These settings affect the single registration page maps only.', 'event_espresso').'</p>';
85 85
 	}
86 86
 
87 87
 	protected function _event_list_map_stop() {
88
-		return '<p>' . __('These setting affect the event list page maps.', 'event_espresso') . '</p>';
88
+		return '<p>'.__('These setting affect the event list page maps.', 'event_espresso').'</p>';
89 89
 	}
90 90
 
91 91
 }
92 92
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.