Completed
Branch ENH-9001-hhvm-max-input-vars (e4c045)
by
unknown
432:28 queued 418:03
created
core/admin/EE_Admin.core.php 3 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,33 +1,33 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package			Event Espresso
8
- * @ author			Seth Shoultes
9
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
- * @ link					http://www.eventespresso.com
12
- * @ version		 	4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- *
16
- * EE_Admin
17
- *
18
- * @package			Event Espresso
19
- * @subpackage	/core/admin/
20
- * @author				Brent Christensen
21
- *
22
- * ------------------------------------------------------------------------
23
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package			Event Espresso
8
+	 * @ author			Seth Shoultes
9
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
+	 * @ link					http://www.eventespresso.com
12
+	 * @ version		 	4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 *
16
+	 * EE_Admin
17
+	 *
18
+	 * @package			Event Espresso
19
+	 * @subpackage	/core/admin/
20
+	 * @author				Brent Christensen
21
+	 *
22
+	 * ------------------------------------------------------------------------
23
+	 */
24 24
 final class EE_Admin {
25 25
 
26 26
    /**
27
-     * 	EE_Admin Object
28
-     * 	@private _instance
29
-	 * 	@private 	protected
30
-     */
27
+    * 	EE_Admin Object
28
+    * 	@private _instance
29
+    * 	@private 	protected
30
+    */
31 31
 	private static $_instance = NULL;
32 32
 
33 33
 	/**
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 
57 57
 
58 58
    /**
59
-     * class constructor
60
-     */
59
+    * class constructor
60
+    */
61 61
 	protected function __construct() {
62 62
 		// define global EE_Admin constants
63 63
 		$this->_define_all_constants();
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
 
169 169
 
170 170
 	/**
171
-	* init- should fire after shortcode, module,  addon, other plugin (default priority), and even EE_Front_Controller's init phases have run
172
-	*
173
-	* @access public
174
-	* @return void
175
-	*/
171
+	 * init- should fire after shortcode, module,  addon, other plugin (default priority), and even EE_Front_Controller's init phases have run
172
+	 *
173
+	 * @access public
174
+	 * @return void
175
+	 */
176 176
 	public function init() {
177 177
 
178 178
 		//only enable most of the EE_Admin IF we're not in full maintenance mode
@@ -463,11 +463,11 @@  discard block
 block discarded – undo
463 463
 
464 464
 
465 465
 	/**
466
-	* admin_init
467
-	*
468
-	* @access public
469
-	* @return void
470
-	*/
466
+	 * admin_init
467
+	 *
468
+	 * @access public
469
+	 * @return void
470
+	 */
471 471
 	public function admin_init() {
472 472
 
473 473
 		/**
@@ -624,11 +624,11 @@  discard block
 block discarded – undo
624 624
 
625 625
 
626 626
 	/**
627
-	* 	dismiss_persistent_admin_notice
628
-	*
629
-	*	@access 	public
630
-	* 	@return 		void
631
-	*/
627
+	 * 	dismiss_persistent_admin_notice
628
+	 *
629
+	 *	@access 	public
630
+	 * 	@return 		void
631
+	 */
632 632
 	public function dismiss_ee_nag_notice_callback() {
633 633
 		EE_Error::dismiss_persistent_admin_notice();
634 634
 	}
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 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,8 +222,9 @@  discard block
 block discarded – undo
220 222
 	 */
221 223
 	public function remove_pages_from_nav_menu( $post_type ) {
222 224
 		//if this isn't the "pages" post type let's get out
223
-		if ( $post_type->name !== 'page' )
224
-			return $post_type;
225
+		if ( $post_type->name !== 'page' ) {
226
+					return $post_type;
227
+		}
225 228
 
226 229
 		$critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array();
227 230
 
@@ -296,8 +299,9 @@  discard block
 block discarded – undo
296 299
 	 * @return string  the (maybe) modified link
297 300
 	 */
298 301
 	public function modify_edit_post_link( $link, $id, $context ) {
299
-		if ( ! $post = get_post( $id ) )
300
-			return $link;
302
+		if ( ! $post = get_post( $id ) ) {
303
+					return $link;
304
+		}
301 305
 
302 306
 		if ( $post->post_type == 'espresso_attendees' ) {
303 307
 			$query_args = array(
@@ -337,7 +341,10 @@  discard block
 block discarded – undo
337 341
 		<div id="posttype-extra-nav-menu-pages" class="posttypediv">
338 342
 			<ul id="posttype-extra-nav-menu-pages-tabs" class="posttype-tabs add-menu-item-tabs">
339 343
 				<li <?php echo ( 'event-archives' == $current_tab ? ' class="tabs"' : '' ); ?>>
340
-					<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
344
+					<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ( $nav_menu_selected_id ) {
345
+	echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args)));
346
+}
347
+?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
341 348
 						<?php _e( 'Event Archive Pages', 'event_espresso' ); ?>
342 349
 					</a>
343 350
 				</li>
@@ -870,8 +877,9 @@  discard block
 block discarded – undo
870 877
 	 */
871 878
 	public static function register_ee_admin_page( $page_basename, $page_path, $config = array() ) {
872 879
 		EE_Error::doing_it_wrong( __METHOD__, sprintf( __('Usage is deprecated.  Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3' );
873
-		if ( class_exists( 'EE_Register_Admin_Page' ) )
874
-			$config['page_path'] = $page_path;
880
+		if ( class_exists( 'EE_Register_Admin_Page' ) ) {
881
+					$config['page_path'] = $page_path;
882
+		}
875 883
 			EE_Register_Admin_Page::register( $page_basename, $config );
876 884
 	}
877 885
 
Please login to merge, or discard this patch.
Spacing   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public static function instance() {
49 49
 		// check if class object is instantiated
50
-		if (  ! self::$_instance instanceof EE_Admin ) {
50
+		if ( ! self::$_instance instanceof EE_Admin) {
51 51
 			self::$_instance = new self();
52 52
 		}
53 53
 		return self::$_instance;
@@ -62,25 +62,25 @@  discard block
 block discarded – undo
62 62
 		// define global EE_Admin constants
63 63
 		$this->_define_all_constants();
64 64
 		// set autoloaders for our admin page classes based on included path information
65
-		EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( EE_ADMIN );
65
+		EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder(EE_ADMIN);
66 66
 		// admin hooks
67
-		add_filter( 'plugin_action_links', array( $this, 'filter_plugin_actions' ), 10, 2 );
67
+		add_filter('plugin_action_links', array($this, 'filter_plugin_actions'), 10, 2);
68 68
 		// load EE_Request_Handler early
69
-		add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'get_request' ));
70
-		add_action( 'AHEE__EE_System__initialize_last', array( $this, 'init' ));
71
-		add_action( 'AHEE__EE_Admin_Page__route_admin_request', array( $this, 'route_admin_request' ), 100, 2 );
72
-		add_action( 'wp_loaded', array( $this, 'wp_loaded' ), 100 );
73
-		add_action( 'admin_init', array( $this, 'admin_init' ), 100 );
74
-		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 20 );
75
-		add_action( 'admin_notices', array( $this, 'display_admin_notices' ), 10 );
76
-		add_action( 'network_admin_notices', array( $this, 'display_admin_notices' ), 10 );
77
-		add_filter( 'pre_update_option', array( $this, 'check_for_invalid_datetime_formats' ), 100, 2 );
78
-		add_filter('admin_footer_text', array( $this, 'espresso_admin_footer' ));
69
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'get_request'));
70
+		add_action('AHEE__EE_System__initialize_last', array($this, 'init'));
71
+		add_action('AHEE__EE_Admin_Page__route_admin_request', array($this, 'route_admin_request'), 100, 2);
72
+		add_action('wp_loaded', array($this, 'wp_loaded'), 100);
73
+		add_action('admin_init', array($this, 'admin_init'), 100);
74
+		add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'), 20);
75
+		add_action('admin_notices', array($this, 'display_admin_notices'), 10);
76
+		add_action('network_admin_notices', array($this, 'display_admin_notices'), 10);
77
+		add_filter('pre_update_option', array($this, 'check_for_invalid_datetime_formats'), 100, 2);
78
+		add_filter('admin_footer_text', array($this, 'espresso_admin_footer'));
79 79
 
80 80
 		//reset Environment config (we only do this on admin page loads);
81 81
 		EE_Registry::instance()->CFG->environment->recheck_values();
82 82
 
83
-		do_action( 'AHEE__EE_Admin__loaded' );
83
+		do_action('AHEE__EE_Admin__loaded');
84 84
 	}
85 85
 
86 86
 
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 	 * @return void
96 96
 	 */
97 97
 	private function _define_all_constants() {
98
-		define( 'EE_ADMIN_URL', EE_PLUGIN_DIR_URL . 'core/admin/' );
99
-		define( 'EE_ADMIN_PAGES_URL', EE_PLUGIN_DIR_URL . 'admin_pages/' );
100
-		define( 'EE_ADMIN_TEMPLATE', EE_ADMIN . 'templates' . DS );
101
-		define( 'WP_ADMIN_PATH', ABSPATH . 'wp-admin/' );
102
-		define( 'WP_AJAX_URL', admin_url( 'admin-ajax.php' ));
103
-		define( 'JQPLOT_URL', EE_GLOBAL_ASSETS_URL . 'scripts/jqplot/' );
98
+		define('EE_ADMIN_URL', EE_PLUGIN_DIR_URL.'core/admin/');
99
+		define('EE_ADMIN_PAGES_URL', EE_PLUGIN_DIR_URL.'admin_pages/');
100
+		define('EE_ADMIN_TEMPLATE', EE_ADMIN.'templates'.DS);
101
+		define('WP_ADMIN_PATH', ABSPATH.'wp-admin/');
102
+		define('WP_AJAX_URL', admin_url('admin-ajax.php'));
103
+		define('JQPLOT_URL', EE_GLOBAL_ASSETS_URL.'scripts/jqplot/');
104 104
 	}
105 105
 
106 106
 
@@ -113,23 +113,23 @@  discard block
 block discarded – undo
113 113
 	 * @param 	string 	$plugin
114 114
 	 * @return 	array
115 115
 	 */
116
-	public function filter_plugin_actions( $links, $plugin ) {
116
+	public function filter_plugin_actions($links, $plugin) {
117 117
 		// set $main_file in stone
118 118
 		static $main_file;
119 119
 		// if $main_file is not set yet
120
-		if ( ! $main_file ) {
121
-			$main_file = plugin_basename( EVENT_ESPRESSO_MAIN_FILE );
120
+		if ( ! $main_file) {
121
+			$main_file = plugin_basename(EVENT_ESPRESSO_MAIN_FILE);
122 122
 		}
123
-		 if ( $plugin == $main_file ) {
123
+		 if ($plugin == $main_file) {
124 124
 		 	// compare current plugin to this one
125
-			if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
126
-				$maintenance_link = '<a href="admin.php?page=espresso_maintenance_settings" title="Event Espresso is in maintenance mode.  Click this link to learn why.">' . __('Maintenance Mode Active', 'event_espresso' ) . '</a>';
127
-				array_unshift( $links, $maintenance_link );
125
+			if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
126
+				$maintenance_link = '<a href="admin.php?page=espresso_maintenance_settings" title="Event Espresso is in maintenance mode.  Click this link to learn why.">'.__('Maintenance Mode Active', 'event_espresso').'</a>';
127
+				array_unshift($links, $maintenance_link);
128 128
 			} else {
129
-				$org_settings_link = '<a href="admin.php?page=espresso_general_settings">' . __( 'Settings', 'event_espresso' ) . '</a>';
130
-				$events_link = '<a href="admin.php?page=espresso_events">' . __( 'Events', 'event_espresso' ) . '</a>';
129
+				$org_settings_link = '<a href="admin.php?page=espresso_general_settings">'.__('Settings', 'event_espresso').'</a>';
130
+				$events_link = '<a href="admin.php?page=espresso_events">'.__('Events', 'event_espresso').'</a>';
131 131
 				// add before other links
132
-				array_unshift( $links, $org_settings_link, $events_link );
132
+				array_unshift($links, $org_settings_link, $events_link);
133 133
 			}
134 134
 		}
135 135
 		return $links;
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 	 *	@return void
145 145
 	 */
146 146
 	public function get_request() {
147
-		EE_Registry::instance()->load_core( 'Request_Handler' );
148
-		EE_Registry::instance()->load_core( 'CPT_Strategy' );
147
+		EE_Registry::instance()->load_core('Request_Handler');
148
+		EE_Registry::instance()->load_core('CPT_Strategy');
149 149
 	}
150 150
 
151 151
 
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
 	 * @param array $admin_page_folder_names
158 158
 	 * @return array
159 159
 	 */
160
-	public function hide_admin_pages_except_maintenance_mode( $admin_page_folder_names = array() ){
160
+	public function hide_admin_pages_except_maintenance_mode($admin_page_folder_names = array()) {
161 161
 		return array(
162
-			'maintenance' => EE_ADMIN_PAGES . 'maintenance' . DS,
163
-			'about' => EE_ADMIN_PAGES . 'about' . DS,
164
-			'support' => EE_ADMIN_PAGES . 'support' . DS
162
+			'maintenance' => EE_ADMIN_PAGES.'maintenance'.DS,
163
+			'about' => EE_ADMIN_PAGES.'about'.DS,
164
+			'support' => EE_ADMIN_PAGES.'support'.DS
165 165
 		);
166 166
 	}
167 167
 
@@ -176,36 +176,36 @@  discard block
 block discarded – undo
176 176
 	public function init() {
177 177
 
178 178
 		//only enable most of the EE_Admin IF we're not in full maintenance mode
179
-		if ( EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ){
179
+		if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) {
180 180
 			//ok so we want to enable the entire admin
181
-			add_action( 'wp_ajax_dismiss_ee_nag_notice', array( $this, 'dismiss_ee_nag_notice_callback' ));
182
-			add_action( 'save_post', array( 'EE_Admin', 'parse_post_content_on_save' ), 100, 2 );
183
-			add_action( 'update_option', array( $this, 'reset_page_for_posts_on_change' ), 100, 3 );
184
-			add_filter( 'content_save_pre', array( $this, 'its_eSpresso' ), 10, 1 );
185
-			add_action( 'admin_notices', array( $this, 'get_persistent_admin_notices' ), 9 );
186
-			add_action( 'network_admin_notices', array( $this, 'get_persistent_admin_notices' ), 9 );
181
+			add_action('wp_ajax_dismiss_ee_nag_notice', array($this, 'dismiss_ee_nag_notice_callback'));
182
+			add_action('save_post', array('EE_Admin', 'parse_post_content_on_save'), 100, 2);
183
+			add_action('update_option', array($this, 'reset_page_for_posts_on_change'), 100, 3);
184
+			add_filter('content_save_pre', array($this, 'its_eSpresso'), 10, 1);
185
+			add_action('admin_notices', array($this, 'get_persistent_admin_notices'), 9);
186
+			add_action('network_admin_notices', array($this, 'get_persistent_admin_notices'), 9);
187 187
 			//at a glance dashboard widget
188
-			add_filter( 'dashboard_glance_items', array( $this, 'dashboard_glance_items'), 10 );
188
+			add_filter('dashboard_glance_items', array($this, 'dashboard_glance_items'), 10);
189 189
 			//filter for get_edit_post_link used on comments for custom post types
190
-			add_filter('get_edit_post_link', array( $this, 'modify_edit_post_link' ), 10, 3 );
190
+			add_filter('get_edit_post_link', array($this, 'modify_edit_post_link'), 10, 3);
191 191
 		}
192 192
 
193 193
 		// run the admin page factory but ONLY if we are doing an ee admin ajax request
194
-		if ( !defined('DOING_AJAX') || EE_ADMIN_AJAX ) {
194
+		if ( ! defined('DOING_AJAX') || EE_ADMIN_AJAX) {
195 195
 			try {
196 196
 				//this loads the controller for the admin pages which will setup routing etc
197
-				EE_Registry::instance()->load_core( 'Admin_Page_Loader' );
198
-			} catch ( EE_Error $e ) {
197
+				EE_Registry::instance()->load_core('Admin_Page_Loader');
198
+			} catch (EE_Error $e) {
199 199
 				$e->get_error();
200 200
 			}
201 201
 		}
202 202
 
203 203
 		//make sure our CPTs and custom taxonomy metaboxes get shown for first time users
204
-		add_action('admin_head', array($this, 'enable_hidden_ee_nav_menu_metaboxes' ), 10 );
205
-		add_action('admin_head', array( $this, 'register_custom_nav_menu_boxes' ), 10 );
204
+		add_action('admin_head', array($this, 'enable_hidden_ee_nav_menu_metaboxes'), 10);
205
+		add_action('admin_head', array($this, 'register_custom_nav_menu_boxes'), 10);
206 206
 
207 207
 		//exclude EE critical pages from all nav menus and wp_list_pages
208
-		add_filter('nav_menu_meta_box_object', array( $this, 'remove_pages_from_nav_menu'), 10 );
208
+		add_filter('nav_menu_meta_box_object', array($this, 'remove_pages_from_nav_menu'), 10);
209 209
 	}
210 210
 
211 211
 
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 	 * @param  object $post_type WP post type object
219 219
 	 * @return object            WP post type object
220 220
 	 */
221
-	public function remove_pages_from_nav_menu( $post_type ) {
221
+	public function remove_pages_from_nav_menu($post_type) {
222 222
 		//if this isn't the "pages" post type let's get out
223
-		if ( $post_type->name !== 'page' )
223
+		if ($post_type->name !== 'page')
224 224
 			return $post_type;
225 225
 
226 226
 		$critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array();
@@ -240,28 +240,28 @@  discard block
 block discarded – undo
240 240
 	 */
241 241
 	public function enable_hidden_ee_nav_menu_metaboxes() {
242 242
 		global $wp_meta_boxes, $pagenow;
243
-		if ( ! is_array($wp_meta_boxes) || $pagenow !== 'nav-menus.php' ) {
243
+		if ( ! is_array($wp_meta_boxes) || $pagenow !== 'nav-menus.php') {
244 244
 			return;
245 245
 		}
246 246
 		$user = wp_get_current_user();
247 247
 		//has this been done yet?
248
-		if ( get_user_option( 'ee_nav_menu_initialized', $user->ID ) ) {
248
+		if (get_user_option('ee_nav_menu_initialized', $user->ID)) {
249 249
 			return;
250 250
 		}
251 251
 
252
-		$hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus', $user->ID );
253
-		$initial_meta_boxes = apply_filters( 'FHEE__EE_Admin__enable_hidden_ee_nav_menu_boxes__initial_meta_boxes', array( 'nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category', 'add-espresso_events', 'add-espresso_venues', 'add-espresso_event_categories', 'add-espresso_venue_categories', 'add-post-type-post', 'add-post-type-page' ) );
252
+		$hidden_meta_boxes = get_user_option('metaboxhidden_nav-menus', $user->ID);
253
+		$initial_meta_boxes = apply_filters('FHEE__EE_Admin__enable_hidden_ee_nav_menu_boxes__initial_meta_boxes', array('nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category', 'add-espresso_events', 'add-espresso_venues', 'add-espresso_event_categories', 'add-espresso_venue_categories', 'add-post-type-post', 'add-post-type-page'));
254 254
 
255
-		if ( is_array( $hidden_meta_boxes ) ) {
256
-			foreach ( $hidden_meta_boxes as $key => $meta_box_id ) {
257
-				if ( in_array( $meta_box_id, $initial_meta_boxes ) ) {
258
-					unset( $hidden_meta_boxes[ $key ] );
255
+		if (is_array($hidden_meta_boxes)) {
256
+			foreach ($hidden_meta_boxes as $key => $meta_box_id) {
257
+				if (in_array($meta_box_id, $initial_meta_boxes)) {
258
+					unset($hidden_meta_boxes[$key]);
259 259
 				}
260 260
 			}
261 261
 		}
262 262
 
263
-		update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
264
-		update_user_option( $user->ID, 'ee_nav_menu_initialized', 1, true );
263
+		update_user_option($user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true);
264
+		update_user_option($user->ID, 'ee_nav_menu_initialized', 1, true);
265 265
 	}
266 266
 
267 267
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 * @return void
281 281
 	 */
282 282
 	public function register_custom_nav_menu_boxes() {
283
-		add_meta_box( 'add-extra-nav-menu-pages', __('Event Espresso Pages', 'event_espresso'), array( $this, 'ee_cpt_archive_pages' ), 'nav-menus', 'side', 'core' );
283
+		add_meta_box('add-extra-nav-menu-pages', __('Event Espresso Pages', 'event_espresso'), array($this, 'ee_cpt_archive_pages'), 'nav-menus', 'side', 'core');
284 284
 	}
285 285
 
286 286
 
@@ -297,17 +297,17 @@  discard block
 block discarded – undo
297 297
 	 *
298 298
 	 * @return string  the (maybe) modified link
299 299
 	 */
300
-	public function modify_edit_post_link( $link, $id, $context ) {
301
-		if ( ! $post = get_post( $id ) )
300
+	public function modify_edit_post_link($link, $id, $context) {
301
+		if ( ! $post = get_post($id))
302 302
 			return $link;
303 303
 
304
-		if ( $post->post_type == 'espresso_attendees' ) {
304
+		if ($post->post_type == 'espresso_attendees') {
305 305
 			$query_args = array(
306 306
 				'action' => 'edit_attendee',
307 307
 				'post' => $id
308 308
 				);
309 309
 			EE_Registry::instance()->load_helper('URL');
310
-			return EEH_URL::add_query_args_and_nonce( $query_args, admin_url('admin.php?page=espresso_registrations') );
310
+			return EEH_URL::add_query_args_and_nonce($query_args, admin_url('admin.php?page=espresso_registrations'));
311 311
 		}
312 312
 		return $link;
313 313
 	}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		global $nav_menu_selected_id;
320 320
 
321 321
 		$db_fields = false;
322
-		$walker = new Walker_Nav_Menu_Checklist( $db_fields );
322
+		$walker = new Walker_Nav_Menu_Checklist($db_fields);
323 323
 		$current_tab = 'event-archives';
324 324
 
325 325
 		/*if ( ! empty( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
@@ -338,9 +338,9 @@  discard block
 block discarded – undo
338 338
 		?>
339 339
 		<div id="posttype-extra-nav-menu-pages" class="posttypediv">
340 340
 			<ul id="posttype-extra-nav-menu-pages-tabs" class="posttype-tabs add-menu-item-tabs">
341
-				<li <?php echo ( 'event-archives' == $current_tab ? ' class="tabs"' : '' ); ?>>
342
-					<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
343
-						<?php _e( 'Event Archive Pages', 'event_espresso' ); ?>
341
+				<li <?php echo ('event-archives' == $current_tab ? ' class="tabs"' : ''); ?>>
342
+					<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ($nav_menu_selected_id) echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
343
+						<?php _e('Event Archive Pages', 'event_espresso'); ?>
344 344
 					</a>
345 345
 				</li>
346 346
 			<?php /* // temporarily removing but leaving skeleton in place in case we ever decide to add more tabs.
@@ -358,13 +358,13 @@  discard block
 block discarded – undo
358 358
  			<?php */ ?>
359 359
 
360 360
 			<div id="tabs-panel-posttype-extra-nav-menu-pages-event-archives" class="tabs-panel <?php
361
-			echo ( 'event-archives' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
361
+			echo ('event-archives' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive');
362 362
 			?>">
363 363
 				<ul id="extra-nav-menu-pageschecklist-event-archives" class="categorychecklist form-no-clear">
364 364
 					<?php
365 365
 					$pages = $this->_get_extra_nav_menu_pages_items();
366 366
 					$args['walker'] = $walker;
367
-					echo walk_nav_menu_tree( array_map( array( $this, '_setup_extra_nav_menu_pages_items' ), $pages), 0, (object) $args );
367
+					echo walk_nav_menu_tree(array_map(array($this, '_setup_extra_nav_menu_pages_items'), $pages), 0, (object) $args);
368 368
 					?>
369 369
 				</ul>
370 370
 			</div><!-- /.tabs-panel -->
@@ -372,18 +372,18 @@  discard block
 block discarded – undo
372 372
 			<p class="button-controls">
373 373
 				<span class="list-controls">
374 374
 					<a href="<?php
375
-						echo esc_url( add_query_arg(
375
+						echo esc_url(add_query_arg(
376 376
 							array(
377 377
 								'extra-nav-menu-pages-tab' => 'event-archives',
378 378
 								'selectall' => 1,
379 379
 							),
380
-							remove_query_arg( $removed_args )
380
+							remove_query_arg($removed_args)
381 381
 						));
382 382
 					?>#posttype-extra-nav-menu-pages>" class="select-all"><?php _e('Select All'); ?></a>
383 383
 				</span>
384 384
 
385 385
 				<span class="add-to-menu">
386
-					<input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e( 'submit-posttype-extra-nav-menu-pages' ); ?>" />
386
+					<input type="submit"<?php wp_nav_menu_disabled_check($nav_menu_selected_id); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e(__('Add to Menu')); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e('submit-posttype-extra-nav-menu-pages'); ?>" />
387 387
 					<span class="spinner"></span>
388 388
 				</span>
389 389
 			</p>
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
 	private function _get_extra_nav_menu_pages_items() {
405 405
 		$menuitems[] = array(
406 406
 			'title' => __('Event List', 'event_espresso'),
407
-			'url' => get_post_type_archive_link( 'espresso_events' ),
407
+			'url' => get_post_type_archive_link('espresso_events'),
408 408
 			'description' => __('Archive page for all events.', 'event_espresso')
409 409
 		);
410
-		return apply_filters( 'FHEE__EE_Admin__get_extra_nav_menu_pages_items', $menuitems );
410
+		return apply_filters('FHEE__EE_Admin__get_extra_nav_menu_pages_items', $menuitems);
411 411
 	}
412 412
 
413 413
 
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 	 * @param $menuitem
420 420
 	 * @return stdClass
421 421
 	 */
422
-	private function _setup_extra_nav_menu_pages_items( $menuitem ) {
422
+	private function _setup_extra_nav_menu_pages_items($menuitem) {
423 423
 		$menu_item = new stdClass();
424 424
 		$keys = array(
425 425
 			'ID' => 0,
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 			'xfn' => ''
440 440
 			);
441 441
 
442
-		foreach ( $keys as $key => $value) {
442
+		foreach ($keys as $key => $value) {
443 443
 			$menu_item->$key = isset($menuitem[$key]) ? $menuitem[$key] : $value;
444 444
 		}
445 445
 		return $menu_item;
@@ -479,10 +479,10 @@  discard block
 block discarded – undo
479 479
 		 * - check if doing post processing of one of EE CPTs
480 480
 		 * - instantiate the corresponding EE CPT model for the post_type being processed.
481 481
 		 */
482
-		if ( isset( $_POST['action'] ) && $_POST['action'] == 'editpost' ) {
483
-			if ( isset( $_POST['post_type'] ) ) {
484
-				EE_Registry::instance()->load_core( 'Register_CPTs' );
485
-				EE_Register_CPTs::instantiate_cpt_models( $_POST['post_type'] );
482
+		if (isset($_POST['action']) && $_POST['action'] == 'editpost') {
483
+			if (isset($_POST['post_type'])) {
484
+				EE_Registry::instance()->load_core('Register_CPTs');
485
+				EE_Register_CPTs::instantiate_cpt_models($_POST['post_type']);
486 486
 			}
487 487
 		}
488 488
 
@@ -492,8 +492,8 @@  discard block
 block discarded – undo
492 492
 		 * 'options-reading.php' core WordPress admin settings page.  This is for user-proofing.
493 493
 		 */
494 494
 		global $pagenow;
495
-		if ( $pagenow == 'options-reading.php' ) {
496
-			add_filter( 'wp_dropdown_pages', array( $this, 'modify_dropdown_pages' ) );
495
+		if ($pagenow == 'options-reading.php') {
496
+			add_filter('wp_dropdown_pages', array($this, 'modify_dropdown_pages'));
497 497
 		}
498 498
 
499 499
 	}
@@ -505,25 +505,25 @@  discard block
 block discarded – undo
505 505
 	 * @param string $output  Current output.
506 506
 	 * @return string
507 507
 	 */
508
-	public function modify_dropdown_pages( $output ) {
508
+	public function modify_dropdown_pages($output) {
509 509
 		//get critical pages
510 510
 		$critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array();
511 511
 
512 512
 		//split current output by line break for easier parsing.
513
-		$split_output = explode( "\n", $output );
513
+		$split_output = explode("\n", $output);
514 514
 
515 515
 		//loop through to remove any critical pages from the array.
516
-		foreach ( $critical_pages as $page_id ) {
517
-			$needle = 'value="' . $page_id . '"';
518
-			foreach( $split_output as $key => $haystack ) {
519
-				if( strpos( $haystack, $needle ) !== false ) {
520
-					unset( $split_output[$key] );
516
+		foreach ($critical_pages as $page_id) {
517
+			$needle = 'value="'.$page_id.'"';
518
+			foreach ($split_output as $key => $haystack) {
519
+				if (strpos($haystack, $needle) !== false) {
520
+					unset($split_output[$key]);
521 521
 				}
522 522
 			}
523 523
 		}
524 524
 
525 525
 		//replace output with the new contents
526
-		$output = implode( "\n", $split_output );
526
+		$output = implode("\n", $split_output);
527 527
 
528 528
 		return $output;
529 529
 	}
@@ -539,37 +539,37 @@  discard block
 block discarded – undo
539 539
 	public function enqueue_admin_scripts() {
540 540
 		// this javascript is loaded on every admin page to catch any injections ee needs to add to wp run js.
541 541
 		// Note: the intention of this script is to only do TARGETED injections.  I.E, only injecting on certain script calls.
542
-		wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL . 'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
542
+		wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL.'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
543 543
 		// register cookie script for future dependencies
544
-		wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL . 'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE );
544
+		wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL.'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE);
545 545
 		// jquery_validate loading is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again via:  add_filter( 'FHEE_load_jquery_validate', '__return_true' );
546
-		if ( apply_filters( 'FHEE_load_jquery_validate', FALSE ) ) {
546
+		if (apply_filters('FHEE_load_jquery_validate', FALSE)) {
547 547
 			// register jQuery Validate
548
-			wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js', array('jquery'), '1.11.1', TRUE);
548
+			wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL.'scripts/jquery.validate.min.js', array('jquery'), '1.11.1', TRUE);
549 549
 		}
550 550
 		//joyride is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again vai: add_filter('FHEE_load_joyride', '__return_true' );
551
-		if ( apply_filters( 'FHEE_load_joyride', FALSE ) ) {
551
+		if (apply_filters('FHEE_load_joyride', FALSE)) {
552 552
 			//joyride style
553
-			wp_register_style('joyride-css', EE_THIRD_PARTY_URL . 'joyride/joyride-2.1.css', array(), '2.1');
554
-			wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL . 'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION );
555
-			wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL . 'joyride/modernizr.mq.js', array(), '2.1', TRUE );
553
+			wp_register_style('joyride-css', EE_THIRD_PARTY_URL.'joyride/joyride-2.1.css', array(), '2.1');
554
+			wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL.'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION);
555
+			wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL.'joyride/modernizr.mq.js', array(), '2.1', TRUE);
556 556
 			//joyride JS
557
-			wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL . 'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE );
557
+			wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL.'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE);
558 558
 			// wanna go for a joyride?
559 559
 			wp_enqueue_style('ee-joyride-css');
560 560
 			wp_enqueue_script('jquery-joyride');
561 561
 		}
562 562
 		//qtip is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtips', '__return_true' );
563
-		if ( apply_filters( 'FHEE_load_qtip', FALSE ) ) {
563
+		if (apply_filters('FHEE_load_qtip', FALSE)) {
564 564
 			EE_Registry::instance()->load_helper('Qtip_Loader');
565 565
 			EEH_Qtip_Loader::instance()->register_and_enqueue();
566 566
 		}
567 567
 		//accounting.js library
568 568
 		// @link http://josscrowcroft.github.io/accounting.js/
569
-		if ( apply_filters( 'FHEE_load_accounting_js', FALSE ) ) {
570
-			wp_register_script( 'ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE );
571
-			wp_register_script( 'ee-accounting-core', EE_THIRD_PARTY_URL . 'accounting/accounting.js', array('underscore'), '0.3.2', TRUE );
572
-			wp_enqueue_script( 'ee-accounting' );
569
+		if (apply_filters('FHEE_load_accounting_js', FALSE)) {
570
+			wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL.'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE);
571
+			wp_register_script('ee-accounting-core', EE_THIRD_PARTY_URL.'accounting/accounting.js', array('underscore'), '0.3.2', TRUE);
572
+			wp_enqueue_script('ee-accounting');
573 573
 			// array of settings to get converted to JSON array via wp_localize_script
574 574
 			$currency_config = array(
575 575
 				'currency' => array(
@@ -616,11 +616,11 @@  discard block
 block discarded – undo
616 616
 	public function get_persistent_admin_notices() {
617 617
 		// http://www.example.com/wp-admin/admin.php?page=espresso_general_settings&action=critical_pages&critical_pages_nonce=2831ce0f30
618 618
 		$args = array(
619
-			'page' => EE_Registry::instance()->REQ->is_set( 'page' ) ? EE_Registry::instance()->REQ->get( 'page' ) : '',
620
-			'action' => EE_Registry::instance()->REQ->is_set( 'action' ) ? EE_Registry::instance()->REQ->get( 'action' ) : '',
619
+			'page' => EE_Registry::instance()->REQ->is_set('page') ? EE_Registry::instance()->REQ->get('page') : '',
620
+			'action' => EE_Registry::instance()->REQ->is_set('action') ? EE_Registry::instance()->REQ->get('action') : '',
621 621
 		);
622
-		$return_url = EE_Admin_Page::add_query_args_and_nonce( $args, EE_ADMIN_URL );
623
-		echo EE_Error::get_persistent_admin_notices( $return_url );
622
+		$return_url = EE_Admin_Page::add_query_args_and_nonce($args, EE_ADMIN_URL);
623
+		echo EE_Error::get_persistent_admin_notices($return_url);
624 624
 	}
625 625
 
626 626
 
@@ -641,26 +641,26 @@  discard block
 block discarded – undo
641 641
 	 * @param $elements
642 642
 	 * @return array
643 643
 	 */
644
-	public function dashboard_glance_items( $elements ) {
644
+	public function dashboard_glance_items($elements) {
645 645
 		$events = EEM_Event::instance()->count();
646
-		$items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_events'), admin_url('admin.php') );
647
-		$items['events']['text'] = sprintf( _n( '%s Event', '%s Events', $events ), number_format_i18n( $events ) );
646
+		$items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events'), admin_url('admin.php'));
647
+		$items['events']['text'] = sprintf(_n('%s Event', '%s Events', $events), number_format_i18n($events));
648 648
 		$items['events']['title'] = __('Click to view all Events', 'event_espresso');
649 649
 		$registrations = EEM_Registration::instance()->count(
650 650
 			array(
651 651
 				array(
652
-					'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete )
652
+					'STS_ID' => array('!=', EEM_Registration::status_id_incomplete)
653 653
 				)
654 654
 			)
655 655
 		);
656
-		$items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_registrations' ), admin_url('admin.php') );
657
-		$items['registrations']['text'] = sprintf( _n( '%s Registration', '%s Registrations', $registrations ), number_format_i18n($registrations) );
656
+		$items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_registrations'), admin_url('admin.php'));
657
+		$items['registrations']['text'] = sprintf(_n('%s Registration', '%s Registrations', $registrations), number_format_i18n($registrations));
658 658
 		$items['registrations']['title'] = __('Click to view all registrations', 'event_espresso');
659 659
 
660
-		$items = apply_filters( 'FHEE__EE_Admin__dashboard_glance_items__items', $items );
660
+		$items = apply_filters('FHEE__EE_Admin__dashboard_glance_items__items', $items);
661 661
 
662
-		foreach ( $items as $type => $item_properties ) {
663
-			$elements[] = sprintf( '<a class="ee-dashboard-link-' . $type . '" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text'] );
662
+		foreach ($items as $type => $item_properties) {
663
+			$elements[] = sprintf('<a class="ee-dashboard-link-'.$type.'" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text']);
664 664
 		}
665 665
 		return $elements;
666 666
 	}
@@ -679,63 +679,63 @@  discard block
 block discarded – undo
679 679
 	 * @param $post
680 680
 	 * @return    void
681 681
 	 */
682
-	public static function parse_post_content_on_save( $post_ID, $post ) {
682
+	public static function parse_post_content_on_save($post_ID, $post) {
683 683
 		// default post types
684
-		$post_types = array( 'post' => 0, 'page' => 1 );
684
+		$post_types = array('post' => 0, 'page' => 1);
685 685
 		// add CPTs
686 686
 		$CPTs = EE_Register_CPTs::get_CPTs();
687
-		$post_types = array_merge( $post_types, $CPTs );
687
+		$post_types = array_merge($post_types, $CPTs);
688 688
 		// for default or CPT posts...
689
-		if ( isset( $post_types[ $post->post_type ] )) {
689
+		if (isset($post_types[$post->post_type])) {
690 690
 			// post on frontpage ?
691 691
 			$page_for_posts = EE_Config::get_page_for_posts();
692 692
 			$maybe_remove_from_posts = array();
693 693
 			// critical page shortcodes that we do NOT want added to the Posts page (blog)
694 694
 			$critical_shortcodes = EE_Registry::instance()->CFG->core->get_critical_pages_shortcodes_array();
695 695
 			// array of shortcodes indexed by post name
696
-			EE_Registry::instance()->CFG->core->post_shortcodes = isset( EE_Registry::instance()->CFG->core->post_shortcodes ) ? EE_Registry::instance()->CFG->core->post_shortcodes : array();
696
+			EE_Registry::instance()->CFG->core->post_shortcodes = isset(EE_Registry::instance()->CFG->core->post_shortcodes) ? EE_Registry::instance()->CFG->core->post_shortcodes : array();
697 697
 			// whether to proceed with update, if an entry already exists for this post, then we want to update
698
-			$update_post_shortcodes = isset( EE_Registry::instance()->CFG->core->post_shortcodes[ $post->post_name ] ) ? true : false;
698
+			$update_post_shortcodes = isset(EE_Registry::instance()->CFG->core->post_shortcodes[$post->post_name]) ? true : false;
699 699
 			// empty both arrays
700
-			EE_Registry::instance()->CFG->core->post_shortcodes[ $post->post_name ] = array();
700
+			EE_Registry::instance()->CFG->core->post_shortcodes[$post->post_name] = array();
701 701
 			// check that posts page is already being tracked
702
-			if ( ! isset( EE_Registry::instance()->CFG->core->post_shortcodes[ $page_for_posts ] ) ) {
702
+			if ( ! isset(EE_Registry::instance()->CFG->core->post_shortcodes[$page_for_posts])) {
703 703
 				// if not, then ensure that it is properly added
704
-				EE_Registry::instance()->CFG->core->post_shortcodes[ $page_for_posts ] = array();
704
+				EE_Registry::instance()->CFG->core->post_shortcodes[$page_for_posts] = array();
705 705
 			}
706 706
 			// loop thru shortcodes
707
-			foreach ( EE_Registry::instance()->shortcodes as $EES_Shortcode => $shortcode_dir ) {
707
+			foreach (EE_Registry::instance()->shortcodes as $EES_Shortcode => $shortcode_dir) {
708 708
 				// convert to UPPERCASE to get actual shortcode
709
-				$EES_Shortcode = strtoupper( $EES_Shortcode );
709
+				$EES_Shortcode = strtoupper($EES_Shortcode);
710 710
 				// is the shortcode in the post_content ?
711
-				if ( strpos( $post->post_content, $EES_Shortcode ) !== FALSE ) {
711
+				if (strpos($post->post_content, $EES_Shortcode) !== FALSE) {
712 712
 					// map shortcode to post names and post IDs
713
-					EE_Registry::instance()->CFG->core->post_shortcodes[ $post->post_name ][ $EES_Shortcode ] = $post_ID;
713
+					EE_Registry::instance()->CFG->core->post_shortcodes[$post->post_name][$EES_Shortcode] = $post_ID;
714 714
 					// if the shortcode is NOT one of the critical page shortcodes like ESPRESSO_TXN_PAGE
715
-					if ( ! in_array( $EES_Shortcode, $critical_shortcodes )) {
715
+					if ( ! in_array($EES_Shortcode, $critical_shortcodes)) {
716 716
 						// add shortcode to "Posts page" tracking
717
-						EE_Registry::instance()->CFG->core->post_shortcodes[ $page_for_posts ][ $EES_Shortcode ] = $post_ID;
717
+						EE_Registry::instance()->CFG->core->post_shortcodes[$page_for_posts][$EES_Shortcode] = $post_ID;
718 718
 					}
719 719
 					$update_post_shortcodes = TRUE;
720
-					unset( $maybe_remove_from_posts[ $EES_Shortcode ] );
720
+					unset($maybe_remove_from_posts[$EES_Shortcode]);
721 721
 				} else {
722
-					$maybe_remove_from_posts[ $EES_Shortcode ] = $post_ID;
722
+					$maybe_remove_from_posts[$EES_Shortcode] = $post_ID;
723 723
 				}
724 724
 			}
725
-			if ( $update_post_shortcodes ) {
725
+			if ($update_post_shortcodes) {
726 726
 				// remove shortcodes from $maybe_remove_from_posts that are still being used
727
-				foreach ( EE_Registry::instance()->CFG->core->post_shortcodes as $post_name => $shortcodes ) {
728
-					if ( $post_name == $page_for_posts ) {
727
+				foreach (EE_Registry::instance()->CFG->core->post_shortcodes as $post_name => $shortcodes) {
728
+					if ($post_name == $page_for_posts) {
729 729
 						continue;
730 730
 					}
731 731
 					// compute difference between active post_shortcodes array and $maybe_remove_from_posts array
732
-					$maybe_remove_from_posts = array_diff_key( $maybe_remove_from_posts, $shortcodes );
732
+					$maybe_remove_from_posts = array_diff_key($maybe_remove_from_posts, $shortcodes);
733 733
 				}
734 734
 				// now unset unused shortcodes from the $page_for_posts post_shortcodes
735
-				foreach ( $maybe_remove_from_posts as $shortcode => $post_ID ) {
736
-					unset( EE_Registry::instance()->CFG->core->post_shortcodes[ $page_for_posts ][ $shortcode ] );
735
+				foreach ($maybe_remove_from_posts as $shortcode => $post_ID) {
736
+					unset(EE_Registry::instance()->CFG->core->post_shortcodes[$page_for_posts][$shortcode]);
737 737
 				}
738
-				EE_Registry::instance()->CFG->update_post_shortcodes( $page_for_posts );
738
+				EE_Registry::instance()->CFG->update_post_shortcodes($page_for_posts);
739 739
 			}
740 740
 		}
741 741
 	}
@@ -753,32 +753,32 @@  discard block
 block discarded – undo
753 753
 	 * @throws EE_Error
754 754
 	 * @return    string
755 755
 	 */
756
-	public function check_for_invalid_datetime_formats( $value, $option ) {
757
-		EE_Registry::instance()->load_helper( 'DTT_Helper' );
756
+	public function check_for_invalid_datetime_formats($value, $option) {
757
+		EE_Registry::instance()->load_helper('DTT_Helper');
758 758
 		// check for date_format or time_format
759
-		switch ( $option ) {
759
+		switch ($option) {
760 760
 			case 'date_format' :
761
-				$date_time_format = $value . ' ' . get_option('time_format');
761
+				$date_time_format = $value.' '.get_option('time_format');
762 762
 				break;
763 763
 			case 'time_format' :
764
-				$date_time_format = get_option('date_format') . ' ' . $value;
764
+				$date_time_format = get_option('date_format').' '.$value;
765 765
 				break;
766 766
 			default :
767 767
 				$date_time_format = FALSE;
768 768
 		}
769 769
 		// do we have a date_time format to check ?
770
-		if ( $date_time_format ) {
771
-			$error_msg = EEH_DTT_Helper::validate_format_string( $date_time_format );
770
+		if ($date_time_format) {
771
+			$error_msg = EEH_DTT_Helper::validate_format_string($date_time_format);
772 772
 
773
-			if ( is_array( $error_msg ) ) {
774
-				$msg = '<p>' . sprintf( __( 'The following date time "%s" ( %s ) is difficult to be properly parsed by PHP for the following reasons:', 'event_espresso' ), date( $date_time_format ) , $date_time_format  ) . '</p><p><ul>';
773
+			if (is_array($error_msg)) {
774
+				$msg = '<p>'.sprintf(__('The following date time "%s" ( %s ) is difficult to be properly parsed by PHP for the following reasons:', 'event_espresso'), date($date_time_format), $date_time_format).'</p><p><ul>';
775 775
 
776 776
 
777
-				foreach ( $error_msg as $error ) {
778
-					$msg .= '<li>' . $error . '</li>';
777
+				foreach ($error_msg as $error) {
778
+					$msg .= '<li>'.$error.'</li>';
779 779
 				}
780 780
 
781
-				$msg .= '</ul></p><p>' . sprintf( __( '%sPlease note that your date and time formats have been reset to "F j, Y" and "g:i a" respectively.%s', 'event_espresso' ), '<span style="color:#D54E21;">', '</span>' ) . '</p>';
781
+				$msg .= '</ul></p><p>'.sprintf(__('%sPlease note that your date and time formats have been reset to "F j, Y" and "g:i a" respectively.%s', 'event_espresso'), '<span style="color:#D54E21;">', '</span>').'</p>';
782 782
 
783 783
 				// trigger WP settings error
784 784
 				add_settings_error(
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 				);
789 789
 
790 790
 				// set format to something valid
791
-				switch ( $option ) {
791
+				switch ($option) {
792 792
 					case 'date_format' :
793 793
 						$value = 'F j, Y';
794 794
 						break;
@@ -814,14 +814,14 @@  discard block
 block discarded – undo
814 814
 	 * @param 	$value
815 815
 	 * @return 	void
816 816
 	 */
817
-	public function reset_page_for_posts_on_change( $option, $old_value, $value ) {
818
-		if ( $option == 'page_for_posts' ) {
817
+	public function reset_page_for_posts_on_change($option, $old_value, $value) {
818
+		if ($option == 'page_for_posts') {
819 819
 			global $wpdb;
820
-			$SQL = 'SELECT post_name from ' . $wpdb->posts . ' WHERE post_type="posts" OR post_type="page" AND post_status="publish" AND ID=%s';
821
-			$old_page_for_posts = $old_value ? $wpdb->get_var( $wpdb->prepare( $SQL, $old_value )) : 'posts';
822
-			$new_page_for_posts = $value ? $wpdb->get_var( $wpdb->prepare( $SQL, $value )) : 'posts';
823
-			EE_Registry::instance()->CFG->core->post_shortcodes[ $new_page_for_posts ] = EE_Registry::instance()->CFG->core->post_shortcodes[ $old_page_for_posts ];
824
-			EE_Registry::instance()->CFG->update_post_shortcodes( $new_page_for_posts );
820
+			$SQL = 'SELECT post_name from '.$wpdb->posts.' WHERE post_type="posts" OR post_type="page" AND post_status="publish" AND ID=%s';
821
+			$old_page_for_posts = $old_value ? $wpdb->get_var($wpdb->prepare($SQL, $old_value)) : 'posts';
822
+			$new_page_for_posts = $value ? $wpdb->get_var($wpdb->prepare($SQL, $value)) : 'posts';
823
+			EE_Registry::instance()->CFG->core->post_shortcodes[$new_page_for_posts] = EE_Registry::instance()->CFG->core->post_shortcodes[$old_page_for_posts];
824
+			EE_Registry::instance()->CFG->update_post_shortcodes($new_page_for_posts);
825 825
 		}
826 826
 	}
827 827
 
@@ -834,8 +834,8 @@  discard block
 block discarded – undo
834 834
 	 * @param $content
835 835
 	 * @return    string
836 836
 	 */
837
-	public function its_eSpresso( $content ) {
838
-		return str_replace( '[EXPRESSO_', '[ESPRESSO_', $content );
837
+	public function its_eSpresso($content) {
838
+		return str_replace('[EXPRESSO_', '[ESPRESSO_', $content);
839 839
 	}
840 840
 
841 841
 
@@ -848,9 +848,9 @@  discard block
 block discarded – undo
848 848
 	 */
849 849
 	public function espresso_admin_footer() {
850 850
 		return sprintf(
851
-			__( 'Event Registration and Ticketing Powered by %sEvent Registration Powered by Event Espresso%s', 'event_espresso' ),
851
+			__('Event Registration and Ticketing Powered by %sEvent Registration Powered by Event Espresso%s', 'event_espresso'),
852 852
 			'<a href="http://eventespresso.com/" title="',
853
-			'">' . EVENT_ESPRESSO_POWERED_BY . '</a>'
853
+			'">'.EVENT_ESPRESSO_POWERED_BY.'</a>'
854 854
 		);
855 855
 	}
856 856
 
@@ -870,11 +870,11 @@  discard block
 block discarded – undo
870 870
 	 * @param array $config
871 871
 	 * @return void
872 872
 	 */
873
-	public static function register_ee_admin_page( $page_basename, $page_path, $config = array() ) {
874
-		EE_Error::doing_it_wrong( __METHOD__, sprintf( __('Usage is deprecated.  Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3' );
875
-		if ( class_exists( 'EE_Register_Admin_Page' ) )
873
+	public static function register_ee_admin_page($page_basename, $page_path, $config = array()) {
874
+		EE_Error::doing_it_wrong(__METHOD__, sprintf(__('Usage is deprecated.  Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3');
875
+		if (class_exists('EE_Register_Admin_Page'))
876 876
 			$config['page_path'] = $page_path;
877
-			EE_Register_Admin_Page::register( $page_basename, $config );
877
+			EE_Register_Admin_Page::register($page_basename, $config);
878 878
 	}
879 879
 
880 880
 
Please login to merge, or discard this patch.
registrations/templates/attendee_registrations_main_meta_box.template.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -5,42 +5,42 @@
 block discarded – undo
5 5
 		<table class="admin-primary-mbox-tbl">
6 6
 			<thead>
7 7
 				<tr>
8
-					<th class="jst-left"><?php esc_html_e( 'Event Name', 'event_espresso' );?></th>
9
-					<th class="jst-left"><?php esc_html_e( 'REG ID', 'event_espresso' );?></th>
10
-					<th class="jst-left"><?php esc_html_e( 'TXN ID', 'event_espresso' );?></th>
11
-					<th class="jst-left"><?php esc_html_e( 'Reg Code', 'event_espresso' );?></th>
12
-					<th class="jst-rght"><?php esc_html_e( 'Ticket Price', 'event_espresso' );?></th>
8
+					<th class="jst-left"><?php esc_html_e('Event Name', 'event_espresso'); ?></th>
9
+					<th class="jst-left"><?php esc_html_e('REG ID', 'event_espresso'); ?></th>
10
+					<th class="jst-left"><?php esc_html_e('TXN ID', 'event_espresso'); ?></th>
11
+					<th class="jst-left"><?php esc_html_e('Reg Code', 'event_espresso'); ?></th>
12
+					<th class="jst-rght"><?php esc_html_e('Ticket Price', 'event_espresso'); ?></th>
13 13
 				</tr>
14 14
 			</thead>
15 15
 			<tbody>
16
-			<?php foreach( $registrations as $registration ) : ?>
16
+			<?php foreach ($registrations as $registration) : ?>
17 17
 				<tr>
18 18
 					<td class="jst-left">
19 19
 					<?php
20
-						$event_url = add_query_arg( array( 'action' => 'edit', 'post' => $registration->event_ID() ), admin_url( 'admin.php?page=espresso_events' ));
21
-						echo EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $registration->event_ID() ) ?  '<a href="'. $event_url .'"  title="'. esc_attr__( 'Edit Event', 'event_espresso' ) .'">' . $registration->event_name() . '</a>' : $registration->event_name();
20
+						$event_url = add_query_arg(array('action' => 'edit', 'post' => $registration->event_ID()), admin_url('admin.php?page=espresso_events'));
21
+						echo EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $registration->event_ID()) ? '<a href="'.$event_url.'"  title="'.esc_attr__('Edit Event', 'event_espresso').'">'.$registration->event_name().'</a>' : $registration->event_name();
22 22
 					?>
23 23
 					</td>
24 24
 					<td class="jst-left">
25 25
 					<?php
26
-							$reg_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration->ID() ), REG_ADMIN_URL );
27
-							echo EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $registration->ID() ) ? '
28
-							<a href="'.$reg_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . 
29
-								esc_html__( 'View Registration', 'event_espresso' ) .
26
+							$reg_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$registration->ID()), REG_ADMIN_URL);
27
+							echo EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $registration->ID()) ? '
28
+							<a href="'.$reg_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'. 
29
+								esc_html__('View Registration', 'event_espresso').
30 30
 							'</a>' : $registration->ID();
31 31
 					?>
32 32
 					</td>
33 33
 					<td class="jst-left">
34 34
 					<?php
35
-						$txn_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$registration->transaction_ID() ), TXN_ADMIN_URL );
36
-						echo EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ? '
37
-						<a href="'.$txn_url.'" title="' . esc_attr__( 'View Transaction Details', 'event_espresso' ) . '">' .
38
-							sprintf( esc_html__('View Transaction %d', 'event_espresso'), $registration->transaction_ID() ) .
35
+						$txn_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$registration->transaction_ID()), TXN_ADMIN_URL);
36
+						echo EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '
37
+						<a href="'.$txn_url.'" title="'.esc_attr__('View Transaction Details', 'event_espresso').'">'.
38
+							sprintf(esc_html__('View Transaction %d', 'event_espresso'), $registration->transaction_ID()).
39 39
 						'</a>' : $registration->transaction_ID();
40 40
 					?>
41 41
 					</td>
42
-					<td class="jst-left"><?php echo $registration->reg_code();?></td>
43
-					<td class="jst-rght"><?php echo EEH_Template::format_currency( $registration->final_price() );?></td>
42
+					<td class="jst-left"><?php echo $registration->reg_code(); ?></td>
43
+					<td class="jst-rght"><?php echo EEH_Template::format_currency($registration->final_price()); ?></td>
44 44
 				</tr>
45 45
 			<?php endforeach; ?>
46 46
 			</tbody>
Please login to merge, or discard this patch.
core/helpers/EEH_Template.helper.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	 *
283 283
 	 * given two paths, this determines if there is a common base path between the two
284 284
 	 *
285
-	 * @param array $paths
285
+	 * @param string[] $paths
286 286
 	 * @return string
287 287
 	 */
288 288
 	protected static function _find_common_base_path( $paths ) {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 * @param bool|string $template_path server path to the file to be loaded, including file name and extension
310 310
 	 * @param  array      $template_args an array of arguments to be extracted for use in the template
311 311
 	 * @param  boolean    $return_string whether to send output immediately to screen, or capture and return as a string
312
-	 * @return mixed string
312
+	 * @return string string
313 313
 	 */
314 314
 	public static function display_template( $template_path = FALSE, $template_args = array(), $return_string = FALSE ) {
315 315
 		//require the template validator for verifying variables are set according to how the template requires
Please login to merge, or discard this patch.
Spacing   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 
17 17
 
18
-if ( ! function_exists( 'espresso_get_template_part' )) {
18
+if ( ! function_exists('espresso_get_template_part')) {
19 19
 	/**
20 20
 	 * espresso_get_template_part
21 21
 	 * basically a copy of the WordPress get_template_part() function but uses EEH_Template::locate_template() instead, and doesn't add base versions of files
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 	 * @param string $name The name of the specialised template.
26 26
 	 * @return string        the html output for the formatted money value
27 27
 	 */
28
-	function espresso_get_template_part( $slug = NULL, $name = NULL ) {
29
-		EEH_Template::get_template_part( $slug, $name );
28
+	function espresso_get_template_part($slug = NULL, $name = NULL) {
29
+		EEH_Template::get_template_part($slug, $name);
30 30
 	}
31 31
 }
32 32
 
33 33
 
34 34
 
35
-if ( ! function_exists( 'espresso_get_object_css_class' )) {
35
+if ( ! function_exists('espresso_get_object_css_class')) {
36 36
 	/**
37 37
 	 * espresso_get_object_css_class - attempts to generate a css class based on the type of EE object passed
38 38
 	 *
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param  string $suffix added to the end of the generated class
43 43
 	 * @return string
44 44
 	 */
45
-	function espresso_get_object_css_class( $object = NULL, $prefix = '', $suffix = '' ) {
46
-		return EEH_Template::get_object_css_class( $object, $prefix, $suffix );
45
+	function espresso_get_object_css_class($object = NULL, $prefix = '', $suffix = '') {
46
+		return EEH_Template::get_object_css_class($object, $prefix, $suffix);
47 47
 	}
48 48
 }
49 49
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * 	@return boolean
71 71
 	 */
72 72
 	public static function is_espresso_theme() {
73
-		return wp_get_theme()->get( 'TextDomain' ) == 'event_espresso' ? TRUE : FALSE;
73
+		return wp_get_theme()->get('TextDomain') == 'event_espresso' ? TRUE : FALSE;
74 74
 	}
75 75
 
76 76
 	/**
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 	 * 	@return void
80 80
 	 */
81 81
 	public static function load_espresso_theme_functions() {
82
-		if ( ! defined( 'EE_THEME_FUNCTIONS_LOADED' )) {
83
-			if ( is_readable( EE_PUBLIC . EE_Config::get_current_theme() . DS . 'functions.php' )) {
84
-				require_once( EE_PUBLIC . EE_Config::get_current_theme() . DS . 'functions.php' );
82
+		if ( ! defined('EE_THEME_FUNCTIONS_LOADED')) {
83
+			if (is_readable(EE_PUBLIC.EE_Config::get_current_theme().DS.'functions.php')) {
84
+				require_once(EE_PUBLIC.EE_Config::get_current_theme().DS.'functions.php');
85 85
 			}
86 86
 		}
87 87
 	}
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
 	 * 	@return array
94 94
 	 */
95 95
 	public static function get_espresso_themes() {
96
-		if ( empty( EEH_Template::$_espresso_themes )) {
97
-			$espresso_themes =  glob( EE_PUBLIC . '*', GLOB_ONLYDIR );
98
-			if ( empty( $espresso_themes ) ) {
96
+		if (empty(EEH_Template::$_espresso_themes)) {
97
+			$espresso_themes = glob(EE_PUBLIC.'*', GLOB_ONLYDIR);
98
+			if (empty($espresso_themes)) {
99 99
 				return array();
100 100
 			}
101
-			if (( $key = array_search( 'global_assets', $espresso_themes )) !== FALSE ) {
102
-			    unset( $espresso_themes[ $key ] );
101
+			if (($key = array_search('global_assets', $espresso_themes)) !== FALSE) {
102
+			    unset($espresso_themes[$key]);
103 103
 			}
104 104
 			EEH_Template::$_espresso_themes = array();
105
-			foreach ( $espresso_themes as $espresso_theme ) {
106
-				EEH_Template::$_espresso_themes[ basename( $espresso_theme ) ] = $espresso_theme;
105
+			foreach ($espresso_themes as $espresso_theme) {
106
+				EEH_Template::$_espresso_themes[basename($espresso_theme)] = $espresso_theme;
107 107
 			}
108 108
 		}
109 109
 		return EEH_Template::$_espresso_themes;
@@ -122,16 +122,16 @@  discard block
 block discarded – undo
122 122
 	 * @param bool   $return_string
123 123
 	 * @return string        the html output for the formatted money value
124 124
 	 */
125
-	public static function get_template_part( $slug = NULL, $name = NULL, $template_args = array(), $return_string = FALSE  ) {
126
-		do_action( "get_template_part_{$slug}-{$name}", $slug, $name );
125
+	public static function get_template_part($slug = NULL, $name = NULL, $template_args = array(), $return_string = FALSE) {
126
+		do_action("get_template_part_{$slug}-{$name}", $slug, $name);
127 127
 		$templates = array();
128 128
 		$name = (string) $name;
129
-		if ( $name != '' ) {
129
+		if ($name != '') {
130 130
 			$templates[] = "{$slug}-{$name}.php";
131 131
 		}
132 132
 		// allow template parts to be turned off via something like: add_filter( 'FHEE__content_espresso_events_tickets_template__display_datetimes', '__return_false' );
133
-		if ( apply_filters( "FHEE__EEH_Template__get_template_part__display__{$slug}_{$name}", TRUE )) {
134
-			EEH_Template::locate_template( $templates, $template_args, TRUE, $return_string );
133
+		if (apply_filters("FHEE__EEH_Template__get_template_part__display__{$slug}_{$name}", TRUE)) {
134
+			EEH_Template::locate_template($templates, $template_args, TRUE, $return_string);
135 135
 		}
136 136
 	}
137 137
 
@@ -171,26 +171,26 @@  discard block
 block discarded – undo
171 171
 	 * 				Used in places where you don't actually load the template, you just want to know if there's a custom version of it.
172 172
 	 * @return mixed
173 173
 	 */
174
-	public static function locate_template( $templates = array(), $template_args = array(), $load = TRUE, $return_string = TRUE, $check_if_custom = FALSE ) {
174
+	public static function locate_template($templates = array(), $template_args = array(), $load = TRUE, $return_string = TRUE, $check_if_custom = FALSE) {
175 175
 		// first use WP locate_template to check for template in the current theme folder
176
-		$template_path = locate_template( $templates );
176
+		$template_path = locate_template($templates);
177 177
 
178
-		if ( $check_if_custom && !empty( $template_path ) )
178
+		if ($check_if_custom && ! empty($template_path))
179 179
 			return TRUE;
180 180
 
181 181
 		// not in the theme
182
-		if ( empty( $template_path )) {
182
+		if (empty($template_path)) {
183 183
 			// not even a template to look for ?
184
-			if ( empty( $templates )) {
184
+			if (empty($templates)) {
185 185
 				// get post_type
186
-				$post_type = EE_Registry::instance()->REQ->get( 'post_type' );
186
+				$post_type = EE_Registry::instance()->REQ->get('post_type');
187 187
 				// get array of EE Custom Post Types
188 188
 				$EE_CPTs = EE_Register_CPTs::get_CPTs();
189 189
 				// build template name based on request
190
-				if ( isset( $EE_CPTs[ $post_type ] )) {
191
-					$archive_or_single =  is_archive() ? 'archive' : '';
192
-					$archive_or_single =  is_single() ? 'single' : $archive_or_single;
193
-					$templates = $archive_or_single . '-' . $post_type . '.php';
190
+				if (isset($EE_CPTs[$post_type])) {
191
+					$archive_or_single = is_archive() ? 'archive' : '';
192
+					$archive_or_single = is_single() ? 'single' : $archive_or_single;
193
+					$templates = $archive_or_single.'-'.$post_type.'.php';
194 194
 				}
195 195
 			}
196 196
 			// currently active EE template theme
@@ -199,80 +199,80 @@  discard block
 block discarded – undo
199 199
 			// array of paths to folders that may contain templates
200 200
 			$template_folder_paths = array(
201 201
 				// first check the /wp-content/uploads/espresso/templates/(current EE theme)/  folder for an EE theme template file
202
-				EVENT_ESPRESSO_TEMPLATE_DIR . $current_theme,
202
+				EVENT_ESPRESSO_TEMPLATE_DIR.$current_theme,
203 203
 				// then in the root of the /wp-content/uploads/espresso/templates/ folder
204 204
 				EVENT_ESPRESSO_TEMPLATE_DIR
205 205
 			);
206 206
 
207 207
 			//add core plugin folders for checking only if we're not $check_if_custom
208
-			if ( ! $check_if_custom ) {
208
+			if ( ! $check_if_custom) {
209 209
 				$core_paths = array(
210 210
 					// in the  /wp-content/plugins/(EE4 folder)/public/(current EE theme)/ folder within the plugin
211
-					EE_PUBLIC . $current_theme,
211
+					EE_PUBLIC.$current_theme,
212 212
 					// in the  /wp-content/plugins/(EE4 folder)/core/templates/(current EE theme)/ folder within the plugin
213
-					EE_TEMPLATES . $current_theme,
213
+					EE_TEMPLATES.$current_theme,
214 214
 					// or maybe relative from the plugin root: /wp-content/plugins/(EE4 folder)/
215 215
 					EE_PLUGIN_DIR_PATH
216 216
 					);
217
-				$template_folder_paths = array_merge( $template_folder_paths, $core_paths );
217
+				$template_folder_paths = array_merge($template_folder_paths, $core_paths);
218 218
 			}
219 219
 
220 220
 			// now filter that array
221
-			$template_folder_paths = apply_filters( 'FHEE__EEH_Template__locate_template__template_folder_paths', $template_folder_paths );
222
-			$templates = is_array( $templates ) ? $templates : array( $templates );
223
-			$template_folder_paths = is_array( $template_folder_paths ) ? $template_folder_paths : array( $template_folder_paths );
221
+			$template_folder_paths = apply_filters('FHEE__EEH_Template__locate_template__template_folder_paths', $template_folder_paths);
222
+			$templates = is_array($templates) ? $templates : array($templates);
223
+			$template_folder_paths = is_array($template_folder_paths) ? $template_folder_paths : array($template_folder_paths);
224 224
 			// array to hold all possible template paths
225 225
 			$full_template_paths = array();
226 226
 
227 227
 			EE_Registry::instance()->load_helper('File');
228 228
 			// loop through $templates
229
-			foreach ( $templates as $template ) {
229
+			foreach ($templates as $template) {
230 230
 				// normalize directory separators
231
-				$template = EEH_File::standardise_directory_separators( $template );
232
-				$file_name = basename( $template );
233
-				$template_path_minus_file_name = substr( $template, 0, ( strlen( $file_name ) * -1 ) );
231
+				$template = EEH_File::standardise_directory_separators($template);
232
+				$file_name = basename($template);
233
+				$template_path_minus_file_name = substr($template, 0, (strlen($file_name) * -1));
234 234
 				// while looping through all template folder paths
235
-				foreach ( $template_folder_paths as $template_folder_path ) {
235
+				foreach ($template_folder_paths as $template_folder_path) {
236 236
 					// normalize directory separators
237
-					$template_folder_path = EEH_File::standardise_directory_separators( $template_folder_path );
237
+					$template_folder_path = EEH_File::standardise_directory_separators($template_folder_path);
238 238
 					// determine if any common base path exists between the two paths
239 239
 					$common_base_path = EEH_Template::_find_common_base_path(
240
-						array( $template_folder_path, $template_path_minus_file_name )
240
+						array($template_folder_path, $template_path_minus_file_name)
241 241
 					);
242
-					if ( $common_base_path !== '' ) {
242
+					if ($common_base_path !== '') {
243 243
 						// both paths have a common base, so just tack the filename onto our search path
244
-						$resolved_path = EEH_File::end_with_directory_separator( $template_folder_path ) . $file_name;
244
+						$resolved_path = EEH_File::end_with_directory_separator($template_folder_path).$file_name;
245 245
 					} else {
246 246
 						// no common base path, so let's just concatenate
247
-						$resolved_path = EEH_File::end_with_directory_separator( $template_folder_path ) . $template;
247
+						$resolved_path = EEH_File::end_with_directory_separator($template_folder_path).$template;
248 248
 					}
249 249
 					// build up our template locations array by adding our resolved paths
250 250
 					$full_template_paths[] = $resolved_path;
251 251
 				}
252 252
 				// if $template is an absolute path, then we'll tack it onto the start of our array so that it gets searched first
253
-				array_unshift( $full_template_paths, $template );
253
+				array_unshift($full_template_paths, $template);
254 254
 				// path to the directory of the current theme: /wp-content/themes/(current WP theme)/
255
-				array_unshift( $full_template_paths, get_template_directory() . DS . $file_name );
255
+				array_unshift($full_template_paths, get_template_directory().DS.$file_name);
256 256
 			}
257 257
 			// filter final array of full template paths
258
-			$full_template_paths = apply_filters( 'FHEE__EEH_Template__locate_template__full_template_paths', $full_template_paths );
258
+			$full_template_paths = apply_filters('FHEE__EEH_Template__locate_template__full_template_paths', $full_template_paths);
259 259
 			// now loop through our final array of template location paths and check each location
260
-			foreach ( (array)$full_template_paths as $full_template_path ) {
261
-				if ( is_readable( $full_template_path )) {
262
-					$template_path = str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, $full_template_path );
260
+			foreach ((array) $full_template_paths as $full_template_path) {
261
+				if (is_readable($full_template_path)) {
262
+					$template_path = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $full_template_path);
263 263
 					break;
264 264
 				}
265 265
 			}
266 266
 		}
267 267
 		// if we got it and you want to see it...
268
-		if ( $template_path && $load && ! $check_if_custom  ) {
269
-			if ( $return_string ) {
270
-				return EEH_Template::display_template( $template_path, $template_args, TRUE );
268
+		if ($template_path && $load && ! $check_if_custom) {
269
+			if ($return_string) {
270
+				return EEH_Template::display_template($template_path, $template_args, TRUE);
271 271
 			} else {
272
-				EEH_Template::display_template( $template_path, $template_args, FALSE );
272
+				EEH_Template::display_template($template_path, $template_args, FALSE);
273 273
 			}
274 274
 		}
275
-		return $check_if_custom && ! empty( $template_path ) ? TRUE : $template_path;
275
+		return $check_if_custom && ! empty($template_path) ? TRUE : $template_path;
276 276
 	}
277 277
 
278 278
 
@@ -285,21 +285,21 @@  discard block
 block discarded – undo
285 285
 	 * @param array $paths
286 286
 	 * @return string
287 287
 	 */
288
-	protected static function _find_common_base_path( $paths ) {
288
+	protected static function _find_common_base_path($paths) {
289 289
 		$last_offset = 0;
290 290
 		$common_base_path = '';
291
-		while ( ( $index = strpos( $paths[ 0 ], DS, $last_offset ) ) !== false ) {
291
+		while (($index = strpos($paths[0], DS, $last_offset)) !== false) {
292 292
 			$dir_length = $index - $last_offset + 1;
293
-			$directory = substr( $paths[ 0 ], $last_offset, $dir_length );
294
-			foreach ( $paths as $path ) {
295
-				if ( substr( $path, $last_offset, $dir_length ) != $directory ) {
293
+			$directory = substr($paths[0], $last_offset, $dir_length);
294
+			foreach ($paths as $path) {
295
+				if (substr($path, $last_offset, $dir_length) != $directory) {
296 296
 					return $common_base_path;
297 297
 				}
298 298
 			}
299 299
 			$common_base_path .= $directory;
300 300
 			$last_offset = $index + 1;
301 301
 		}
302
-		return substr( $common_base_path, 0, -1 );
302
+		return substr($common_base_path, 0, -1);
303 303
 	}
304 304
 
305 305
 
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
 	 * @param  boolean    $return_string whether to send output immediately to screen, or capture and return as a string
312 312
 	 * @return mixed string
313 313
 	 */
314
-	public static function display_template( $template_path = FALSE, $template_args = array(), $return_string = FALSE ) {
314
+	public static function display_template($template_path = FALSE, $template_args = array(), $return_string = FALSE) {
315 315
 		//require the template validator for verifying variables are set according to how the template requires
316
-		EE_Registry::instance()->load_helper( 'Template_Validator' );
316
+		EE_Registry::instance()->load_helper('Template_Validator');
317 317
 
318 318
 		/**
319 319
 		 * These two filters are intended for last minute changes to templates being loaded and/or template arg
@@ -324,26 +324,26 @@  discard block
 block discarded – undo
324 324
 		 *
325 325
 		 * @since 4.6.0
326 326
 		 */
327
-		$template_path = apply_filters( 'FHEE__EEH_Template__display_template__template_path', $template_path );
328
-		$template_args = apply_filters( 'FHEE__EEH_Template__display_template__template_args', $template_args );
327
+		$template_path = apply_filters('FHEE__EEH_Template__display_template__template_path', $template_path);
328
+		$template_args = apply_filters('FHEE__EEH_Template__display_template__template_args', $template_args);
329 329
 
330 330
 		// you gimme nuttin - YOU GET NUTTIN !!
331
-		if ( ! $template_path || ! is_readable( $template_path )) {
331
+		if ( ! $template_path || ! is_readable($template_path)) {
332 332
 			return '';
333 333
 		}
334 334
 		// if $template_args are not in an array, then make it so
335
-		if ( ! is_array( $template_args ) && ! is_object( $template_args )) {
336
-			$template_args = array( $template_args );
335
+		if ( ! is_array($template_args) && ! is_object($template_args)) {
336
+			$template_args = array($template_args);
337 337
 		}
338
-		extract( (array) $template_args);
338
+		extract((array) $template_args);
339 339
 
340
-		if ( $return_string ) {
340
+		if ($return_string) {
341 341
 			// because we want to return a string, we are going to capture the output
342 342
 			ob_start();
343
-			include( $template_path );
343
+			include($template_path);
344 344
 			return ob_get_clean();
345 345
 		} else {
346
-			include( $template_path );
346
+			include($template_path);
347 347
 		}
348 348
 		return '';
349 349
 	}
@@ -361,27 +361,27 @@  discard block
 block discarded – undo
361 361
 	 * @param  string $suffix added to the end of the generated class
362 362
 	 * @return string
363 363
 	 */
364
-	public static function get_object_css_class( $object = NULL, $prefix = '', $suffix = '' ) {
364
+	public static function get_object_css_class($object = NULL, $prefix = '', $suffix = '') {
365 365
 		// in the beginning...
366
-		$prefix = ! empty( $prefix ) ? rtrim( $prefix, '-' ) . '-' : '';
366
+		$prefix = ! empty($prefix) ? rtrim($prefix, '-').'-' : '';
367 367
 		// da muddle
368 368
 		$class = '';
369 369
 		// the end
370
-		$suffix = ! empty( $suffix ) ? '-' . ltrim( $suffix, '-' ) : '';
370
+		$suffix = ! empty($suffix) ? '-'.ltrim($suffix, '-') : '';
371 371
 		// is the passed object an EE object ?
372
-		if ( $object instanceof EE_Base_Class ) {
372
+		if ($object instanceof EE_Base_Class) {
373 373
 			// grab the exact type of object
374
-			$obj_class = get_class( $object );
374
+			$obj_class = get_class($object);
375 375
 			// depending on the type of object...
376
-			switch ( $obj_class ) {
376
+			switch ($obj_class) {
377 377
 				// no specifics just yet...
378 378
 				default :
379
-					$class = strtolower( str_replace( '_', '-', $obj_class ));
380
-					$class .= method_exists( $obj_class, 'name' ) ? '-' . sanitize_title( $object->name() ) : '';
379
+					$class = strtolower(str_replace('_', '-', $obj_class));
380
+					$class .= method_exists($obj_class, 'name') ? '-'.sanitize_title($object->name()) : '';
381 381
 
382 382
 			}
383 383
 		}
384
-		return $prefix . $class . $suffix;
384
+		return $prefix.$class.$suffix;
385 385
 	}
386 386
 
387 387
 
@@ -397,50 +397,50 @@  discard block
 block discarded – undo
397 397
 	 * @param string      $cur_code_span_class
398 398
 	 * @return string        the html output for the formatted money value
399 399
 	 */
400
-	public static function format_currency( $amount = NULL, $return_raw = FALSE, $display_code = TRUE, $CNT_ISO = '', $cur_code_span_class = 'currency-code' ) {
400
+	public static function format_currency($amount = NULL, $return_raw = FALSE, $display_code = TRUE, $CNT_ISO = '', $cur_code_span_class = 'currency-code') {
401 401
 		// ensure amount was received
402
-		if ( is_null( $amount ) ) {
403
-			$msg = __( 'In order to format currency, an amount needs to be passed.', 'event_espresso' );
404
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
402
+		if (is_null($amount)) {
403
+			$msg = __('In order to format currency, an amount needs to be passed.', 'event_espresso');
404
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
405 405
 			return '';
406 406
 		}
407 407
 		//ensure amount is float
408 408
 		$amount = (float) $amount;
409 409
 		// filter raw amount (allows 0.00 to be changed to "free" for example)
410
-		$amount_formatted = apply_filters( 'FHEE__EEH_Template__format_currency__amount', $amount, $return_raw );
410
+		$amount_formatted = apply_filters('FHEE__EEH_Template__format_currency__amount', $amount, $return_raw);
411 411
 		// still a number or was amount converted to a string like "free" ?
412
-		if ( is_float( $amount_formatted )) {
412
+		if (is_float($amount_formatted)) {
413 413
 			// was a country ISO code passed ? if so generate currency config object for that country
414
-			$mny = $CNT_ISO !== '' ? new EE_Currency_Config( $CNT_ISO ) : NULL;
414
+			$mny = $CNT_ISO !== '' ? new EE_Currency_Config($CNT_ISO) : NULL;
415 415
 			// verify results
416
-			if ( ! $mny instanceof EE_Currency_Config ) {
416
+			if ( ! $mny instanceof EE_Currency_Config) {
417 417
 				// set default config country currency settings
418 418
 				$mny = EE_Registry::instance()->CFG->currency instanceof EE_Currency_Config ? EE_Registry::instance()->CFG->currency : new EE_Currency_Config();
419 419
 			}
420 420
 			// format float
421
-			$amount_formatted = number_format( $amount, $mny->dec_plc, $mny->dec_mrk, $mny->thsnds );
421
+			$amount_formatted = number_format($amount, $mny->dec_plc, $mny->dec_mrk, $mny->thsnds);
422 422
 			// add formatting ?
423
-			if ( ! $return_raw ) {
423
+			if ( ! $return_raw) {
424 424
 				// add currency sign
425
-				if( $mny->sign_b4 ){
426
-					if( $amount >= 0 ){
427
-						$amount_formatted = $mny->sign . $amount_formatted;
428
-					}else{
429
-						$amount_formatted = '-' . $mny->sign . str_replace( '-', '', $amount_formatted );
425
+				if ($mny->sign_b4) {
426
+					if ($amount >= 0) {
427
+						$amount_formatted = $mny->sign.$amount_formatted;
428
+					} else {
429
+						$amount_formatted = '-'.$mny->sign.str_replace('-', '', $amount_formatted);
430 430
 					}
431 431
 
432
-				}else{
433
-					$amount_formatted =  $amount_formatted . $mny->sign;
432
+				} else {
433
+					$amount_formatted = $amount_formatted.$mny->sign;
434 434
 				}
435 435
 
436 436
 				// add currency code ?
437
-				$amount_formatted = $display_code ? $amount_formatted . ' <span class="' . $cur_code_span_class . '">(' . $mny->code . ')</span>' : $amount_formatted;
437
+				$amount_formatted = $display_code ? $amount_formatted.' <span class="'.$cur_code_span_class.'">('.$mny->code.')</span>' : $amount_formatted;
438 438
 			}
439 439
 			// filter results
440
-			$amount_formatted = apply_filters( 'FHEE__EEH_Template__format_currency__amount_formatted', $amount_formatted, $mny, $return_raw );
440
+			$amount_formatted = apply_filters('FHEE__EEH_Template__format_currency__amount_formatted', $amount_formatted, $mny, $return_raw);
441 441
 		}
442 442
 		// clean up vars
443
-		unset( $mny );
443
+		unset($mny);
444 444
 		// return formatted currency amount
445 445
 		return $amount_formatted;
446 446
 	}
@@ -455,11 +455,11 @@  discard block
 block discarded – undo
455 455
 	 * @param  string  $schema    'UPPER', 'lower', or 'Sentence'
456 456
 	 * @return string             The localized label for the status id.
457 457
 	 */
458
-	public static function pretty_status( $status_id, $plural = FALSE, $schema = 'upper' ) {
458
+	public static function pretty_status($status_id, $plural = FALSE, $schema = 'upper') {
459 459
 		/** @type EEM_Status $EEM_Status */
460
-		$EEM_Status = EE_Registry::instance()->load_model( 'Status' );
461
-		$status = $EEM_Status->localized_status( array( $status_id => __( 'unknown', 'event_espresso' )), $plural, $schema );
462
-		return $status[ $status_id ];
460
+		$EEM_Status = EE_Registry::instance()->load_model('Status');
461
+		$status = $EEM_Status->localized_status(array($status_id => __('unknown', 'event_espresso')), $plural, $schema);
462
+		return $status[$status_id];
463 463
 	}
464 464
 
465 465
 
@@ -472,9 +472,9 @@  discard block
 block discarded – undo
472 472
 	 * @param string  $icon
473 473
 	 * @return string 	the html output for the button
474 474
 	 */
475
-	public static function get_button_or_link( $url, $label, $class = 'button-primary', $icon = '' ) {
476
-		$label = ! empty( $icon ) ? '<span class="' . $icon . '"></span>' . $label : $label;
477
-		$button = '<a id="' . sanitize_title_with_dashes($label) . '" href="' . $url . '" class="' . $class . '">' . $label . '</a>';
475
+	public static function get_button_or_link($url, $label, $class = 'button-primary', $icon = '') {
476
+		$label = ! empty($icon) ? '<span class="'.$icon.'"></span>'.$label : $label;
477
+		$button = '<a id="'.sanitize_title_with_dashes($label).'" href="'.$url.'" class="'.$class.'">'.$label.'</a>';
478 478
 		return $button;
479 479
 	}
480 480
 
@@ -491,21 +491,21 @@  discard block
 block discarded – undo
491 491
 	 * @param bool|string $help_text   (optional) send help text you want to use for the link if default not to be used
492 492
 	 * @return string              generated link
493 493
 	 */
494
-	public static function get_help_tab_link( $help_tab_id, $page = FALSE, $action = FALSE, $icon_style = FALSE, $help_text = FALSE ) {
494
+	public static function get_help_tab_link($help_tab_id, $page = FALSE, $action = FALSE, $icon_style = FALSE, $help_text = FALSE) {
495 495
 
496
-		if ( ! $page )
497
-			$page = isset( $_REQUEST['page'] ) && ! empty( $_REQUEST['page'] ) ? sanitize_key( $_REQUEST['page'] ) : $page;
496
+		if ( ! $page)
497
+			$page = isset($_REQUEST['page']) && ! empty($_REQUEST['page']) ? sanitize_key($_REQUEST['page']) : $page;
498 498
 
499
-		if ( ! $action )
500
-			$action = isset( $_REQUEST['action'] ) && ! empty( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : $action;
499
+		if ( ! $action)
500
+			$action = isset($_REQUEST['action']) && ! empty($_REQUEST['action']) ? sanitize_key($_REQUEST['action']) : $action;
501 501
 
502 502
 		$action = empty($action) ? 'default' : $action;
503 503
 
504 504
 
505
-		$help_tab_lnk = $page . '-' . $action . '-' . $help_tab_id;
506
-		$icon = !$icon_style ? ' dashicons-editor-help' : $icon_style;
507
-		$help_text = !$help_text ? '' : $help_text;
508
-		return '<a id="' . $help_tab_lnk . '" class="ee-clickable dashicons espresso-help-tab-lnk ee-icon-size-22' . $icon . '" title="' . esc_attr__('Click to open the \'Help\' tab for more information about this feature.', 'event_espresso') . '" > ' . $help_text . ' </a>';
505
+		$help_tab_lnk = $page.'-'.$action.'-'.$help_tab_id;
506
+		$icon = ! $icon_style ? ' dashicons-editor-help' : $icon_style;
507
+		$help_text = ! $help_text ? '' : $help_text;
508
+		return '<a id="'.$help_tab_lnk.'" class="ee-clickable dashicons espresso-help-tab-lnk ee-icon-size-22'.$icon.'" title="'.esc_attr__('Click to open the \'Help\' tab for more information about this feature.', 'event_espresso').'" > '.$help_text.' </a>';
509 509
 	}
510 510
 
511 511
 
@@ -517,31 +517,31 @@  discard block
 block discarded – undo
517 517
 	 * @param EE_Help_Tour
518 518
 	 * @return string         html
519 519
 	 */
520
-	public static function help_tour_stops_generator( EE_Help_Tour $tour ) {
520
+	public static function help_tour_stops_generator(EE_Help_Tour $tour) {
521 521
 		$id = $tour->get_slug();
522 522
 		$stops = $tour->get_stops();
523 523
 
524
-		$content = '<ol style="display:none" id="' . $id . '">';
524
+		$content = '<ol style="display:none" id="'.$id.'">';
525 525
 
526
-		foreach ( $stops as $stop ) {
527
-			$data_id = !empty( $stop['id'] ) ? ' data-id="' . $stop['id'] . '"' : '';
528
-			$data_class = empty( $data_id ) && !empty( $stop['class'] ) ? ' data-class="' . $stop['class'] . '"' : '';
526
+		foreach ($stops as $stop) {
527
+			$data_id = ! empty($stop['id']) ? ' data-id="'.$stop['id'].'"' : '';
528
+			$data_class = empty($data_id) && ! empty($stop['class']) ? ' data-class="'.$stop['class'].'"' : '';
529 529
 
530 530
 			//if container is set to modal then let's make sure we set the options accordingly
531
-			if ( empty( $data_id ) && empty( $data_class ) ) {
531
+			if (empty($data_id) && empty($data_class)) {
532 532
 				$stop['options']['modal'] = true;
533 533
 				$stop['options']['expose'] = true;
534 534
 			}
535 535
 
536
-			$custom_class = !empty( $stop['custom_class'] ) ? ' class="' . $stop['custom_class'] . '"' : '';
537
-			$button_text = !empty( $stop['button_text'] ) ? ' data-button="' . $stop['button_text'] . '"' : '';
536
+			$custom_class = ! empty($stop['custom_class']) ? ' class="'.$stop['custom_class'].'"' : '';
537
+			$button_text = ! empty($stop['button_text']) ? ' data-button="'.$stop['button_text'].'"' : '';
538 538
 			$inner_content = isset($stop['content']) ? $stop['content'] : '';
539 539
 
540 540
 			//options
541
-			if ( isset( $stop['options'] ) && is_array( $stop['options'] ) ) {
541
+			if (isset($stop['options']) && is_array($stop['options'])) {
542 542
 				$options = ' data-options="';
543
-				foreach ( $stop['options'] as $option => $value ) {
544
-					$options .= $option . ':' . $value . ';';
543
+				foreach ($stop['options'] as $option => $value) {
544
+					$options .= $option.':'.$value.';';
545 545
 				}
546 546
 				$options .= '"';
547 547
 			} else {
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 			}
550 550
 
551 551
 			//let's put all together
552
-			$content .= '<li' . $data_id . $data_class . $custom_class . $button_text . $options . '>' . $inner_content . '</li>';
552
+			$content .= '<li'.$data_id.$data_class.$custom_class.$button_text.$options.'>'.$inner_content.'</li>';
553 553
 		}
554 554
 
555 555
 		$content .= '</ol>';
@@ -570,31 +570,31 @@  discard block
 block discarded – undo
570 570
 	 * @throws EE_Error
571 571
 	 * @return string               html structure for status.
572 572
 	 */
573
-	public static function status_legend( $status_array, $active_status = '' ) {
574
-		if ( !is_array( $status_array ) )
575
-			throw new EE_Error( __('The EEH_Template::status_legend helper required the incoming status_array argument to be an array!', 'event_espresso') );
573
+	public static function status_legend($status_array, $active_status = '') {
574
+		if ( ! is_array($status_array))
575
+			throw new EE_Error(__('The EEH_Template::status_legend helper required the incoming status_array argument to be an array!', 'event_espresso'));
576 576
 
577 577
 		$setup_array = array();
578
-		foreach ( $status_array as $item => $status ) {
578
+		foreach ($status_array as $item => $status) {
579 579
 			$setup_array[$item] = array(
580
-					'class' => 'ee-status-legend ee-status-legend-' . $status,
581
-					'desc' => EEH_Template::pretty_status( $status, FALSE, 'sentence' ),
580
+					'class' => 'ee-status-legend ee-status-legend-'.$status,
581
+					'desc' => EEH_Template::pretty_status($status, FALSE, 'sentence'),
582 582
 					'status' => $status
583 583
 				);
584 584
 		}
585 585
 
586
-		$content = '<div class="ee-list-table-legend-container">' . "\n";
587
-		$content .= '<h4>' . __('Status Legend', 'event_espresso') . '</h4>' . "\n";
588
-		$content .= '<dl class="ee-list-table-legend">' . "\n\t";
589
-		foreach ( $setup_array as $item => $details ) {
586
+		$content = '<div class="ee-list-table-legend-container">'."\n";
587
+		$content .= '<h4>'.__('Status Legend', 'event_espresso').'</h4>'."\n";
588
+		$content .= '<dl class="ee-list-table-legend">'."\n\t";
589
+		foreach ($setup_array as $item => $details) {
590 590
 			$active_class = $active_status == $details['status'] ? ' class="ee-is-active-status"' : '';
591
-			$content .= '<dt id="ee-legend-item-tooltip-' . $item . '"' . $active_class . '>' . "\n\t\t";
592
-			$content .= '<span class="' . $details['class'] . '"></span>' . "\n\t\t";
593
-			$content .= '<span class="ee-legend-description">' . $details['desc'] . '</span>' . "\n\t";
594
-			$content .= '</dt>' . "\n";
591
+			$content .= '<dt id="ee-legend-item-tooltip-'.$item.'"'.$active_class.'>'."\n\t\t";
592
+			$content .= '<span class="'.$details['class'].'"></span>'."\n\t\t";
593
+			$content .= '<span class="ee-legend-description">'.$details['desc'].'</span>'."\n\t";
594
+			$content .= '</dt>'."\n";
595 595
 		}
596
-		$content .= '</dl>' . "\n";
597
-		$content .= '</div>' . "\n";
596
+		$content .= '</dl>'."\n";
597
+		$content .= '</div>'."\n";
598 598
 		return $content;
599 599
 	}
600 600
 
@@ -607,8 +607,8 @@  discard block
 block discarded – undo
607 607
 	 * @return string
608 608
 	 */
609 609
 	public static function layout_array_as_table($data) {
610
-	if (is_object($data) || $data instanceof __PHP_Incomplete_Class ) {
611
-		$data = (array)$data;
610
+	if (is_object($data) || $data instanceof __PHP_Incomplete_Class) {
611
+		$data = (array) $data;
612 612
 	}
613 613
 	EE_Registry::instance()->load_helper('Array');
614 614
 	ob_start();
@@ -622,10 +622,10 @@  discard block
 block discarded – undo
622 622
 						?>
623 623
 						<tr>
624 624
 							<td>
625
-								<?php echo $data_key;?>
625
+								<?php echo $data_key; ?>
626 626
 							</td>
627 627
 							<td>
628
-								<?php echo self::layout_array_as_table($data_values);?>
628
+								<?php echo self::layout_array_as_table($data_values); ?>
629 629
 							</td>
630 630
 						</tr>
631 631
 						<?php
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 			<ul>
640 640
 				<?php
641 641
 				foreach ($data as $datum) {
642
-					echo "<li>"; echo self::layout_array_as_table($datum);echo "</li>";
642
+					echo "<li>"; echo self::layout_array_as_table($datum); echo "</li>";
643 643
 				}?>
644 644
 			</ul>
645 645
 			<?php
@@ -669,8 +669,8 @@  discard block
 block discarded – undo
669 669
 	 *
670 670
 	 * @return string
671 671
 	 */
672
-	public static function paging_html( $total_items, $current, $per_page, $url, $show_num_field = TRUE, $paged_arg_name = 'paged', $items_label = array() ) {
673
-		echo self::get_paging_html( $total_items, $current, $per_page, $url, $show_num_field, $paged_arg_name, $items_label );
672
+	public static function paging_html($total_items, $current, $per_page, $url, $show_num_field = TRUE, $paged_arg_name = 'paged', $items_label = array()) {
673
+		echo self::get_paging_html($total_items, $current, $per_page, $url, $show_num_field, $paged_arg_name, $items_label);
674 674
 	}
675 675
 
676 676
 
@@ -694,13 +694,13 @@  discard block
 block discarded – undo
694 694
 	 *                                 )
695 695
 	 * @return  string
696 696
 	 */
697
-	public static function get_paging_html( $total_items, $current, $per_page, $url, $show_num_field = TRUE, $paged_arg_name = 'paged', $items_label = array() ) {
697
+	public static function get_paging_html($total_items, $current, $per_page, $url, $show_num_field = TRUE, $paged_arg_name = 'paged', $items_label = array()) {
698 698
 		$page_links = array();
699 699
 		$disable_first = $disable_last = '';
700 700
 		$total_items = (int) $total_items;
701 701
 		$per_page = (int) $per_page;
702 702
 		$current = (int) $current;
703
-		$paged_arg_name = empty( $paged_arg_name ) ? 'paged' : sanitize_key( $paged_arg_name );
703
+		$paged_arg_name = empty($paged_arg_name) ? 'paged' : sanitize_key($paged_arg_name);
704 704
 
705 705
 		//filter items_label
706 706
 		$items_label = apply_filters(
@@ -708,68 +708,68 @@  discard block
 block discarded – undo
708 708
 			$items_label
709 709
 		);
710 710
 
711
-		if ( empty( $items_label )
712
-		     || ! is_array( $items_label )
713
-		     || ! isset( $items_label['single'] )
714
-		     || ! isset( $items_label['plural'] ) ) {
711
+		if (empty($items_label)
712
+		     || ! is_array($items_label)
713
+		     || ! isset($items_label['single'])
714
+		     || ! isset($items_label['plural'])) {
715 715
 			$items_label = array(
716
-				'single' => __( '1 item', 'event_espresso' ),
717
-				'plural' => __( '%s items', 'event_espresso' )
716
+				'single' => __('1 item', 'event_espresso'),
717
+				'plural' => __('%s items', 'event_espresso')
718 718
 			);
719 719
 		} else {
720 720
 			$items_label = array(
721
-				'single' => '1 ' . esc_html( $items_label['single'] ),
722
-				'plural' => '%s ' . esc_html( $items_label['plural'] )
721
+				'single' => '1 '.esc_html($items_label['single']),
722
+				'plural' => '%s '.esc_html($items_label['plural'])
723 723
 			);
724 724
 		}
725 725
 
726
-		$total_pages = ceil( $total_items / $per_page );
726
+		$total_pages = ceil($total_items / $per_page);
727 727
 
728
-		if ( $total_pages <= 1 )
728
+		if ($total_pages <= 1)
729 729
 			return '';
730 730
 
731
-		$item_label = $total_items > 1 ? sprintf( $items_label['plural'], $total_items ) : $items_label['single'];
731
+		$item_label = $total_items > 1 ? sprintf($items_label['plural'], $total_items) : $items_label['single'];
732 732
 
733
-		$output = '<span class="displaying-num">' . $item_label . '</span>';
733
+		$output = '<span class="displaying-num">'.$item_label.'</span>';
734 734
 
735
-		if ( $current === 1 ) {
735
+		if ($current === 1) {
736 736
 			$disable_first = ' disabled';
737 737
 		}
738
-		if ( $current == $total_pages ) {
738
+		if ($current == $total_pages) {
739 739
 			$disable_last = ' disabled';
740 740
 		}
741 741
 
742
-		$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
743
-			'first-page' . $disable_first,
744
-			esc_attr__( 'Go to the first page' ),
745
-			esc_url( remove_query_arg( $paged_arg_name, $url ) ),
742
+		$page_links[] = sprintf("<a class='%s' title='%s' href='%s'>%s</a>",
743
+			'first-page'.$disable_first,
744
+			esc_attr__('Go to the first page'),
745
+			esc_url(remove_query_arg($paged_arg_name, $url)),
746 746
 			'&laquo;'
747 747
 		);
748 748
 
749 749
 		$page_links[] = sprintf(
750 750
 			'<a class="%s" title="%s" href="%s">%s</a>',
751
-			'prev-page' . $disable_first,
752
-			esc_attr__( 'Go to the previous page' ),
753
-			esc_url( add_query_arg( $paged_arg_name, max( 1, $current-1 ), $url ) ),
751
+			'prev-page'.$disable_first,
752
+			esc_attr__('Go to the previous page'),
753
+			esc_url(add_query_arg($paged_arg_name, max(1, $current - 1), $url)),
754 754
 			'&lsaquo;'
755 755
 		);
756 756
 
757
-		if ( ! $show_num_field ) {
757
+		if ( ! $show_num_field) {
758 758
 			$html_current_page = $current;
759 759
 		} else {
760
-			$html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name=$paged_arg_name value='%s' size='%d' />",
761
-				esc_attr__( 'Current page' ),
760
+			$html_current_page = sprintf("<input class='current-page' title='%s' type='text' name=$paged_arg_name value='%s' size='%d' />",
761
+				esc_attr__('Current page'),
762 762
 				$current,
763
-				strlen( $total_pages )
763
+				strlen($total_pages)
764 764
 			);
765 765
 		}
766 766
 
767 767
 		$html_total_pages = sprintf(
768 768
 			'<span class="total-pages">%s</span>',
769
-			number_format_i18n( $total_pages )
769
+			number_format_i18n($total_pages)
770 770
 		);
771 771
 		$page_links[] = sprintf(
772
-			_x( '%3$s%1$s of %2$s%4$s', 'paging' ),
772
+			_x('%3$s%1$s of %2$s%4$s', 'paging'),
773 773
 			$html_current_page,
774 774
 			$html_total_pages,
775 775
 			'<span class="paging-input">',
@@ -778,29 +778,29 @@  discard block
 block discarded – undo
778 778
 
779 779
 		$page_links[] = sprintf(
780 780
 			'<a class="%s" title="%s" href="%s">%s</a>',
781
-			'next-page' . $disable_last,
782
-			esc_attr__( 'Go to the next page' ),
783
-			esc_url( add_query_arg( $paged_arg_name, min( $total_pages, $current+1 ), $url ) ),
781
+			'next-page'.$disable_last,
782
+			esc_attr__('Go to the next page'),
783
+			esc_url(add_query_arg($paged_arg_name, min($total_pages, $current + 1), $url)),
784 784
 			'&rsaquo;'
785 785
 		);
786 786
 
787 787
 		$page_links[] = sprintf(
788 788
 			'<a class="%s" title="%s" href="%s">%s</a>',
789
-			'last-page' . $disable_last,
790
-			esc_attr__( 'Go to the last page' ),
791
-			esc_url( add_query_arg( $paged_arg_name, $total_pages, $url ) ),
789
+			'last-page'.$disable_last,
790
+			esc_attr__('Go to the last page'),
791
+			esc_url(add_query_arg($paged_arg_name, $total_pages, $url)),
792 792
 			'&raquo;'
793 793
 		);
794 794
 
795
-		$output .= "\n" . '<span class="pagination-links">' . join( "\n", $page_links ) . '</span>';
795
+		$output .= "\n".'<span class="pagination-links">'.join("\n", $page_links).'</span>';
796 796
 		// set page class
797
-		if ( $total_pages ) {
797
+		if ($total_pages) {
798 798
 			$page_class = $total_pages < 2 ? ' one-page' : '';
799 799
 		} else {
800 800
 			$page_class = ' no-pages';
801 801
 		}
802 802
 
803
-		return '<div class="tablenav"><div class="tablenav-pages' . $page_class . '">' . $output . '</div></div>';
803
+		return '<div class="tablenav"><div class="tablenav-pages'.$page_class.'">'.$output.'</div></div>';
804 804
 	}
805 805
 
806 806
 
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 				return array();
100 100
 			}
101 101
 			if (( $key = array_search( 'global_assets', $espresso_themes )) !== FALSE ) {
102
-			    unset( $espresso_themes[ $key ] );
102
+				unset( $espresso_themes[ $key ] );
103 103
 			}
104 104
 			EEH_Template::$_espresso_themes = array();
105 105
 			foreach ( $espresso_themes as $espresso_theme ) {
@@ -709,9 +709,9 @@  discard block
 block discarded – undo
709 709
 		);
710 710
 
711 711
 		if ( empty( $items_label )
712
-		     || ! is_array( $items_label )
713
-		     || ! isset( $items_label['single'] )
714
-		     || ! isset( $items_label['plural'] ) ) {
712
+			 || ! is_array( $items_label )
713
+			 || ! isset( $items_label['single'] )
714
+			 || ! isset( $items_label['plural'] ) ) {
715 715
 			$items_label = array(
716 716
 				'single' => __( '1 item', 'event_espresso' ),
717 717
 				'plural' => __( '%s items', 'event_espresso' )
Please login to merge, or discard this patch.
core/db_models/relations/EE_HABTM_Any_Relation.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,6 @@
 block discarded – undo
32 32
 	/**
33 33
 	 * 
34 34
 	 * @param string $model_name
35
-	 * @param string $comparison_model_name
36 35
 	 * @param string $id_or_name_field should be the string 'ID' or 'name' only
37 36
 	 * @return EE_Model_Field_Base
38 37
 	 */
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * Joins any two models together via a has-and-belongs-to-many relation, using 
4 4
  * the esp_extra_join table.
5 5
  */
6
-class EE_HABTM_Any_Relation extends EE_HABTM_Relation{	
6
+class EE_HABTM_Any_Relation extends EE_HABTM_Relation {	
7 7
 	/**
8 8
 	 *
9 9
 	 * @var string
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 	 * @param boolean $block_deletes for this type of relation, we block by default for now. if there are related models across this relation, block (prevent and add an error) the deletion of this model
18 18
 	 * @param type $blocking_delete_error_message a customized error message on blocking deletes instead of the default
19 19
 	 */
20
-	function __construct( $block_deletes = true, $blocking_delete_error_message =''){
21
-		parent::__construct( 'Extra_Join', $block_deletes, $blocking_delete_error_message);
20
+	function __construct($block_deletes = true, $blocking_delete_error_message = '') {
21
+		parent::__construct('Extra_Join', $block_deletes, $blocking_delete_error_message);
22 22
 	}
23
-	function _construct_finalize_set_models($this_model_name, $other_model_name){
24
-		if( $this_model_name < $other_model_name ) {
23
+	function _construct_finalize_set_models($this_model_name, $other_model_name) {
24
+		if ($this_model_name < $other_model_name) {
25 25
 			$this->_alphabetically_first_model_name = $this_model_name;
26
-		} else{
26
+		} else {
27 27
 			$this->_alphabetically_first_model_name = $other_model_name;
28 28
 		}
29
-		return parent::_construct_finalize_set_models( $this_model_name, $other_model_name );
29
+		return parent::_construct_finalize_set_models($this_model_name, $other_model_name);
30 30
 	}
31 31
 	
32 32
 	/**
@@ -36,21 +36,21 @@  discard block
 block discarded – undo
36 36
 	 * @param string $id_or_name_field should be the string 'ID' or 'name' only
37 37
 	 * @return EE_Model_Field_Base
38 38
 	 */
39
-	function get_join_table_fk_field_to( $model_name, $id_or_name_field ) {
39
+	function get_join_table_fk_field_to($model_name, $id_or_name_field) {
40 40
 		$order = null;
41
-		if( $model_name === $this->_alphabetically_first_model_name ) {
41
+		if ($model_name === $this->_alphabetically_first_model_name) {
42 42
 			$order = 'first';
43 43
 		} else {
44 44
 			$order = 'second';
45 45
 		}
46
-		return $this->get_join_model()->field_settings_for( 'EXJ_' . $order . '_model_' . $id_or_name_field );
46
+		return $this->get_join_model()->field_settings_for('EXJ_'.$order.'_model_'.$id_or_name_field);
47 47
 	}
48 48
 	/**
49 49
 	 * Gets the SQL string for joining the main model's table containing the pk to the join table. Eg "LEFT JOIN real_join_table AS join_table_alias ON this_table_alias.pk = join_table_alias.fk_to_this_table"
50 50
 	 * @param string $model_relation_chain like 'Event.Event_Venue.Venue'
51 51
 	 * @return string of SQL
52 52
 	 */
53
-	function get_join_to_intermediate_model_statement($model_relation_chain){
53
+	function get_join_to_intermediate_model_statement($model_relation_chain) {
54 54
 		//create sql like
55 55
 		//LEFT JOIN join_table AS join_table_alias ON this_table_alias.this_table_pk = join_table_alias.join_table_fk_to_this
56 56
 		//LEFT JOIN other_table AS other_table_alias ON join_table_alias.join_table_fk_to_other = other_table_alias.other_table_pk
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 		$field_with_model_name = $this->get_join_table_fk_field_to( 
65 65
 				$this->get_this_model()->get_this_model_name(), 
66 66
 				'name' );
67
-		$this_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_this_model()->get_this_model_name()) . $this_table_pk_field->get_table_alias();
68
-		$join_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_join_model()->get_this_model_name()) . $join_table_fk_field_to_this_table->get_table_alias();
67
+		$this_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_this_model()->get_this_model_name()).$this_table_pk_field->get_table_alias();
68
+		$join_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_join_model()->get_this_model_name()).$join_table_fk_field_to_this_table->get_table_alias();
69 69
 		$join_table = $this->get_join_model()->get_table_for_alias($join_table_alias);
70 70
 		//phew! ok, we have all the info we need, now we can create the SQL join string
71 71
 		$SQL = $this->_left_join(
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 					$join_table_fk_field_to_this_table->get_table_column(), 
75 75
 					$this_table_alias, 
76 76
 					$this_table_pk_field->get_table_column(),
77
-					$field_with_model_name->get_qualified_column()."='".$this->get_this_model()->get_this_model_name()."'" ) .
77
+					$field_with_model_name->get_qualified_column()."='".$this->get_this_model()->get_this_model_name()."'" ).
78 78
 				$this->get_join_model()->_construct_internal_join_to_table_with_alias($join_table_alias);
79 79
 
80 80
 		return $SQL;
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 	 * @param string $model_relation_chain like 'Event.Event_Venue.Venue'
88 88
 	 * @return string of SQL
89 89
 	 */
90
-	function get_join_statement($model_relation_chain){
91
-		if( $this->_model_relation_chain_to_join_model === NULL ){
92
-			throw new EE_Error( sprintf( __( 'When using EE_HABTM_Relation to create a join, you must call get_join_to_intermediate_model_statement BEFORE get_join_statement', 'event_espresso' )));
90
+	function get_join_statement($model_relation_chain) {
91
+		if ($this->_model_relation_chain_to_join_model === NULL) {
92
+			throw new EE_Error(sprintf(__('When using EE_HABTM_Relation to create a join, you must call get_join_to_intermediate_model_statement BEFORE get_join_statement', 'event_espresso')));
93 93
 		}
94 94
 		$join_table_fk_field_to_this_table = $this->get_join_table_fk_field_to( 
95 95
 				$this->get_this_model()->get_this_model_name(), 
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
 				$this->get_other_model()->get_this_model_name(), 
102 102
 				'name' );
103 103
 		
104
-		$join_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($this->_model_relation_chain_to_join_model, $this->get_join_model()->get_this_model_name()) . $join_table_fk_field_to_this_table->get_table_alias();
104
+		$join_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($this->_model_relation_chain_to_join_model, $this->get_join_model()->get_this_model_name()).$join_table_fk_field_to_this_table->get_table_alias();
105 105
 		
106 106
 		$other_table_pk_field = $this->get_other_model()->get_primary_key_field();
107
-		$other_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_other_model()->get_this_model_name()) . $other_table_pk_field->get_table_alias();
107
+		$other_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix($model_relation_chain, $this->get_other_model()->get_this_model_name()).$other_table_pk_field->get_table_alias();
108 108
 		$other_table = $this->get_other_model()->get_table_for_alias($other_table_alias);
109 109
 
110 110
 		$SQL = $this->_left_join(
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 					$join_table_alias, 
115 115
 					$join_table_fk_field_to_other_table->get_table_column(),
116 116
 					$field_with_other_model_name->get_qualified_column()."='".$this->get_other_model()->get_this_model_name()."'" 
117
-				) . 
117
+				). 
118 118
 				$this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias);
119 119
 		return $SQL;
120 120
 	}
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * @param array             $extra_join_model_fields_n_values col=>val pairs that are used as extra conditions for checking existing values and for setting new rows if no exact matches.
127 127
 	 * @return EE_Base_Class
128 128
 	 */
129
-	 function add_relation_to($this_obj_or_id, $other_obj_or_id, $extra_join_model_fields_n_values = array() ){
129
+	 function add_relation_to($this_obj_or_id, $other_obj_or_id, $extra_join_model_fields_n_values = array()) {
130 130
 		 $this_model_obj = $this->get_this_model()->ensure_is_obj($this_obj_or_id, true);
131 131
 		 $other_model_obj = $this->get_other_model()->ensure_is_obj($other_obj_or_id, true);
132 132
 		//check if such a relationship already exists
@@ -143,31 +143,31 @@  discard block
 block discarded – undo
143 143
 				$this->get_other_model()->get_this_model_name(),
144 144
 				'name' );
145 145
 
146
-		$cols_n_values =  array(
146
+		$cols_n_values = array(
147 147
 				$join_model_fk_to_this_model->get_name() => $this_model_obj->ID(),
148 148
 				$join_model_name_field_to_this_model->get_name() => $this_model_obj->get_model()->get_this_model_name(),
149 149
 				$join_model_fk_to_other_model->get_name() => $other_model_obj->ID(),
150 150
 				$join_model_name_field_to_other_model->get_name() => $other_model_obj->get_model()->get_this_model_name() );
151 151
 
152 152
 		//if $where_query exists lets add them to the query_params.
153
-		if ( !empty( $extra_join_model_fields_n_values ) ) {
153
+		if ( ! empty($extra_join_model_fields_n_values)) {
154 154
 		   //make sure we strip any of the join model names from the $where_query cause we don't need that in here (why? because client code may have used the same conditionals for get_all_related which DOES need the join model name)
155 155
 		   //make sure we strip THIS models name from the query param
156
-		   foreach ( $extra_join_model_fields_n_values as $query_param => $val ) {
157
-			   $query_param = str_replace($this->get_join_model()->get_this_model_name().".","", $query_param);
156
+		   foreach ($extra_join_model_fields_n_values as $query_param => $val) {
157
+			   $query_param = str_replace($this->get_join_model()->get_this_model_name().".", "", $query_param);
158 158
 			   $parsed_query[$query_param] = $val;
159 159
 		   }
160
-		   $cols_n_values = array_merge( $cols_n_values, $parsed_query );
160
+		   $cols_n_values = array_merge($cols_n_values, $parsed_query);
161 161
 		}
162 162
 
163
-		$query_params = array( $cols_n_values );
163
+		$query_params = array($cols_n_values);
164 164
 
165 165
 
166 166
 		$existing_entry_in_join_table = $this->get_join_model()->get_one($query_params);
167 167
 		//if there is already an entry in the join table, indicating a relationship, we're done
168 168
 		 //again, if you want more sophisticated logic or insertions (handling more columns than just 2 foreign keys to
169 169
 		 //the other tables, use the joining model directly!
170
-		if( ! $existing_entry_in_join_table ){
170
+		if ( ! $existing_entry_in_join_table) {
171 171
 			$this->get_join_model()->insert($cols_n_values);
172 172
 		}
173 173
 		return $other_model_obj;
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * * @param array           $where_query col=>val pairs that are used as extra conditions for checking existing values and for removing existing rows if exact matches exist.
180 180
 	 * @return EE_Base_Class
181 181
 	 */
182
-	 function remove_relation_to($this_obj_or_id, $other_obj_or_id, $where_query = array() ){
182
+	 function remove_relation_to($this_obj_or_id, $other_obj_or_id, $where_query = array()) {
183 183
 		 $this_model_obj = $this->get_this_model()->ensure_is_obj($this_obj_or_id, true);
184 184
 		 $other_model_obj = $this->get_other_model()->ensure_is_obj($other_obj_or_id, true);
185 185
 		//check if such a relationship already exists
@@ -196,24 +196,24 @@  discard block
 block discarded – undo
196 196
 				$this->get_other_model()->get_this_model_name(), 
197 197
 				'name' );
198 198
 
199
-		$cols_n_values =  array(
199
+		$cols_n_values = array(
200 200
 				$join_model_fk_to_this_model->get_name() => $this_model_obj->ID(),
201 201
 				$join_model_name_field_to_this_model->get_name() => $this_model_obj->get_model()->get_this_model_name(),
202 202
 				$join_model_fk_to_other_model->get_name() => $other_model_obj->ID(),
203 203
 				$join_model_name_field_to_other_model->get_name() => $other_model_obj->get_model()->get_this_model_name() );
204 204
 
205 205
 		//if $where_query exists lets add them to the query_params.
206
-		if ( !empty( $where_query ) ) {
206
+		if ( ! empty($where_query)) {
207 207
 		 	//make sure we strip any of the join model names from the $where_query cause we don't need that in here (why? because client code may have used the same conditionals for get_all_related which DOES need the join model name)
208 208
 		 	//make sure we strip THIS models name from the query param
209
-		 	foreach ( $where_query as $query_param => $val ) {
210
-				$query_param = str_replace($this->get_join_model()->get_this_model_name().".","", $query_param);
209
+		 	foreach ($where_query as $query_param => $val) {
210
+				$query_param = str_replace($this->get_join_model()->get_this_model_name().".", "", $query_param);
211 211
 				$parsed_query[$query_param] = $val;
212 212
 			}
213
-		 	$cols_n_values = array_merge( $cols_n_values, $parsed_query );
213
+		 	$cols_n_values = array_merge($cols_n_values, $parsed_query);
214 214
 		}
215 215
 
216
-		$existing_entry_in_join_table = $this->get_join_model()->delete( array($cols_n_values) );
216
+		$existing_entry_in_join_table = $this->get_join_model()->delete(array($cols_n_values));
217 217
 		return $other_model_obj;
218 218
 	 }
219 219
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Extra_Join.class.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Contains definition for EE_Extra_Join model object
4
- * @package 		Event Espresso
5
- * @subpackage 	models
6
- * @since 			$VID$
7
- */
3
+	 * Contains definition for EE_Extra_Join model object
4
+	 * @package 		Event Espresso
5
+	 * @subpackage 	models
6
+	 * @since 			$VID$
7
+	 */
8 8
 
9 9
 /**
10 10
  * EE_Extra_Join
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	 * @param null  $timezone
23 23
 	 * @return EE_Event_Message_Template|mixed
24 24
 	 */
25
-	public static function new_instance( $props_n_values = array(), $timezone = NULL ) {
26
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone );
27
-		return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone );
25
+	public static function new_instance($props_n_values = array(), $timezone = NULL) {
26
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone);
27
+		return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone);
28 28
 	}
29 29
 
30 30
 
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * @param null  $timezone
35 35
 	 * @return EE_Event_Message_Template
36 36
 	 */
37
-	public static function new_instance_from_db ( $props_n_values = array(), $timezone = NULL ) {
38
-		return new self( $props_n_values, TRUE, $timezone );
37
+	public static function new_instance_from_db($props_n_values = array(), $timezone = NULL) {
38
+		return new self($props_n_values, TRUE, $timezone);
39 39
 	}
40 40
 
41 41
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Question.class.php 2 patches
Doc Comments   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	/**
185 185
 	 * returns the text for displaying the question to users
186 186
 	 * @access public
187
-	 * @return string
187
+	 * @return boolean
188 188
 	 */
189 189
 	public function display_text() {
190 190
 		return $this->get( 'QST_display_text' );
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	/**
196 196
 	 * returns the text for the administrative label
197 197
 	 * @access public
198
-	 * @return string
198
+	 * @return boolean
199 199
 	 */
200 200
 	public function admin_label() {
201 201
 		return $this->get( 'QST_admin_label' );
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	/**
207 207
 	 * returns the attendee column name for this question
208 208
 	 * @access public
209
-	 * @return string
209
+	 * @return boolean
210 210
 	 */
211 211
 	public function system_ID() {
212 212
 		return $this->get( 'QST_system' );
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 * returns the text which should be displayed when a user
230 230
 	 * doesn't answer this question in a form
231 231
 	 * @access public
232
-	 * @return string
232
+	 * @return boolean
233 233
 	 */
234 234
 	public function required_text() {
235 235
 		return $this->get( 'QST_required_text' );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	/**
241 241
 	 * returns the type of this question
242 242
 	 * @access public
243
-	 * @return string
243
+	 * @return boolean
244 244
 	 */
245 245
 	public function type() {
246 246
 		return $this->get( 'QST_type' );
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	 * returns an integer showing where this question should
253 253
 	 * be placed in a sequence of questions
254 254
 	 * @access public
255
-	 * @return int
255
+	 * @return boolean
256 256
 	 */
257 257
 	public function order() {
258 258
 		return $this->get( 'QST_order' );
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	/**
276 276
 	 * returns the id the wordpress user who created this question
277 277
 	 * @access public
278
-	 * @return int
278
+	 * @return boolean
279 279
 	 */
280 280
 	public function wp_user() {
281 281
 		return $this->get( 'QST_wp_user' );
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 	 * Adds an option for this question. Note: if the option were previously associated with a different
370 370
 	 * Question, that relationship will be overwritten.
371 371
 	 * @param EE_Question_Option $option
372
-	 * @return boolean success
372
+	 * @return EE_Base_Class success
373 373
 	 */
374 374
 	public function add_option( EE_Question_Option $option ) {
375 375
 		return $this->_add_relation_to( $option, 'Question_Option' );
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	/**
393 393
 	 * Marks the option as deleted.
394 394
 	 * @param EE_Question_Option $option
395
-	 * @return boolean success
395
+	 * @return EE_Base_Class success
396 396
 	 */
397 397
 	public function remove_option( EE_Question_Option $option ) {
398 398
 		return $this->_remove_relation_to( $option, 'Question_Option' );
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	
462 462
 	/**
463 463
 	 * Returns the question's maximum allowed response size
464
-	 * @return int|float
464
+	 * @return boolean
465 465
 	 */
466 466
 	public function max() {
467 467
 		return $this->get( 'QST_max' );
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	 *                             		    date_format and the second value is the time format
38 38
 	 * @return EE_Question
39 39
 	 */
40
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
41
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
42
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
40
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
41
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
42
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
43 43
 	}
44 44
 
45 45
 
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 *                          		the website will be used.
51 51
 	 * @return EE_Question
52 52
 	 */
53
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
54
-		return new self( $props_n_values, TRUE, $timezone );
53
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
54
+		return new self($props_n_values, TRUE, $timezone);
55 55
 	}
56 56
 
57 57
 
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 * @access        public
63 63
 	 * @param string $QST_display_text
64 64
 	 */
65
-	public function set_display_text( $QST_display_text = '' ) {
66
-		$this->set( 'QST_display_text', $QST_display_text );
65
+	public function set_display_text($QST_display_text = '') {
66
+		$this->set('QST_display_text', $QST_display_text);
67 67
 	}
68 68
 
69 69
 
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 	 * @access        public
75 75
 	 * @param        string $QST_admin_label
76 76
 	 */
77
-	public function set_admin_label( $QST_admin_label = '' ) {
78
-		$this->set( 'QST_admin_label', $QST_admin_label );
77
+	public function set_admin_label($QST_admin_label = '') {
78
+		$this->set('QST_admin_label', $QST_admin_label);
79 79
 	}
80 80
 
81 81
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	 * @access        public
87 87
 	 * @param        mixed $QST_system
88 88
 	 */
89
-	public function set_system_ID( $QST_system = '' ) {
90
-		$this->set( 'QST_system', $QST_system );
89
+	public function set_system_ID($QST_system = '') {
90
+		$this->set('QST_system', $QST_system);
91 91
 	}
92 92
 
93 93
 
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 	 * @access        public
99 99
 	 * @param        string $QST_type
100 100
 	 */
101
-	public function set_question_type( $QST_type = '' ) {
102
-		$this->set( 'QST_type', $QST_type );
101
+	public function set_question_type($QST_type = '') {
102
+		$this->set('QST_type', $QST_type);
103 103
 	}
104 104
 
105 105
 
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 	 * @access        public
111 111
 	 * @param        bool $QST_required
112 112
 	 */
113
-	public function set_required( $QST_required = FALSE ) {
114
-		$this->set( 'QST_required', $QST_required );
113
+	public function set_required($QST_required = FALSE) {
114
+		$this->set('QST_required', $QST_required);
115 115
 	}
116 116
 
117 117
 
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 	 * @access        public
123 123
 	 * @param        string $QST_required_text
124 124
 	 */
125
-	public function set_required_text( $QST_required_text = '' ) {
126
-		$this->set( 'QST_required_text', $QST_required_text );
125
+	public function set_required_text($QST_required_text = '') {
126
+		$this->set('QST_required_text', $QST_required_text);
127 127
 	}
128 128
 
129 129
 
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 	 * @access        public
135 135
 	 * @param        int $QST_order
136 136
 	 */
137
-	public function set_order( $QST_order = 0 ) {
138
-		$this->set( 'QST_order', $QST_order );
137
+	public function set_order($QST_order = 0) {
138
+		$this->set('QST_order', $QST_order);
139 139
 	}
140 140
 
141 141
 
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 	 * @access        public
147 147
 	 * @param        bool $QST_admin_only
148 148
 	 */
149
-	public function set_admin_only( $QST_admin_only = FALSE ) {
150
-		$this->set( 'QST_admin_only', $QST_admin_only );
149
+	public function set_admin_only($QST_admin_only = FALSE) {
150
+		$this->set('QST_admin_only', $QST_admin_only);
151 151
 	}
152 152
 
153 153
 
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	 * @access        public
159 159
 	 * @param        int $QST_wp_user
160 160
 	 */
161
-	public function set_wp_user( $QST_wp_user = 1 ) {
162
-		$this->set( 'QST_wp_user', $QST_wp_user );
161
+	public function set_wp_user($QST_wp_user = 1) {
162
+		$this->set('QST_wp_user', $QST_wp_user);
163 163
 	}
164 164
 
165 165
 
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 	 * @access        public
176 176
 	 * @param 	bool $QST_deleted
177 177
 	 */
178
-	public function set_deleted( $QST_deleted = FALSE ) {
179
-		$this->set( 'QST_deleted', $QST_deleted );
178
+	public function set_deleted($QST_deleted = FALSE) {
179
+		$this->set('QST_deleted', $QST_deleted);
180 180
 	}
181 181
 
182 182
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 * @return string
188 188
 	 */
189 189
 	public function display_text() {
190
-		return $this->get( 'QST_display_text' );
190
+		return $this->get('QST_display_text');
191 191
 	}
192 192
 
193 193
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 * @return string
199 199
 	 */
200 200
 	public function admin_label() {
201
-		return $this->get( 'QST_admin_label' );
201
+		return $this->get('QST_admin_label');
202 202
 	}
203 203
 
204 204
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 * @return string
210 210
 	 */
211 211
 	public function system_ID() {
212
-		return $this->get( 'QST_system' );
212
+		return $this->get('QST_system');
213 213
 	}
214 214
 
215 215
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	 * @return boolean
221 221
 	 */
222 222
 	public function required() {
223
-		return $this->get( 'QST_required' );
223
+		return $this->get('QST_required');
224 224
 	}
225 225
 
226 226
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	 * @return string
233 233
 	 */
234 234
 	public function required_text() {
235
-		return $this->get( 'QST_required_text' );
235
+		return $this->get('QST_required_text');
236 236
 	}
237 237
 
238 238
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	 * @return string
244 244
 	 */
245 245
 	public function type() {
246
-		return $this->get( 'QST_type' );
246
+		return $this->get('QST_type');
247 247
 	}
248 248
 
249 249
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 * @return int
256 256
 	 */
257 257
 	public function order() {
258
-		return $this->get( 'QST_order' );
258
+		return $this->get('QST_order');
259 259
 	}
260 260
 
261 261
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 * @return boolean
268 268
 	 */
269 269
 	public function admin_only() {
270
-		return $this->get( 'QST_admin_only' );
270
+		return $this->get('QST_admin_only');
271 271
 	}
272 272
 
273 273
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 * @return int
279 279
 	 */
280 280
 	public function wp_user() {
281
-		return $this->get( 'QST_wp_user' );
281
+		return $this->get('QST_wp_user');
282 282
 	}
283 283
 
284 284
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	 * @return boolean
290 290
 	 */
291 291
 	public function deleted() {
292
-		return $this->get( 'QST_deleted' );
292
+		return $this->get('QST_deleted');
293 293
 	}
294 294
 
295 295
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 * @return EE_Answer[]
300 300
 	 */
301 301
 	public function answers() {
302
-		return $this->get_many_related( 'Answer' );
302
+		return $this->get_many_related('Answer');
303 303
 	}
304 304
 
305 305
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 * @return boolean true = has answers, false = no answers.
310 310
 	 */
311 311
 	public function has_answers() {
312
-		return $this->count_related( 'Answer' ) > 0 ? TRUE : FALSE;
312
+		return $this->count_related('Answer') > 0 ? TRUE : FALSE;
313 313
 	}
314 314
 
315 315
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @return EE_Question_Group[]
320 320
 	 */
321 321
 	public function question_groups() {
322
-		return $this->get_many_related( 'Question_Group' );
322
+		return $this->get_many_related('Question_Group');
323 323
 	}
324 324
 
325 325
 
@@ -333,24 +333,24 @@  discard block
 block discarded – undo
333 333
 	 *                                                       whether it was trashed or not.
334 334
 	 * @return EE_Question_Option[]
335 335
 	 */
336
-	public function options( $notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL ) {
337
-		if ( ! $this->ID() ) {
336
+	public function options($notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL) {
337
+		if ( ! $this->ID()) {
338 338
 			return array();
339 339
 		}
340 340
 		$query_params = array();
341
-		if ( $selected_value_to_always_include ) {
342
-			if ( is_array( $selected_value_to_always_include ) ) {
343
-				$query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = array( 'IN', $selected_value_to_always_include );
341
+		if ($selected_value_to_always_include) {
342
+			if (is_array($selected_value_to_always_include)) {
343
+				$query_params[0]['OR*options-query']['QSO_value'] = array('IN', $selected_value_to_always_include);
344 344
 			} else {
345
-				$query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = $selected_value_to_always_include;
345
+				$query_params[0]['OR*options-query']['QSO_value'] = $selected_value_to_always_include;
346 346
 			}
347 347
 		}
348
-		if ( $notDeletedOptionsOnly ) {
349
-			$query_params[ 0 ][ 'OR*options-query' ][ 'QSO_deleted' ] = FALSE;
348
+		if ($notDeletedOptionsOnly) {
349
+			$query_params[0]['OR*options-query']['QSO_deleted'] = FALSE;
350 350
 		}
351 351
 		//order by QSO_order
352
-		$query_params[ 'order_by' ] = array( 'QSO_order' => 'ASC' );
353
-		return $this->get_many_related( 'Question_Option', $query_params );
352
+		$query_params['order_by'] = array('QSO_order' => 'ASC');
353
+		return $this->get_many_related('Question_Option', $query_params);
354 354
 	}
355 355
 
356 356
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	 * @return \EE_Question_Option[]
361 361
 	 */
362 362
 	public function temp_options() {
363
-		return $this->_model_relations[ 'Question_Option' ];
363
+		return $this->_model_relations['Question_Option'];
364 364
 	}
365 365
 
366 366
 
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 	 * @param EE_Question_Option $option
372 372
 	 * @return boolean success
373 373
 	 */
374
-	public function add_option( EE_Question_Option $option ) {
375
-		return $this->_add_relation_to( $option, 'Question_Option' );
374
+	public function add_option(EE_Question_Option $option) {
375
+		return $this->_add_relation_to($option, 'Question_Option');
376 376
 	}
377 377
 
378 378
 
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 	 * @param EE_Question_Option $option
383 383
 	 * @return boolean success
384 384
 	 */
385
-	public function add_temp_option( EE_Question_Option $option ) {
386
-		$this->_model_relations[ 'Question_Option' ][ ] = $option;
385
+	public function add_temp_option(EE_Question_Option $option) {
386
+		$this->_model_relations['Question_Option'][] = $option;
387 387
 		return TRUE;
388 388
 	}
389 389
 
@@ -394,8 +394,8 @@  discard block
 block discarded – undo
394 394
 	 * @param EE_Question_Option $option
395 395
 	 * @return boolean success
396 396
 	 */
397
-	public function remove_option( EE_Question_Option $option ) {
398
-		return $this->_remove_relation_to( $option, 'Question_Option' );
397
+	public function remove_option(EE_Question_Option $option) {
398
+		return $this->_remove_relation_to($option, 'Question_Option');
399 399
 	}
400 400
 
401 401
 
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
 	 * @return bool
405 405
 	 */
406 406
 	public function is_system_question() {
407
-		$system_ID = $this->get( 'QST_system' );
408
-		return ! empty( $system_ID ) ? TRUE : FALSE;
407
+		$system_ID = $this->get('QST_system');
408
+		return ! empty($system_ID) ? TRUE : FALSE;
409 409
 	}
410 410
 
411 411
 
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
 	 */
419 419
 	public function set_order_to_latest() {
420 420
 		$latest_order = $this->get_model()->get_latest_question_order();
421
-		$latest_order ++;
422
-		$this->set( 'QST_order', $latest_order );
421
+		$latest_order++;
422
+		$this->set('QST_order', $latest_order);
423 423
 	}
424 424
 
425 425
 
@@ -438,20 +438,20 @@  discard block
 block discarded – undo
438 438
 	 * Duplicates this question and its question options
439 439
 	 * @return \EE_Question
440 440
 	 */
441
-	public function duplicate( $options = array() ) {
441
+	public function duplicate($options = array()) {
442 442
 		$new_question = clone $this;
443
-		$new_question->set( 'QST_ID', null );
444
-		$new_question->set_display_text( sprintf( __( '%s **Duplicate**', 'event_espresso' ), $this->display_text() ) );
445
-		$new_question->set_admin_label( sprintf( __( '%s **Duplicate**', 'event_espresso' ), $this->admin_label() ) );
446
-		$new_question->set_system_ID( null );
447
-		$new_question->set_wp_user( get_current_user_id() );
443
+		$new_question->set('QST_ID', null);
444
+		$new_question->set_display_text(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->display_text()));
445
+		$new_question->set_admin_label(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->admin_label()));
446
+		$new_question->set_system_ID(null);
447
+		$new_question->set_wp_user(get_current_user_id());
448 448
                 //if we're duplicating a trashed question, assume we don't want the new one to be trashed
449
-                $new_question->set_deleted( false );
449
+                $new_question->set_deleted(false);
450 450
 		$success = $new_question->save();
451
-		if( $success ) {
451
+		if ($success) {
452 452
 			//we don't totally want to duplicate the question options, because we want them to be for the NEW question
453
-			foreach( $this->options() as $question_option ) {
454
-				$question_option->duplicate( array( 'QST_ID' => $new_question->ID() ) );
453
+			foreach ($this->options() as $question_option) {
454
+				$question_option->duplicate(array('QST_ID' => $new_question->ID()));
455 455
 			}
456 456
 			return $new_question;
457 457
 		} else {
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	 * @return int|float
465 465
 	 */
466 466
 	public function max() {
467
-		return $this->get( 'QST_max' );
467
+		return $this->get('QST_max');
468 468
 	}
469 469
 	
470 470
 	/**
@@ -472,8 +472,8 @@  discard block
 block discarded – undo
472 472
 	 * @param int|float $new_max
473 473
 	 * @return int|float
474 474
 	 */
475
-	public function set_max( $new_max ) {
476
-		return $this->set( 'QST_max', $new_max );
475
+	public function set_max($new_max) {
476
+		return $this->set('QST_max', $new_max);
477 477
 	}
478 478
 
479 479
 
Please login to merge, or discard this patch.
core/libraries/batch/JobHandlerBaseClasses/JobHandler.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- *
4
- * Class JobHandler
5
- *
6
- * Base class for common implementations of JobHandlerInterface.
7
- *
8
- * @package         Event Espresso
9
- * @subpackage    batch
10
- * @author				Mike Nelson
11
- * @since		 	   4.8.26
12
- *
13
- */
3
+	 *
4
+	 * Class JobHandler
5
+	 *
6
+	 * Base class for common implementations of JobHandlerInterface.
7
+	 *
8
+	 * @package         Event Espresso
9
+	 * @subpackage    batch
10
+	 * @author				Mike Nelson
11
+	 * @since		 	   4.8.26
12
+	 *
13
+	 */
14 14
 namespace EventEspressoBatchRequest\JobHandlerBaseClasses;
15 15
 
16 16
 use EventEspressoBatchRequest\Helpers\BatchRequestException;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  * Class EE_Line_Item_Filter_Collection
Please login to merge, or discard this patch.
libraries/form_sections/payment_methods/EE_Payment_Method_Form.form.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * Specialized form for payment methods, allowing for easy setting and retrieving of meta fields.
5 5
  * Uses EEM_Payment_Method as the model
6 6
  */
7
-class EE_Payment_Method_Form extends EE_Model_Form_Section{
7
+class EE_Payment_Method_Form extends EE_Model_Form_Section {
8 8
 
9 9
 	/**
10 10
 	 * All the subsection inputs that correspond ot extra meta rows
@@ -39,37 +39,37 @@  discard block
 block discarded – undo
39 39
 	 *	@see EE_Model_Form_Section::__construct() for more
40 40
 	 * }
41 41
 	 */
42
-	public function __construct($options_array = array()){
42
+	public function __construct($options_array = array()) {
43 43
 		$this->_model = EEM_Payment_Method::instance();
44 44
 		$this->_options_array = $options_array;
45
-		if(isset($options_array['payment_method_type'])){
45
+		if (isset($options_array['payment_method_type'])) {
46 46
 			$this->_payment_method_type = $options_array['payment_method_type'];
47 47
 		}
48 48
 		$options_array = $this->_options_array;
49
-		if(isset($options_array['extra_meta_inputs'])){
50
-			$this->_extra_meta_inputs = array_merge($this->_extra_meta_inputs,$options_array['extra_meta_inputs']);
49
+		if (isset($options_array['extra_meta_inputs'])) {
50
+			$this->_extra_meta_inputs = array_merge($this->_extra_meta_inputs, $options_array['extra_meta_inputs']);
51 51
 		}
52
-		if($this->_extra_meta_inputs){
53
-			$this->_subsections = array_merge($this->_subsections,$this->_extra_meta_inputs);
52
+		if ($this->_extra_meta_inputs) {
53
+			$this->_subsections = array_merge($this->_subsections, $this->_extra_meta_inputs);
54 54
 		}
55 55
 		$this->_subsections['PMD_button_url'] = new EE_Admin_File_Uploader_Input(
56
-			array( 'html_label_text'=>  __( 'Button URL', 'event_espresso' ))
56
+			array('html_label_text'=>  __('Button URL', 'event_espresso'))
57 57
 		);
58 58
 		$this->_subsections['PMD_scope'] = new EE_Checkbox_Multi_Input(
59 59
 			EEM_Payment_Method::instance()->scopes(),
60
-			array( 'html_label_text' => $this->_model->field_settings_for('PMD_scope')->get_nicename() . EEH_Template::get_help_tab_link( 'payment_methods_overview' ))
60
+			array('html_label_text' => $this->_model->field_settings_for('PMD_scope')->get_nicename().EEH_Template::get_help_tab_link('payment_methods_overview'))
61 61
 		);
62 62
 		//setup the currency options
63 63
 		$this->_subsections['Currency'] = new EE_Select_Multi_Model_Input(
64
-			EEM_Currency::instance()->get_all_currencies_usable_by( $this->_payment_method_type ),
64
+			EEM_Currency::instance()->get_all_currencies_usable_by($this->_payment_method_type),
65 65
 			array(
66
-				'html_label_text'=>  __( 'Currencies Supported', 'event_espresso' ),
66
+				'html_label_text'=>  __('Currencies Supported', 'event_espresso'),
67 67
 				'required'=>TRUE
68 68
 			)
69 69
 		);
70
-		$this->_subsections['PMD_order'] = new EE_Text_Input( array(
71
-			'html_label_text' => __( 'Order', 'event_espresso' ),
72
-			'html_help_text' => __( 'Lowest numbers will be shown first', 'event_espresso' ),
70
+		$this->_subsections['PMD_order'] = new EE_Text_Input(array(
71
+			'html_label_text' => __('Order', 'event_espresso'),
72
+			'html_help_text' => __('Lowest numbers will be shown first', 'event_espresso'),
73 73
 			'normalization_strategy' => new EE_Int_Normalization(),
74 74
 			'validation_strategies' => array(
75 75
 				new EE_Int_Validation_Strategy()
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
 	 * @param string 	$name
89 89
 	 * @throws EE_Error
90 90
 	 */
91
-	public function _construct_finalize( $parent_form_section, $name ) {
92
-		if( ! $this->_payment_method_type instanceof EE_PMT_Base ){
93
-			throw new EE_Error( sprintf( __( 'Payment Method forms must have set their payment method type BEFORE calling _construct_finalize', 'event_espresso' )));
91
+	public function _construct_finalize($parent_form_section, $name) {
92
+		if ( ! $this->_payment_method_type instanceof EE_PMT_Base) {
93
+			throw new EE_Error(sprintf(__('Payment Method forms must have set their payment method type BEFORE calling _construct_finalize', 'event_espresso')));
94 94
 		}
95 95
 		//set the name of this form based on the payment method type
96
-		if( ! $this->_name && ! $name ){
97
-			$name = str_replace(" ","_",ucwords(str_replace("_"," ",($this->_payment_method_type->system_name()))))."_Settings_Form";
96
+		if ( ! $this->_name && ! $name) {
97
+			$name = str_replace(" ", "_", ucwords(str_replace("_", " ", ($this->_payment_method_type->system_name()))))."_Settings_Form";
98 98
 		}
99
-		parent::_construct_finalize( $parent_form_section, $name );
99
+		parent::_construct_finalize($parent_form_section, $name);
100 100
 	}
101 101
 
102 102
 
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 * @param $payment_method_type
106 106
 	 * @throws EE_Error
107 107
 	 */
108
-	public function set_payment_method_type( $payment_method_type ){
109
-		if( ! $payment_method_type instanceof EE_PMT_Base){
108
+	public function set_payment_method_type($payment_method_type) {
109
+		if ( ! $payment_method_type instanceof EE_PMT_Base) {
110 110
 			throw new EE_Error(sprintf(__("Payment Method forms MUST set a payment method type by using _set_payment_method_type", "event_espresso")));
111 111
 		}
112 112
 		$this->_payment_method_type = $payment_method_type;
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 	 * extends the model form section's save method to also save the extra meta field values
119 119
 	 * @return int ID of the payment method inserted, or true on update
120 120
 	 */
121
-	public function save(){
121
+	public function save() {
122 122
 		$parent_save_val = parent::save();
123
-		if( $this->_model_object && $this->_model_object->ID()){
124
-			foreach($this->_extra_meta_inputs as $input_name => $input){
123
+		if ($this->_model_object && $this->_model_object->ID()) {
124
+			foreach ($this->_extra_meta_inputs as $input_name => $input) {
125 125
 				$this->_model_object->update_extra_meta($input_name, $input->normalized_value());
126 126
 			}
127 127
 		}
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 		$model_obj = $this->_model->ensure_is_obj($model_obj);
139 139
 		parent::populate_model_obj($model_obj);
140 140
 		$extra_meta = $model_obj->all_extra_meta_array();
141
-		foreach($this->_extra_meta_inputs as $input_name => $extra_meta_input){
142
-			if(isset($extra_meta[$input_name])){
141
+		foreach ($this->_extra_meta_inputs as $input_name => $extra_meta_input) {
142
+			if (isset($extra_meta[$input_name])) {
143 143
 				$extra_meta_input->set_default($extra_meta[$input_name]);
144 144
 			}
145 145
 		}
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
 	 * gets the default name of this form section if none is specified
152 152
 	 * @return string
153 153
 	 */
154
-	protected function _set_default_name_if_empty(){
155
-		if( ! $this->_name ){
156
-			$default_name = str_replace("EEM_", "", get_class($this->_model)) . "_Model_Form";
157
-			$this->_name =  $default_name;
154
+	protected function _set_default_name_if_empty() {
155
+		if ( ! $this->_name) {
156
+			$default_name = str_replace("EEM_", "", get_class($this->_model))."_Model_Form";
157
+			$this->_name = $default_name;
158 158
 		}
159 159
 	}
160 160
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 * Gets all the extra meta inputs in this form
165 165
 	 * @return EE_Form_Input_Base[]
166 166
 	 */
167
-	public function extra_meta_inputs(){
167
+	public function extra_meta_inputs() {
168 168
 		return $this->_extra_meta_inputs;
169 169
 	}
170 170
 }
Please login to merge, or discard this patch.
admin_pages/registration_form/Registration_Form_Admin_Page.core.php 2 patches
Braces   +9 added lines, -13 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
@@ -330,14 +331,9 @@  discard block
 block discarded – undo
330 331
 			else if ( $fieldName == 'QST_admin_label' && ( isset( $this->_req_data['QST_admin_label'] ) && empty( $this->_req_data['QST_admin_label'] )  )) {
331 332
 				$QST_text = isset( $this->_req_data['QST_display_text'] ) ? $this->_req_data['QST_display_text'] : '' ;
332 333
 				$set_column_values[$fieldName] = sanitize_title(wp_trim_words($QST_text,10));
333
-			}
334
-
335
-
336
-			else if ( $fieldName == 'QST_admin_only' && ( !isset( $this->_req_data['QST_admin_only'] ) ) ) {
334
+			} else if ( $fieldName == 'QST_admin_only' && ( !isset( $this->_req_data['QST_admin_only'] ) ) ) {
337 335
 				$set_column_values[$fieldName] = 0;
338
-			}
339
-
340
-			else if ( $fieldName == 'QST_max' ) {
336
+			} else if ( $fieldName == 'QST_max' ) {
341 337
 				$qst_system = EEM_Question::instance()->get_var(
342 338
 					array(
343 339
 						array(
@@ -390,7 +386,7 @@  discard block
 block discarded – undo
390 386
 			$question=$this->_question_model->get_one_by_ID($ID);
391 387
 			$additional_hidden_fields=array('QST_ID'=>array('type'=>'hidden','value'=>$ID));
392 388
 			$this->_set_add_edit_form_tags('update_question', $additional_hidden_fields);
393
-		}else{
389
+		} else{
394 390
 			$question= EE_Question::new_instance();
395 391
 			$question->set_order_to_latest();
396 392
 			$this->_set_add_edit_form_tags('insert_question');
@@ -421,7 +417,7 @@  discard block
 block discarded – undo
421 417
 			$ID=$this->_question_model->insert($set_column_values);
422 418
 			$success = $ID ? true : false;
423 419
 			$action_desc = 'added';
424
-		}else{
420
+		} else{
425 421
 			$ID=absint($this->_req_data['QST_ID']);
426 422
 			$pk=$this->_question_model->primary_key_name();
427 423
 			$wheres=array($pk=>$ID);
@@ -442,7 +438,7 @@  discard block
 block discarded – undo
442 438
 					$option_req_index=$this->_get_option_req_data_index($option_ID);
443 439
 					if($option_req_index!==FALSE){
444 440
 						$option->save($this->_req_data['question_options'][$option_req_index]);
445
-					}else{
441
+					} else{
446 442
 						//not found, remove it
447 443
 						$option->delete();
448 444
 					}
@@ -519,7 +515,7 @@  discard block
 block discarded – undo
519 515
 						'QSG_name'=>array('LIKE',"%$search_string%"),
520 516
 						'QSG_desc'=>array('LIKE',"%$search_string%"))
521 517
 					);
522
-			}else{
518
+			} else{
523 519
 				$query_params[0]=array(
524 520
 					'QST_display_text'=>array('LIKE',"%$search_string%")
525 521
 					);
@@ -575,7 +571,7 @@  discard block
 block discarded – undo
575 571
 		if ($count){
576 572
 			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
577 573
 			$results = $QST->count($where);
578
-		}else{
574
+		} else{
579 575
 			$results = $QST->get_all($query_params);
580 576
 		}
581 577
 		return $results;
Please login to merge, or discard this patch.
Spacing   +145 added lines, -145 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
 /**
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 
59 59
 
60 60
 
61
-	public function __construct( $routing = TRUE ) {
62
-		require_once( EE_MODELS . 'EEM_Question.model.php' );
63
-		require_once( EE_MODELS . 'EEM_Question_Group.model.php' );
64
-		$this->_question_model=  EEM_Question::instance();
65
-		$this->_question_group_model=EEM_Question_Group::instance();
66
-		parent::__construct( $routing );
61
+	public function __construct($routing = TRUE) {
62
+		require_once(EE_MODELS.'EEM_Question.model.php');
63
+		require_once(EE_MODELS.'EEM_Question_Group.model.php');
64
+		$this->_question_model = EEM_Question::instance();
65
+		$this->_question_group_model = EEM_Question_Group::instance();
66
+		parent::__construct($routing);
67 67
 	}
68 68
 
69 69
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
 
99 99
 	protected function _set_page_routes() {
100
-		$qst_id = ! empty( $this->_req_data['QST_ID'] ) ? $this->_req_data['QST_ID'] : 0;
100
+		$qst_id = ! empty($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0;
101 101
 		$this->_page_routes = array(
102 102
 			'default' => array(
103 103
 				'func' => '_questions_overview_list_table',
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 			'update_question' => array(
120 120
 				'func' => '_insert_or_update_question',
121
-				'args' => array('new_question' => FALSE ),
121
+				'args' => array('new_question' => FALSE),
122 122
 				'capability' => 'ee_edit_question',
123 123
 				'obj_id' => $qst_id,
124 124
 				'noheader' => TRUE,
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 						'filename' => 'registration_form_questions_overview_views_bulk_actions_search'
154 154
 						)
155 155
 					),
156
-				'help_tour' => array( 'Registration_Form_Questions_Overview_Help_Tour'),
156
+				'help_tour' => array('Registration_Form_Questions_Overview_Help_Tour'),
157 157
 				'require_nonce' => FALSE,
158 158
 				'qtips' => array(
159 159
 					'EE_Registration_Form_Tips'
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 						'filename' => 'registration_form_question_groups'
173 173
 						),
174 174
 					),
175
-				'help_tour' => array( 'Registration_Form_Question_Groups_Help_Tour'),
175
+				'help_tour' => array('Registration_Form_Question_Groups_Help_Tour'),
176 176
 				'require_nonce' => FALSE
177 177
 				),
178 178
 
@@ -181,16 +181,16 @@  discard block
 block discarded – undo
181 181
 					'label' => __('Edit Question', 'event_espresso'),
182 182
 					'order' => 15,
183 183
 					'persistent' => FALSE,
184
-					'url' => isset($this->_req_data['question_id']) ? add_query_arg(array('question_id' => $this->_req_data['question_id'] ), $this->_current_page_view_url )  : $this->_admin_base_url
184
+					'url' => isset($this->_req_data['question_id']) ? add_query_arg(array('question_id' => $this->_req_data['question_id']), $this->_current_page_view_url) : $this->_admin_base_url
185 185
 					),
186
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
186
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
187 187
 				'help_tabs' => array(
188 188
 					'registration_form_edit_question_group_help_tab' => array(
189 189
 						'title' => __('Edit Question', 'event_espresso'),
190 190
 						'filename' => 'registration_form_edit_question'
191 191
 						),
192 192
 					),
193
-                'help_tour' => array( 'Registration_Form_Edit_Question_Help_Tour'),
193
+                'help_tour' => array('Registration_Form_Edit_Question_Help_Tour'),
194 194
 				'require_nonce' => FALSE
195 195
 				),
196 196
 			);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	//none of the below group are currently used for Event Categories
219 219
 	protected function _add_feature_pointers() {}
220 220
 	public function load_scripts_styles() {
221
-		wp_register_style( 'espresso_registration', REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.css', array(), EVENT_ESPRESSO_VERSION );
221
+		wp_register_style('espresso_registration', REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.css', array(), EVENT_ESPRESSO_VERSION);
222 222
 		wp_enqueue_style('espresso_registration');
223 223
 	}
224 224
 	public function admin_init() {}
@@ -234,20 +234,20 @@  discard block
 block discarded – undo
234 234
 
235 235
 	public function load_scripts_styles_add_question() {
236 236
 		$this->load_scripts_styles_forms();
237
-		wp_register_script( 'espresso_registration_form_single', REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE );
238
-		wp_enqueue_script( 'espresso_registration_form_single' );
237
+		wp_register_script('espresso_registration_form_single', REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE);
238
+		wp_enqueue_script('espresso_registration_form_single');
239 239
 	}
240 240
 	public function load_scripts_styles_edit_question() {
241 241
 		$this->load_scripts_styles_forms();
242
-		wp_register_script( 'espresso_registration_form_single', REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE );
243
-		wp_enqueue_script( 'espresso_registration_form_single' );
242
+		wp_register_script('espresso_registration_form_single', REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, TRUE);
243
+		wp_enqueue_script('espresso_registration_form_single');
244 244
 	}
245 245
 
246 246
 
247 247
 
248 248
 
249 249
 	public function recaptcha_info_help_tab() {
250
-		$template = REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php';
250
+		$template = REGISTRATION_FORM_TEMPLATE_PATH.'recaptcha_info_help_tab.template.php';
251 251
 		EEH_Template::display_template($template, array());
252 252
 	}
253 253
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 				)
280 280
 		);
281 281
 
282
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_questions', 'espresso_registration_form_trash_questions' ) ) {
282
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions')) {
283 283
 			$this->_views['trash'] = array(
284 284
 				'slug' => 'trash',
285 285
 				'label' => __('Trash', 'event_espresso'),
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
 	 */
298 298
 	protected function _questions_groups_preview() {
299 299
 		$this->_admin_page_title = __('Question Groups (Preview)', 'event_espresso');
300
-		$this->_template_args['preview_img'] = '<img src="' . REGISTRATION_FORM_ASSETS_URL . 'caf_reg_form_preview.jpg" alt="' . esc_attr__( 'Preview Question Groups Overview List Table screenshot', 'event_espresso' ) . '" />';
301
-		$this->_template_args['preview_text'] = '<strong>'.__( 'Question Groups is a feature that is only available in the Caffeinated version of Event Espresso.  With the Question Groups feature you are able to: create new question groups, edit existing question groups, and also create and edit new questions and add them to question groups.', 'event_espresso' ).'</strong>';
302
-		$this->display_admin_caf_preview_page( 'question_groups_tab' );
300
+		$this->_template_args['preview_img'] = '<img src="'.REGISTRATION_FORM_ASSETS_URL.'caf_reg_form_preview.jpg" alt="'.esc_attr__('Preview Question Groups Overview List Table screenshot', 'event_espresso').'" />';
301
+		$this->_template_args['preview_text'] = '<strong>'.__('Question Groups is a feature that is only available in the Caffeinated version of Event Espresso.  With the Question Groups feature you are able to: create new question groups, edit existing question groups, and also create and edit new questions and add them to question groups.', 'event_espresso').'</strong>';
302
+		$this->display_admin_caf_preview_page('question_groups_tab');
303 303
 	}
304 304
 
305 305
 
@@ -310,58 +310,58 @@  discard block
 block discarded – undo
310 310
 	 * @param \EEM_Base $model
311 311
 	 * @return array where each key is the name of a model's field/db column, and each value is its value.
312 312
 	 */
313
-	protected function _set_column_values_for(EEM_Base $model){
314
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
315
-		$set_column_values=array();
313
+	protected function _set_column_values_for(EEM_Base $model) {
314
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
315
+		$set_column_values = array();
316 316
 
317 317
 		//some initial checks for proper values.
318 318
 		//if QST_admin_only, then no matter what QST_required is we disable.
319
-		if ( !empty( $this->_req_data['QST_admin_only'] ) ) {
319
+		if ( ! empty($this->_req_data['QST_admin_only'])) {
320 320
 			$this->_req_data['QST_required'] = 0;
321 321
 		}
322
-		foreach($model->field_settings() as $fieldName=>$settings){
322
+		foreach ($model->field_settings() as $fieldName=>$settings) {
323 323
 			// basically if QSG_identifier is empty or not set
324
-			if ( $fieldName == 'QSG_identifier' && ( isset( $this->_req_data['QSG_identifier'] ) && empty( $this->_req_data['QSG_identifier'] ) )) {
325
-				$QSG_name = isset( $this->_req_data['QSG_name'] ) ? $this->_req_data['QSG_name'] : '' ;
326
-				$set_column_values[$fieldName] = sanitize_title($QSG_name ) . '-' . uniqid();
324
+			if ($fieldName == 'QSG_identifier' && (isset($this->_req_data['QSG_identifier']) && empty($this->_req_data['QSG_identifier']))) {
325
+				$QSG_name = isset($this->_req_data['QSG_name']) ? $this->_req_data['QSG_name'] : '';
326
+				$set_column_values[$fieldName] = sanitize_title($QSG_name).'-'.uniqid();
327 327
 //				dd($set_column_values);
328 328
 			}
329 329
 			//if the admin label is blank, use a slug version of the question text
330
-			else if ( $fieldName == 'QST_admin_label' && ( isset( $this->_req_data['QST_admin_label'] ) && empty( $this->_req_data['QST_admin_label'] )  )) {
331
-				$QST_text = isset( $this->_req_data['QST_display_text'] ) ? $this->_req_data['QST_display_text'] : '' ;
332
-				$set_column_values[$fieldName] = sanitize_title(wp_trim_words($QST_text,10));
330
+			else if ($fieldName == 'QST_admin_label' && (isset($this->_req_data['QST_admin_label']) && empty($this->_req_data['QST_admin_label']))) {
331
+				$QST_text = isset($this->_req_data['QST_display_text']) ? $this->_req_data['QST_display_text'] : '';
332
+				$set_column_values[$fieldName] = sanitize_title(wp_trim_words($QST_text, 10));
333 333
 			}
334 334
 
335 335
 
336
-			else if ( $fieldName == 'QST_admin_only' && ( !isset( $this->_req_data['QST_admin_only'] ) ) ) {
336
+			else if ($fieldName == 'QST_admin_only' && ( ! isset($this->_req_data['QST_admin_only']))) {
337 337
 				$set_column_values[$fieldName] = 0;
338 338
 			}
339 339
 
340
-			else if ( $fieldName == 'QST_max' ) {
340
+			else if ($fieldName == 'QST_max') {
341 341
 				$qst_system = EEM_Question::instance()->get_var(
342 342
 					array(
343 343
 						array(
344
-							'QST_ID' => isset( $this->_req_data[ 'QST_ID' ] ) ? $this->_req_data[ 'QST_ID' ] : 0
344
+							'QST_ID' => isset($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0
345 345
 						)
346 346
 					),
347 347
 					'QST_system' );
348
-				$max_max = EEM_Question::instance()->absolute_max_for_system_question( $qst_system );
349
-				if( empty( $this->_req_data[ 'QST_max' ] ) ||
350
-					 $this->_req_data[ 'QST_max' ] > $max_max ) {
351
-					$set_column_values[ $fieldName ] = $max_max;
348
+				$max_max = EEM_Question::instance()->absolute_max_for_system_question($qst_system);
349
+				if (empty($this->_req_data['QST_max']) ||
350
+					 $this->_req_data['QST_max'] > $max_max) {
351
+					$set_column_values[$fieldName] = $max_max;
352 352
 				}
353 353
 			}
354 354
 
355 355
 
356 356
 			//only add a property to the array if it's not null (otherwise the model should just use the default value)
357
-			if(
358
-				! isset( $set_column_values[ $fieldName ] ) &&
359
-				isset($this->_req_data[$fieldName] ) ){
360
-				$set_column_values[$fieldName]=$this->_req_data[$fieldName];
357
+			if (
358
+				! isset($set_column_values[$fieldName]) &&
359
+				isset($this->_req_data[$fieldName]) ) {
360
+				$set_column_values[$fieldName] = $this->_req_data[$fieldName];
361 361
 			}
362 362
 
363 363
 		}
364
-		return $set_column_values;//validation fo this data to be performed by the model before insertion.
364
+		return $set_column_values; //validation fo this data to be performed by the model before insertion.
365 365
 	}
366 366
 
367 367
 
@@ -379,30 +379,30 @@  discard block
 block discarded – undo
379 379
 	/**
380 380
 	 * @param string $action
381 381
 	 */
382
-	protected function _edit_question( $action= 'add' ) {
383
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
384
-		$ID=isset( $this->_req_data['QST_ID'] ) && ! empty( $this->_req_data['QST_ID'] ) ? absint( $this->_req_data['QST_ID'] ) : FALSE;
382
+	protected function _edit_question($action = 'add') {
383
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
384
+		$ID = isset($this->_req_data['QST_ID']) && ! empty($this->_req_data['QST_ID']) ? absint($this->_req_data['QST_ID']) : FALSE;
385 385
 
386
-		$this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action ));
386
+		$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
387 387
 		// add PRC_ID to title if editing
388
-		$this->_admin_page_title = $ID ? $this->_admin_page_title . ' # ' . $ID : $this->_admin_page_title;
389
-		if($ID){
390
-			$question=$this->_question_model->get_one_by_ID($ID);
391
-			$additional_hidden_fields=array('QST_ID'=>array('type'=>'hidden','value'=>$ID));
388
+		$this->_admin_page_title = $ID ? $this->_admin_page_title.' # '.$ID : $this->_admin_page_title;
389
+		if ($ID) {
390
+			$question = $this->_question_model->get_one_by_ID($ID);
391
+			$additional_hidden_fields = array('QST_ID'=>array('type'=>'hidden', 'value'=>$ID));
392 392
 			$this->_set_add_edit_form_tags('update_question', $additional_hidden_fields);
393
-		}else{
394
-			$question= EE_Question::new_instance();
393
+		} else {
394
+			$question = EE_Question::new_instance();
395 395
 			$question->set_order_to_latest();
396 396
 			$this->_set_add_edit_form_tags('insert_question');
397 397
 		}
398
-		$question_types = $question->has_answers() ?  $this->_question_model->question_types_in_same_category( $question->type() ) : $this->_question_model->allowed_question_types();
399
-		$this->_template_args['QST_ID']=$ID;
400
-		$this->_template_args['question']=$question;
401
-		$this->_template_args['question_types']= $question_types;
402
-		$this->_template_args['max_max'] = EEM_Question::instance()->absolute_max_for_system_question( $question->system_ID() );
398
+		$question_types = $question->has_answers() ? $this->_question_model->question_types_in_same_category($question->type()) : $this->_question_model->allowed_question_types();
399
+		$this->_template_args['QST_ID'] = $ID;
400
+		$this->_template_args['question'] = $question;
401
+		$this->_template_args['question_types'] = $question_types;
402
+		$this->_template_args['max_max'] = EEM_Question::instance()->absolute_max_for_system_question($question->system_ID());
403 403
 
404
-		$this->_set_publish_post_box_vars( 'id', $ID );
405
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php', $this->_template_args, TRUE );
404
+		$this->_set_publish_post_box_vars('id', $ID);
405
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH.'questions_main_meta_box.template.php', $this->_template_args, TRUE);
406 406
 
407 407
 		// the details template wrapper
408 408
 		$this->display_admin_page_with_sidebar();
@@ -414,58 +414,58 @@  discard block
 block discarded – undo
414 414
 	 * @param bool|true $new_question
415 415
 	 * @throws \EE_Error
416 416
 	 */
417
-	protected function _insert_or_update_question( $new_question = TRUE) {
418
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
419
-		$set_column_values=$this->_set_column_values_for($this->_question_model);
420
-		if($new_question){
421
-			$ID=$this->_question_model->insert($set_column_values);
417
+	protected function _insert_or_update_question($new_question = TRUE) {
418
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
419
+		$set_column_values = $this->_set_column_values_for($this->_question_model);
420
+		if ($new_question) {
421
+			$ID = $this->_question_model->insert($set_column_values);
422 422
 			$success = $ID ? true : false;
423 423
 			$action_desc = 'added';
424
-		}else{
425
-			$ID=absint($this->_req_data['QST_ID']);
426
-			$pk=$this->_question_model->primary_key_name();
427
-			$wheres=array($pk=>$ID);
424
+		} else {
425
+			$ID = absint($this->_req_data['QST_ID']);
426
+			$pk = $this->_question_model->primary_key_name();
427
+			$wheres = array($pk=>$ID);
428 428
 			unset($set_column_values[$pk]);
429
-			$success= $this->_question_model->update($set_column_values,array($wheres));
430
-			$action_desc='updated';
429
+			$success = $this->_question_model->update($set_column_values, array($wheres));
430
+			$action_desc = 'updated';
431 431
 		}
432 432
 
433
-		if ($ID){
433
+		if ($ID) {
434 434
 			//save the related options
435 435
 			//trash removed options, save old ones
436 436
 			//get list of all options
437 437
 			/** @type EE_Question $question */
438
-			$question=$this->_question_model->get_one_by_ID($ID);
439
-			$options=$question->options();
440
-			if(! empty($options)){
441
-				foreach($options as $option_ID=>$option){
442
-					$option_req_index=$this->_get_option_req_data_index($option_ID);
443
-					if($option_req_index!==FALSE){
438
+			$question = $this->_question_model->get_one_by_ID($ID);
439
+			$options = $question->options();
440
+			if ( ! empty($options)) {
441
+				foreach ($options as $option_ID=>$option) {
442
+					$option_req_index = $this->_get_option_req_data_index($option_ID);
443
+					if ($option_req_index !== FALSE) {
444 444
 						$option->save($this->_req_data['question_options'][$option_req_index]);
445
-					}else{
445
+					} else {
446 446
 						//not found, remove it
447 447
 						$option->delete();
448 448
 					}
449 449
 				}
450 450
 			}
451 451
 			//save new related options
452
-			foreach($this->_req_data['question_options'] as $index=>$option_req_data){
453
-				if( empty($option_req_data['QSO_ID'] ) && (  ( isset( $option_req_data['QSO_value'] ) && $option_req_data['QSO_value'] !== '' ) || ! empty( $option_req_data['QSO_desc'] ) ) ) {//no ID! save it!
454
-					if( ! isset( $option_req_data['QSO_value'] ) || $option_req_data['QSO_value'] === ''  ){
455
-						$option_req_data['QSO_value']=$option_req_data['QSO_desc'];
452
+			foreach ($this->_req_data['question_options'] as $index=>$option_req_data) {
453
+				if (empty($option_req_data['QSO_ID']) && ((isset($option_req_data['QSO_value']) && $option_req_data['QSO_value'] !== '') || ! empty($option_req_data['QSO_desc']))) {//no ID! save it!
454
+					if ( ! isset($option_req_data['QSO_value']) || $option_req_data['QSO_value'] === '') {
455
+						$option_req_data['QSO_value'] = $option_req_data['QSO_desc'];
456 456
 					}
457
-					$new_option=EE_Question_Option::new_instance( array( 'QSO_value' => $option_req_data['QSO_value'], 'QSO_desc' => $option_req_data['QSO_desc'], 'QSO_order' => $option_req_data['QSO_order'], 'QST_ID' => $question->ID()));
457
+					$new_option = EE_Question_Option::new_instance(array('QSO_value' => $option_req_data['QSO_value'], 'QSO_desc' => $option_req_data['QSO_desc'], 'QSO_order' => $option_req_data['QSO_order'], 'QST_ID' => $question->ID()));
458 458
 					$new_option->save();
459 459
 				}
460 460
 			}
461 461
 		}
462
-		$query_args = array( 'action' => 'edit_question', 'QST_ID' => $ID );
463
-		if ( $success !== FALSE ) {
464
-			$msg = $new_question ? sprintf( __('The %s has been created', 'event_espresso'), $this->_question_model->item_name() ) : sprintf( __('The %s has been updated', 'event_espresso' ), $this->_question_model->item_name() );
465
-			EE_Error::add_success( $msg );
462
+		$query_args = array('action' => 'edit_question', 'QST_ID' => $ID);
463
+		if ($success !== FALSE) {
464
+			$msg = $new_question ? sprintf(__('The %s has been created', 'event_espresso'), $this->_question_model->item_name()) : sprintf(__('The %s has been updated', 'event_espresso'), $this->_question_model->item_name());
465
+			EE_Error::add_success($msg);
466 466
 		}
467 467
 
468
-		$this->_redirect_after_action( FALSE, '', $action_desc, $query_args, TRUE);
468
+		$this->_redirect_after_action(FALSE, '', $action_desc, $query_args, TRUE);
469 469
 	}
470 470
 
471 471
 
@@ -478,10 +478,10 @@  discard block
 block discarded – undo
478 478
 	 * @param int $ID of the question option to find
479 479
 	 * @return int index in question_options array if successful, FALSE if unsuccessful
480 480
 	 */
481
-	protected function _get_option_req_data_index($ID){
482
-		$req_data_for_question_options=$this->_req_data['question_options'];
483
-		foreach($req_data_for_question_options as $num=>$option_data){
484
-			if(array_key_exists('QSO_ID',$option_data) && intval($option_data['QSO_ID'])==$ID){
481
+	protected function _get_option_req_data_index($ID) {
482
+		$req_data_for_question_options = $this->_req_data['question_options'];
483
+		foreach ($req_data_for_question_options as $num=>$option_data) {
484
+			if (array_key_exists('QSO_ID', $option_data) && intval($option_data['QSO_ID']) == $ID) {
485 485
 				return $num;
486 486
 			}
487 487
 		}
@@ -503,25 +503,25 @@  discard block
 block discarded – undo
503 503
 	 * @param int      $current_page
504 504
 	 * @return array lik EEM_Base::get_all's $query_params parameter
505 505
 	 */
506
-	protected function get_query_params($model, $per_page=10,$current_page=10){
506
+	protected function get_query_params($model, $per_page = 10, $current_page = 10) {
507 507
 		$query_params = array();
508
-		$offset=($current_page-1)*$per_page;
509
-		$query_params['limit']=array($offset,$per_page);
510
-		$order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
508
+		$offset = ($current_page - 1) * $per_page;
509
+		$query_params['limit'] = array($offset, $per_page);
510
+		$order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
511 511
 		$orderby_field = $model instanceof EEM_Question ? 'QST_ID' : 'QSG_order';
512 512
 		$field_to_order_by = empty($this->_req_data['orderby']) ? $orderby_field : $this->_req_data['orderby'];
513
-		$query_params['order_by']=array( $field_to_order_by => $order );
514
-		$search_string = array_key_exists('s',$this->_req_data) ? $this->_req_data['s'] : null;
515
-		if(! empty($search_string)){
516
-			if($model instanceof EEM_Question_Group){
517
-				$query_params[0]=array(
513
+		$query_params['order_by'] = array($field_to_order_by => $order);
514
+		$search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null;
515
+		if ( ! empty($search_string)) {
516
+			if ($model instanceof EEM_Question_Group) {
517
+				$query_params[0] = array(
518 518
 					'OR'=>array(
519
-						'QSG_name'=>array('LIKE',"%$search_string%"),
520
-						'QSG_desc'=>array('LIKE',"%$search_string%"))
519
+						'QSG_name'=>array('LIKE', "%$search_string%"),
520
+						'QSG_desc'=>array('LIKE', "%$search_string%"))
521 521
 					);
522
-			}else{
523
-				$query_params[0]=array(
524
-					'QST_display_text'=>array('LIKE',"%$search_string%")
522
+			} else {
523
+				$query_params[0] = array(
524
+					'QST_display_text'=>array('LIKE', "%$search_string%")
525 525
 					);
526 526
 			}
527 527
 		}
@@ -569,13 +569,13 @@  discard block
 block discarded – undo
569 569
 	 * @param bool|false $count
570 570
 	 * @return \EE_Soft_Delete_Base_Class[]|int
571 571
 	 */
572
-	public function get_questions( $per_page=10, $current_page = 1, $count = FALSE ) {
572
+	public function get_questions($per_page = 10, $current_page = 1, $count = FALSE) {
573 573
 		$QST = EEM_Question::instance();
574 574
 		$query_params = $this->get_query_params($QST, $per_page, $current_page);
575
-		if ($count){
576
-			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
575
+		if ($count) {
576
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
577 577
 			$results = $QST->count($where);
578
-		}else{
578
+		} else {
579 579
 			$results = $QST->get_all($query_params);
580 580
 		}
581 581
 		return $results;
@@ -590,10 +590,10 @@  discard block
 block discarded – undo
590 590
 	 * @param bool|false $count
591 591
 	 * @return \EE_Soft_Delete_Base_Class[]|int
592 592
 	 */
593
-	public function get_trashed_questions( $per_page, $current_page = 1, $count = FALSE ) {
594
-		$query_params =$this->get_query_params( EEM_Question::instance(), $per_page, $current_page);
595
-		$where        = isset( $query_params[0] ) ? array($query_params[0]) : array();
596
-		$questions    =$count ? EEM_Question::instance()->count_deleted($where) : EEM_Question::instance()->get_all_deleted($query_params);
593
+	public function get_trashed_questions($per_page, $current_page = 1, $count = FALSE) {
594
+		$query_params = $this->get_query_params(EEM_Question::instance(), $per_page, $current_page);
595
+		$where        = isset($query_params[0]) ? array($query_params[0]) : array();
596
+		$questions    = $count ? EEM_Question::instance()->count_deleted($where) : EEM_Question::instance()->get_all_deleted($query_params);
597 597
 		return $questions;
598 598
 	}
599 599
 
@@ -605,11 +605,11 @@  discard block
 block discarded – undo
605 605
 	 * @param bool|false $count
606 606
 	 * @return \EE_Soft_Delete_Base_Class[]
607 607
 	 */
608
-	public function get_question_groups( $per_page, $current_page = 1, $count = FALSE ) {
608
+	public function get_question_groups($per_page, $current_page = 1, $count = FALSE) {
609 609
 		/** @type EEM_Question_Group $questionGroupModel */
610
-		$questionGroupModel=EEM_Question_Group::instance();
611
-		$query_params=$this->get_query_params( $questionGroupModel, $per_page, $current_page );
612
-		$questionGroups=$questionGroupModel->get_all($query_params);//note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items
610
+		$questionGroupModel = EEM_Question_Group::instance();
611
+		$query_params = $this->get_query_params($questionGroupModel, $per_page, $current_page);
612
+		$questionGroups = $questionGroupModel->get_all($query_params); //note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items
613 613
 		return $questionGroups;
614 614
 	}
615 615
 
@@ -626,36 +626,36 @@  discard block
 block discarded – undo
626 626
 
627 627
 		$this->_template_args['values'] = $this->_yes_no_values;
628 628
 
629
-		$this->_template_args['use_captcha'] = isset( EE_Registry::instance()->CFG->registration->use_captcha ) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE;
630
-		$this->_template_args['show_captcha_settings'] = $this->_template_args['use_captcha'] ? 'style="display:table-row;"': '';
629
+		$this->_template_args['use_captcha'] = isset(EE_Registry::instance()->CFG->registration->use_captcha) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE;
630
+		$this->_template_args['show_captcha_settings'] = $this->_template_args['use_captcha'] ? 'style="display:table-row;"' : '';
631 631
 
632
-		$this->_template_args['recaptcha_publickey'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_publickey ) ? stripslashes( EE_Registry::instance()->CFG->registration->recaptcha_publickey ) : '';
633
-		$this->_template_args['recaptcha_privatekey'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_privatekey ) ? stripslashes( EE_Registry::instance()->CFG->registration->recaptcha_privatekey ) : '';
634
-		$this->_template_args['recaptcha_width'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_width ) ? absint( EE_Registry::instance()->CFG->registration->recaptcha_width ) : 500;
632
+		$this->_template_args['recaptcha_publickey'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_publickey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_publickey) : '';
633
+		$this->_template_args['recaptcha_privatekey'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) : '';
634
+		$this->_template_args['recaptcha_width'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_width) ? absint(EE_Registry::instance()->CFG->registration->recaptcha_width) : 500;
635 635
 
636 636
 		$this->_template_args['recaptcha_theme_options'] = array(
637
-				array('id'  => 'red','text'=> __('Red', 'event_espresso')),
638
-				array('id'  => 'white','text'=> __('White', 'event_espresso')),
639
-				array('id'  => 'blackglass','text'=> __('Blackglass', 'event_espresso')),
640
-				array('id'  => 'clean','text'=> __('Clean', 'event_espresso'))
637
+				array('id'  => 'red', 'text'=> __('Red', 'event_espresso')),
638
+				array('id'  => 'white', 'text'=> __('White', 'event_espresso')),
639
+				array('id'  => 'blackglass', 'text'=> __('Blackglass', 'event_espresso')),
640
+				array('id'  => 'clean', 'text'=> __('Clean', 'event_espresso'))
641 641
 			);
642
-		$this->_template_args['recaptcha_theme'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_theme ) ? EE_Registry::instance()->CFG->registration->get_pretty( 'recaptcha_theme' ) : 'clean';
642
+		$this->_template_args['recaptcha_theme'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_theme) ? EE_Registry::instance()->CFG->registration->get_pretty('recaptcha_theme') : 'clean';
643 643
 
644 644
 		$this->_template_args['recaptcha_language_options'] = array(
645
-				array('id'  => 'en','text'=> __('English', 'event_espresso')),
646
-				array('id'  => 'es','text'=> __('Spanish', 'event_espresso')),
647
-				array('id'  => 'nl','text'=> __('Dutch', 'event_espresso')),
648
-				array('id'  => 'fr','text'=> __('French', 'event_espresso')),
649
-				array('id'  => 'de','text'=> __('German', 'event_espresso')),
650
-				array('id'  => 'pt','text'=> __('Portuguese', 'event_espresso')),
651
-				array('id'  => 'ru','text'=> __('Russian', 'event_espresso')),
652
-				array('id'  => 'tr','text'=> __('Turkish', 'event_espresso'))
645
+				array('id'  => 'en', 'text'=> __('English', 'event_espresso')),
646
+				array('id'  => 'es', 'text'=> __('Spanish', 'event_espresso')),
647
+				array('id'  => 'nl', 'text'=> __('Dutch', 'event_espresso')),
648
+				array('id'  => 'fr', 'text'=> __('French', 'event_espresso')),
649
+				array('id'  => 'de', 'text'=> __('German', 'event_espresso')),
650
+				array('id'  => 'pt', 'text'=> __('Portuguese', 'event_espresso')),
651
+				array('id'  => 'ru', 'text'=> __('Russian', 'event_espresso')),
652
+				array('id'  => 'tr', 'text'=> __('Turkish', 'event_espresso'))
653 653
 			);
654
-		$this->_template_args['recaptcha_language'] = isset( EE_Registry::instance()->CFG->registration->recaptcha_language ) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en';
654
+		$this->_template_args['recaptcha_language'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_language) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en';
655 655
 
656
-		$this->_set_add_edit_form_tags( 'update_reg_form_settings' );
657
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
658
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_TEMPLATE_PATH . 'reg_form_settings.template.php', $this->_template_args, TRUE );
656
+		$this->_set_add_edit_form_tags('update_reg_form_settings');
657
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
658
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH.'reg_form_settings.template.php', $this->_template_args, TRUE);
659 659
 		$this->display_admin_page_with_sidebar();
660 660
 	}
661 661
 
Please login to merge, or discard this patch.