@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ), |
84 | 84 | 7 => array( |
85 | 85 | 'content_id' => 'tkt-status-archived', |
86 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::archived, |
|
86 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::archived, |
|
87 | 87 | 'content' => $this->_ticket_status_legend(EE_Ticket::archived), |
88 | 88 | 'options' => array( |
89 | 89 | 'position' => array( |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ), |
97 | 97 | 8 => array( |
98 | 98 | 'content_id' => 'tkt-status-expired', |
99 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::expired, |
|
99 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::expired, |
|
100 | 100 | 'content' => $this->_ticket_status_legend(EE_Ticket::expired), |
101 | 101 | 'options' => array( |
102 | 102 | 'position' => array( |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | ), |
110 | 110 | 9 => array( |
111 | 111 | 'content_id' => 'tkt-status-sold_out', |
112 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::sold_out, |
|
112 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::sold_out, |
|
113 | 113 | 'content' => $this->_ticket_status_legend(EE_Ticket::sold_out), |
114 | 114 | 'options' => array( |
115 | 115 | 'position' => array( |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ), |
123 | 123 | 10 => array( |
124 | 124 | 'content_id' => 'tkt-status-pending', |
125 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::pending, |
|
125 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::pending, |
|
126 | 126 | 'content' => $this->_ticket_status_legend(EE_Ticket::pending), |
127 | 127 | 'options' => array( |
128 | 128 | 'position' => array( |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ), |
136 | 136 | 11 => array( |
137 | 137 | 'content_id' => 'tkt-status-onsale', |
138 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::onsale, |
|
138 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::onsale, |
|
139 | 139 | 'content' => $this->_ticket_status_legend(EE_Ticket::onsale), |
140 | 140 | 'options' => array( |
141 | 141 | 'position' => array( |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | |
179 | 179 | |
180 | 180 | private function _get_taxable_info_content() { |
181 | - $price_admin_link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), PRICING_ADMIN_URL ); |
|
182 | - return '<p>' . sprintf( __('Clicking the taxable ticket toggle checkbox has enabled taxes for this ticket. What this means is that when a person purchases this ticket, the tax will be applied to all prices on this ticket. You can edit the existing tax price modifier that was setup in Event Espresso by going to %sDefault Pricing Admin Page%s (labelled "Pricing" in the Event Espresso Menu)', 'event_espresso'), '<a href="' . $price_admin_link . '" title="' . esc_attr__('Pricing Admin Page', 'event_espresso') . '">', '</a>' ) . '</p>'; |
|
181 | + $price_admin_link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), PRICING_ADMIN_URL); |
|
182 | + return '<p>'.sprintf(__('Clicking the taxable ticket toggle checkbox has enabled taxes for this ticket. What this means is that when a person purchases this ticket, the tax will be applied to all prices on this ticket. You can edit the existing tax price modifier that was setup in Event Espresso by going to %sDefault Pricing Admin Page%s (labelled "Pricing" in the Event Espresso Menu)', 'event_espresso'), '<a href="'.$price_admin_link.'" title="'.esc_attr__('Pricing Admin Page', 'event_espresso').'">', '</a>').'</p>'; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param EE_Ticket constant $status What status is set (by class) |
188 | 188 | * @return string The status legend with the related status highlighted |
189 | 189 | */ |
190 | - private function _ticket_status_legend( $status ) { |
|
190 | + private function _ticket_status_legend($status) { |
|
191 | 191 | |
192 | 192 | $status_array = array( |
193 | 193 | 'archived' => EE_Ticket::archived, |
@@ -197,6 +197,6 @@ discard block |
||
197 | 197 | 'onsale' => EE_Ticket::onsale |
198 | 198 | ); |
199 | 199 | |
200 | - return EEH_Template::status_legend( $status_array, $status ); |
|
200 | + return EEH_Template::status_legend($status_array, $status); |
|
201 | 201 | } |
202 | 202 | } |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <a class='clone-date-time dtm-inp-btn' rel='<?php echo $row; ?>' title='<?php esc_attr_e('Clone this Event Date and Time', 'event_espresso'); ?>' style='position:relative; top:5px; margin:0 0 0 10px; font-size:.9em; cursor:pointer;'> |
2 | - <img src='<?php echo EE_IMAGES_URL;?>clone-trooper-16x16.png' width='16' height='16' alt='<?php esc_attr_e('clone', 'event_espresso'); ?>'/> |
|
2 | + <img src='<?php echo EE_IMAGES_URL; ?>clone-trooper-16x16.png' width='16' height='16' alt='<?php esc_attr_e('clone', 'event_espresso'); ?>'/> |
|
3 | 3 | </a> |
@@ -1,4 +1,4 @@ |
||
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> |
@@ -6,27 +6,27 @@ |
||
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 | } |
@@ -1,6 +1,6 @@ |
||
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> |
@@ -5,6 +5,6 @@ |
||
5 | 5 | ?> |
6 | 6 | <div class="padding"> |
7 | 7 | |
8 | - <?php do_action( 'AHEE__template_settings__template__before_settings_form' ); ?> |
|
8 | + <?php do_action('AHEE__template_settings__template__before_settings_form'); ?> |
|
9 | 9 | |
10 | 10 | </div> |
@@ -1,6 +1,7 @@ discard block |
||
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 |
||
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( |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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_global_mtps' ) { |
|
109 | + public function add_custom_mtps_columns($columns, $screen_id) { |
|
110 | + if ($screen_id !== 'espresso_messages_global_mtps') { |
|
111 | 111 | return $columns; |
112 | 112 | } |
113 | 113 | |
@@ -128,13 +128,13 @@ discard block |
||
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_global_mtps' || ! 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_global_mtps' || ! 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 |
||
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 |
||
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'), |
@@ -1,6 +1,7 @@ discard block |
||
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 |
||
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', |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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( |
@@ -67,35 +67,35 @@ discard block |
||
67 | 67 | 'QST_ID' => $item->ID() |
68 | 68 | ); |
69 | 69 | |
70 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL ); |
|
71 | - $trash_link = EE_Admin_Page::add_query_args_and_nonce( $trash_query_args, EE_FORMS_ADMIN_URL ); |
|
72 | - $restore_link = EE_Admin_Page::add_query_args_and_nonce( $restore_query_args, EE_FORMS_ADMIN_URL ); |
|
73 | - $delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_FORMS_ADMIN_URL ); |
|
74 | - $duplicate_link = EE_Admin_Page::add_query_args_and_nonce( $duplicate_query_args, EE_FORMS_ADMIN_URL ); |
|
70 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
71 | + $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL); |
|
72 | + $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL); |
|
73 | + $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL); |
|
74 | + $duplicate_link = EE_Admin_Page::add_query_args_and_nonce($duplicate_query_args, EE_FORMS_ADMIN_URL); |
|
75 | 75 | |
76 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ) { |
|
76 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID())) { |
|
77 | 77 | $actions = array( |
78 | - 'edit' => '<a href="' . $edit_link . '" title="' . __('Edit Question', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>' |
|
78 | + 'edit' => '<a href="'.$edit_link.'" title="'.__('Edit Question', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>' |
|
79 | 79 | ); |
80 | 80 | } |
81 | 81 | |
82 | - if ( ! $system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_trash_question', $item->ID() ) ) { |
|
83 | - $actions['delete'] = '<a href="' . $trash_link . '" title="' . __('Trash Question', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
82 | + if ( ! $system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_trash_question', $item->ID())) { |
|
83 | + $actions['delete'] = '<a href="'.$trash_link.'" title="'.__('Trash Question', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
84 | 84 | } |
85 | 85 | |
86 | - if ( $this->_view == 'trash' ) { |
|
87 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_restore_question', $item->ID() ) ) { |
|
88 | - $actions['restore'] = '<a href="' . $restore_link . '" title="' . __('Restore Question', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>'; |
|
86 | + if ($this->_view == 'trash') { |
|
87 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_restore_question', $item->ID())) { |
|
88 | + $actions['restore'] = '<a href="'.$restore_link.'" title="'.__('Restore Question', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
89 | 89 | } |
90 | - if ( $item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID() ) ) { |
|
91 | - $actions['delete'] = '<a href="' . $delete_link . '" title="' . __('Delete Question Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
90 | + if ($item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID())) { |
|
91 | + $actions['delete'] = '<a href="'.$delete_link.'" title="'.__('Delete Question Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
92 | 92 | } |
93 | 93 | } |
94 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_questions', 'espresso_registration_form_edit_question' ) ) { |
|
95 | - $actions[ 'duplicate' ] = '<a href="' . $duplicate_link . '" title="' . __('Duplicate Question', 'event_espresso') . '">' . __('Duplicate', 'event_espresso') . '</a>'; |
|
94 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_questions', 'espresso_registration_form_edit_question')) { |
|
95 | + $actions['duplicate'] = '<a href="'.$duplicate_link.'" title="'.__('Duplicate Question', 'event_espresso').'">'.__('Duplicate', 'event_espresso').'</a>'; |
|
96 | 96 | } |
97 | 97 | |
98 | - $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(); |
|
98 | + $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(); |
|
99 | 99 | $content .= $this->row_actions($actions); |
100 | 100 | return $content; |
101 | 101 | } |
@@ -1,6 +1,7 @@ discard block |
||
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 |
@@ -125,8 +126,9 @@ discard block |
||
125 | 126 | $actions = array(); |
126 | 127 | |
127 | 128 | //return $item->name(); |
128 | - if ( !defined('REG_ADMIN_URL') ) |
|
129 | - define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
|
129 | + if ( !defined('REG_ADMIN_URL') ) { |
|
130 | + define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
|
131 | + } |
|
130 | 132 | |
131 | 133 | $edit_query_args = array( |
132 | 134 | 'action' => 'edit_question_group', |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | class Registration_Form_Question_Groups_Admin_List_Table extends EE_Admin_List_Table { |
32 | 32 | |
33 | 33 | |
34 | - public function __construct( $admin_page ) { |
|
34 | + public function __construct($admin_page) { |
|
35 | 35 | parent::__construct($admin_page); |
36 | 36 | } |
37 | 37 | |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | |
41 | 41 | protected function _setup_data() { |
42 | - $this->_data = $this->_view != 'trash' ? $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, FALSE ) : $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, FALSE ); |
|
43 | - $this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, TRUE ) : $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, TRUE ); |
|
42 | + $this->_data = $this->_view != 'trash' ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, FALSE) : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, FALSE); |
|
43 | + $this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, TRUE) : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, TRUE); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | |
50 | 50 | protected function _set_properties() { |
51 | 51 | $this->_wp_list_args = array( |
52 | - 'singular' => __('question group', 'event_espresso' ), |
|
53 | - 'plural' => __('question groups', 'event_espresso' ), |
|
52 | + 'singular' => __('question group', 'event_espresso'), |
|
53 | + 'plural' => __('question groups', 'event_espresso'), |
|
54 | 54 | 'ajax' => TRUE, //for now, |
55 | 55 | 'screen' => $this->_admin_page->get_current_screen()->id |
56 | 56 | ); |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | ); |
66 | 66 | |
67 | 67 | $this->_sortable_columns = array( |
68 | - 'id' => array( 'QSG_ID' => FALSE ), |
|
69 | - 'name' => array( 'QSG_name' => FALSE ) |
|
68 | + 'id' => array('QSG_ID' => FALSE), |
|
69 | + 'name' => array('QSG_name' => FALSE) |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | $this->_hidden_columns = array( |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | |
93 | 93 | |
94 | 94 | protected function _add_view_counts() { |
95 | - $this->_views['all']['count'] = $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, TRUE ); |
|
96 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_group' ) ) { |
|
97 | - $this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, TRUE ); |
|
95 | + $this->_views['all']['count'] = $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, TRUE); |
|
96 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_group')) { |
|
97 | + $this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, TRUE); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $system_group = $item->get('QSG_system'); |
108 | 108 | $has_questions_with_answers = $item->has_questions_with_answers(); |
109 | 109 | $lock_icon = $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers ? 'ee-lock-icon ee-alternate-color' : 'ee-lock-icon ee-system-lock'; |
110 | - return $system_group > 0 || ( $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers ) || ! EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_groups', $item->ID() ) ? '<span class="' . $lock_icon . '"></span>' . sprintf( '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID() ) : sprintf( '<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />', $item->ID() ); |
|
110 | + return $system_group > 0 || ($system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers) || ! EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_groups', $item->ID()) ? '<span class="'.$lock_icon.'"></span>'.sprintf('<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID()) : sprintf('<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />', $item->ID()); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | public function column_id(EE_Question_Group $item) { |
119 | 119 | $content = $item->ID(); |
120 | - $content .= ' <span class="show-on-mobile-view-only">' .$item->name() . '</span>'; |
|
120 | + $content .= ' <span class="show-on-mobile-view-only">'.$item->name().'</span>'; |
|
121 | 121 | return $content; |
122 | 122 | } |
123 | 123 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $actions = array(); |
128 | 128 | |
129 | 129 | //return $item->name(); |
130 | - if ( !defined('REG_ADMIN_URL') ) |
|
130 | + if ( ! defined('REG_ADMIN_URL')) |
|
131 | 131 | define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
132 | 132 | |
133 | 133 | $edit_query_args = array( |
@@ -152,32 +152,32 @@ discard block |
||
152 | 152 | |
153 | 153 | |
154 | 154 | |
155 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL ); |
|
156 | - $trash_link = EE_Admin_Page::add_query_args_and_nonce( $trash_query_args, EE_FORMS_ADMIN_URL ); |
|
157 | - $restore_link = EE_Admin_Page::add_query_args_and_nonce( $restore_query_args, EE_FORMS_ADMIN_URL ); |
|
158 | - $delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_FORMS_ADMIN_URL ); |
|
155 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
156 | + $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL); |
|
157 | + $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL); |
|
158 | + $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL); |
|
159 | 159 | |
160 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID() ) ) { |
|
160 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID())) { |
|
161 | 161 | $actions = array( |
162 | - 'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Question Group', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>' |
|
162 | + 'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Question Group', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>' |
|
163 | 163 | ); |
164 | 164 | } |
165 | - if ( $item->get('QSG_system') < 1 && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_trash_question_group', $item->ID() ) ) { |
|
166 | - $actions['delete'] = '<a href="' . $trash_link . '" title="' . esc_attr__('Delete Question Group', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
165 | + if ($item->get('QSG_system') < 1 && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_trash_question_group', $item->ID())) { |
|
166 | + $actions['delete'] = '<a href="'.$trash_link.'" title="'.esc_attr__('Delete Question Group', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
167 | 167 | } |
168 | 168 | |
169 | - if ( $this->_view == 'trash' ) { |
|
169 | + if ($this->_view == 'trash') { |
|
170 | 170 | |
171 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_restore_question_group', $item->ID() ) ) { |
|
172 | - $actions['restore'] = '<a href="' . $restore_link . '" title="' . esc_attr__('Restore Question Group', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>'; |
|
171 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_restore_question_group', $item->ID())) { |
|
172 | + $actions['restore'] = '<a href="'.$restore_link.'" title="'.esc_attr__('Restore Question Group', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
173 | 173 | } |
174 | 174 | |
175 | - if ( !$item->has_questions_with_answers() && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_delete_question_group', $item->ID() ) ) { |
|
176 | - $actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
175 | + if ( ! $item->has_questions_with_answers() && EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_delete_question_group', $item->ID())) { |
|
176 | + $actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Question Group Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
180 | - $content = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID() ) ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' : $item->name(); |
|
180 | + $content = EE_Registry::instance()->CAP->current_user_can('ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID()) ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>' : $item->name(); |
|
181 | 181 | $content .= $this->row_actions($actions); |
182 | 182 | return $content; |
183 | 183 | } |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | |
199 | 199 | |
200 | 200 | public function column_show_group_name(EE_Question_Group $item) { |
201 | - return $this->_yes_no[ $item->show_group_name() ]; |
|
201 | + return $this->_yes_no[$item->show_group_name()]; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | |
205 | 205 | |
206 | 206 | public function column_show_group_desc(EE_Question_Group $item) { |
207 | - return $this->_yes_no[ $item->show_group_desc() ]; |
|
207 | + return $this->_yes_no[$item->show_group_desc()]; |
|
208 | 208 | } |
209 | 209 | |
210 | 210 |