Completed
Branch ENH/remove-assert (475b03)
by
unknown
21:25 queued 13:40
created
extend/registration_form/templates/questions_in_group_meta_box.template.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@
 block discarded – undo
10 10
 <h4><?php esc_html_e('Check off all questions that you wish to appear in this group.', 'event_espresso'); ?></h4>
11 11
 <ul>
12 12
     <?php
13
-    foreach ($all_questions as $question_ID => $question) {
14
-        $checked = array_key_exists($question_ID, $question_group->questions()) ? 'checked' : '';
15
-        ?>
13
+	foreach ($all_questions as $question_ID => $question) {
14
+		$checked = array_key_exists($question_ID, $question_group->questions()) ? 'checked' : '';
15
+		?>
16 16
         <li>
17 17
             <label for="question-<?php echo absint($question_ID); ?>">
18 18
                 <input type="checkbox" name="questions[<?php echo absint($question_ID); ?>]"
Please login to merge, or discard this patch.
registration_form/templates/question_groups_main_meta_box.template.php 2 patches
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
             <td>
96 96
                 <label for="QSG_show_group_name">
97 97
                     <?php echo wp_kses(
98
-                        EEH_Form_Fields::select_input(
99
-                            'QSG_show_group_name',
100
-                            $values,
101
-                            $question_group->show_group_name()
102
-                        ),
103
-                        AllowedTags::getWithFormTags()
104
-                    ); ?>
98
+						EEH_Form_Fields::select_input(
99
+							'QSG_show_group_name',
100
+							$values,
101
+							$question_group->show_group_name()
102
+						),
103
+						AllowedTags::getWithFormTags()
104
+					); ?>
105 105
                     <p class="description"><?php esc_html_e('Show Group Name on Registration Page?', 'event_espresso'); ?></p>
106 106
                 </label>
107 107
             </td>
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
             <td>
118 118
                 <label for="QSG_show_group_order">
119 119
                     <?php echo wp_kses(
120
-                        EEH_Form_Fields::select_input(
121
-                            'QSG_show_group_desc',
122
-                            $values,
123
-                            $question_group->show_group_desc()
124
-                        ),
125
-                        AllowedTags::getWithFormTags()
126
-                    ); ?>
120
+						EEH_Form_Fields::select_input(
121
+							'QSG_show_group_desc',
122
+							$values,
123
+							$question_group->show_group_desc()
124
+						),
125
+						AllowedTags::getWithFormTags()
126
+					); ?>
127 127
                     <p class="description"><?php
128
-                        esc_html_e(' Show Group Description on Registration Page?', 'event_espresso');
129
-                    ?></p>
128
+						esc_html_e(' Show Group Description on Registration Page?', 'event_espresso');
129
+					?></p>
130 130
                 </label>
131 131
                 <input type="hidden" name="QSG_system" value="<?php echo esc_attr($question_group->system_group()); ?>">
132 132
             </td>
@@ -142,85 +142,85 @@  discard block
 block discarded – undo
142 142
     <div class="form-table question-group-questions inside">
143 143
         <div class="padding">
144 144
             <p><span class="description"><?php
145
-                    esc_html_e(
146
-                        'Select which questions should be shown in this group by checking or unchecking boxes. You can drag and drop questions to reorder them. Your changes will be updated when you save.',
147
-                        'event_espresso'
148
-                    ); ?></span></p>
145
+					esc_html_e(
146
+						'Select which questions should be shown in this group by checking or unchecking boxes. You can drag and drop questions to reorder them. Your changes will be updated when you save.',
147
+						'event_espresso'
148
+					); ?></span></p>
149 149
             <div>
150 150
                 <ul class="question-list-sortable">
151 151
                     <?php
152
-                    $question_order = 0;
153
-                    $question_group_questions = $question_group->questions();
154
-                    foreach ($all_questions as $question_ID => $question) {
155
-                        if ($question instanceof EE_Question) {
156
-                            /*@var $question EE_Question*/
157
-                            $checked = isset($question_group_questions[ $question_ID ]) ? 'checked' : '';
158
-                            // disable questions from the personal information question group
159
-                            // is it required in the current question group? if so don't allow admins to remove it
160
-                            $disabled = in_array(
161
-                                $question->system_ID(),
162
-                                EEM_Question::instance()->required_system_questions_in_system_question_group(
163
-                                    $QSG_system
164
-                                )
165
-                            ) ? 'disabled' : '';
166
-                            // limit where system questions can appear
167
-                            if (
168
-                                $question->system_ID() &&
169
-                                ! in_array(
170
-                                    $question->system_ID(),
171
-                                    EEM_Question::instance()->allowed_system_questions_in_system_question_group(
172
-                                        $QSG_system
173
-                                    )
174
-                                )
175
-                            ) {
176
-                                continue; // skip over system question not assigned to this group except for the address system group cause we want the address questions to display even if they aren't selected (but still not show the personal system questions).  The third condition checks if we're displaying a non system question group and the question is a system question, then we skip because for non-system question groups we only want to show non-system questions.
177
-                            }
178
-                            ?>
152
+					$question_order = 0;
153
+					$question_group_questions = $question_group->questions();
154
+					foreach ($all_questions as $question_ID => $question) {
155
+						if ($question instanceof EE_Question) {
156
+							/*@var $question EE_Question*/
157
+							$checked = isset($question_group_questions[ $question_ID ]) ? 'checked' : '';
158
+							// disable questions from the personal information question group
159
+							// is it required in the current question group? if so don't allow admins to remove it
160
+							$disabled = in_array(
161
+								$question->system_ID(),
162
+								EEM_Question::instance()->required_system_questions_in_system_question_group(
163
+									$QSG_system
164
+								)
165
+							) ? 'disabled' : '';
166
+							// limit where system questions can appear
167
+							if (
168
+								$question->system_ID() &&
169
+								! in_array(
170
+									$question->system_ID(),
171
+									EEM_Question::instance()->allowed_system_questions_in_system_question_group(
172
+										$QSG_system
173
+									)
174
+								)
175
+							) {
176
+								continue; // skip over system question not assigned to this group except for the address system group cause we want the address questions to display even if they aren't selected (but still not show the personal system questions).  The third condition checks if we're displaying a non system question group and the question is a system question, then we skip because for non-system question groups we only want to show non-system questions.
177
+							}
178
+							?>
179 179
                             <li class="ee-question-sortable">
180 180
                                 <label for="question-<?php echo absint($question_ID); ?>">
181 181
                                     <input type="checkbox" name="questions[<?php echo absint($question_ID); ?>]"
182 182
                                            id="question-<?php echo absint($question_ID); ?>"
183 183
                                            value="<?php echo absint($question_ID); ?>" <?php echo esc_attr($disabled); ?> <?php echo esc_attr($checked); ?>>
184 184
                                     <span class="question-text"><?php
185
-                                        echo wp_kses(trim($question->display_text()), AllowedTags::getAllowedTags())
186
-                                             . (95 <= strlen(trim($question->display_text()))
187
-                                                ? "&hellip;"
188
-                                                : '');
189
-                                                                ?>
185
+										echo wp_kses(trim($question->display_text()), AllowedTags::getAllowedTags())
186
+											 . (95 <= strlen(trim($question->display_text()))
187
+												? "&hellip;"
188
+												: '');
189
+																?>
190 190
                                     </span>
191 191
                                     <input class="question-group-QGQ_order" type="hidden"
192 192
                                            name="question_orders[<?php echo absint($question_ID); ?>]"
193 193
                                            value="<?php echo esc_attr($question_order); ?>">
194 194
                                 </label>
195 195
                                 <?php
196
-                                if (
197
-                                    EE_Registry::instance()->CAP->current_user_can(
198
-                                        'ee_edit_question',
199
-                                        'espresso_registration_form_edit_question',
200
-                                        $question->ID()
201
-                                    )
202
-                                ) {
203
-                                    $edit_query_args = array(
204
-                                        'action' => 'edit_question',
205
-                                        'QST_ID' => $question->ID(),
206
-                                    );
207
-                                    $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
208
-
209
-                                    echo '<a href="' . $edit_link . '" target="_blank" aria-label="' .
210
-                                        sprintf(
211
-                                            esc_attr__('Edit %s', 'event_espresso'),
212
-                                            $question->admin_label()
213
-                                        )
214
-                                        . '"><span class="dashicons dashicons-edit"></span>
196
+								if (
197
+									EE_Registry::instance()->CAP->current_user_can(
198
+										'ee_edit_question',
199
+										'espresso_registration_form_edit_question',
200
+										$question->ID()
201
+									)
202
+								) {
203
+									$edit_query_args = array(
204
+										'action' => 'edit_question',
205
+										'QST_ID' => $question->ID(),
206
+									);
207
+									$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
208
+
209
+									echo '<a href="' . $edit_link . '" target="_blank" aria-label="' .
210
+										sprintf(
211
+											esc_attr__('Edit %s', 'event_espresso'),
212
+											$question->admin_label()
213
+										)
214
+										. '"><span class="dashicons dashicons-edit"></span>
215 215
                                         </a>';
216
-                                }
217
-                                ?>
216
+								}
217
+								?>
218 218
                             </li>
219 219
                             <?php
220
-                            $question_order++;
221
-                        }
222
-                    }
223
-                    ?>
220
+							$question_order++;
221
+						}
222
+					}
223
+					?>
224 224
                 </ul>
225 225
             </div>
226 226
         </div>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 <input id="QSG_identifier" name="QSG_identifier<?php echo esc_attr($id); ?>"
52 52
                        value="<?php echo esc_attr($question_group->get_f('QSG_identifier')); ?>" type="text"
53 53
                        class="regular-text" <?php echo esc_attr($disabled); ?>>
54
-                <?php if (! empty($QSG_system)) { ?>
54
+                <?php if ( ! empty($QSG_system)) { ?>
55 55
                     <p><span class="description" style="color:#D54E21;">
56 56
                             <?php esc_html_e('System question group! This field cannot be changed.', 'event_espresso') ?>
57 57
                     </span><br/></p>
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                     foreach ($all_questions as $question_ID => $question) {
155 155
                         if ($question instanceof EE_Question) {
156 156
                             /*@var $question EE_Question*/
157
-                            $checked = isset($question_group_questions[ $question_ID ]) ? 'checked' : '';
157
+                            $checked = isset($question_group_questions[$question_ID]) ? 'checked' : '';
158 158
                             // disable questions from the personal information question group
159 159
                             // is it required in the current question group? if so don't allow admins to remove it
160 160
                             $disabled = in_array(
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                                     );
207 207
                                     $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
208 208
 
209
-                                    echo '<a href="' . $edit_link . '" target="_blank" aria-label="' .
209
+                                    echo '<a href="'.$edit_link.'" target="_blank" aria-label="'.
210 210
                                         sprintf(
211 211
                                             esc_attr__('Edit %s', 'event_espresso'),
212 212
                                             $question->admin_label()
Please login to merge, or discard this patch.