@@ -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 |
@@ -42,7 +43,7 @@ discard block |
||
42 | 43 | protected function _setup_data() { |
43 | 44 | if(isset($this->_req_data['status'] ) && $this->_req_data['status'] == 'trash'){ |
44 | 45 | $this->_data = $this->_admin_page->get_trashed_questions( $this->_per_page,$this->_current_page, FALSE ); |
45 | - }else{ |
|
46 | + } else{ |
|
46 | 47 | $this->_data = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, FALSE ); |
47 | 48 | } |
48 | 49 | $this->_all_data_count = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, TRUE ); |
@@ -117,8 +118,9 @@ discard block |
||
117 | 118 | public function column_display_text(EE_Question $item) { |
118 | 119 | $system_question = $item->is_system_question(); |
119 | 120 | |
120 | - if ( !defined('REG_ADMIN_URL') ) |
|
121 | - define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
|
121 | + if ( !defined('REG_ADMIN_URL') ) { |
|
122 | + define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
|
123 | + } |
|
122 | 124 | |
123 | 125 | $edit_query_args = array( |
124 | 126 | 'action' => 'edit_question', |
@@ -152,7 +154,7 @@ discard block |
||
152 | 154 | $options= $item->options(); |
153 | 155 | if(empty($options)){ |
154 | 156 | return "N/A"; |
155 | - }else{ |
|
157 | + } else{ |
|
156 | 158 | foreach($options as $optionID=>$option){ |
157 | 159 | /* @var $option EE_Question_Option */ |
158 | 160 | $optionNames[]=$option->value(); |
@@ -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 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | class Registration_Form_Questions_Admin_List_Table extends EE_Admin_List_Table { |
33 | 33 | |
34 | 34 | |
35 | - public function __construct( $admin_page ) { |
|
35 | + public function __construct($admin_page) { |
|
36 | 36 | parent::__construct($admin_page); |
37 | 37 | } |
38 | 38 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | protected function _setup_data() { |
43 | - if(isset($this->_req_data['status'] ) && $this->_req_data['status'] == 'trash'){ |
|
44 | - $this->_data = $this->_admin_page->get_trashed_questions( $this->_per_page,$this->_current_page, FALSE ); |
|
45 | - }else{ |
|
46 | - $this->_data = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, FALSE ); |
|
43 | + if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'trash') { |
|
44 | + $this->_data = $this->_admin_page->get_trashed_questions($this->_per_page, $this->_current_page, FALSE); |
|
45 | + } else { |
|
46 | + $this->_data = $this->_admin_page->get_questions($this->_per_page, $this->_current_page, FALSE); |
|
47 | 47 | } |
48 | - $this->_all_data_count = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, TRUE ); |
|
48 | + $this->_all_data_count = $this->_admin_page->get_questions($this->_per_page, $this->_current_page, TRUE); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | protected function _set_properties() { |
56 | 56 | $this->_wp_list_args = array( |
57 | - 'singular' => __('question', 'event_espresso' ), |
|
58 | - 'plural' => __('questions', 'event_espresso' ), |
|
57 | + 'singular' => __('question', 'event_espresso'), |
|
58 | + 'plural' => __('questions', 'event_espresso'), |
|
59 | 59 | 'ajax' => TRUE, //for now, |
60 | 60 | 'screen' => $this->_admin_page->get_current_screen()->id |
61 | 61 | ); |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | ); |
72 | 72 | |
73 | 73 | $this->_sortable_columns = array( |
74 | - 'id' => array( 'QST_ID' => FALSE ), |
|
75 | - 'display_text' => array( 'QST_display_text' => FALSE ) |
|
74 | + 'id' => array('QST_ID' => FALSE), |
|
75 | + 'display_text' => array('QST_display_text' => FALSE) |
|
76 | 76 | ); |
77 | 77 | |
78 | 78 | $this->_hidden_columns = array( |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | |
91 | 91 | |
92 | 92 | protected function _add_view_counts() { |
93 | - $this->_views['all']['count'] = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, TRUE ); |
|
94 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_questions', 'espresso_registration_form_trash_question' ) ) { |
|
93 | + $this->_views['all']['count'] = $this->_admin_page->get_questions($this->_per_page, $this->_current_page, TRUE); |
|
94 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_question')) { |
|
95 | 95 | $this->_views['trash']['count'] = $this->_admin_page->get_trashed_questions( -1, $this->_current_page, TRUE); |
96 | 96 | } |
97 | 97 | } |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | public function column_cb($item) { |
102 | 102 | $system_question = $item->is_system_question(); |
103 | 103 | $related_answer_count = $item->count_related('Answer'); |
104 | - $lock_icon = ( !$system_question && $related_answer_count > 0 && $this->_view == 'trash' ) ? 'ee-lock-icon ee-alternate-color' : 'ee-lock-icon ee-system-lock'; |
|
105 | - return $system_question || (!$system_question && $related_answer_count > 0 && $this->_view == 'trash' ) ? '<span class="' . $lock_icon . '"></span>' . sprintf( '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID() ) : sprintf( '<input type="checkbox" class="QST_ID" name="checkbox[%1$d]" value="%1$d" />', $item->ID() ); |
|
104 | + $lock_icon = ( ! $system_question && $related_answer_count > 0 && $this->_view == 'trash') ? 'ee-lock-icon ee-alternate-color' : 'ee-lock-icon ee-system-lock'; |
|
105 | + return $system_question || ( ! $system_question && $related_answer_count > 0 && $this->_view == 'trash') ? '<span class="'.$lock_icon.'"></span>'.sprintf('<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID()) : sprintf('<input type="checkbox" class="QST_ID" name="checkbox[%1$d]" value="%1$d" />', $item->ID()); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | public function column_id(EE_Question $item) { |
112 | 112 | $content = $item->ID(); |
113 | - $content .= ' <span class="show-on-mobile-view-only">' . $item->display_text() . '</span>'; |
|
113 | + $content .= ' <span class="show-on-mobile-view-only">'.$item->display_text().'</span>'; |
|
114 | 114 | return $content; |
115 | 115 | } |
116 | 116 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function column_display_text(EE_Question $item) { |
120 | 120 | $system_question = $item->is_system_question(); |
121 | 121 | |
122 | - if ( !defined('REG_ADMIN_URL') ) |
|
122 | + if ( ! defined('REG_ADMIN_URL')) |
|
123 | 123 | define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
124 | 124 | |
125 | 125 | $edit_query_args = array( |
@@ -127,16 +127,16 @@ discard block |
||
127 | 127 | 'QST_ID' => $item->ID() |
128 | 128 | ); |
129 | 129 | |
130 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ) { |
|
131 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL ); |
|
130 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID())) { |
|
131 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
132 | 132 | |
133 | 133 | $actions = array( |
134 | - 'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Event', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>' |
|
134 | + 'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Event', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>' |
|
135 | 135 | ); |
136 | 136 | } |
137 | 137 | |
138 | 138 | |
139 | - $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(); |
|
139 | + $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(); |
|
140 | 140 | $content .= $this->row_actions($actions); |
141 | 141 | return $content; |
142 | 142 | } |
@@ -150,16 +150,16 @@ discard block |
||
150 | 150 | |
151 | 151 | |
152 | 152 | public function column_values(EE_Question $item) { |
153 | - $optionNames=array(); |
|
154 | - $options= $item->options(); |
|
155 | - if(empty($options)){ |
|
153 | + $optionNames = array(); |
|
154 | + $options = $item->options(); |
|
155 | + if (empty($options)) { |
|
156 | 156 | return "N/A"; |
157 | - }else{ |
|
158 | - foreach($options as $optionID=>$option){ |
|
157 | + } else { |
|
158 | + foreach ($options as $optionID=>$option) { |
|
159 | 159 | /* @var $option EE_Question_Option */ |
160 | - $optionNames[]=$option->value(); |
|
160 | + $optionNames[] = $option->value(); |
|
161 | 161 | } |
162 | - return implode(', ',$optionNames); |
|
162 | + return implode(', ', $optionNames); |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 |
@@ -26,8 +26,8 @@ |
||
26 | 26 | <?php _e('This shows the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso'); ?> |
27 | 27 | </li> |
28 | 28 | <li> |
29 | -<strong><?php _e('Answer Options (for applicable question types)', 'event_espresso');?></strong><br/> |
|
30 | -<?php _e('Values do not allow any HTML, however, descriptions do allow HTML.', 'event_espresso');?> |
|
29 | +<strong><?php _e('Answer Options (for applicable question types)', 'event_espresso'); ?></strong><br/> |
|
30 | +<?php _e('Values do not allow any HTML, however, descriptions do allow HTML.', 'event_espresso'); ?> |
|
31 | 31 | </li> |
32 | 32 | <li> |
33 | 33 | <strong><?php _e('Required Question', 'event_espresso'); ?></strong><br /> |
@@ -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 | /** |
@@ -98,34 +98,34 @@ discard block |
||
98 | 98 | |
99 | 99 | |
100 | 100 | protected function _start() { |
101 | - $content = '<h3>' . __('Add Question Group', 'event_espresso') . '</h3>'; |
|
102 | - $content .= '<p>' . __('This tour of the Add Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
101 | + $content = '<h3>'.__('Add Question Group', 'event_espresso').'</h3>'; |
|
102 | + $content .= '<p>'.__('This tour of the Add Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
103 | 103 | |
104 | 104 | return $content; |
105 | 105 | } |
106 | 106 | |
107 | 107 | protected function _qsg_name_stop() { |
108 | - return '<p>' . __('The name of the question group.', 'event_espresso') . '</p>'; |
|
108 | + return '<p>'.__('The name of the question group.', 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | protected function _qsg_identifier_stop() { |
112 | - return '<p>' . __('A unique name for your question group.', 'event_espresso') . '</p>'; |
|
112 | + return '<p>'.__('A unique name for your question group.', 'event_espresso').'</p>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function _qsg_desc_stop() { |
116 | - return '<p>' . __('A description of the question group.', 'event_espresso') . '</p>'; |
|
116 | + return '<p>'.__('A description of the question group.', 'event_espresso').'</p>'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | protected function _qsg_order_stop() { |
120 | - return '<p>' . __('Set the order that you want your question group to appear in.', 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('Set the order that you want your question group to appear in.', 'event_espresso').'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _qsg_show_group_name_stop() { |
124 | - return '<p>' . __('Specify whether the group name should be shown on the registration page.', 'event_espresso') . '</p>'; |
|
124 | + return '<p>'.__('Specify whether the group name should be shown on the registration page.', 'event_espresso').'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _qsg_show_group_desc_stop() { |
128 | - return '<p>' . __('Specify whether the group description should be shown on the registration page.', 'event_espresso') . '</p>'; |
|
128 | + return '<p>'.__('Specify whether the group description should be shown on the registration page.', 'event_espresso').'</p>'; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | } |
132 | 132 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
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 |
@@ -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 | /** |
@@ -98,34 +98,34 @@ discard block |
||
98 | 98 | |
99 | 99 | |
100 | 100 | protected function _start() { |
101 | - $content = '<h3>' . __('Add New Question', 'event_espresso') . '</h3>'; |
|
102 | - $content .= '<p>' . __('This tour of the Add New Question page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
101 | + $content = '<h3>'.__('Add New Question', 'event_espresso').'</h3>'; |
|
102 | + $content .= '<p>'.__('This tour of the Add New Question page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
103 | 103 | |
104 | 104 | return $content; |
105 | 105 | } |
106 | 106 | |
107 | 107 | protected function _qst_display_text_stop() { |
108 | - return '<p>' . __('This is the question that is displayed to registrants who are signing up for events.', 'event_espresso') . '</p>'; |
|
108 | + return '<p>'.__('This is the question that is displayed to registrants who are signing up for events.', 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | protected function _qst_admin_label_stop() { |
112 | - return '<p>' . __('Helps you understand the difference between questions that may appear similar but are actually different.', 'event_espresso') . '</p>'; |
|
112 | + return '<p>'.__('Helps you understand the difference between questions that may appear similar but are actually different.', 'event_espresso').'</p>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function _qst_admin_only_stop() { |
116 | - return '<p>' . __('Specify whether this question should be shown only to admins.', 'event_espresso') . '</p>'; |
|
116 | + return '<p>'.__('Specify whether this question should be shown only to admins.', 'event_espresso').'</p>'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | protected function _qst_type_stop() { |
120 | - return '<p>' . __('Select the type of question. Available options are Text, Textarea, Single, Multiple, Dropdown, and Date.', 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('Select the type of question. Available options are Text, Textarea, Single, Multiple, Dropdown, and Date.', 'event_espresso').'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _qst_required_stop() { |
124 | - return '<p>' . __('Specify whether this question should be required.', 'event_espresso') . '</p>'; |
|
124 | + return '<p>'.__('Specify whether this question should be required.', 'event_espresso').'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _qst_required_text_stop() { |
128 | - return '<p>' . __('Text to display when registrant does not answer question but is required to.', 'event_espresso') . '</p>'; |
|
128 | + return '<p>'.__('Text to display when registrant does not answer question but is required to.', 'event_espresso').'</p>'; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | } |
132 | 132 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
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 |
@@ -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 | /** |
@@ -98,34 +98,34 @@ discard block |
||
98 | 98 | |
99 | 99 | |
100 | 100 | protected function _start() { |
101 | - $content = '<h3>' . __('Edit Question Group', 'event_espresso') . '</h3>'; |
|
102 | - $content .= '<p>' . __('This tour of the Edit Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
101 | + $content = '<h3>'.__('Edit Question Group', 'event_espresso').'</h3>'; |
|
102 | + $content .= '<p>'.__('This tour of the Edit Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
103 | 103 | |
104 | 104 | return $content; |
105 | 105 | } |
106 | 106 | |
107 | 107 | protected function _qsg_name_stop() { |
108 | - return '<p>' . __('The name of the question group.', 'event_espresso') . '</p>'; |
|
108 | + return '<p>'.__('The name of the question group.', 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | protected function _qsg_identifier_stop() { |
112 | - return '<p>' . __('A unique name for your question group.', 'event_espresso') . '</p>'; |
|
112 | + return '<p>'.__('A unique name for your question group.', 'event_espresso').'</p>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function _qsg_desc_stop() { |
116 | - return '<p>' . __('A description of the question group.', 'event_espresso') . '</p>'; |
|
116 | + return '<p>'.__('A description of the question group.', 'event_espresso').'</p>'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | protected function _qsg_order_stop() { |
120 | - return '<p>' . __('Set the order that you want your question group to appear in.', 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('Set the order that you want your question group to appear in.', 'event_espresso').'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _qsg_show_group_name_stop() { |
124 | - return '<p>' . __('Specify whether the group name should be shown on the registration page.', 'event_espresso') . '</p>'; |
|
124 | + return '<p>'.__('Specify whether the group name should be shown on the registration page.', 'event_espresso').'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _qsg_show_group_desc_stop() { |
128 | - return '<p>' . __('Specify whether the group description should be shown on the registration page.', 'event_espresso') . '</p>'; |
|
128 | + return '<p>'.__('Specify whether the group description should be shown on the registration page.', 'event_espresso').'</p>'; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | } |
132 | 132 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
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 |
@@ -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 | /** |
@@ -98,34 +98,34 @@ discard block |
||
98 | 98 | |
99 | 99 | |
100 | 100 | protected function _start() { |
101 | - $content = '<h3>' . __('Edit Question', 'event_espresso') . '</h3>'; |
|
102 | - $content .= '<p>' . __('This tour of the Edit Question page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
101 | + $content = '<h3>'.__('Edit Question', 'event_espresso').'</h3>'; |
|
102 | + $content .= '<p>'.__('This tour of the Edit Question page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
103 | 103 | |
104 | 104 | return $content; |
105 | 105 | } |
106 | 106 | |
107 | 107 | protected function _qst_display_text_stop() { |
108 | - return '<p>' . __('This is the question that is displayed to registrants who are signing up for events.', 'event_espresso') . '</p>'; |
|
108 | + return '<p>'.__('This is the question that is displayed to registrants who are signing up for events.', 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | protected function _qst_admin_label_stop() { |
112 | - return '<p>' . __('Helps you understand the difference between questions that may appear similar but are actually different.', 'event_espresso') . '</p>'; |
|
112 | + return '<p>'.__('Helps you understand the difference between questions that may appear similar but are actually different.', 'event_espresso').'</p>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function _qst_admin_only_stop() { |
116 | - return '<p>' . __('Specify whether this question should be shown only to the admins.', 'event_espresso') . '</p>'; |
|
116 | + return '<p>'.__('Specify whether this question should be shown only to the admins.', 'event_espresso').'</p>'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | protected function _qst_type_stop() { |
120 | - return '<p>' . __('Select the type of question. Available options are text, textarea, single, multiple, dropdown, and date.', 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('Select the type of question. Available options are text, textarea, single, multiple, dropdown, and date.', 'event_espresso').'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _qst_required_stop() { |
124 | - return '<p>' . __('Specify whether this question should be required.', 'event_espresso') . '</p>'; |
|
124 | + return '<p>'.__('Specify whether this question should be required.', 'event_espresso').'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _qst_required_text_stop() { |
128 | - return '<p>' . __('Text to display when registrant does not answer question but is required to.', 'event_espresso') . '</p>'; |
|
128 | + return '<p>'.__('Text to display when registrant does not answer question but is required to.', 'event_espresso').'</p>'; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | } |
132 | 132 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
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 |
@@ -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 | /** |
@@ -98,34 +98,34 @@ discard block |
||
98 | 98 | |
99 | 99 | |
100 | 100 | protected function _start() { |
101 | - $content = '<h3>' . __('Registration Form Settings', 'event_espresso') . '</h3>'; |
|
102 | - $content .= '<p>' . __('This tour of the Registration Form Settings page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
101 | + $content = '<h3>'.__('Registration Form Settings', 'event_espresso').'</h3>'; |
|
102 | + $content .= '<p>'.__('This tour of the Registration Form Settings page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
103 | 103 | |
104 | 104 | return $content; |
105 | 105 | } |
106 | 106 | |
107 | 107 | protected function _use_recaptcha_stop() { |
108 | - return '<p>' . __('Specify whether reCAPTCHA should be enabled.', 'event_espresso') . '</p>'; |
|
108 | + return '<p>'.__('Specify whether reCAPTCHA should be enabled.', 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | protected function _recaptcha_public_key_stop() { |
112 | - return '<p>' . __('Enter your public key for reCAPTCHA.', 'event_espresso') . '</p>'; |
|
112 | + return '<p>'.__('Enter your public key for reCAPTCHA.', 'event_espresso').'</p>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function _recaptcha_private_key_stop() { |
116 | - return '<p>' . __('Enter your private key for reCAPTCHA.', 'event_espresso') . '</p>'; |
|
116 | + return '<p>'.__('Enter your private key for reCAPTCHA.', 'event_espresso').'</p>'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | protected function _recaptcha_theme_stop() { |
120 | - return '<p>' . __('Select a theme (style) for your reCAPTCHA.', 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('Select a theme (style) for your reCAPTCHA.', 'event_espresso').'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _recaptcha_language_stop() { |
124 | - return '<p>' . __('Specify the language that should be used for reCAPTCHA.', 'event_espresso') . '</p>'; |
|
124 | + return '<p>'.__('Specify the language that should be used for reCAPTCHA.', 'event_espresso').'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _recaptcha_width_stop() { |
128 | - return '<p>' . __('Specify how wide (in pixels) the reCAPTCHA form should be.', 'event_espresso') . '</p>'; |
|
128 | + return '<p>'.__('Specify how wide (in pixels) the reCAPTCHA form should be.', 'event_espresso').'</p>'; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | } |
132 | 132 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
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 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | |
3 | 5 | |
4 | 6 | class EE_Attendee_Contact_List_Table extends EE_Admin_List_Table { |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | class EE_Attendee_Contact_List_Table extends EE_Admin_List_Table { |
5 | 5 | |
6 | 6 | |
7 | - public function __construct( $admin_page ) { |
|
7 | + public function __construct($admin_page) { |
|
8 | 8 | parent::__construct($admin_page); |
9 | 9 | } |
10 | 10 | |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | |
13 | 13 | |
14 | 14 | protected function _setup_data() { |
15 | - $this->_data = $this->_view != 'trash' ? $this->_admin_page->get_attendees( $this->_per_page ) : $this->_admin_page->get_attendees( $this->_per_page, FALSE, TRUE ); |
|
16 | - $this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_attendees( $this->_per_page, TRUE ) : $this->_admin_page->get_attendees( $this->_per_page,TRUE, TRUE ); |
|
15 | + $this->_data = $this->_view != 'trash' ? $this->_admin_page->get_attendees($this->_per_page) : $this->_admin_page->get_attendees($this->_per_page, FALSE, TRUE); |
|
16 | + $this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_attendees($this->_per_page, TRUE) : $this->_admin_page->get_attendees($this->_per_page, TRUE, TRUE); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | ); |
42 | 42 | |
43 | 43 | $this->_sortable_columns = array( |
44 | - 'ATT_ID' => array( 'ATT_ID' => FALSE ), |
|
45 | - 'ATT_lname' => array( 'ATT_lname' => TRUE ), //true means its already sorted |
|
46 | - 'ATT_fname' => array( 'ATT_fname' => FALSE ), |
|
47 | - 'ATT_email' => array( 'ATT_email' => FALSE ), |
|
48 | - 'ATT_city' => array( 'ATT_city' => FALSE ), |
|
49 | - 'STA_ID' => array( 'STA_ID' => FALSE ), |
|
50 | - 'CNT_ISO' => array( 'CNT_ISO' => FALSE ) |
|
44 | + 'ATT_ID' => array('ATT_ID' => FALSE), |
|
45 | + 'ATT_lname' => array('ATT_lname' => TRUE), //true means its already sorted |
|
46 | + 'ATT_fname' => array('ATT_fname' => FALSE), |
|
47 | + 'ATT_email' => array('ATT_email' => FALSE), |
|
48 | + 'ATT_city' => array('ATT_city' => FALSE), |
|
49 | + 'STA_ID' => array('STA_ID' => FALSE), |
|
50 | + 'CNT_ISO' => array('CNT_ISO' => FALSE) |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | $this->_hidden_columns = array(); |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | |
65 | 65 | |
66 | 66 | protected function _add_view_counts() { |
67 | - $this->_views['in_use']['count'] = $this->_admin_page->get_attendees( $this->_per_page, TRUE ); |
|
68 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_delete_registration' ) ) { |
|
69 | - $this->_views['trash']['count'] = $this->_admin_page->get_attendees( $this->_per_page,TRUE, TRUE ); |
|
67 | + $this->_views['in_use']['count'] = $this->_admin_page->get_attendees($this->_per_page, TRUE); |
|
68 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_delete_registration')) { |
|
69 | + $this->_views['trash']['count'] = $this->_admin_page->get_attendees($this->_per_page, TRUE, TRUE); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | |
91 | 91 | function column_cb($item) { |
92 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() ); |
|
92 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID()); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | |
98 | 98 | |
99 | 99 | function column_ATT_ID($item) { |
100 | - $content = $item->ID(); |
|
100 | + $content = $item->ID(); |
|
101 | 101 | $attendee_name = $item instanceof EE_Attendee ? $item->full_name() : ''; |
102 | - $content .= ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
|
102 | + $content .= ' <span class="show-on-mobile-view-only">'.$attendee_name.'</span>'; |
|
103 | 103 | return $content; |
104 | 104 | } |
105 | 105 | |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | function column_ATT_lname($item) { |
111 | 111 | |
112 | 112 | // edit attendee link |
113 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
114 | - $name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->lname() . '</a>' : $item->lname(); |
|
113 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
114 | + $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->lname().'</a>' : $item->lname(); |
|
115 | 115 | return $name_link; |
116 | 116 | |
117 | 117 | } |
@@ -124,30 +124,30 @@ discard block |
||
124 | 124 | //Build row actions |
125 | 125 | $actions = array(); |
126 | 126 | // edit attendee link |
127 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ) { |
|
128 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
129 | - $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>'; |
|
127 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee')) { |
|
128 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
129 | + $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
130 | 130 | } |
131 | 131 | |
132 | - if ( $this->_view == 'in_use' ) { |
|
132 | + if ($this->_view == 'in_use') { |
|
133 | 133 | // trash attendee link |
134 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) { |
|
135 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_attendee', 'ATT_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
136 | - $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Contact to Trash', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>'; |
|
134 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) { |
|
135 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_attendee', 'ATT_ID'=>$item->ID()), REG_ADMIN_URL); |
|
136 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Contact to Trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
137 | 137 | } |
138 | 138 | } else { |
139 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_restore_attendees' ) ) { |
|
139 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_restore_attendees')) { |
|
140 | 140 | // restore attendee link |
141 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_attendees', 'ATT_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
142 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Contact', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
141 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_attendees', 'ATT_ID'=>$item->ID()), REG_ADMIN_URL); |
|
142 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Contact', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
147 | - $name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->fname() . '</a>' : $item->fname(); |
|
146 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
147 | + $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->fname().'</a>' : $item->fname(); |
|
148 | 148 | |
149 | 149 | //Return the name contents |
150 | - return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions) ); |
|
150 | + return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions)); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | |
157 | 157 | function column_ATT_email($item) { |
158 | - return '<a href="mailto:' . $item->email() . '">' . $item->email() . '</a>'; |
|
158 | + return '<a href="mailto:'.$item->email().'">'.$item->email().'</a>'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | |
176 | 176 | function column_STA_ID($item) { |
177 | 177 | $states = EEM_State::instance()->get_all_states(); |
178 | - $state = isset( $states[ $item->state_ID() ] ) ? $states[ $item->state_ID() ]->get( 'STA_name' ) : $item->state_ID(); |
|
179 | - return ! is_numeric( $state ) ? $state : ''; |
|
178 | + $state = isset($states[$item->state_ID()]) ? $states[$item->state_ID()]->get('STA_name') : $item->state_ID(); |
|
179 | + return ! is_numeric($state) ? $state : ''; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | function column_CNT_ISO($item) { |
185 | 185 | $countries = EEM_Country::instance()->get_all_countries(); |
186 | 186 | //EEH_Debug_Tools::printr( $countries, '$countries <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
187 | - $country = isset( $countries[ $item->country_ID() ] ) ? $countries[ $item->country_ID() ]->get( 'CNT_name' ) : $item->country_ID(); |
|
188 | - return ! is_numeric( $country ) ? $country : ''; |
|
187 | + $country = isset($countries[$item->country_ID()]) ? $countries[$item->country_ID()]->get('CNT_name') : $item->country_ID(); |
|
188 | + return ! is_numeric($country) ? $country : ''; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * ------------------------------------------------------------------------ |
23 | 23 | */ |
24 | -class Registrations_Admin_Page_Init extends EE_Admin_Page_CPT_Init { |
|
24 | +class Registrations_Admin_Page_Init extends EE_Admin_Page_CPT_Init { |
|
25 | 25 | |
26 | 26 | |
27 | 27 | |
@@ -34,16 +34,16 @@ discard block |
||
34 | 34 | * @return void |
35 | 35 | */ |
36 | 36 | public function __construct() { |
37 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
38 | - if ( ! defined( 'REG_PG_SLUG' ) ) { |
|
39 | - define( 'REG_PG_SLUG', 'espresso_registrations' ); |
|
40 | - define( 'REG_PG_NAME', ucwords( str_replace( '_', '', REG_PG_SLUG ))); |
|
41 | - define( 'REG_ADMIN', EE_ADMIN_PAGES . 'registrations' . DS ); |
|
42 | - define( 'REG_ADMIN_URL', admin_url( 'admin.php?page=' . REG_PG_SLUG )); |
|
43 | - define( 'REG_ASSETS_PATH', REG_ADMIN . 'assets' . DS ); |
|
44 | - define( 'REG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registrations/assets/' ); |
|
45 | - define( 'REG_TEMPLATE_PATH', REG_ADMIN . 'templates' . DS ); |
|
46 | - define( 'REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registrations/templates/' ); |
|
37 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
38 | + if ( ! defined('REG_PG_SLUG')) { |
|
39 | + define('REG_PG_SLUG', 'espresso_registrations'); |
|
40 | + define('REG_PG_NAME', ucwords(str_replace('_', '', REG_PG_SLUG))); |
|
41 | + define('REG_ADMIN', EE_ADMIN_PAGES.'registrations'.DS); |
|
42 | + define('REG_ADMIN_URL', admin_url('admin.php?page='.REG_PG_SLUG)); |
|
43 | + define('REG_ASSETS_PATH', REG_ADMIN.'assets'.DS); |
|
44 | + define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL.'registrations/assets/'); |
|
45 | + define('REG_TEMPLATE_PATH', REG_ADMIN.'templates'.DS); |
|
46 | + define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL.'registrations/templates/'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | parent::__construct(); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | |
61 | 61 | protected function _set_menu_map() { |
62 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( array( |
|
62 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu(array( |
|
63 | 63 | 'menu_group' => 'main', |
64 | 64 | 'menu_order' => 40, |
65 | 65 | 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |