Completed
Branch FET-8347-separate-logging (f2247f)
by
unknown
43:49 queued 34:52
created
admin/extend/events/templates/event_datetime_timezones.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php if ( EE_Registry::instance()->CFG->admin->use_event_timezones ) : ?>
1
+<?php if (EE_Registry::instance()->CFG->admin->use_event_timezones) : ?>
2 2
 <div id="timezones-datetimes-dv" class="">
3 3
 	<span class="run-in"> <?php _e('Current Time for Event Timezone:', 'event_espresso'); ?> </span>
4 4
 	<span class="current-date"> <?php echo $current_date; ?></span>
Please login to merge, or discard this patch.
admin/extend/events/templates/event_registration_options.template.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 block discarded – undo
6 6
 <?php
7 7
 	$settings_array = array(
8 8
 		'max_registrants' => '<p>
9
-			<label for="max-registrants">' .  __('Maximum number of tickets allowed per order for this event: ', 'event_espresso') . '</label>
10
-			<input class="ee-numeric" type="text" id="max-registrants" name="additional_limit" value="' . $additional_limit . '" size="4" />
9
+			<label for="max-registrants">' .  __('Maximum number of tickets allowed per order for this event: ', 'event_espresso').'</label>
10
+			<input class="ee-numeric" type="text" id="max-registrants" name="additional_limit" value="' . $additional_limit.'" size="4" />
11 11
 			</p>',
12 12
 		'additional_registration_options' => $additional_registration_options,
13 13
 		'display_ticket_selector' => '<p>
14
-			<label>' . __('Display Ticket Selector', 'event_espresso') . '</label>' . $display_ticket_selector . '</p>',
14
+			<label>' . __('Display Ticket Selector', 'event_espresso').'</label>'.$display_ticket_selector.'</p>',
15 15
 		'alternative_registration_page' => '<p>
16
-			<label>' . __('Alternative Registration Page', 'event_espresso') . '</label>
17
-			<input name="externalURL" size="20" type="text" value="' . $_event->external_url() . '">
16
+			<label>' . __('Alternative Registration Page', 'event_espresso').'</label>
17
+			<input name="externalURL" size="20" type="text" value="' . $_event->external_url().'">
18 18
 			</p>',
19 19
 		'event_phone_number' => '<p>
20
-			<label>' . __('Event Phone Number', 'event_espresso') . '</label>
21
-			<input name="event_phone" size="20" type="text" value="' . $_event->phone() . '">
20
+			<label>' . __('Event Phone Number', 'event_espresso').'</label>
21
+			<input name="event_phone" size="20" type="text" value="' . $_event->phone().'">
22 22
 			</p>',
23 23
 		'default_registration_status' => '<p>
24
-			<label>' . __('Default Registration Status', 'event_espresso') . '</label>' . $EVT_default_registration_status . '</p>'
24
+			<label>' . __('Default Registration Status', 'event_espresso').'</label>'.$EVT_default_registration_status.'</p>'
25 25
 		);
26 26
 	//filter
27
-	$settings_array = apply_filters( 'FHEE__caffeinated_event_registration_options__template__settings', $settings_array );
27
+	$settings_array = apply_filters('FHEE__caffeinated_event_registration_options__template__settings', $settings_array);
28 28
 
29 29
 	//echo
30
-	foreach ( $settings_array as $item ) {
30
+	foreach ($settings_array as $item) {
31 31
 		echo $item;
32 32
 	}
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/templates/import_page.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <div class="import-area">
2 2
 	<div class="important-notice">
3
-		<?php _e( 'The import feature has been disabled because of bugs. It is expected to be put back in place soon.', 'event_espresso' );?>
3
+		<?php _e('The import feature has been disabled because of bugs. It is expected to be put back in place soon.', 'event_espresso'); ?>
4 4
 	</div>
5 5
 <?php // echo $form?>
6 6
 </div>
Please login to merge, or discard this patch.
admin/extend/general_settings/Extend_General_Settings_Admin_Page.core.php 2 patches
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -32,30 +32,30 @@  discard block
 block discarded – undo
32 32
 
33 33
 
34 34
 
35
-	public function __construct( $routing = TRUE ) {
36
-		parent::__construct( $routing );
37
-		define( 'GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/' );
35
+	public function __construct($routing = TRUE) {
36
+		parent::__construct($routing);
37
+		define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'general_settings/templates/');
38 38
 	}
39 39
 
40 40
 
41 41
 
42 42
 	protected function _extend_page_config() {
43 43
 
44
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings';
44
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'general_settings';
45 45
 
46 46
 		//filters and action hooks here
47
-		add_action('AHEE__admin_option_settings__template__before', array( $this, 'use_venue_and_staff_manager_settings'), 10 );
48
-		add_action( 'AHEE__admin_option_settings__template__before', array( $this, 'debug_logging_options' ), 9 );
49
-		add_filter( 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', array( $this, 'update_debug_logging_options' ), 10, 1 );
47
+		add_action('AHEE__admin_option_settings__template__before', array($this, 'use_venue_and_staff_manager_settings'), 10);
48
+		add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9);
49
+		add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', array($this, 'update_debug_logging_options'), 10, 1);
50 50
 
51 51
 	}
52 52
 
53 53
 
54 54
 
55
-	public function use_venue_and_staff_manager_settings( $template_args ) {
56
-		$_args['use_personnel_manager_select'] = EEH_Form_Fields::select_input('use_personnel_manager', $template_args['values'], $template_args['use_personnel_manager'] );
57
-		$template = GEN_SET_CAF_TEMPLATE_PATH . 'use_venue_and_staff_manager_settings.template.php';
58
-		EEH_Template::display_template( $template, $_args );
55
+	public function use_venue_and_staff_manager_settings($template_args) {
56
+		$_args['use_personnel_manager_select'] = EEH_Form_Fields::select_input('use_personnel_manager', $template_args['values'], $template_args['use_personnel_manager']);
57
+		$template = GEN_SET_CAF_TEMPLATE_PATH.'use_venue_and_staff_manager_settings.template.php';
58
+		EEH_Template::display_template($template, $_args);
59 59
 	}
60 60
 
61 61
 
@@ -72,31 +72,31 @@  discard block
 block discarded – undo
72 72
 	 * @param bool $show_errors
73 73
 	 * @return bool
74 74
 	 */
75
-	protected function _request_filesystem_credentials( $show_errors = TRUE ) {
76
-
77
-		require_once( ABSPATH . 'wp-admin/includes/file.php' );
78
-		$url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'request_filesystem_credentials' ), $this->_admin_base_url );
79
-		$credentials = request_filesystem_credentials( $url );
80
-		if ( $credentials == FALSE ) {
81
-			if ( $show_errors ) {
82
-				EE_Error::get_notices( FALSE );
75
+	protected function _request_filesystem_credentials($show_errors = TRUE) {
76
+
77
+		require_once(ABSPATH.'wp-admin/includes/file.php');
78
+		$url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'request_filesystem_credentials'), $this->_admin_base_url);
79
+		$credentials = request_filesystem_credentials($url);
80
+		if ($credentials == FALSE) {
81
+			if ($show_errors) {
82
+				EE_Error::get_notices(FALSE);
83 83
 				EE_Error::reset_notices();
84
-				EE_Error::add_error( __('Connection settings are missing or incorrect. Please verify that the connection settings below are correct.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
85
-				add_filter( 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false' );
84
+				EE_Error::add_error(__('Connection settings are missing or incorrect. Please verify that the connection settings below are correct.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
85
+				add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false');
86 86
 			}
87 87
 			return FALSE;
88 88
 		}
89 89
 		// now we have some credentials, try to get the wp_filesystem running
90
-		$WP_Filesystem = WP_Filesystem( $credentials );
91
-		if ( ! $WP_Filesystem ) {
92
-			if ( $show_errors ) {
93
-				EE_Error::get_notices( FALSE );
90
+		$WP_Filesystem = WP_Filesystem($credentials);
91
+		if ( ! $WP_Filesystem) {
92
+			if ($show_errors) {
93
+				EE_Error::get_notices(FALSE);
94 94
 				EE_Error::reset_notices();
95
-				EE_Error::add_error( __('There was an error connecting to the server. Please verify that the connection settings below are correct.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
96
-				add_filter( 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false' );
95
+				EE_Error::add_error(__('There was an error connecting to the server. Please verify that the connection settings below are correct.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
96
+				add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false');
97 97
 			}
98 98
 			// our credentials were no good, ask the user for them again
99
-			request_filesystem_credentials( $url );
99
+			request_filesystem_credentials($url);
100 100
 			return FALSE;
101 101
 		}
102 102
 		EE_Registry::instance()->CFG->admin->use_full_logging = TRUE;
@@ -111,21 +111,21 @@  discard block
 block discarded – undo
111 111
 	 * @param array $template_args
112 112
 	 * @return void
113 113
 	 */
114
-	public function debug_logging_options( $template_args = array() ) {
115
-		if ( EE_Registry::instance()->CFG->admin->use_full_logging === NULL ) {
116
-			$this->_request_filesystem_credentials( FALSE );
114
+	public function debug_logging_options($template_args = array()) {
115
+		if (EE_Registry::instance()->CFG->admin->use_full_logging === NULL) {
116
+			$this->_request_filesystem_credentials(FALSE);
117 117
 			$template_args['use_full_logging'] = TRUE;
118
-			EE_Error::get_notices( FALSE );
118
+			EE_Error::get_notices(FALSE);
119 119
 			EE_Error::reset_notices();
120
-			EE_Error::add_attention( __('In order to enable Full Logging, the connection settings below are required.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
120
+			EE_Error::add_attention(__('In order to enable Full Logging, the connection settings below are required.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
121 121
 			echo EE_Error::get_notices();
122 122
 		} else {
123 123
 			$template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging;
124 124
 		}
125
-		$template_args['use_remote_logging'] = isset( EE_Registry::instance()->CFG->admin->use_remote_logging ) ? absint( EE_Registry::instance()->CFG->admin->use_remote_logging ) : FALSE;
126
-		$template_args['remote_logging_url'] = isset( EE_Registry::instance()->CFG->admin->remote_logging_url ) && ! empty( EE_Registry::instance()->CFG->admin->remote_logging_url ) ? stripslashes( EE_Registry::instance()->CFG->admin->remote_logging_url ) : '';
127
-		$template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php';
128
-		EEH_Template::display_template( $template, $template_args );
125
+		$template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : FALSE;
126
+		$template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : '';
127
+		$template = GEN_SET_CAF_TEMPLATE_PATH.'debug_log_settings.template.php';
128
+		EEH_Template::display_template($template, $template_args);
129 129
 	}
130 130
 
131 131
 
@@ -136,24 +136,24 @@  discard block
 block discarded – undo
136 136
 	 * @param array $admin_options
137 137
 	 * @return array
138 138
 	 */
139
-	public function update_debug_logging_options( $admin_options = array() ) {
140
-		$use_full_logging = isset( $this->_req_data['use_full_logging'] ) ? (bool)absint( $this->_req_data['use_full_logging'] ) : $admin_options->use_full_logging;
139
+	public function update_debug_logging_options($admin_options = array()) {
140
+		$use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool) absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging;
141 141
 		// trying to enable full logging for the first time?
142
-		if ( $use_full_logging && $use_full_logging !== $admin_options->use_full_logging ) {
142
+		if ($use_full_logging && $use_full_logging !== $admin_options->use_full_logging) {
143 143
 			$admin_options->use_full_logging = $this->_request_filesystem_credentials() ? TRUE : NULL;
144
-			if ( $admin_options->use_full_logging === NULL ) {
145
-				add_filter( 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false' );
144
+			if ($admin_options->use_full_logging === NULL) {
145
+				add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false');
146 146
 			}
147 147
 		} else {
148 148
 			$admin_options->use_full_logging = $use_full_logging;
149 149
 		}
150
-		if ( $use_full_logging === FALSE ) {
151
-			EE_Error::get_notices( FALSE );
150
+		if ($use_full_logging === FALSE) {
151
+			EE_Error::get_notices(FALSE);
152 152
 			EE_Error::reset_notices();
153 153
 		}
154 154
 
155
-		$admin_options->use_remote_logging = isset( $this->_req_data['use_remote_logging'] ) ? absint( $this->_req_data['use_remote_logging'] ) : $admin_options->use_remote_logging;
156
-		$admin_options->remote_logging_url = isset( $this->_req_data['remote_logging_url'] ) ? esc_url_raw( $this->_req_data['remote_logging_url'] ) : $admin_options->remote_logging_url;
155
+		$admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint($this->_req_data['use_remote_logging']) : $admin_options->use_remote_logging;
156
+		$admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw($this->_req_data['remote_logging_url']) : $admin_options->remote_logging_url;
157 157
 		return $admin_options;
158 158
 	}
159 159
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
admin/extend/general_settings/templates/debug_log_settings.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 				<?php echo EEH_Template::get_help_tab_link('full_logging_info'); ?>
12 12
 			</th>
13 13
 			<td>
14
-				<?php echo EEH_Form_Fields::select_input('use_full_logging', $values, $use_full_logging ); ?>
14
+				<?php echo EEH_Form_Fields::select_input('use_full_logging', $values, $use_full_logging); ?>
15 15
 				<p class="description">
16 16
 					<span class="reminder-spn">
17 17
 						<?php _e('Please use caution when using this feature. These files may be publicly available.', 'event_espresso'); ?>
18 18
 					</span><br/>
19
-					<?php echo sprintf( __('Once saved, this file will be available at: %s', 'event_espresso'), '<br /><b>/wp-content/uploads/espresso/logs/' . EE_Registry::instance()->CFG->admin->log_file_name() . '</b>' ); ?>
19
+					<?php echo sprintf(__('Once saved, this file will be available at: %s', 'event_espresso'), '<br /><b>/wp-content/uploads/espresso/logs/'.EE_Registry::instance()->CFG->admin->log_file_name().'</b>'); ?>
20 20
 				</p>
21 21
 
22 22
 			</td>
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 				<?php echo EEH_Template::get_help_tab_link('remote_logging_info'); ?>
29 29
 			</th>
30 30
 			<td>
31
-				<?php echo EEH_Form_Fields::select_input('use_remote_logging', $values, $use_remote_logging ); ?>
31
+				<?php echo EEH_Form_Fields::select_input('use_remote_logging', $values, $use_remote_logging); ?>
32 32
 				<p class="description">
33 33
 					<?php _e('Send debugging data to the remote URL below.', 'event_espresso'); ?>
34 34
 				</p>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 				<?php echo EEH_Template::get_help_tab_link('remote_logging_url_info'); ?>
42 42
 			</th>
43 43
 			<td>
44
-				<input name="remote_logging_url" id="remote_logging_url" size="20" class="regular-text" type="text" value="<?php echo $remote_logging_url;?>" />
44
+				<input name="remote_logging_url" id="remote_logging_url" size="20" class="regular-text" type="text" value="<?php echo $remote_logging_url; ?>" />
45 45
 				<p class="description">
46 46
 					<?php _e('Example: http://requestb.in/MY_UNIQUE_ID', 'event_espresso'); ?>
47 47
 
Please login to merge, or discard this patch.
admin/extend/messages/Custom_Messages_Template_List_Table.class.php 2 patches
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 class Custom_Messages_Template_List_Table extends EE_Admin_List_Table {
31 31
 
32 32
 
33
-	public function __construct( $admin_page ) {
33
+	public function __construct($admin_page) {
34 34
 		//Set parent defaults
35 35
 		parent::__construct($admin_page);
36 36
 	}
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 	protected function _setup_data() {
42
-		$this->_data = $this->_admin_page->get_message_templates( $this->_per_page, $this->_view, FALSE, FALSE, FALSE );
43
-		$this->_all_data_count = $this->_admin_page->get_message_templates( $this->_per_page, $this->_view, TRUE, TRUE, FALSE );
42
+		$this->_data = $this->_admin_page->get_message_templates($this->_per_page, $this->_view, FALSE, FALSE, FALSE);
43
+		$this->_all_data_count = $this->_admin_page->get_message_templates($this->_per_page, $this->_view, TRUE, TRUE, FALSE);
44 44
 	}
45 45
 
46 46
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	protected function _set_properties() {
51 51
 		$this->_wp_list_args = array(
52
-			'singular' => __('Message Template Group', 'event_espresso' ),
53
-			'plural' => __('Message Template', 'event_espresso' ),
52
+			'singular' => __('Message Template Group', 'event_espresso'),
53
+			'plural' => __('Message Template', 'event_espresso'),
54 54
 			'ajax' => TRUE, //for now,
55 55
 			'screen' => $this->_admin_page->get_current_screen()->id
56 56
 			);
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 			'cb' => '<input type="checkbox" />',
60 60
 			'name' => __('Template Name', 'event_espresso'),
61 61
 			'message_type' => __('Message Type', 'event_espresso'),
62
-			'messenger' => __( 'Messenger', 'event_espresso'),
63
-			'description' => __( 'Description', 'event_espresso' ),
64
-			'events' => __( 'Events', 'event_espresso'), //count of events using this template.
62
+			'messenger' => __('Messenger', 'event_espresso'),
63
+			'description' => __('Description', 'event_espresso'),
64
+			'events' => __('Events', 'event_espresso'), //count of events using this template.
65 65
 			'actions' => ''
66 66
 			//'messages_sent' => __( 'Total Sent', 'event_espresso' ) //todo this will come later when we've got message tracking in place.
67 67
 			);
68 68
 
69 69
 		$this->_sortable_columns = array(
70
-			'messenger' => array( 'MTP_messenger' => TRUE ),
70
+			'messenger' => array('MTP_messenger' => TRUE),
71 71
 			//'message_type' => array( 'MTP_message_type' => FALSE )
72 72
 			);
73 73
 
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
 	 *
87 87
 	 * @return string
88 88
 	 */
89
-	public function single_row( $item ) {
89
+	public function single_row($item) {
90 90
 		$message_type = $item->message_type_obj();
91 91
 		$messenger = $item->messenger_obj();
92 92
 
93
-		if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger ) {
93
+		if ( ! $message_type instanceof EE_message_type || ! $messenger instanceof EE_messenger) {
94 94
 			echo '';
95 95
 			return;
96 96
 		}
97 97
 
98
-		parent::single_row( $item );
98
+		parent::single_row($item);
99 99
 	}
100 100
 
101 101
 
@@ -103,29 +103,29 @@  discard block
 block discarded – undo
103 103
 
104 104
 	protected function _get_table_filters() {
105 105
 		$filters = array();
106
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
106
+		EE_Registry::instance()->load_helper('Form_Fields');
107 107
 		$messengers = $this->_admin_page->get_active_messengers();
108 108
 		$message_types = $this->_admin_page->get_installed_message_types();
109 109
 
110 110
 
111 111
 		//setup messengers for selects
112
-		$i=1;
112
+		$i = 1;
113 113
 		$m_values[0]['id'] = 'all';
114
-		$m_values[0]['text'] = __('All Messengers', 'event_espresso' );
115
-		foreach ( $messengers as $messenger => $args ) {
114
+		$m_values[0]['text'] = __('All Messengers', 'event_espresso');
115
+		foreach ($messengers as $messenger => $args) {
116 116
 			$m_values[$i]['id'] = $messenger;
117 117
 			$m_values[$i]['text'] = ucwords($args['obj']->label['singular']);
118 118
 			$i++;
119 119
 		}
120
-		foreach ( $messengers as $messenger => $args ) {
120
+		foreach ($messengers as $messenger => $args) {
121 121
 			$m_values[$i]['id'] = $messenger;
122 122
 			$m_values[$i]['text'] = ucwords($args['obj']->label['singular']);
123 123
 			$i++;
124 124
 		}
125 125
 
126 126
 		//lets do the same for message types
127
-		$i=1;
128
-		foreach ( $message_types as $message_type => $args ) {
127
+		$i = 1;
128
+		foreach ($message_types as $message_type => $args) {
129 129
 			$mt_values[$i]['id'] = $message_type;
130 130
 			$mt_values[$i]['text'] = ucwords($args['obj']->label['singular']);
131 131
 			$i++;
@@ -141,28 +141,28 @@  discard block
 block discarded – undo
141 141
 			'text' => __('Show All', 'event_espresso')
142 142
 			);
143 143
 
144
-		$msgr_filters = !empty($m_values) ? array_merge( $msgr_default, $m_values ) : array();
145
-		$mt_filters = !empty($mt_values) ? array_merge( $mt_default, $mt_values ) : array();
144
+		$msgr_filters = ! empty($m_values) ? array_merge($msgr_default, $m_values) : array();
145
+		$mt_filters = ! empty($mt_values) ? array_merge($mt_default, $mt_values) : array();
146 146
 
147
-		if ( empty( $m_values ) )
147
+		if (empty($m_values))
148 148
 			$msgr_filters[0] = array(
149 149
 				'id' => 'no_messenger_options',
150 150
 				'text' => __('No Messengers active', 'event_espresso')
151 151
 				);
152 152
 
153
-		if ( empty($mt_values) )
153
+		if (empty($mt_values))
154 154
 			$mt_filters[0] = array(
155 155
 				'id' => 'no_message_type_options',
156 156
 				'text' => __('No Message Types active', 'event_espresso')
157 157
 				);
158 158
 
159
-		if ( count( $messengers ) >= 1  && !empty( $m_values ) ) {
160
-			unset( $msgr_filters[0] );
161
-			$msgr_filters = array_values( $msgr_filters ); //reindex keys
159
+		if (count($messengers) >= 1 && ! empty($m_values)) {
160
+			unset($msgr_filters[0]);
161
+			$msgr_filters = array_values($msgr_filters); //reindex keys
162 162
 		}
163 163
 
164
-		$filters[] = EEH_Form_Fields::select_input('ee_messenger_filter_by', $msgr_filters, isset($this->_req_data['ee_messenger_filter_by']) ? sanitize_key( $this->_req_data['ee_messenger_filter_by']) : '' );
165
-		$filters[] = EEH_Form_Fields::select_input('ee_message_type_filter_by', $mt_filters, isset($this->_req_data['ee_message_type_filter_by']) ? sanitize_key( $this->_req_data['ee_message_type_filter_by']) : '');
164
+		$filters[] = EEH_Form_Fields::select_input('ee_messenger_filter_by', $msgr_filters, isset($this->_req_data['ee_messenger_filter_by']) ? sanitize_key($this->_req_data['ee_messenger_filter_by']) : '');
165
+		$filters[] = EEH_Form_Fields::select_input('ee_message_type_filter_by', $mt_filters, isset($this->_req_data['ee_message_type_filter_by']) ? sanitize_key($this->_req_data['ee_message_type_filter_by']) : '');
166 166
 		return $filters;
167 167
 	}
168 168
 
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
 	 * we're just removing the search box for message templates, not needed.
171 171
 	 * @return string (empty);
172 172
 	 */
173
-	function search_box( $text, $input_id ) {
173
+	function search_box($text, $input_id) {
174 174
 		return '';
175 175
 	}
176 176
 
177 177
 
178 178
 	protected function _add_view_counts() {
179
-		foreach ( $this->_views as $view => $args )  {
180
-			$this->_views[$view]['count'] = $this->_admin_page->get_message_templates( $this->_per_page, $view, TRUE, TRUE, FALSE );
179
+		foreach ($this->_views as $view => $args) {
180
+			$this->_views[$view]['count'] = $this->_admin_page->get_message_templates($this->_per_page, $view, TRUE, TRUE, FALSE);
181 181
 		}
182 182
 	}
183 183
 
@@ -191,16 +191,16 @@  discard block
 block discarded – undo
191 191
 	 * @return string
192 192
 	 */
193 193
 	public function no_items() {
194
-		if ( $this->_view !== 'trashed' )
195
-			printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' );
194
+		if ($this->_view !== 'trashed')
195
+			printf(__('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>');
196 196
 		else
197 197
 			parent::no_items();
198 198
 	}
199 199
 
200 200
 
201 201
 
202
-	public function column_cb( $item ) {
203
-		return sprintf( '<input type="checkbox" name="checkbox[%s] value="1" />', $item->GRP_ID() );
202
+	public function column_cb($item) {
203
+		return sprintf('<input type="checkbox" name="checkbox[%s] value="1" />', $item->GRP_ID());
204 204
 	}
205 205
 
206 206
 
@@ -208,29 +208,29 @@  discard block
 block discarded – undo
208 208
 
209 209
 
210 210
 
211
-	function column_name( $item ) {
212
-		return '<p>' . $item->name() . '</p>';
211
+	function column_name($item) {
212
+		return '<p>'.$item->name().'</p>';
213 213
 	}
214 214
 
215 215
 
216 216
 
217 217
 
218
-	function column_description( $item ) {
219
-		return '<p>' . $item->description() . '</p>';
218
+	function column_description($item) {
219
+		return '<p>'.$item->description().'</p>';
220 220
 	}
221 221
 
222 222
 
223 223
 
224
-	function column_actions( $item ) {
225
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'espresso_messages_add_new_message_template' ) ) {
224
+	function column_actions($item) {
225
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messages_add_new_message_template')) {
226 226
 			$create_args = array(
227 227
 				'GRP_ID' => $item->ID(),
228 228
 				'messenger' => $item->messenger(),
229 229
 				'message_type' => $item->message_type(),
230 230
 				'action' => 'add_new_message_template'
231 231
 				);
232
-			$create_link = EE_Admin_Page::add_query_args_and_nonce( $create_args, EE_MSG_ADMIN_URL );
233
-			return sprintf( '<p><a href="%s" class="button button-small">%s</a></p>', $create_link, __('Create Custom', 'event_espresso') );
232
+			$create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL);
233
+			return sprintf('<p><a href="%s" class="button button-small">%s</a></p>', $create_link, __('Create Custom', 'event_espresso'));
234 234
 		}
235 235
 		return '';
236 236
 	}
@@ -247,27 +247,27 @@  discard block
 block discarded – undo
247 247
 		$actions = array();
248 248
 
249 249
 		// edit link but only if item isn't trashed.
250
-		if ( !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ) {
251
-			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_message_template', 'id'=>$item->GRP_ID() ), EE_MSG_ADMIN_URL );
252
-			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Template', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>';
250
+		if ( ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID())) {
251
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_message_template', 'id'=>$item->GRP_ID()), EE_MSG_ADMIN_URL);
252
+			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Template', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
253 253
 		}
254 254
 
255
-		$name_link = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() )? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Template', 'event_espresso' ) . '">' . ucwords( $item->messenger_obj()->label['singular'] ) . '</a>' : ucwords( $item->messenger_obj()->label['singular'] );
256
-		$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL );
255
+		$name_link = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Template', 'event_espresso').'">'.ucwords($item->messenger_obj()->label['singular']).'</a>' : ucwords($item->messenger_obj()->label['singular']);
256
+		$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL);
257 257
 		// restore link
258
-		$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL );
258
+		$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL);
259 259
 		// delete price link
260
-		$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE ), EE_MSG_ADMIN_URL );
260
+		$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_message_template', 'id'=>$item->GRP_ID(), 'noheader' => TRUE), EE_MSG_ADMIN_URL);
261 261
 
262
-		if ( !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_trash_message_template', $item->ID() ) ) {
263
-			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Template Group to Trash', 'event_espresso' ) . '">' . __( 'Move to Trash', 'event_espresso' ) . '</a>';
262
+		if ( ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_trash_message_template', $item->ID())) {
263
+			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Template Group to Trash', 'event_espresso').'">'.__('Move to Trash', 'event_espresso').'</a>';
264 264
 		} else {
265
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_restore_message_template', $item->ID() ) ) {
266
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Message Template', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
265
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_restore_message_template', $item->ID())) {
266
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Message Template', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
267 267
 			}
268 268
 
269
-			if ( $this->_view == 'trashed' && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_message', 'espresso_messages_delete_message_template', $item->ID() ) ) {
270
-				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Template Group Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>';
269
+			if ($this->_view == 'trashed' && EE_Registry::instance()->CAP->current_user_can('ee_delete_message', 'espresso_messages_delete_message_template', $item->ID())) {
270
+				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Template Group Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
271 271
 			}
272 272
 		}
273 273
 
@@ -276,15 +276,15 @@  discard block
 block discarded – undo
276 276
 		$c_configs = $item->contexts_config();
277 277
 		$ctxt = array();
278 278
 		$context_templates = $item->context_templates();
279
-		foreach ( $context_templates as $context => $template_fields ) {
280
-			$mtp_to = !empty( $context_templates[$context]['to'] ) && $context_templates[$context]['to'] instanceof EE_Message_Template ? $context_templates[$context]['to']->get('MTP_content') : NULL;
281
-			$inactive = empty( $mtp_to ) && !empty( $context_templates[$context]['to'] ) ? ' class="mtp-inactive"' : '';
279
+		foreach ($context_templates as $context => $template_fields) {
280
+			$mtp_to = ! empty($context_templates[$context]['to']) && $context_templates[$context]['to'] instanceof EE_Message_Template ? $context_templates[$context]['to']->get('MTP_content') : NULL;
281
+			$inactive = empty($mtp_to) && ! empty($context_templates[$context]['to']) ? ' class="mtp-inactive"' : '';
282 282
 			$context_title = ucwords($c_configs[$context]['label']);
283
-			$edit_link = EE_Admin_Page::add_query_args_and_nonce( array('action'=>'edit_message_template', 'id'=>$item->GRP_ID(), 'context' => $context), EE_MSG_ADMIN_URL );
284
-			$ctxt[] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? '<a' . $inactive . ' href="'. $edit_link . '" title="' . esc_attr__('Edit Context', 'event_espresso') . '">' . $context_title . '</a>' : $context_title;
283
+			$edit_link = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_message_template', 'id'=>$item->GRP_ID(), 'context' => $context), EE_MSG_ADMIN_URL);
284
+			$ctxt[] = EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? '<a'.$inactive.' href="'.$edit_link.'" title="'.esc_attr__('Edit Context', 'event_espresso').'">'.$context_title.'</a>' : $context_title;
285 285
 		}
286 286
 
287
-		$ctx_content = !$item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $item->ID() ) ? sprintf( __('<strong>%s:</strong> ', 'event_espresso'), ucwords($c_label['plural']) ) . implode(' | ', $ctxt) : '';
287
+		$ctx_content = ! $item->get('MTP_deleted') && EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $item->ID()) ? sprintf(__('<strong>%s:</strong> ', 'event_espresso'), ucwords($c_label['plural'])).implode(' | ', $ctxt) : '';
288 288
 
289 289
 
290 290
 		//Return the name contents
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 										/* $1%s */ $name_link,
293 293
 										/* $2%s */ $item->GRP_ID(),
294 294
 										/* %4$s */ $ctx_content,
295
-										/* $3%s */ $this->row_actions( $actions )
295
+										/* $3%s */ $this->row_actions($actions)
296 296
 		);
297 297
 	}
298 298
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 	 * @return string       message_type name
314 314
 	 */
315 315
 	function column_message_type($item) {
316
-		return ucwords($item->message_type_obj()->label['singular'] );
316
+		return ucwords($item->message_type_obj()->label['singular']);
317 317
 	}
318 318
 
319 319
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -144,17 +145,19 @@  discard block
 block discarded – undo
144 145
 		$msgr_filters = !empty($m_values) ? array_merge( $msgr_default, $m_values ) : array();
145 146
 		$mt_filters = !empty($mt_values) ? array_merge( $mt_default, $mt_values ) : array();
146 147
 
147
-		if ( empty( $m_values ) )
148
-			$msgr_filters[0] = array(
148
+		if ( empty( $m_values ) ) {
149
+					$msgr_filters[0] = array(
149 150
 				'id' => 'no_messenger_options',
150 151
 				'text' => __('No Messengers active', 'event_espresso')
151 152
 				);
153
+		}
152 154
 
153
-		if ( empty($mt_values) )
154
-			$mt_filters[0] = array(
155
+		if ( empty($mt_values) ) {
156
+					$mt_filters[0] = array(
155 157
 				'id' => 'no_message_type_options',
156 158
 				'text' => __('No Message Types active', 'event_espresso')
157 159
 				);
160
+		}
158 161
 
159 162
 		if ( count( $messengers ) >= 1  && !empty( $m_values ) ) {
160 163
 			unset( $msgr_filters[0] );
@@ -191,10 +194,11 @@  discard block
 block discarded – undo
191 194
 	 * @return string
192 195
 	 */
193 196
 	public function no_items() {
194
-		if ( $this->_view !== 'trashed' )
195
-			printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' );
196
-		else
197
-			parent::no_items();
197
+		if ( $this->_view !== 'trashed' ) {
198
+					printf( __('%sNo Custom Templates found.%s To create your first custom message template, go to the "Default Message Templates" tab and click the "Create Custom" button next to the template you want to use as a base for the new one.', 'event_espresso'), '<strong>', '</strong>' );
199
+		} else {
200
+					parent::no_items();
201
+		}
198 202
 	}
199 203
 
200 204
 
Please login to merge, or discard this patch.
caffeinated/admin/extend/messages/Extend_Messages_Admin_Page.core.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -31,18 +31,18 @@  discard block
 block discarded – undo
31 31
 
32 32
 
33 33
 
34
-	public function __construct( $routing = TRUE ) {
35
-		parent::__construct( $routing );
36
-		if ( !defined( 'EE_MSG_CAF_ASSETS_PATH' ) ) {
37
-			define( 'EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/assets/' );
38
-			define( 'EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/' );
39
-			define( 'EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/' );
40
-			define( 'EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/templates/' );
34
+	public function __construct($routing = TRUE) {
35
+		parent::__construct($routing);
36
+		if ( ! defined('EE_MSG_CAF_ASSETS_PATH')) {
37
+			define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND.'messages/assets/');
38
+			define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/assets/');
39
+			define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'messages/templates/');
40
+			define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/templates/');
41 41
 		}
42 42
 	}
43 43
 
44 44
 	protected function _extend_page_config() {
45
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages';
45
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'messages';
46 46
 		$this->_page_routes['custom_mtps'] = array(
47 47
 			'func' => '_ee_custom_messages_overview_list_table',
48 48
 			'capability' => 'ee_read_messages' );
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 				'require_nonce' => FALSE
71 71
 				);
72 72
 
73
-		add_action( 'current_screen', array( $this, 'dynamic_screen_hooks' ), 10 );
73
+		add_action('current_screen', array($this, 'dynamic_screen_hooks'), 10);
74 74
 	}
75 75
 
76 76
 
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 	public function dynamic_screen_hooks() {
88 88
 		global $admin_page_hooks;
89 89
 
90
-		if ( !empty( $admin_page_hooks['espresso_events'] ) ) {
90
+		if ( ! empty($admin_page_hooks['espresso_events'])) {
91 91
 			//we're on a EE specific page... good stuff!
92 92
 			$hook_prefix = $admin_page_hooks['espresso_events'];
93
-			$filter_ref = $hook_prefix . '_page_' . $this->page_slug;
94
-			add_filter( 'FHEE_manage_' . $filter_ref . '_columns', array( $this, 'add_custom_mtps_columns' ), 10, 2 );
95
-			add_action( 'AHEE__EE_Admin_List_Table__column_actions__' . $filter_ref, array( $this, 'custom_mtp_create_button_column'), 10, 2 );
93
+			$filter_ref = $hook_prefix.'_page_'.$this->page_slug;
94
+			add_filter('FHEE_manage_'.$filter_ref.'_columns', array($this, 'add_custom_mtps_columns'), 10, 2);
95
+			add_action('AHEE__EE_Admin_List_Table__column_actions__'.$filter_ref, array($this, 'custom_mtp_create_button_column'), 10, 2);
96 96
 		}
97 97
 	}
98 98
 
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 	 * @param array  $columns   Original defined list of columns
107 107
 	 * @param string $screen_id The unique screen id for the page.
108 108
 	 */
109
-	public function add_custom_mtps_columns( $columns, $screen_id ) {
110
-		if ( $screen_id !== 'espresso_messages_default' ) {
109
+	public function add_custom_mtps_columns($columns, $screen_id) {
110
+		if ($screen_id !== 'espresso_messages_default') {
111 111
 			return $columns;
112 112
 		}
113 113
 
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 	 *
129 129
 	 * @return string html content for the page.
130 130
 	 */
131
-	public function custom_mtp_create_button_column( $item, $screen_id ) {
132
-		if ( $screen_id !== 'espresso_messages_default' || ! EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'espresso_messages_add_new_message_template' ) ) {
131
+	public function custom_mtp_create_button_column($item, $screen_id) {
132
+		if ($screen_id !== 'espresso_messages_default' || ! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messages_add_new_message_template')) {
133 133
 			return '';
134 134
 		}
135 135
 
136 136
 		//first we consider whether this template has override set.  If it does then that means no custom templates can be created from this template as a base.  So let's just skip the button creation.
137
-		if ( $item->get('MTP_is_override' ) )
137
+		if ($item->get('MTP_is_override'))
138 138
 			return '';
139 139
 
140 140
 
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 			'message_type' => $item->message_type(),
145 145
 			'action' => 'add_new_message_template'
146 146
 			);
147
-		$create_link = EE_Admin_Page::add_query_args_and_nonce( $create_args, EE_MSG_ADMIN_URL );
148
-		echo sprintf( '<a href="%s" class="button button-small">%s</a>', $create_link, __('Create Custom', 'event_espresso') );
147
+		$create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL);
148
+		echo sprintf('<a href="%s" class="button button-small">%s</a>', $create_link, __('Create Custom', 'event_espresso'));
149 149
 	}
150 150
 
151 151
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 				)
179 179
 			)
180 180
 		);
181
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_messages', 'espresso_messages_trash_message_template' ) ) {
181
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_messages', 'espresso_messages_trash_message_template')) {
182 182
 			$this->_views['trashed'] = array(
183 183
 				'slug' => 'trashed',
184 184
 				'label' => __('Trash', 'event_espresso'),
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 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
@@ -134,8 +135,9 @@  discard block
 block discarded – undo
134 135
 		}
135 136
 
136 137
 		//first we consider whether this template has override set.  If it does then that means no custom templates can be created from this template as a base.  So let's just skip the button creation.
137
-		if ( $item->get('MTP_is_override' ) )
138
-			return '';
138
+		if ( $item->get('MTP_is_override' ) ) {
139
+					return '';
140
+		}
139 141
 
140 142
 
141 143
 		$create_args = array(
Please login to merge, or discard this patch.
admin/extend/registration_form/Extend_Registration_Form_Admin_Page.core.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -235,13 +235,13 @@  discard block
 block discarded – undo
235 235
 					'persistent' => FALSE
236 236
 					),
237 237
 				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
238
-                'help_tabs' => array(
238
+				'help_tabs' => array(
239 239
 					'registration_form_add_question_help_tab' => array(
240 240
 						'title' => __('Add Question', 'event_espresso'),
241 241
 						'filename' => 'registration_form_add_question'
242 242
 						),
243 243
 					),
244
-                'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'),
244
+				'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'),
245 245
 				'require_nonce' => FALSE
246 246
 				),
247 247
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 						'filename' => 'registration_form_add_question_group'
259 259
 						),
260 260
 					),
261
-                'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'),
261
+				'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'),
262 262
 				'require_nonce' => FALSE
263 263
 				),
264 264
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 						'filename' => 'registration_form_edit_question_group'
277 277
 						),
278 278
 					),
279
-                'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'),
279
+				'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'),
280 280
 				'require_nonce' => FALSE
281 281
 				),
282 282
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 						'filename' => 'registration_form_reg_form_settings'
296 296
 						),
297 297
 					),
298
-                'help_tour' => array( 'Registration_Form_Settings_Help_Tour'),
298
+				'help_tour' => array( 'Registration_Form_Settings_Help_Tour'),
299 299
 				'require_nonce' => FALSE
300 300
 				)
301 301
 
Please login to merge, or discard this patch.
Spacing   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 
31 31
 
32 32
 
33
-	public function __construct( $routing = TRUE ) {
34
-		define( 'REGISTRATION_FORM_CAF_ADMIN', EE_CORE_CAF_ADMIN_EXTEND . 'registration_form' . DS );
35
-		define( 'REGISTRATION_FORM_CAF_ASSETS_PATH', REGISTRATION_FORM_CAF_ADMIN . 'assets' . DS );
36
-		define( 'REGISTRATION_FORM_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/assets/' );
37
-		define( 'REGISTRATION_FORM_CAF_TEMPLATE_PATH', REGISTRATION_FORM_CAF_ADMIN . 'templates' . DS );
38
-		define( 'REGISTRATION_FORM_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/templates/' );
39
-		parent::__construct( $routing );
33
+	public function __construct($routing = TRUE) {
34
+		define('REGISTRATION_FORM_CAF_ADMIN', EE_CORE_CAF_ADMIN_EXTEND.'registration_form'.DS);
35
+		define('REGISTRATION_FORM_CAF_ASSETS_PATH', REGISTRATION_FORM_CAF_ADMIN.'assets'.DS);
36
+		define('REGISTRATION_FORM_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registration_form/assets/');
37
+		define('REGISTRATION_FORM_CAF_TEMPLATE_PATH', REGISTRATION_FORM_CAF_ADMIN.'templates'.DS);
38
+		define('REGISTRATION_FORM_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registration_form/templates/');
39
+		parent::__construct($routing);
40 40
 	}
41 41
 
42 42
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
 	protected function _extend_page_config() {
48 48
 		$this->_admin_base_path = REGISTRATION_FORM_CAF_ADMIN;
49
-		$qst_id = ! empty( $this->_req_data['QST_ID'] ) && ! is_array( $this->_req_data['QST_ID'] ) ? $this->_req_data['QST_ID'] : 0;
50
-		$qsg_id = ! empty( $this->_req_data['QSG_ID'] ) && ! is_array( $this->_req_data['QSG_ID'] ) ? $this->_req_data['QSG_ID'] : 0;
49
+		$qst_id = ! empty($this->_req_data['QST_ID']) && ! is_array($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0;
50
+		$qsg_id = ! empty($this->_req_data['QSG_ID']) && ! is_array($this->_req_data['QSG_ID']) ? $this->_req_data['QSG_ID'] : 0;
51 51
 
52 52
 		$new_page_routes = array(
53 53
 			'question_groups' => array(
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 				'func' => '_trash_or_restore_questions',
77 77
 				'capability' => 'ee_delete_question',
78 78
 				'obj_id' => $qst_id,
79
-				'args' => array( 'trash' => FALSE ),
79
+				'args' => array('trash' => FALSE),
80 80
 				'noheader' => TRUE
81 81
 				),
82 82
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
 			'trash_question_group' => array(
137 137
 				'func' => '_trash_or_restore_question_groups',
138
-				'args' => array( 'trash' => TRUE ),
138
+				'args' => array('trash' => TRUE),
139 139
 				'capability' => 'ee_delete_question_group',
140 140
 				'obj_id' => $qsg_id,
141 141
 				'noheader' => TRUE
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
 			'restore_question_group' => array(
145 145
 				'func' => '_trash_or_restore_question_groups',
146
-				'args' => array( 'trash' => FALSE ),
146
+				'args' => array('trash' => FALSE),
147 147
 				'capability' => 'ee_delete_question_group',
148 148
 				'obj_id' => $qsg_id,
149 149
 				'noheader' => TRUE
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 			'update_question_group' => array(
160 160
 				'func' => '_insert_or_update_question_group',
161
-				'args' => array('new_question_group' => FALSE ),
161
+				'args' => array('new_question_group' => FALSE),
162 162
 				'capability' => 'ee_edit_question_group',
163 163
 				'obj_id' => $qsg_id,
164 164
 				'noheader' => TRUE,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 					'noheader' => TRUE
197 197
 				),
198 198
 			);
199
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
199
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
200 200
 
201 201
 		$new_page_config = array(
202 202
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 						'filename' => 'registration_form_question_groups_views_bulk_actions_search'
221 221
 						),
222 222
 					),
223
-				'help_tour' => array( 'Registration_Form_Question_Groups_Help_Tour'),
223
+				'help_tour' => array('Registration_Form_Question_Groups_Help_Tour'),
224 224
 				'metaboxes' => $this->_default_espresso_metaboxes,
225 225
 				'require_nonce' => FALSE,
226 226
 				'qtips' => array(
@@ -234,14 +234,14 @@  discard block
 block discarded – undo
234 234
 					'order' => 5,
235 235
 					'persistent' => FALSE
236 236
 					),
237
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
237
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
238 238
                 'help_tabs' => array(
239 239
 					'registration_form_add_question_help_tab' => array(
240 240
 						'title' => __('Add Question', 'event_espresso'),
241 241
 						'filename' => 'registration_form_add_question'
242 242
 						),
243 243
 					),
244
-                'help_tour' => array( 'Registration_Form_Add_Question_Help_Tour'),
244
+                'help_tour' => array('Registration_Form_Add_Question_Help_Tour'),
245 245
 				'require_nonce' => FALSE
246 246
 				),
247 247
 
@@ -251,14 +251,14 @@  discard block
 block discarded – undo
251 251
 					'order' => 5,
252 252
 					'persistent' => FALSE
253 253
 					),
254
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
254
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
255 255
 				'help_tabs' => array(
256 256
 					'registration_form_add_question_group_help_tab' => array(
257 257
 						'title' => __('Add Question Group', 'event_espresso'),
258 258
 						'filename' => 'registration_form_add_question_group'
259 259
 						),
260 260
 					),
261
-                'help_tour' => array( 'Registration_Form_Add_Question_Group_Help_Tour'),
261
+                'help_tour' => array('Registration_Form_Add_Question_Group_Help_Tour'),
262 262
 				'require_nonce' => FALSE
263 263
 				),
264 264
 
@@ -267,16 +267,16 @@  discard block
 block discarded – undo
267 267
 					'label' => __('Edit Question Group', 'event_espresso'),
268 268
 					'order' => 5,
269 269
 					'persistent' => FALSE,
270
-					'url' => isset($this->_req_data['question_group_id']) ? add_query_arg(array('question_group_id' => $this->_req_data['question_group_id'] ), $this->_current_page_view_url )  : $this->_admin_base_url
270
+					'url' => isset($this->_req_data['question_group_id']) ? add_query_arg(array('question_group_id' => $this->_req_data['question_group_id']), $this->_current_page_view_url) : $this->_admin_base_url
271 271
 					),
272
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box' ) ),
272
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
273 273
 				'help_tabs' => array(
274 274
 					'registration_form_edit_question_group_help_tab' => array(
275 275
 						'title' => __('Edit Question Group', 'event_espresso'),
276 276
 						'filename' => 'registration_form_edit_question_group'
277 277
 						),
278 278
 					),
279
-                'help_tour' => array( 'Registration_Form_Edit_Question_Group_Help_Tour'),
279
+                'help_tour' => array('Registration_Form_Edit_Question_Group_Help_Tour'),
280 280
 				'require_nonce' => FALSE
281 281
 				),
282 282
 
@@ -288,19 +288,19 @@  discard block
 block discarded – undo
288 288
 				'labels' => array(
289 289
 					'publishbox' => __('Update Settings', 'event_espresso')
290 290
 					),
291
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
291
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
292 292
 				'help_tabs' => array(
293 293
 					'registration_form_reg_form_settings_help_tab' => array(
294 294
 						'title' => __('Registration Form Settings', 'event_espresso'),
295 295
 						'filename' => 'registration_form_reg_form_settings'
296 296
 						),
297 297
 					),
298
-                'help_tour' => array( 'Registration_Form_Settings_Help_Tour'),
298
+                'help_tour' => array('Registration_Form_Settings_Help_Tour'),
299 299
 				'require_nonce' => FALSE
300 300
 				)
301 301
 
302 302
 			);
303
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
303
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
304 304
 
305 305
 		//change the list table we're going to use so it's the NEW list table!
306 306
 		$this->_page_config['default']['list_table'] = 'Extend_Registration_Form_Questions_Admin_List_Table';
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 			'edit_question_group' => __('Edit Question Group', 'event_espresso'),
315 315
 			'delete_question_group' => __('Delete Question Group', 'event_espresso'),
316 316
 			);
317
-		$this->_labels['buttons'] = array_merge( $this->_labels['buttons'], $new_labels );
317
+		$this->_labels['buttons'] = array_merge($this->_labels['buttons'], $new_labels);
318 318
 
319 319
 	}
320 320
 
@@ -323,14 +323,14 @@  discard block
 block discarded – undo
323 323
 
324 324
 
325 325
 	protected function _ajax_hooks() {
326
-		add_action('wp_ajax_espresso_update_question_group_order', array( $this, 'update_question_group_order' ));
326
+		add_action('wp_ajax_espresso_update_question_group_order', array($this, 'update_question_group_order'));
327 327
 	}
328 328
 
329 329
 
330 330
 
331 331
 
332 332
 	public function load_scripts_styles_question_groups() {
333
-		wp_enqueue_script( 'espresso_ajax_table_sorting' );
333
+		wp_enqueue_script('espresso_ajax_table_sorting');
334 334
 	}
335 335
 
336 336
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	 * @return void
352 352
 	 */
353 353
 	public function load_sortable_question_script() {
354
-		wp_register_script('ee-question-sortable', REGISTRATION_FORM_CAF_ASSETS_URL . 'ee_question_order.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, true);
354
+		wp_register_script('ee-question-sortable', REGISTRATION_FORM_CAF_ASSETS_URL.'ee_question_order.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, true);
355 355
 		wp_enqueue_script('ee-question-sortable');
356 356
 	}
357 357
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 				)
371 371
 		);
372 372
 
373
-		if ( EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions' ) ) {
373
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions')) {
374 374
 			$this->_views['trash'] = array(
375 375
 				'slug' => 'trash',
376 376
 				'label' => __('Trash', 'event_espresso'),
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 				)
401 401
 		);
402 402
 
403
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_groups' ) ) {
403
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_groups')) {
404 404
 			$this->_views['trash'] = array(
405 405
 				'slug' => 'trash',
406 406
 				'label' => __('Trash', 'event_espresso'),
@@ -436,16 +436,16 @@  discard block
 block discarded – undo
436 436
 
437 437
 
438 438
 
439
-	protected function _delete_question(){
440
-		$success=$this->_question_model->delete_permanently_by_ID(intval($this->_req_data['QST_ID']));
441
-		$query_args=array('action'=>'default','status'=>'all');
439
+	protected function _delete_question() {
440
+		$success = $this->_question_model->delete_permanently_by_ID(intval($this->_req_data['QST_ID']));
441
+		$query_args = array('action'=>'default', 'status'=>'all');
442 442
 		$this->_redirect_after_action($success, $this->_question_model->item_name($success), 'deleted', $query_args);
443 443
 	}
444 444
 
445 445
 
446 446
 	protected function _delete_questions() {
447 447
 		$success = $this->_delete_items($this->_question_model);
448
-		$this->_redirect_after_action( $success, $this->_question_model->item_name($success), 'deleted permanently', array( 'action'=>'default', 'status'=>'trash' ));
448
+		$this->_redirect_after_action($success, $this->_question_model->item_name($success), 'deleted permanently', array('action'=>'default', 'status'=>'trash'));
449 449
 	}
450 450
 
451 451
 
@@ -454,27 +454,27 @@  discard block
 block discarded – undo
454 454
  * @param EEM_Base $model
455 455
  * @return int number of items deleted permanenetly
456 456
  */
457
-	private function _delete_items(EEM_Soft_Delete_Base $model){
457
+	private function _delete_items(EEM_Soft_Delete_Base $model) {
458 458
 		$success = 0;
459
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
460
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
459
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
460
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
461 461
 			// if array has more than one element than success message should be plural
462
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
462
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
463 463
 			// cycle thru bulk action checkboxes
464
-			while (list( $ID, $value ) = each($this->_req_data['checkbox'])) {
464
+			while (list($ID, $value) = each($this->_req_data['checkbox'])) {
465 465
 
466
-				if (!$model->delete_permanently_by_ID(absint($ID))) {
466
+				if ( ! $model->delete_permanently_by_ID(absint($ID))) {
467 467
 					$success = 0;
468 468
 				}
469 469
 			}
470 470
 
471
-		}elseif( !empty($this->_req_data['QSG_ID'])){
471
+		}elseif ( ! empty($this->_req_data['QSG_ID'])) {
472 472
 			$success = $model->delete_permanently_by_ID($this->_req_data['QSG_ID']);
473 473
 
474
-		}elseif( !empty($this->_req_data['QST_ID'])){
474
+		}elseif ( ! empty($this->_req_data['QST_ID'])) {
475 475
 			$success = $model->delete_permanently_by_ID($this->_req_data['QST_ID']);
476
-		}else{
477
-			EE_Error::add_error( sprintf(__("No Questions or Question Groups were selected for deleting. This error usually shows when you've attempted to delete via bulk action but there were no selections.", "event_espresso")), __FILE__, __FUNCTION__, __LINE__ );
476
+		} else {
477
+			EE_Error::add_error(sprintf(__("No Questions or Question Groups were selected for deleting. This error usually shows when you've attempted to delete via bulk action but there were no selections.", "event_espresso")), __FILE__, __FUNCTION__, __LINE__);
478 478
 		}
479 479
 		return $success;
480 480
 	}
@@ -488,29 +488,29 @@  discard block
 block discarded – undo
488 488
 
489 489
 
490 490
 
491
-	protected function _edit_question_group( $type = 'add' ) {
492
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
493
-		$ID=isset( $this->_req_data['QSG_ID'] ) && ! empty( $this->_req_data['QSG_ID'] ) ? absint( $this->_req_data['QSG_ID'] ) : FALSE;
494
-		$this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action ));
491
+	protected function _edit_question_group($type = 'add') {
492
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
493
+		$ID = isset($this->_req_data['QSG_ID']) && ! empty($this->_req_data['QSG_ID']) ? absint($this->_req_data['QSG_ID']) : FALSE;
494
+		$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
495 495
 		// add ID to title if editing
496
-		$this->_admin_page_title = $ID ? $this->_admin_page_title . ' # ' . $ID : $this->_admin_page_title;
497
-		if($ID){
498
-			$questionGroup=$this->_question_group_model->get_one_by_ID($ID);
499
-			$additional_hidden_fields=array('QSG_ID'=>array('type'=>'hidden','value'=>$ID));
496
+		$this->_admin_page_title = $ID ? $this->_admin_page_title.' # '.$ID : $this->_admin_page_title;
497
+		if ($ID) {
498
+			$questionGroup = $this->_question_group_model->get_one_by_ID($ID);
499
+			$additional_hidden_fields = array('QSG_ID'=>array('type'=>'hidden', 'value'=>$ID));
500 500
 			$this->_set_add_edit_form_tags('update_question_group', $additional_hidden_fields);
501
-		}else{
501
+		} else {
502 502
 			$questionGroup = EEM_Question_Group::instance()->create_default_object();
503 503
 			$questionGroup->set_order_to_latest();
504 504
 			$this->_set_add_edit_form_tags('insert_question_group');
505 505
 		}
506 506
 		$this->_template_args['values'] = $this->_yes_no_values;
507
-		$this->_template_args['all_questions']=$questionGroup->questions_in_and_not_in_group();
508
-		$this->_template_args['QSG_ID']=$ID ? $ID : TRUE;
509
-		$this->_template_args['question_group']=$questionGroup;
507
+		$this->_template_args['all_questions'] = $questionGroup->questions_in_and_not_in_group();
508
+		$this->_template_args['QSG_ID'] = $ID ? $ID : TRUE;
509
+		$this->_template_args['question_group'] = $questionGroup;
510 510
 
511
-		$redirect_URL = add_query_arg( array( 'action' => 'question_groups'), $this->_admin_base_url );
512
-		$this->_set_publish_post_box_vars( 'id', $ID, FALSE, $redirect_URL  );
513
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_CAF_TEMPLATE_PATH . 'question_groups_main_meta_box.template.php', $this->_template_args, TRUE );
511
+		$redirect_URL = add_query_arg(array('action' => 'question_groups'), $this->_admin_base_url);
512
+		$this->_set_publish_post_box_vars('id', $ID, FALSE, $redirect_URL);
513
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_CAF_TEMPLATE_PATH.'question_groups_main_meta_box.template.php', $this->_template_args, TRUE);
514 514
 
515 515
 		// the details template wrapper
516 516
 		$this->display_admin_page_with_sidebar();
@@ -521,87 +521,87 @@  discard block
 block discarded – undo
521 521
 
522 522
 	protected function _delete_question_groups() {
523 523
 		$success = $this->_delete_items($this->_question_group_model);
524
-		$this->_redirect_after_action( $success, $this->_question_group_model->item_name($success), 'deleted permanently', array( 'action'=>'question_groups', 'status'=>'trash' ));
524
+		$this->_redirect_after_action($success, $this->_question_group_model->item_name($success), 'deleted permanently', array('action'=>'question_groups', 'status'=>'trash'));
525 525
 	}
526 526
 
527 527
 
528 528
 
529
-	protected function _insert_or_update_question_group( $new_question_group = TRUE) {
530
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
531
-		$set_column_values=$this->_set_column_values_for($this->_question_group_model);
532
-		if ( $new_question_group ){
529
+	protected function _insert_or_update_question_group($new_question_group = TRUE) {
530
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
531
+		$set_column_values = $this->_set_column_values_for($this->_question_group_model);
532
+		if ($new_question_group) {
533 533
 			$QSG_ID = $this->_question_group_model->insert($set_column_values);
534 534
 			$success = $QSG_ID ? 1 : 0;
535 535
 		} else {
536 536
 			$QSG_ID = absint($this->_req_data['QSG_ID']);
537
-			unset( $set_column_values[ 'QSG_ID' ] );
538
-			$success= $this->_question_group_model->update( $set_column_values, array( array( 'QSG_ID' => $QSG_ID )));
537
+			unset($set_column_values['QSG_ID']);
538
+			$success = $this->_question_group_model->update($set_column_values, array(array('QSG_ID' => $QSG_ID)));
539 539
 		}
540 540
 		// update the existing related questions
541 541
 		// BUT FIRST...  delete the phone question from the Question_Group_Question if it is being added to this question group (therefore removed from the existing group)
542
-		if ( isset( $this->_req_data['questions'], $this->_req_data['questions'][ EEM_Attendee::phone_question_id ] )) {
542
+		if (isset($this->_req_data['questions'], $this->_req_data['questions'][EEM_Attendee::phone_question_id])) {
543 543
 			// delete where QST ID = system phone question ID and Question Group ID is NOT this group
544
-			EEM_Question_Group_Question::instance()->delete( array( array( 'QST_ID' => EEM_Attendee::phone_question_id, 'QSG_ID' => array( '!=', $QSG_ID ))));
544
+			EEM_Question_Group_Question::instance()->delete(array(array('QST_ID' => EEM_Attendee::phone_question_id, 'QSG_ID' => array('!=', $QSG_ID))));
545 545
 		}
546 546
 		/** @type EE_Question_Group $question_group */
547
-		$question_group=$this->_question_group_model->get_one_by_ID( $QSG_ID );
547
+		$question_group = $this->_question_group_model->get_one_by_ID($QSG_ID);
548 548
 		$questions = $question_group->questions();
549 549
 		// make sure system phone question is added to list of questions for this group
550
-		if ( ! isset( $questions[ EEM_Attendee::phone_question_id ] )) {
551
-			$questions[ EEM_Attendee::phone_question_id ] = EEM_Question::instance()->get_one_by_ID( EEM_Attendee::phone_question_id );
550
+		if ( ! isset($questions[EEM_Attendee::phone_question_id])) {
551
+			$questions[EEM_Attendee::phone_question_id] = EEM_Question::instance()->get_one_by_ID(EEM_Attendee::phone_question_id);
552 552
 		}
553 553
 
554
-		foreach( $questions as $question_ID => $question ){
554
+		foreach ($questions as $question_ID => $question) {
555 555
 			// first we always check for order.
556
-			if ( ! empty( $this->_req_data['question_orders'][ $question_ID ] ) ){
556
+			if ( ! empty($this->_req_data['question_orders'][$question_ID])) {
557 557
 				//update question order
558
-				$question_group->update_question_order( $question_ID, $this->_req_data['question_orders'][ $question_ID ] );
558
+				$question_group->update_question_order($question_ID, $this->_req_data['question_orders'][$question_ID]);
559 559
 			}
560 560
 
561 561
 			// then we always check if adding or removing.
562
-			if ( isset( $this->_req_data['questions'], $this->_req_data['questions'][ $question_ID ] )) {
563
-				$question_group->add_question( $question_ID );
562
+			if (isset($this->_req_data['questions'], $this->_req_data['questions'][$question_ID])) {
563
+				$question_group->add_question($question_ID);
564 564
 			} else {
565 565
 				// not found, remove it (but only if not a system question for the personal group)
566
-				if ( ! ( $question->is_system_question() && $question_group->system_group() === EEM_Question_Group::system_personal )) {
567
-					$question_group->remove_question( $question_ID );
566
+				if ( ! ($question->is_system_question() && $question_group->system_group() === EEM_Question_Group::system_personal)) {
567
+					$question_group->remove_question($question_ID);
568 568
 				}
569 569
 			}
570 570
 		}
571 571
 		// save new related questions
572
-		if ( isset( $this->_req_data['questions'] )) {
573
-			foreach( $this->_req_data['questions'] as $QST_ID ){
574
-				$question_group->add_question( $QST_ID );
575
-				if ( isset( $this->_req_data['question_orders'][ $QST_ID ] )) {
576
-					$question_group->update_question_order( $QST_ID, $this->_req_data['question_orders'][ $QST_ID ] );
572
+		if (isset($this->_req_data['questions'])) {
573
+			foreach ($this->_req_data['questions'] as $QST_ID) {
574
+				$question_group->add_question($QST_ID);
575
+				if (isset($this->_req_data['question_orders'][$QST_ID])) {
576
+					$question_group->update_question_order($QST_ID, $this->_req_data['question_orders'][$QST_ID]);
577 577
 				}
578 578
 			}
579 579
 		}
580 580
 
581
-		if ( $success !== FALSE ) {
582
-			$msg = $new_question_group ? sprintf( __('The %s has been created', 'event_espresso'), $this->_question_group_model->item_name() ) : sprintf( __('The %s has been updated', 'event_espresso' ), $this->_question_group_model->item_name() );
583
-			EE_Error::add_success( $msg );
581
+		if ($success !== FALSE) {
582
+			$msg = $new_question_group ? sprintf(__('The %s has been created', 'event_espresso'), $this->_question_group_model->item_name()) : sprintf(__('The %s has been updated', 'event_espresso'), $this->_question_group_model->item_name());
583
+			EE_Error::add_success($msg);
584 584
 		}
585
-		$this->_redirect_after_action(FALSE, '', '', array('action'=>'edit_question_group','QSG_ID'=>$QSG_ID), TRUE);
585
+		$this->_redirect_after_action(FALSE, '', '', array('action'=>'edit_question_group', 'QSG_ID'=>$QSG_ID), TRUE);
586 586
 
587 587
 	}
588 588
 
589 589
 
590 590
 
591 591
 	protected function _trash_or_restore_question_groups($trash = TRUE) {
592
-		return $this->_trash_or_restore_items( $this->_question_group_model, $trash );
592
+		return $this->_trash_or_restore_items($this->_question_group_model, $trash);
593 593
 	}
594 594
 
595
-	protected function _trash_question(){
596
-		$success=$this->_question_model->delete_by_ID(intval($this->_req_data['QST_ID']));
597
-		$query_args=array('action'=>'default','status'=>'all');
595
+	protected function _trash_question() {
596
+		$success = $this->_question_model->delete_by_ID(intval($this->_req_data['QST_ID']));
597
+		$query_args = array('action'=>'default', 'status'=>'all');
598 598
 		$this->_redirect_after_action($success, $this->_question_model->item_name($success), 'trashed', $query_args);
599 599
 	}
600 600
 
601 601
 
602 602
 
603
-	protected function _trash_or_restore_questions($trash=TRUE){
604
-		$this->_trash_or_restore_items( $this->_question_model, $trash );
603
+	protected function _trash_or_restore_questions($trash = TRUE) {
604
+		$this->_trash_or_restore_items($this->_question_model, $trash);
605 605
 	}
606 606
 
607 607
 
@@ -612,21 +612,21 @@  discard block
 block discarded – undo
612 612
 	 * @param EEM_Base $model
613 613
 	 * @param boolean $trash wehter to trash or restore
614 614
 	 */
615
-	private function _trash_or_restore_items( EEM_Base $model, $trash = TRUE ) {
615
+	private function _trash_or_restore_items(EEM_Base $model, $trash = TRUE) {
616 616
 
617
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
617
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
618 618
 
619 619
 		$success = 1;
620 620
 		//Checkboxes
621 621
 		//echo "trash $trash";
622 622
 		//var_dump($this->_req_data['checkbox']);die;
623
-		if ( isset( $this->_req_data['checkbox'] )) {
624
-			if ( isset( $this->_req_data['checkbox'] ) && ! empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] )) {
623
+		if (isset($this->_req_data['checkbox'])) {
624
+			if (isset($this->_req_data['checkbox']) && ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
625 625
 				// if array has more than one element than success message should be plural
626
-				$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
626
+				$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
627 627
 				// cycle thru bulk action checkboxes
628
-				while (list( $ID, $value ) = each($this->_req_data['checkbox'])) {
629
-					if ( ! $model->delete_or_restore_by_ID($trash,absint($ID))) {
628
+				while (list($ID, $value) = each($this->_req_data['checkbox'])) {
629
+					if ( ! $model->delete_or_restore_by_ID($trash, absint($ID))) {
630 630
 						$success = 0;
631 631
 					}
632 632
 				}
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 			} else {
635 635
 				// grab single id and delete
636 636
 				$ID = absint($this->_req_data['checkbox']);
637
-				if ( ! $model->delete_or_restore_by_ID($trash,$ID)) {
637
+				if ( ! $model->delete_or_restore_by_ID($trash, $ID)) {
638 638
 					$success = 0;
639 639
 				}
640 640
 			}
@@ -642,53 +642,53 @@  discard block
 block discarded – undo
642 642
 		} else {
643 643
 			// delete via trash link
644 644
 			// grab single id and delete
645
-			$ID = absint($this->_req_data[ $model->primary_key_name() ]);
646
-			if ( ! $model->delete_or_restore_by_ID($trash,$ID)) {
645
+			$ID = absint($this->_req_data[$model->primary_key_name()]);
646
+			if ( ! $model->delete_or_restore_by_ID($trash, $ID)) {
647 647
 				$success = 0;
648 648
 			}
649 649
 
650 650
 		}
651 651
 
652 652
 
653
-		$action = $model instanceof EEM_Question ? 'default' : 'question_groups';//strtolower( $model->item_name(2) );
653
+		$action = $model instanceof EEM_Question ? 'default' : 'question_groups'; //strtolower( $model->item_name(2) );
654 654
 		//echo "action :$action";
655 655
 		//$action = 'questions' ? 'default' : $action;
656
-		if($trash){
656
+		if ($trash) {
657 657
 			$action_desc = 'trashed';
658 658
 			$status = 'trash';
659
-		}else{
659
+		} else {
660 660
 			$action_desc = 'restored';
661 661
 			$status = 'all';
662 662
 		}
663
-		$this->_redirect_after_action( $success, $model->item_name($success), $action_desc, array( 'action' => $action, 'status'=>$status ) );
663
+		$this->_redirect_after_action($success, $model->item_name($success), $action_desc, array('action' => $action, 'status'=>$status));
664 664
 	}
665 665
 
666 666
 
667 667
 
668 668
 
669
-	public function get_trashed_questions( $per_page,$current_page = 1, $count = FALSE ) {
669
+	public function get_trashed_questions($per_page, $current_page = 1, $count = FALSE) {
670 670
 		$query_params = $this->get_query_params(EEM_Question::instance(), $per_page, $current_page);
671 671
 
672
-		if( $count ){
672
+		if ($count) {
673 673
 			//note: this a subclass of EEM_Soft_Delete_Base, so thsi is actually only getting nontrashed items
674
-			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
675
-			$results=$this->_question_model->count_deleted($where);
676
-		}else{
674
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
675
+			$results = $this->_question_model->count_deleted($where);
676
+		} else {
677 677
 			//note: this a subclass of EEM_Soft_Delete_Base, so thsi is actually only getting nontrashed items
678
-			$results=$this->_question_model->get_all_deleted($query_params);
678
+			$results = $this->_question_model->get_all_deleted($query_params);
679 679
 		}
680 680
 		return $results;
681 681
 	}
682 682
 
683 683
 
684 684
 
685
-	public function get_question_groups( $per_page,$current_page = 1, $count = FALSE ) {
686
-		$questionGroupModel=EEM_Question_Group::instance();
687
-		$query_params=$this->get_query_params($questionGroupModel,$per_page,$current_page);
688
-		if ($count){
689
-			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
685
+	public function get_question_groups($per_page, $current_page = 1, $count = FALSE) {
686
+		$questionGroupModel = EEM_Question_Group::instance();
687
+		$query_params = $this->get_query_params($questionGroupModel, $per_page, $current_page);
688
+		if ($count) {
689
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
690 690
 			$results = $questionGroupModel->count($where);
691
-		}else{
691
+		} else {
692 692
 			$results = $questionGroupModel->get_all($query_params);
693 693
 		}
694 694
 		return $results;
@@ -696,14 +696,14 @@  discard block
 block discarded – undo
696 696
 
697 697
 
698 698
 
699
-	public function get_trashed_question_groups( $per_page,$current_page = 1, $count = FALSE ) {
700
-		$questionGroupModel=EEM_Question_Group::instance();
701
-		$query_params=$this->get_query_params($questionGroupModel,$per_page,$current_page);
702
-		if($count){
703
-			$where = isset( $query_params[0] ) ? array($query_params[0]) : array();
699
+	public function get_trashed_question_groups($per_page, $current_page = 1, $count = FALSE) {
700
+		$questionGroupModel = EEM_Question_Group::instance();
701
+		$query_params = $this->get_query_params($questionGroupModel, $per_page, $current_page);
702
+		if ($count) {
703
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
704 704
 			$query_params['limit'] = NULL;
705 705
 			$results = $questionGroupModel->count_deleted($where);
706
-		}else{
706
+		} else {
707 707
 			$results = $questionGroupModel->get_all_deleted($query_params);
708 708
 		}
709 709
 		return $results;
@@ -716,22 +716,22 @@  discard block
 block discarded – undo
716 716
 	 */
717 717
 	public function update_question_group_order() {
718 718
 
719
-		$success = __( 'Question group order was updated successfully.', 'event_espresso' );
719
+		$success = __('Question group order was updated successfully.', 'event_espresso');
720 720
 
721 721
 		// grab our row IDs
722
-		$row_ids = isset( $this->_req_data['row_ids'] ) && ! empty( $this->_req_data['row_ids'] ) ? explode( ',', rtrim( $this->_req_data['row_ids'], ',' )) : FALSE;
722
+		$row_ids = isset($this->_req_data['row_ids']) && ! empty($this->_req_data['row_ids']) ? explode(',', rtrim($this->_req_data['row_ids'], ',')) : FALSE;
723 723
 
724
-		$perpage = !empty( $this->_req_data['perpage'] ) ? (int) $this->_req_data['perpage'] : NULL;
725
-		$curpage = !empty( $this->_req_data['curpage'] ) ? (int) $this->_req_data['curpage'] : NULL;
724
+		$perpage = ! empty($this->_req_data['perpage']) ? (int) $this->_req_data['perpage'] : NULL;
725
+		$curpage = ! empty($this->_req_data['curpage']) ? (int) $this->_req_data['curpage'] : NULL;
726 726
 
727
-		if ( is_array( $row_ids )) {
727
+		if (is_array($row_ids)) {
728 728
 			//figure out where we start the row_id count at for the current page.
729
-			$qsgcount = empty( $curpage ) ? 0 : ($curpage - 1 ) * $perpage;
729
+			$qsgcount = empty($curpage) ? 0 : ($curpage - 1) * $perpage;
730 730
 
731 731
 			global $wpdb;
732
-			for ( $i = 0; $i < count($row_ids); $i++ ) {
732
+			for ($i = 0; $i < count($row_ids); $i++) {
733 733
 				//Update the questions when re-ordering
734
-				if ( EEM_Question_Group::instance()->update ( array( 'QSG_order' => $qsgcount ), array(array( 'QSG_ID' => $row_ids[$i] ))) === FALSE ) {
734
+				if (EEM_Question_Group::instance()->update(array('QSG_order' => $qsgcount), array(array('QSG_ID' => $row_ids[$i]))) === FALSE) {
735 735
 					$success = FALSE;
736 736
 				}
737 737
 				$qsgcount++;
@@ -740,9 +740,9 @@  discard block
 block discarded – undo
740 740
 			$success = FALSE;
741 741
 		}
742 742
 
743
-		$errors = ! $success ? __( 'An error occurred. The question group order was not updated.', 'event_espresso' ) : FALSE;
743
+		$errors = ! $success ? __('An error occurred. The question group order was not updated.', 'event_espresso') : FALSE;
744 744
 
745
-		echo json_encode( array( 'return_data' => FALSE, 'success' => $success, 'errors' => $errors ));
745
+		echo json_encode(array('return_data' => FALSE, 'success' => $success, 'errors' => $errors));
746 746
 		die();
747 747
 
748 748
 	}
@@ -759,10 +759,10 @@  discard block
 block discarded – undo
759 759
 
760 760
 	protected function _reg_form_settings() {
761 761
 		$this->_template_args['values'] = $this->_yes_no_values;
762
-		$this->_template_args = apply_filters( 'FHEE__Extend_Registration_Form_Admin_Page___reg_form_settings___template_args', $this->_template_args );
763
-		$this->_set_add_edit_form_tags( 'update_reg_form_settings' );
764
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
765
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_CAF_TEMPLATE_PATH . 'reg_form_settings.template.php', $this->_template_args, TRUE );
762
+		$this->_template_args = apply_filters('FHEE__Extend_Registration_Form_Admin_Page___reg_form_settings___template_args', $this->_template_args);
763
+		$this->_set_add_edit_form_tags('update_reg_form_settings');
764
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
765
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_CAF_TEMPLATE_PATH.'reg_form_settings.template.php', $this->_template_args, TRUE);
766 766
 		$this->display_admin_page_with_sidebar();
767 767
 	}
768 768
 
@@ -770,9 +770,9 @@  discard block
 block discarded – undo
770 770
 
771 771
 
772 772
 	protected function _update_reg_form_settings() {
773
-		EE_Registry::instance()->CFG->registration = apply_filters( 'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', EE_Registry::instance()->CFG->registration );
774
-		$success = $this->_update_espresso_configuration( __('Registration Form Options', 'event_espresso'), EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__ );
775
-		$this->_redirect_after_action( $success, __('Registration Form Options', 'event_espresso'), 'updated', array( 'action' => 'view_reg_form_settings' ) );
773
+		EE_Registry::instance()->CFG->registration = apply_filters('FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', EE_Registry::instance()->CFG->registration);
774
+		$success = $this->_update_espresso_configuration(__('Registration Form Options', 'event_espresso'), EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__);
775
+		$this->_redirect_after_action($success, __('Registration Form Options', 'event_espresso'), 'updated', array('action' => 'view_reg_form_settings'));
776 776
 	}
777 777
 
778 778
 }
Please login to merge, or discard this patch.
Braces   +10 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -468,12 +469,12 @@  discard block
 block discarded – undo
468 469
 				}
469 470
 			}
470 471
 
471
-		}elseif( !empty($this->_req_data['QSG_ID'])){
472
+		} elseif( !empty($this->_req_data['QSG_ID'])){
472 473
 			$success = $model->delete_permanently_by_ID($this->_req_data['QSG_ID']);
473 474
 
474
-		}elseif( !empty($this->_req_data['QST_ID'])){
475
+		} elseif( !empty($this->_req_data['QST_ID'])){
475 476
 			$success = $model->delete_permanently_by_ID($this->_req_data['QST_ID']);
476
-		}else{
477
+		} else{
477 478
 			EE_Error::add_error( sprintf(__("No Questions or Question Groups were selected for deleting. This error usually shows when you've attempted to delete via bulk action but there were no selections.", "event_espresso")), __FILE__, __FUNCTION__, __LINE__ );
478 479
 		}
479 480
 		return $success;
@@ -498,7 +499,7 @@  discard block
 block discarded – undo
498 499
 			$questionGroup=$this->_question_group_model->get_one_by_ID($ID);
499 500
 			$additional_hidden_fields=array('QSG_ID'=>array('type'=>'hidden','value'=>$ID));
500 501
 			$this->_set_add_edit_form_tags('update_question_group', $additional_hidden_fields);
501
-		}else{
502
+		} else{
502 503
 			$questionGroup = EEM_Question_Group::instance()->create_default_object();
503 504
 			$questionGroup->set_order_to_latest();
504 505
 			$this->_set_add_edit_form_tags('insert_question_group');
@@ -656,7 +657,7 @@  discard block
 block discarded – undo
656 657
 		if($trash){
657 658
 			$action_desc = 'trashed';
658 659
 			$status = 'trash';
659
-		}else{
660
+		} else{
660 661
 			$action_desc = 'restored';
661 662
 			$status = 'all';
662 663
 		}
@@ -673,7 +674,7 @@  discard block
 block discarded – undo
673 674
 			//note: this a subclass of EEM_Soft_Delete_Base, so thsi is actually only getting nontrashed items
674 675
 			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
675 676
 			$results=$this->_question_model->count_deleted($where);
676
-		}else{
677
+		} else{
677 678
 			//note: this a subclass of EEM_Soft_Delete_Base, so thsi is actually only getting nontrashed items
678 679
 			$results=$this->_question_model->get_all_deleted($query_params);
679 680
 		}
@@ -688,7 +689,7 @@  discard block
 block discarded – undo
688 689
 		if ($count){
689 690
 			$where = isset( $query_params[0] ) ? array( $query_params[0] ) : array();
690 691
 			$results = $questionGroupModel->count($where);
691
-		}else{
692
+		} else{
692 693
 			$results = $questionGroupModel->get_all($query_params);
693 694
 		}
694 695
 		return $results;
@@ -703,7 +704,7 @@  discard block
 block discarded – undo
703 704
 			$where = isset( $query_params[0] ) ? array($query_params[0]) : array();
704 705
 			$query_params['limit'] = NULL;
705 706
 			$results = $questionGroupModel->count_deleted($where);
706
-		}else{
707
+		} else{
707 708
 			$results = $questionGroupModel->get_all_deleted($query_params);
708 709
 		}
709 710
 		return $results;
Please login to merge, or discard this patch.
Extend_Registration_Form_Questions_Admin_List_Table.class.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 
32 32
 class Extend_Registration_Form_Questions_Admin_List_Table extends Registration_Form_Questions_Admin_List_Table {
33 33
 
34
-	public function __construct( $admin_page ) {
35
-		parent::__construct( $admin_page );
34
+	public function __construct($admin_page) {
35
+		parent::__construct($admin_page);
36 36
 	}
37 37
 
38 38
 	public function column_display_text(EE_Question $item) {
39 39
 		$system_question = $item->is_system_question();
40 40
 		$actions = array();
41 41
 
42
-		if ( !defined('REG_ADMIN_URL') )
42
+		if ( ! defined('REG_ADMIN_URL'))
43 43
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
44 44
 
45 45
 		$edit_query_args = array(
@@ -63,31 +63,31 @@  discard block
 block discarded – undo
63 63
 			);
64 64
 
65 65
 
66
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL );
67
-		$trash_link = EE_Admin_Page::add_query_args_and_nonce( $trash_query_args, EE_FORMS_ADMIN_URL );
68
-		$restore_link = EE_Admin_Page::add_query_args_and_nonce( $restore_query_args, EE_FORMS_ADMIN_URL );
69
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_FORMS_ADMIN_URL );
66
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
67
+		$trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
68
+		$restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
69
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
70 70
 
71
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ) {
71
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID())) {
72 72
 			$actions = array(
73
-				'edit' => '<a href="' . $edit_link . '" title="' . __('Edit Question', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
73
+				'edit' => '<a href="'.$edit_link.'" title="'.__('Edit Question', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
74 74
 			);
75 75
 		}
76 76
 
77
-		if ( ! $system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_trash_question', $item->ID() ) ) {
78
-			$actions['delete'] = '<a href="' . $trash_link . '" title="' . __('Trash Question', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
77
+		if ( ! $system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_trash_question', $item->ID())) {
78
+			$actions['delete'] = '<a href="'.$trash_link.'" title="'.__('Trash Question', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
79 79
 		}
80 80
 
81
-		if ( $this->_view == 'trash' ) {
82
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_restore_question', $item->ID() ) ) {
83
-				$actions['restore'] = '<a href="' . $restore_link . '" title="' . __('Restore Question', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
81
+		if ($this->_view == 'trash') {
82
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_restore_question', $item->ID())) {
83
+				$actions['restore'] = '<a href="'.$restore_link.'" title="'.__('Restore Question', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
84 84
 			}
85
-			if ( $item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID() ) ) {
86
-				$actions['delete_permanently'] = '<a href="' . $delete_link . '" title="' . __('Delete Question Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
85
+			if ($item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID())) {
86
+				$actions['delete_permanently'] = '<a href="'.$delete_link.'" title="'.__('Delete Question Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
87 87
 			}
88 88
 		}
89 89
 
90
-		$content = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>' : $item->display_text();
90
+		$content = EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID()) ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->display_text().'</a></strong>' : $item->display_text();
91 91
 		$content .= $this->row_actions($actions);
92 92
 		return $content;
93 93
 	}
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 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
@@ -39,8 +40,9 @@  discard block
 block discarded – undo
39 40
 		$system_question = $item->is_system_question();
40 41
 		$actions = array();
41 42
 
42
-		if ( !defined('REG_ADMIN_URL') )
43
-			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
43
+		if ( !defined('REG_ADMIN_URL') ) {
44
+					define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
45
+		}
44 46
 
45 47
 		$edit_query_args = array(
46 48
 				'action' => 'edit_question',
Please login to merge, or discard this patch.