@@ -121,9 +121,10 @@ discard block |
||
121 | 121 | <h3 class="catbg">', $txt['attachment_transfer'], '</h3> |
122 | 122 | </div>'; |
123 | 123 | |
124 | - if (!empty($context['results'])) |
|
125 | - echo ' |
|
124 | + if (!empty($context['results'])) { |
|
125 | + echo ' |
|
126 | 126 | <div class="noticebox">', $context['results'], '</div>'; |
127 | + } |
|
127 | 128 | |
128 | 129 | echo ' |
129 | 130 | <div class="windowbg2 noup"> |
@@ -135,9 +136,10 @@ discard block |
||
135 | 136 | <select name="from"> |
136 | 137 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
137 | 138 | |
138 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
139 | - echo ' |
|
139 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
140 | + echo ' |
|
140 | 141 | <option value="', $id, '">', $dir, '</option>'; |
142 | + } |
|
141 | 143 | |
142 | 144 | echo ' |
143 | 145 | </select> |
@@ -148,13 +150,14 @@ discard block |
||
148 | 150 | <option value="0">', $txt['attachment_transfer_auto_select'], '</option> |
149 | 151 | <option value="-1">', $txt['attachment_transfer_forum_root'], '</option>'; |
150 | 152 | |
151 | - if (!empty($context['base_dirs'])) |
|
152 | - foreach ($context['base_dirs'] as $id => $dir) |
|
153 | + if (!empty($context['base_dirs'])) { |
|
154 | + foreach ($context['base_dirs'] as $id => $dir) |
|
153 | 155 | echo ' |
154 | 156 | <option value="', $id, '">', $dir, '</option>'; |
155 | - else |
|
156 | - echo ' |
|
157 | + } else { |
|
158 | + echo ' |
|
157 | 159 | <option value="0" disabled>', $txt['attachment_transfer_no_base'], '</option>'; |
160 | + } |
|
158 | 161 | |
159 | 162 | echo ' |
160 | 163 | </select> |
@@ -164,18 +167,20 @@ discard block |
||
164 | 167 | <select name="to"> |
165 | 168 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
166 | 169 | |
167 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
168 | - echo ' |
|
170 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
171 | + echo ' |
|
169 | 172 | <option value="', $id, '">', $dir, '</option>'; |
173 | + } |
|
170 | 174 | |
171 | 175 | echo ' |
172 | 176 | </select> |
173 | 177 | </dd>'; |
174 | 178 | |
175 | - if (!empty($modSettings['attachmentDirFileLimit'])) |
|
176 | - echo ' |
|
179 | + if (!empty($modSettings['attachmentDirFileLimit'])) { |
|
180 | + echo ' |
|
177 | 181 | <dt>', $txt['attachment_transfer_empty'], '</dt> |
178 | 182 | <dd><input type="checkbox" name="empty_it"', $context['checked'] ? ' checked' : '', '></dd>'; |
183 | + } |
|
179 | 184 | |
180 | 185 | echo ' |
181 | 186 | </dl> |
@@ -211,8 +216,8 @@ discard block |
||
211 | 216 | global $context, $txt, $scripturl; |
212 | 217 | |
213 | 218 | // If we've completed just let them know! |
214 | - if ($context['completed']) |
|
215 | - echo ' |
|
219 | + if ($context['completed']) { |
|
220 | + echo ' |
|
216 | 221 | <div id="manage_attachments"> |
217 | 222 | <div class="cat_bar"> |
218 | 223 | <h3 class="catbg">', $txt['repair_attachments_complete'], '</h3> |
@@ -221,10 +226,11 @@ discard block |
||
221 | 226 | ', $txt['repair_attachments_complete_desc'], ' |
222 | 227 | </div> |
223 | 228 | </div>'; |
229 | + } |
|
224 | 230 | |
225 | 231 | // What about if no errors were even found? |
226 | - elseif (!$context['errors_found']) |
|
227 | - echo ' |
|
232 | + elseif (!$context['errors_found']) { |
|
233 | + echo ' |
|
228 | 234 | <div id="manage_attachments"> |
229 | 235 | <div class="cat_bar"> |
230 | 236 | <h3 class="catbg">', $txt['repair_attachments_complete'], '</h3> |
@@ -233,6 +239,7 @@ discard block |
||
233 | 239 | ', $txt['repair_attachments_no_errors'], ' |
234 | 240 | </div> |
235 | 241 | </div>'; |
242 | + } |
|
236 | 243 | |
237 | 244 | // Otherwise, I'm sad to say, we have a problem! |
238 | 245 | else |
@@ -247,11 +254,12 @@ discard block |
||
247 | 254 | <p>', $txt['repair_attachments_error_desc'], '</p>'; |
248 | 255 | |
249 | 256 | // Loop through each error reporting the status |
250 | - foreach ($context['repair_errors'] as $error => $number) |
|
251 | - if (!empty($number)) |
|
257 | + foreach ($context['repair_errors'] as $error => $number) { |
|
258 | + if (!empty($number)) |
|
252 | 259 | echo ' |
253 | 260 | <input type="checkbox" name="to_fix[]" id="', $error, '" value="', $error, '"> |
254 | 261 | <label for="', $error, '">', sprintf($txt['attach_repair_' . $error], $number), '</label><br>'; |
262 | + } |
|
255 | 263 | |
256 | 264 | echo ' |
257 | 265 | <br> |
@@ -270,8 +278,9 @@ discard block |
||
270 | 278 | { |
271 | 279 | global $modSettings; |
272 | 280 | |
273 | - if (!empty($modSettings['attachment_basedirectories'])) |
|
274 | - template_show_list('base_paths'); |
|
281 | + if (!empty($modSettings['attachment_basedirectories'])) { |
|
282 | + template_show_list('base_paths'); |
|
283 | + } |
|
275 | 284 | |
276 | 285 | template_show_list('attach_paths'); |
277 | 286 | } |
@@ -28,15 +28,17 @@ discard block |
||
28 | 28 | <form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">'; |
29 | 29 | |
30 | 30 | // Did they make a mistake last time? |
31 | - if (!empty($context['login_errors'])) |
|
32 | - echo ' |
|
31 | + if (!empty($context['login_errors'])) { |
|
32 | + echo ' |
|
33 | 33 | <div class="errorbox">', implode('<br>', $context['login_errors']), '</div> |
34 | 34 | <br>'; |
35 | + } |
|
35 | 36 | |
36 | 37 | // Or perhaps there's some special description for this time? |
37 | - if (isset($context['description'])) |
|
38 | - echo ' |
|
38 | + if (isset($context['description'])) { |
|
39 | + echo ' |
|
39 | 40 | <div class="information">', $context['description'], '</div>'; |
41 | + } |
|
40 | 42 | |
41 | 43 | // Now just get the basic information - username, password, etc. |
42 | 44 | echo ' |
@@ -61,10 +63,11 @@ discard block |
||
61 | 63 | </dd>'; |
62 | 64 | |
63 | 65 | // If they have deleted their account, give them a chance to change their mind. |
64 | - if (isset($context['login_show_undelete'])) |
|
65 | - echo ' |
|
66 | + if (isset($context['login_show_undelete'])) { |
|
67 | + echo ' |
|
66 | 68 | <dt class="alert">', $txt['undelete_account'], ':</dt> |
67 | 69 | <dd><input type="checkbox" name="undelete"></dd>'; |
70 | + } |
|
68 | 71 | |
69 | 72 | echo ' |
70 | 73 | </dl> |
@@ -82,8 +85,8 @@ discard block |
||
82 | 85 | document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus(); |
83 | 86 | }, 150);'; |
84 | 87 | |
85 | - if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) |
|
86 | - echo ' |
|
88 | + if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) { |
|
89 | + echo ' |
|
87 | 90 | form = $("#frmLogin"); |
88 | 91 | form.submit(function(e) { |
89 | 92 | e.preventDefault(); |
@@ -116,16 +119,18 @@ discard block |
||
116 | 119 | |
117 | 120 | return false; |
118 | 121 | });'; |
122 | + } |
|
119 | 123 | |
120 | 124 | echo ' |
121 | 125 | </script> |
122 | 126 | </form>'; |
123 | 127 | |
124 | 128 | // It is a long story as to why we have this when we're clearly not going to use it. |
125 | - if (!empty($context['from_ajax'])) |
|
126 | - echo ' |
|
129 | + if (!empty($context['from_ajax'])) { |
|
130 | + echo ' |
|
127 | 131 | <br> |
128 | 132 | <a href="javascript:self.close();"></a>'; |
133 | + } |
|
129 | 134 | |
130 | 135 | echo ' |
131 | 136 | </div><!-- .roundframe --> |
@@ -148,11 +153,12 @@ discard block |
||
148 | 153 | </div> |
149 | 154 | <div class="roundframe noup">'; |
150 | 155 | |
151 | - if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) |
|
152 | - echo ' |
|
156 | + if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) { |
|
157 | + echo ' |
|
153 | 158 | <div class="error"> |
154 | 159 | ', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], ' |
155 | 160 | </div>'; |
161 | + } |
|
156 | 162 | |
157 | 163 | echo ' |
158 | 164 | <form action="', $context['tfa_url'], '" method="post" id="frmTfa"> |
@@ -181,8 +187,8 @@ discard block |
||
181 | 187 | <script> |
182 | 188 | form = $("#frmTfa");'; |
183 | 189 | |
184 | - if (!empty($context['from_ajax'])) |
|
185 | - echo ' |
|
190 | + if (!empty($context['from_ajax'])) { |
|
191 | + echo ' |
|
186 | 192 | form.submit(function(e) { |
187 | 193 | // If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page |
188 | 194 | if (form.find("input[name=tfa_backup]:first").val().length > 0) |
@@ -201,6 +207,7 @@ discard block |
||
201 | 207 | |
202 | 208 | return false; |
203 | 209 | });'; |
210 | + } |
|
204 | 211 | |
205 | 212 | echo ' |
206 | 213 | form.find("input[name=backup]").click(function(e) { |
@@ -232,10 +239,11 @@ discard block |
||
232 | 239 | <p class="information centertext"> |
233 | 240 | ', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>'; |
234 | 241 | |
235 | - if ($context['can_register']) |
|
236 | - echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
237 | - else |
|
238 | - echo $txt['login_below']; |
|
242 | + if ($context['can_register']) { |
|
243 | + echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
244 | + } else { |
|
245 | + echo $txt['login_below']; |
|
246 | + } |
|
239 | 247 | |
240 | 248 | // And now the login information. |
241 | 249 | echo ' |
@@ -335,9 +343,10 @@ discard block |
||
335 | 343 | </div> |
336 | 344 | <div class="roundframe centertext noup">'; |
337 | 345 | |
338 | - if (!empty($context['incorrect_password'])) |
|
339 | - echo ' |
|
346 | + if (!empty($context['incorrect_password'])) { |
|
347 | + echo ' |
|
340 | 348 | <div class="error">', $txt['admin_incorrect_password'], '</div>'; |
349 | + } |
|
341 | 350 | |
342 | 351 | echo ' |
343 | 352 | <strong>', $txt['password'], ':</strong> |
@@ -378,10 +387,11 @@ discard block |
||
378 | 387 | <dl>'; |
379 | 388 | |
380 | 389 | // You didn't even have an ID? |
381 | - if (empty($context['member_id'])) |
|
382 | - echo ' |
|
390 | + if (empty($context['member_id'])) { |
|
391 | + echo ' |
|
383 | 392 | <dt>', $txt['invalid_activation_username'], ':</dt> |
384 | 393 | <dd><input type="text" name="user" size="30"></dd>'; |
394 | + } |
|
385 | 395 | |
386 | 396 | echo ' |
387 | 397 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
@@ -418,13 +428,14 @@ discard block |
||
418 | 428 | <dd><input type="password" name="passwd" size="30"></dd> |
419 | 429 | </dl>'; |
420 | 430 | |
421 | - if ($context['can_activate']) |
|
422 | - echo ' |
|
431 | + if ($context['can_activate']) { |
|
432 | + echo ' |
|
423 | 433 | <p>', $txt['invalid_activation_known'], '</p> |
424 | 434 | <dl> |
425 | 435 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
426 | 436 | <dd><input type="text" name="code" size="30"></dd> |
427 | 437 | </dl>'; |
438 | + } |
|
428 | 439 | |
429 | 440 | echo ' |
430 | 441 | <p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button"></p> |
@@ -55,9 +55,10 @@ discard block |
||
55 | 55 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
56 | 56 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
57 | 57 | |
58 | - if ($context['allow_protected']) |
|
59 | - echo ' |
|
58 | + if ($context['allow_protected']) { |
|
59 | + echo ' |
|
60 | 60 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
61 | + } |
|
61 | 62 | |
62 | 63 | echo ' |
63 | 64 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -67,14 +68,15 @@ discard block |
||
67 | 68 | </dd>'; |
68 | 69 | } |
69 | 70 | |
70 | - if ($context['post_group'] || $context['undefined_group']) |
|
71 | - echo ' |
|
71 | + if ($context['post_group'] || $context['undefined_group']) { |
|
72 | + echo ' |
|
72 | 73 | <dt id="min_posts_text"> |
73 | 74 | <strong>', $txt['membergroups_min_posts'], ':</strong> |
74 | 75 | </dt> |
75 | 76 | <dd> |
76 | 77 | <input type="number" name="min_posts" id="min_posts_input" size="5"> |
77 | 78 | </dd>'; |
79 | + } |
|
78 | 80 | |
79 | 81 | if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups'])) |
80 | 82 | { |
@@ -92,9 +94,10 @@ discard block |
||
92 | 94 | <option value="-1">', $txt['membergroups_guests'], '</option> |
93 | 95 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
94 | 96 | |
95 | - foreach ($context['groups'] as $group) |
|
96 | - echo ' |
|
97 | + foreach ($context['groups'] as $group) { |
|
98 | + echo ' |
|
97 | 99 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
100 | + } |
|
98 | 101 | |
99 | 102 | echo ' |
100 | 103 | </select> |
@@ -105,9 +108,10 @@ discard block |
||
105 | 108 | <option value="-1">', $txt['membergroups_guests'], '</option> |
106 | 109 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
107 | 110 | |
108 | - foreach ($context['groups'] as $group) |
|
109 | - echo ' |
|
111 | + foreach ($context['groups'] as $group) { |
|
112 | + echo ' |
|
110 | 113 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
114 | + } |
|
111 | 115 | |
112 | 116 | echo ' |
113 | 117 | </select> |
@@ -139,8 +143,8 @@ discard block |
||
139 | 143 | <input type="submit" value="', $txt['membergroups_add_group'], '" class="button"> |
140 | 144 | </div><!-- .windowbg2 -->'; |
141 | 145 | |
142 | - if ($context['undefined_group']) |
|
143 | - echo ' |
|
146 | + if ($context['undefined_group']) { |
|
147 | + echo ' |
|
144 | 148 | <script> |
145 | 149 | function swapPostGroup(isChecked) |
146 | 150 | { |
@@ -150,6 +154,7 @@ discard block |
||
150 | 154 | } |
151 | 155 | swapPostGroup(', $context['post_group'] ? 'true' : 'false', '); |
152 | 156 | </script>'; |
157 | + } |
|
153 | 158 | |
154 | 159 | echo ' |
155 | 160 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -181,14 +186,15 @@ discard block |
||
181 | 186 | <input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30"> |
182 | 187 | </dd>'; |
183 | 188 | |
184 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
185 | - echo ' |
|
189 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
190 | + echo ' |
|
186 | 191 | <dt id="group_desc_text"> |
187 | 192 | <label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label> |
188 | 193 | </dt> |
189 | 194 | <dd> |
190 | 195 | <textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea> |
191 | 196 | </dd>'; |
197 | + } |
|
192 | 198 | |
193 | 199 | // Group type... |
194 | 200 | if ($context['group']['allow_post_group']) |
@@ -202,9 +208,10 @@ discard block |
||
202 | 208 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
203 | 209 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
204 | 210 | |
205 | - if ($context['group']['allow_protected']) |
|
206 | - echo ' |
|
211 | + if ($context['group']['allow_protected']) { |
|
212 | + echo ' |
|
207 | 213 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
214 | + } |
|
208 | 215 | |
209 | 216 | echo ' |
210 | 217 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -214,8 +221,8 @@ discard block |
||
214 | 221 | </dd>'; |
215 | 222 | } |
216 | 223 | |
217 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
218 | - echo ' |
|
224 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
225 | + echo ' |
|
219 | 226 | <dt id="group_moderators_text"> |
220 | 227 | <label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label> |
221 | 228 | </dt> |
@@ -233,6 +240,7 @@ discard block |
||
233 | 240 | <option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option> |
234 | 241 | </select> |
235 | 242 | </dd>'; |
243 | + } |
|
236 | 244 | |
237 | 245 | // Can they inherit permissions? |
238 | 246 | if ($context['group']['id'] > 1 && $context['group']['id'] != 3) |
@@ -249,9 +257,10 @@ discard block |
||
249 | 257 | <option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>'; |
250 | 258 | |
251 | 259 | // For all the inheritable groups show an option. |
252 | - foreach ($context['inheritable_groups'] as $id => $group) |
|
253 | - echo ' |
|
260 | + foreach ($context['inheritable_groups'] as $id => $group) { |
|
261 | + echo ' |
|
254 | 262 | <option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>'; |
263 | + } |
|
255 | 264 | |
256 | 265 | echo ' |
257 | 266 | </select> |
@@ -259,8 +268,8 @@ discard block |
||
259 | 268 | </dd>'; |
260 | 269 | } |
261 | 270 | |
262 | - if ($context['group']['allow_post_group']) |
|
263 | - echo ' |
|
271 | + if ($context['group']['allow_post_group']) { |
|
272 | + echo ' |
|
264 | 273 | |
265 | 274 | <dt id="min_posts_text"> |
266 | 275 | <label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label> |
@@ -268,6 +277,7 @@ discard block |
||
268 | 277 | <dd> |
269 | 278 | <input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6"> |
270 | 279 | </dd>'; |
280 | + } |
|
271 | 281 | |
272 | 282 | echo ' |
273 | 283 | <dt> |
@@ -297,9 +307,10 @@ discard block |
||
297 | 307 | <select name="icon_image" id="icon_image_input">'; |
298 | 308 | |
299 | 309 | // For every possible icon, create an option. |
300 | - foreach ($context['possible_icons'] as $icon) |
|
301 | - echo ' |
|
310 | + foreach ($context['possible_icons'] as $icon) { |
|
311 | + echo ' |
|
302 | 312 | <option value="', $icon, '"', $context['group']['icon_image'] == $icon ? ' selected' : '', '>', $icon, '</option>'; |
313 | + } |
|
303 | 314 | |
304 | 315 | echo ' |
305 | 316 | </select> |
@@ -308,9 +319,10 @@ discard block |
||
308 | 319 | } |
309 | 320 | |
310 | 321 | // No? Hide the entire control. |
311 | - else |
|
312 | - echo ' |
|
322 | + else { |
|
323 | + echo ' |
|
313 | 324 | <input type="hidden" name="icon_image" value="">'; |
325 | + } |
|
314 | 326 | |
315 | 327 | echo ' |
316 | 328 | <dt> |
@@ -322,8 +334,8 @@ discard block |
||
322 | 334 | </dd>'; |
323 | 335 | |
324 | 336 | // Force 2FA for this membergroup? |
325 | - if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) |
|
326 | - echo ' |
|
337 | + if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) { |
|
338 | + echo ' |
|
327 | 339 | <dt> |
328 | 340 | <label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br> |
329 | 341 | <span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span> |
@@ -331,6 +343,7 @@ discard block |
||
331 | 343 | <dd> |
332 | 344 | <input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '> |
333 | 345 | </dd>'; |
346 | + } |
|
334 | 347 | |
335 | 348 | if (!empty($context['categories'])) |
336 | 349 | { |
@@ -341,11 +354,11 @@ discard block |
||
341 | 354 | </dt> |
342 | 355 | <dd>'; |
343 | 356 | |
344 | - if (!empty($context['can_manage_boards'])) |
|
345 | - echo $txt['membergroups_can_manage_access']; |
|
346 | - |
|
347 | - else |
|
348 | - template_add_edit_group_boards_list(); |
|
357 | + if (!empty($context['can_manage_boards'])) { |
|
358 | + echo $txt['membergroups_can_manage_access']; |
|
359 | + } else { |
|
360 | + template_add_edit_group_boards_list(); |
|
361 | + } |
|
349 | 362 | |
350 | 363 | echo ' |
351 | 364 | </dd>'; |
@@ -375,20 +388,21 @@ discard block |
||
375 | 388 | sItemListContainerId: \'moderator_container\', |
376 | 389 | aListItems: ['; |
377 | 390 | |
378 | - foreach ($context['group']['moderators'] as $id_member => $member_name) |
|
379 | - echo ' |
|
391 | + foreach ($context['group']['moderators'] as $id_member => $member_name) { |
|
392 | + echo ' |
|
380 | 393 | { |
381 | 394 | sItemId: ', JavaScriptEscape($id_member), ', |
382 | 395 | sItemName: ', JavaScriptEscape($member_name), ' |
383 | 396 | }', $id_member == $context['group']['last_moderator_id'] ? '' : ','; |
397 | + } |
|
384 | 398 | |
385 | 399 | echo ' |
386 | 400 | ] |
387 | 401 | }); |
388 | 402 | </script>'; |
389 | 403 | |
390 | - if ($context['group']['allow_post_group']) |
|
391 | - echo ' |
|
404 | + if ($context['group']['allow_post_group']) { |
|
405 | + echo ' |
|
392 | 406 | <script> |
393 | 407 | function swapPostGroup(isChecked) |
394 | 408 | { |
@@ -436,7 +450,8 @@ discard block |
||
436 | 450 | |
437 | 451 | swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', '); |
438 | 452 | </script>'; |
439 | -} |
|
453 | + } |
|
454 | + } |
|
440 | 455 | |
441 | 456 | /** |
442 | 457 | * The template for determining which boards a group has access to. |
@@ -454,13 +469,13 @@ discard block |
||
454 | 469 | |
455 | 470 | foreach ($context['categories'] as $category) |
456 | 471 | { |
457 | - if (empty($modSettings['deny_boards_access'])) |
|
458 | - echo ' |
|
472 | + if (empty($modSettings['deny_boards_access'])) { |
|
473 | + echo ' |
|
459 | 474 | <li class="category"> |
460 | 475 | <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a> |
461 | 476 | <ul>'; |
462 | - else |
|
463 | - echo ' |
|
477 | + } else { |
|
478 | + echo ' |
|
464 | 479 | <li class="category"> |
465 | 480 | <strong>', $category['name'], '</strong> |
466 | 481 | <span class="select_all_box"> |
@@ -473,16 +488,17 @@ discard block |
||
473 | 488 | </select> |
474 | 489 | </span> |
475 | 490 | <ul id="boards_list_', $category['id'], '">'; |
491 | + } |
|
476 | 492 | |
477 | 493 | foreach ($category['boards'] as $board) |
478 | 494 | { |
479 | - if (empty($modSettings['deny_boards_access'])) |
|
480 | - echo ' |
|
495 | + if (empty($modSettings['deny_boards_access'])) { |
|
496 | + echo ' |
|
481 | 497 | <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
482 | 498 | <input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label> |
483 | 499 | </li>'; |
484 | - else |
|
485 | - echo ' |
|
500 | + } else { |
|
501 | + echo ' |
|
486 | 502 | <li class="board" style="width:100%"> |
487 | 503 | <span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span> |
488 | 504 | <span style="width:50%;float:right"> |
@@ -491,6 +507,7 @@ discard block |
||
491 | 507 | <input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', '> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label> |
492 | 508 | </span> |
493 | 509 | </li>'; |
510 | + } |
|
494 | 511 | } |
495 | 512 | |
496 | 513 | echo ' |
@@ -501,14 +518,14 @@ discard block |
||
501 | 518 | echo ' |
502 | 519 | </ul>'; |
503 | 520 | |
504 | - if (empty($modSettings['deny_boards_access'])) |
|
505 | - echo ' |
|
521 | + if (empty($modSettings['deny_boards_access'])) { |
|
522 | + echo ' |
|
506 | 523 | <br class="clear"><br> |
507 | 524 | <input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');"> |
508 | 525 | <label for="checkall_check"><em>', $txt['check_all'], '</em></label> |
509 | 526 | </fieldset>'; |
510 | - else |
|
511 | - echo ' |
|
527 | + } else { |
|
528 | + echo ' |
|
512 | 529 | <br class="clear"> |
513 | 530 | <span class="select_all_box"> |
514 | 531 | <em>', $txt['all'], ': </em> |
@@ -524,15 +541,17 @@ discard block |
||
524 | 541 | }); |
525 | 542 | }); |
526 | 543 | </script>'; |
544 | + } |
|
527 | 545 | |
528 | - if ($collapse) |
|
529 | - echo ' |
|
546 | + if ($collapse) { |
|
547 | + echo ' |
|
530 | 548 | <a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a> |
531 | 549 | <script> |
532 | 550 | document.getElementById("visible_boards_link").style.display = ""; |
533 | 551 | document.getElementById("visible_boards").style.display = "none"; |
534 | 552 | </script>'; |
535 | -} |
|
553 | + } |
|
554 | + } |
|
536 | 555 | |
537 | 556 | /** |
538 | 557 | * Templatine for viewing the members of a group. |
@@ -557,14 +576,15 @@ discard block |
||
557 | 576 | </dd>'; |
558 | 577 | |
559 | 578 | // Any description to show? |
560 | - if (!empty($context['group']['description'])) |
|
561 | - echo ' |
|
579 | + if (!empty($context['group']['description'])) { |
|
580 | + echo ' |
|
562 | 581 | <dt> |
563 | 582 | <strong>' . $txt['membergroups_members_description'] . ':</strong> |
564 | 583 | </dt> |
565 | 584 | <dd> |
566 | 585 | ', $context['group']['description'], ' |
567 | 586 | </dd>'; |
587 | + } |
|
568 | 588 | |
569 | 589 | echo ' |
570 | 590 | <dt> |
@@ -578,8 +598,9 @@ discard block |
||
578 | 598 | if (!empty($context['group']['moderators'])) |
579 | 599 | { |
580 | 600 | $moderators = array(); |
581 | - foreach ($context['group']['moderators'] as $moderator) |
|
582 | - $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
601 | + foreach ($context['group']['moderators'] as $moderator) { |
|
602 | + $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
603 | + } |
|
583 | 604 | |
584 | 605 | echo ' |
585 | 606 | <dt> |
@@ -604,9 +625,10 @@ discard block |
||
604 | 625 | <tr class="title_bar"> |
605 | 626 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
606 | 627 | |
607 | - if ($context['can_send_email']) |
|
608 | - echo ' |
|
628 | + if ($context['can_send_email']) { |
|
629 | + echo ' |
|
609 | 630 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
631 | + } |
|
610 | 632 | |
611 | 633 | echo ' |
612 | 634 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th> |
@@ -615,20 +637,22 @@ discard block |
||
615 | 637 | <a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a> |
616 | 638 | </th>'; |
617 | 639 | |
618 | - if (!empty($context['group']['assignable'])) |
|
619 | - echo ' |
|
640 | + if (!empty($context['group']['assignable'])) { |
|
641 | + echo ' |
|
620 | 642 | <th style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>'; |
643 | + } |
|
621 | 644 | |
622 | 645 | echo ' |
623 | 646 | </tr> |
624 | 647 | </thead> |
625 | 648 | <tbody>'; |
626 | 649 | |
627 | - if (empty($context['members'])) |
|
628 | - echo ' |
|
650 | + if (empty($context['members'])) { |
|
651 | + echo ' |
|
629 | 652 | <tr class="windowbg"> |
630 | 653 | <td colspan="6">', $txt['membergroups_members_no_members'], '</td> |
631 | 654 | </tr>'; |
655 | + } |
|
632 | 656 | |
633 | 657 | foreach ($context['members'] as $member) |
634 | 658 | { |
@@ -636,20 +660,22 @@ discard block |
||
636 | 660 | <tr class="windowbg"> |
637 | 661 | <td>', $member['name'], '</td>'; |
638 | 662 | |
639 | - if ($context['can_send_email']) |
|
640 | - echo ' |
|
663 | + if ($context['can_send_email']) { |
|
664 | + echo ' |
|
641 | 665 | <td> |
642 | 666 | <a href="mailto:', $member['email'], '">', $member['email'], '</a> |
643 | 667 | </td>'; |
668 | + } |
|
644 | 669 | |
645 | 670 | echo ' |
646 | 671 | <td>', $member['last_online'], '</td> |
647 | 672 | <td>', $member['registered'], '</td> |
648 | 673 | <td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>'; |
649 | 674 | |
650 | - if (!empty($context['group']['assignable'])) |
|
651 | - echo ' |
|
675 | + if (!empty($context['group']['assignable'])) { |
|
676 | + echo ' |
|
652 | 677 | <td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>'; |
678 | + } |
|
653 | 679 | |
654 | 680 | echo ' |
655 | 681 | </tr>'; |
@@ -659,11 +685,12 @@ discard block |
||
659 | 685 | </tbody> |
660 | 686 | </table>'; |
661 | 687 | |
662 | - if (!empty($context['group']['assignable'])) |
|
663 | - echo ' |
|
688 | + if (!empty($context['group']['assignable'])) { |
|
689 | + echo ' |
|
664 | 690 | <div class="floatright"> |
665 | 691 | <input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button "> |
666 | 692 | </div>'; |
693 | + } |
|
667 | 694 | |
668 | 695 | echo ' |
669 | 696 | <div class="pagesection flow_hidden"> |
@@ -671,8 +698,8 @@ discard block |
||
671 | 698 | </div> |
672 | 699 | <br>'; |
673 | 700 | |
674 | - if (!empty($context['group']['assignable'])) |
|
675 | - echo ' |
|
701 | + if (!empty($context['group']['assignable'])) { |
|
702 | + echo ' |
|
676 | 703 | <div class="cat_bar"> |
677 | 704 | <h3 class="catbg">', $txt['membergroups_members_add_title'], '</h3> |
678 | 705 | </div> |
@@ -688,6 +715,7 @@ discard block |
||
688 | 715 | </dl> |
689 | 716 | <input type="submit" name="add" value="', $txt['membergroups_members_add'], '" class="button"> |
690 | 717 | </div>'; |
718 | + } |
|
691 | 719 | |
692 | 720 | echo ' |
693 | 721 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -695,8 +723,8 @@ discard block |
||
695 | 723 | </form> |
696 | 724 | </div><!-- #admincenter -->'; |
697 | 725 | |
698 | - if (!empty($context['group']['assignable'])) |
|
699 | - echo ' |
|
726 | + if (!empty($context['group']['assignable'])) { |
|
727 | + echo ' |
|
700 | 728 | <script> |
701 | 729 | var oAddMemberSuggest = new smc_AutoSuggest({ |
702 | 730 | sSelf: \'oAddMemberSuggest\', |
@@ -712,7 +740,8 @@ discard block |
||
712 | 740 | sItemListContainerId: \'toAddItemContainer\' |
713 | 741 | }); |
714 | 742 | </script>'; |
715 | -} |
|
743 | + } |
|
744 | + } |
|
716 | 745 | |
717 | 746 | /** |
718 | 747 | * Allow the moderator to enter a reason to each user being rejected. |
@@ -732,8 +761,8 @@ discard block |
||
732 | 761 | <dl class="settings">'; |
733 | 762 | |
734 | 763 | // Loop through and print out a reason box for each... |
735 | - foreach ($context['group_requests'] as $request) |
|
736 | - echo ' |
|
764 | + foreach ($context['group_requests'] as $request) { |
|
765 | + echo ' |
|
737 | 766 | <dt> |
738 | 767 | <strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong> |
739 | 768 | </dt> |
@@ -741,6 +770,7 @@ discard block |
||
741 | 770 | <input type="hidden" name="groupr[]" value="', $request['id'], '"> |
742 | 771 | <textarea name="groupreason[', $request['id'], ']" rows="3" cols="40"></textarea> |
743 | 772 | </dd>'; |
773 | + } |
|
744 | 774 | |
745 | 775 | echo ' |
746 | 776 | </dl> |
@@ -18,11 +18,12 @@ discard block |
||
18 | 18 | global $context, $txt, $scripturl, $modSettings; |
19 | 19 | |
20 | 20 | // If maintenance has finished tell the user. |
21 | - if (!empty($context['maintenance_finished'])) |
|
22 | - echo ' |
|
21 | + if (!empty($context['maintenance_finished'])) { |
|
22 | + echo ' |
|
23 | 23 | <div class="infobox"> |
24 | 24 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
25 | 25 | </div>'; |
26 | + } |
|
26 | 27 | |
27 | 28 | echo ' |
28 | 29 | <div id="manage_maintenance"> |
@@ -39,8 +40,8 @@ discard block |
||
39 | 40 | </div>'; |
40 | 41 | |
41 | 42 | // Show an option to convert the body column of the post table to MEDIUMTEXT or TEXT |
42 | - if (isset($context['convert_to'])) |
|
43 | - echo ' |
|
43 | + if (isset($context['convert_to'])) { |
|
44 | + echo ' |
|
44 | 45 | <div class="cat_bar"> |
45 | 46 | <h3 class="catbg">', $txt[$context['convert_to'] . '_title'], '</h3> |
46 | 47 | </div> |
@@ -53,10 +54,11 @@ discard block |
||
53 | 54 | <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '"> |
54 | 55 | </form> |
55 | 56 | </div>'; |
57 | + } |
|
56 | 58 | |
57 | 59 | // Show an option to convert to UTF-8 if we're not on UTF-8 yet. |
58 | - if ($context['convert_utf8']) |
|
59 | - echo ' |
|
60 | + if ($context['convert_utf8']) { |
|
61 | + echo ' |
|
60 | 62 | <div class="cat_bar"> |
61 | 63 | <h3 class="catbg">', $txt['utf8_title'], '</h3> |
62 | 64 | </div> |
@@ -69,10 +71,11 @@ discard block |
||
69 | 71 | <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '"> |
70 | 72 | </form> |
71 | 73 | </div>'; |
74 | + } |
|
72 | 75 | |
73 | 76 | // We might want to convert entities if we're on UTF-8. |
74 | - if ($context['convert_entities']) |
|
75 | - echo ' |
|
77 | + if ($context['convert_entities']) { |
|
78 | + echo ' |
|
76 | 79 | <div class="cat_bar"> |
77 | 80 | <h3 class="catbg">', $txt['entity_convert_title'], '</h3> |
78 | 81 | </div> |
@@ -84,6 +87,7 @@ discard block |
||
84 | 87 | <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '"> |
85 | 88 | </form> |
86 | 89 | </div>'; |
90 | + } |
|
87 | 91 | |
88 | 92 | echo ' |
89 | 93 | </div><!-- #manage_maintenance -->'; |
@@ -101,11 +105,12 @@ discard block |
||
101 | 105 | <div id="manage_maintenance">'; |
102 | 106 | |
103 | 107 | // If maintenance has finished tell the user. |
104 | - if (!empty($context['maintenance_finished'])) |
|
105 | - echo ' |
|
108 | + if (!empty($context['maintenance_finished'])) { |
|
109 | + echo ' |
|
106 | 110 | <div class="infobox"> |
107 | 111 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
108 | 112 | </div>'; |
113 | + } |
|
109 | 114 | |
110 | 115 | echo ' |
111 | 116 | <div class="cat_bar"> |
@@ -237,11 +242,12 @@ discard block |
||
237 | 242 | <div id="manage_maintenance">'; |
238 | 243 | |
239 | 244 | // If maintenance has finished, tell the user. |
240 | - if (!empty($context['maintenance_finished'])) |
|
241 | - echo ' |
|
245 | + if (!empty($context['maintenance_finished'])) { |
|
246 | + echo ' |
|
242 | 247 | <div class="infobox"> |
243 | 248 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
244 | 249 | </div>'; |
250 | + } |
|
245 | 251 | |
246 | 252 | echo ' |
247 | 253 | <div class="cat_bar"> |
@@ -303,9 +309,10 @@ discard block |
||
303 | 309 | </p> |
304 | 310 | <div style="display: none;" id="membersPanel">'; |
305 | 311 | |
306 | - foreach ($context['membergroups'] as $group) |
|
307 | - echo ' |
|
312 | + foreach ($context['membergroups'] as $group) { |
|
313 | + echo ' |
|
308 | 314 | <label for="groups', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups', $group['id'], '" checked> ', $group['name'], '</label><br>'; |
315 | + } |
|
309 | 316 | |
310 | 317 | echo ' |
311 | 318 | </div> |
@@ -349,11 +356,12 @@ discard block |
||
349 | 356 | global $scripturl, $txt, $context, $settings, $modSettings; |
350 | 357 | |
351 | 358 | // If maintenance has finished tell the user. |
352 | - if (!empty($context['maintenance_finished'])) |
|
353 | - echo ' |
|
359 | + if (!empty($context['maintenance_finished'])) { |
|
360 | + echo ' |
|
354 | 361 | <div class="infobox"> |
355 | 362 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
356 | 363 | </div>'; |
364 | + } |
|
357 | 365 | |
358 | 366 | // Bit of javascript for showing which boards to prune in an otherwise hidden list. |
359 | 367 | echo ' |
@@ -421,21 +429,23 @@ discard block |
||
421 | 429 | <ul>'; |
422 | 430 | |
423 | 431 | // Display a checkbox with every board. |
424 | - foreach ($category['boards'] as $board) |
|
425 | - echo ' |
|
432 | + foreach ($category['boards'] as $board) { |
|
433 | + echo ' |
|
426 | 434 | <li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;"> |
427 | 435 | <label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked>', $board['name'], '</label> |
428 | 436 | </li>'; |
437 | + } |
|
429 | 438 | |
430 | 439 | echo ' |
431 | 440 | </ul> |
432 | 441 | </fieldset>'; |
433 | 442 | |
434 | 443 | // Increase $i, and check if we're at the middle yet. |
435 | - if (++$i == $middle) |
|
436 | - echo ' |
|
444 | + if (++$i == $middle) { |
|
445 | + echo ' |
|
437 | 446 | </div><!-- .floatleft --> |
438 | 447 | <div class="floatright" style="width: 49%;">'; |
448 | + } |
|
439 | 449 | } |
440 | 450 | |
441 | 451 | echo ' |
@@ -477,9 +487,10 @@ discard block |
||
477 | 487 | echo ' |
478 | 488 | <optgroup label="', $category['name'], '">'; |
479 | 489 | |
480 | - foreach ($category['boards'] as $board) |
|
481 | - echo ' |
|
490 | + foreach ($category['boards'] as $board) { |
|
491 | + echo ' |
|
482 | 492 | <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; |
493 | + } |
|
483 | 494 | |
484 | 495 | echo ' |
485 | 496 | </optgroup>'; |
@@ -497,9 +508,10 @@ discard block |
||
497 | 508 | echo ' |
498 | 509 | <optgroup label="', $category['name'], '">'; |
499 | 510 | |
500 | - foreach ($category['boards'] as $board) |
|
501 | - echo ' |
|
511 | + foreach ($category['boards'] as $board) { |
|
512 | + echo ' |
|
502 | 513 | <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; |
514 | + } |
|
503 | 515 | |
504 | 516 | echo ' |
505 | 517 | </optgroup>'; |
@@ -540,9 +552,10 @@ discard block |
||
540 | 552 | ', $txt['database_optimize_attempt'], '<br>'; |
541 | 553 | |
542 | 554 | // List each table being optimized... |
543 | - foreach ($context['optimized_tables'] as $table) |
|
544 | - echo ' |
|
555 | + foreach ($context['optimized_tables'] as $table) { |
|
556 | + echo ' |
|
545 | 557 | ', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br>'; |
558 | + } |
|
546 | 559 | |
547 | 560 | // How did we go? |
548 | 561 | echo ' |
@@ -602,13 +615,14 @@ discard block |
||
602 | 615 | </li> |
603 | 616 | </ul>'; |
604 | 617 | |
605 | - if (!empty($context['exceeding_messages_morethan'])) |
|
606 | - echo ' |
|
618 | + if (!empty($context['exceeding_messages_morethan'])) { |
|
619 | + echo ' |
|
607 | 620 | <p>', $context['exceeding_messages_morethan'], '</p>'; |
608 | - } |
|
609 | - else |
|
610 | - echo ' |
|
621 | + } |
|
622 | + } else { |
|
623 | + echo ' |
|
611 | 624 | <p class="infobox">', $txt['convert_to_text'], '</p>'; |
625 | + } |
|
612 | 626 | |
613 | 627 | echo ' |
614 | 628 | <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertmsgbody" method="post" accept-charset="', $context['character_set'], '"> |
@@ -18,11 +18,12 @@ discard block |
||
18 | 18 | global $context, $txt, $scripturl; |
19 | 19 | |
20 | 20 | // Let them know the action was a success. |
21 | - if (!empty($context['report_post_action'])) |
|
22 | - echo ' |
|
21 | + if (!empty($context['report_post_action'])) { |
|
22 | + echo ' |
|
23 | 23 | <div class="infobox"> |
24 | 24 | ', $txt['report_action_' . $context['report_post_action']], ' |
25 | 25 | </div>'; |
26 | + } |
|
26 | 27 | |
27 | 28 | echo ' |
28 | 29 | <form id="reported_posts" action="', $scripturl, '?action=moderate;area=reportedposts;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '"> |
@@ -52,8 +53,9 @@ discard block |
||
52 | 53 | |
53 | 54 | // Prepare the comments... |
54 | 55 | $comments = array(); |
55 | - foreach ($report['comments'] as $comment) |
|
56 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
56 | + foreach ($report['comments'] as $comment) { |
|
57 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
58 | + } |
|
57 | 59 | |
58 | 60 | echo ' |
59 | 61 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -69,18 +71,21 @@ discard block |
||
69 | 71 | <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
70 | 72 | |
71 | 73 | // Delete message button. |
72 | - if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) |
|
73 | - echo ' |
|
74 | + if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) { |
|
75 | + echo ' |
|
74 | 76 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'], '.0;msg=', $report['topic']['id_msg'], ';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'], '" class="you_sure">', $delete_button, '</a></li>'; |
77 | + } |
|
75 | 78 | |
76 | 79 | // Ban this user button. |
77 | - if (!$report['closed'] && !empty($context['report_manage_bans'])) |
|
78 | - echo ' |
|
80 | + if (!$report['closed'] && !empty($context['report_manage_bans'])) { |
|
81 | + echo ' |
|
79 | 82 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']), ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
83 | + } |
|
80 | 84 | |
81 | - if (!$context['view_closed']) |
|
82 | - echo ' |
|
85 | + if (!$context['view_closed']) { |
|
86 | + echo ' |
|
83 | 87 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>'; |
88 | + } |
|
84 | 89 | |
85 | 90 | echo ' |
86 | 91 | </ul> |
@@ -88,18 +93,20 @@ discard block |
||
88 | 93 | } |
89 | 94 | |
90 | 95 | // Were none found? |
91 | - if (empty($context['reports'])) |
|
92 | - echo ' |
|
96 | + if (empty($context['reports'])) { |
|
97 | + echo ' |
|
93 | 98 | <div class="windowbg2"> |
94 | 99 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
95 | 100 | </div>'; |
101 | + } |
|
96 | 102 | |
97 | 103 | echo ' |
98 | 104 | <div class="pagesection">'; |
99 | 105 | |
100 | - if (!empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many']) |
|
101 | - echo ' |
|
106 | + if (!empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many']) { |
|
107 | + echo ' |
|
102 | 108 | <div class="pagelinks floatleft">' . $context['page_index'] . '</div>'; |
109 | + } |
|
103 | 110 | |
104 | 111 | echo ' |
105 | 112 | <div class="floatright">', !$context['view_closed'] ? ' |
@@ -130,18 +137,20 @@ discard block |
||
130 | 137 | <div class="modbox"> |
131 | 138 | <ul>'; |
132 | 139 | |
133 | - foreach ($context['reported_posts'] as $report) |
|
134 | - echo ' |
|
140 | + foreach ($context['reported_posts'] as $report) { |
|
141 | + echo ' |
|
135 | 142 | <li class="smalltext"> |
136 | 143 | <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], ' |
137 | 144 | </li>'; |
145 | + } |
|
138 | 146 | |
139 | 147 | // Don't have any watched users right now? |
140 | - if (empty($context['reported_posts'])) |
|
141 | - echo ' |
|
148 | + if (empty($context['reported_posts'])) { |
|
149 | + echo ' |
|
142 | 150 | <li> |
143 | 151 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
144 | 152 | </li>'; |
153 | + } |
|
145 | 154 | |
146 | 155 | echo ' |
147 | 156 | </ul> |
@@ -189,11 +198,12 @@ discard block |
||
189 | 198 | global $context, $scripturl, $txt; |
190 | 199 | |
191 | 200 | // Let them know the action was a success. |
192 | - if (!empty($context['report_post_action'])) |
|
193 | - echo ' |
|
201 | + if (!empty($context['report_post_action'])) { |
|
202 | + echo ' |
|
194 | 203 | <div class="infobox"> |
195 | 204 | ', $txt['report_action_' . $context['report_post_action']], ' |
196 | 205 | </div>'; |
206 | + } |
|
197 | 207 | |
198 | 208 | echo ' |
199 | 209 | <div id="modcenter"> |
@@ -229,14 +239,15 @@ discard block |
||
229 | 239 | <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3> |
230 | 240 | </div>'; |
231 | 241 | |
232 | - foreach ($context['report']['comments'] as $comment) |
|
233 | - echo ' |
|
242 | + foreach ($context['report']['comments'] as $comment) { |
|
243 | + echo ' |
|
234 | 244 | <div class="windowbg"> |
235 | 245 | <p class="smalltext"> |
236 | 246 | ', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), ' |
237 | 247 | </p> |
238 | 248 | <p>', $comment['message'], '</p> |
239 | 249 | </div>'; |
250 | + } |
|
240 | 251 | |
241 | 252 | echo ' |
242 | 253 | <br> |
@@ -245,11 +256,12 @@ discard block |
||
245 | 256 | </div> |
246 | 257 | <div>'; |
247 | 258 | |
248 | - if (empty($context['report']['mod_comments'])) |
|
249 | - echo ' |
|
259 | + if (empty($context['report']['mod_comments'])) { |
|
260 | + echo ' |
|
250 | 261 | <div class="information"> |
251 | 262 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
252 | 263 | </div>'; |
264 | + } |
|
253 | 265 | |
254 | 266 | foreach ($context['report']['mod_comments'] as $comment) |
255 | 267 | { |
@@ -335,18 +347,20 @@ discard block |
||
335 | 347 | <div class="modbox"> |
336 | 348 | <ul>'; |
337 | 349 | |
338 | - foreach ($context['reported_members'] as $report) |
|
339 | - echo ' |
|
350 | + foreach ($context['reported_members'] as $report) { |
|
351 | + echo ' |
|
340 | 352 | <li class="smalltext"> |
341 | 353 | <a href="', $report['report_href'], '">', $report['user_name'], '</a> |
342 | 354 | </li>'; |
355 | + } |
|
343 | 356 | |
344 | 357 | // Don't have any reported members right now? |
345 | - if (empty($context['reported_members'])) |
|
346 | - echo ' |
|
358 | + if (empty($context['reported_members'])) { |
|
359 | + echo ' |
|
347 | 360 | <li> |
348 | 361 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
349 | 362 | </li>'; |
363 | + } |
|
350 | 364 | |
351 | 365 | echo ' |
352 | 366 | </ul> |
@@ -394,11 +408,12 @@ discard block |
||
394 | 408 | global $context, $txt, $scripturl; |
395 | 409 | |
396 | 410 | // Let them know the action was a success. |
397 | - if (!empty($context['report_post_action']) && !empty($txt['report_action_' . $context['report_post_action']])) |
|
398 | - echo ' |
|
411 | + if (!empty($context['report_post_action']) && !empty($txt['report_action_' . $context['report_post_action']])) { |
|
412 | + echo ' |
|
399 | 413 | <div class="infobox"> |
400 | 414 | ', $txt['report_action_' . $context['report_post_action']], ' |
401 | 415 | </div>'; |
416 | + } |
|
402 | 417 | |
403 | 418 | echo ' |
404 | 419 | <form id="reported_members" action="', $scripturl, '?action=moderate;area=reportedmembers;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '"> |
@@ -430,8 +445,9 @@ discard block |
||
430 | 445 | |
431 | 446 | // Prepare the comments... |
432 | 447 | $comments = array(); |
433 | - foreach ($report['comments'] as $comment) |
|
434 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
448 | + foreach ($report['comments'] as $comment) { |
|
449 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
450 | + } |
|
435 | 451 | |
436 | 452 | echo ' |
437 | 453 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -443,13 +459,15 @@ discard block |
||
443 | 459 | <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
444 | 460 | |
445 | 461 | // Ban this user button. |
446 | - if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) |
|
447 | - echo ' |
|
462 | + if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) { |
|
463 | + echo ' |
|
448 | 464 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
465 | + } |
|
449 | 466 | |
450 | - if (!$context['view_closed']) |
|
451 | - echo ' |
|
467 | + if (!$context['view_closed']) { |
|
468 | + echo ' |
|
452 | 469 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>'; |
470 | + } |
|
453 | 471 | |
454 | 472 | echo ' |
455 | 473 | </ul> |
@@ -457,11 +475,12 @@ discard block |
||
457 | 475 | } |
458 | 476 | |
459 | 477 | // Were none found? |
460 | - if (empty($context['reports'])) |
|
461 | - echo ' |
|
478 | + if (empty($context['reports'])) { |
|
479 | + echo ' |
|
462 | 480 | <div class="windowbg2"> |
463 | 481 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
464 | 482 | </div>'; |
483 | + } |
|
465 | 484 | |
466 | 485 | echo ' |
467 | 486 | <div class="pagesection"> |
@@ -482,11 +501,12 @@ discard block |
||
482 | 501 | global $context, $scripturl, $txt; |
483 | 502 | |
484 | 503 | // Let them know the action was a success. |
485 | - if (!empty($context['report_post_action'])) |
|
486 | - echo ' |
|
504 | + if (!empty($context['report_post_action'])) { |
|
505 | + echo ' |
|
487 | 506 | <div class="infobox"> |
488 | 507 | ', $txt['report_action_' . $context['report_post_action']], ' |
489 | 508 | </div>'; |
509 | + } |
|
490 | 510 | |
491 | 511 | echo ' |
492 | 512 | <div id="modcenter"> |
@@ -519,14 +539,15 @@ discard block |
||
519 | 539 | <h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3> |
520 | 540 | </div>'; |
521 | 541 | |
522 | - foreach ($context['report']['comments'] as $comment) |
|
523 | - echo ' |
|
542 | + foreach ($context['report']['comments'] as $comment) { |
|
543 | + echo ' |
|
524 | 544 | <div class="windowbg"> |
525 | 545 | <p class="smalltext"> |
526 | 546 | ', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), ' |
527 | 547 | </p> |
528 | 548 | <p>', $comment['message'], '</p> |
529 | 549 | </div>'; |
550 | + } |
|
530 | 551 | |
531 | 552 | echo ' |
532 | 553 | <br> |
@@ -535,11 +556,12 @@ discard block |
||
535 | 556 | </div> |
536 | 557 | <div>'; |
537 | 558 | |
538 | - if (empty($context['report']['mod_comments'])) |
|
539 | - echo ' |
|
559 | + if (empty($context['report']['mod_comments'])) { |
|
560 | + echo ' |
|
540 | 561 | <div class="information"> |
541 | 562 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
542 | 563 | </div>'; |
564 | + } |
|
543 | 565 | |
544 | 566 | foreach ($context['report']['mod_comments'] as $comment) |
545 | 567 | { |
@@ -25,18 +25,20 @@ discard block |
||
25 | 25 | </div> |
26 | 26 | <div class="windowbg2 noup">'; |
27 | 27 | |
28 | - if (!empty($context['move_board'])) |
|
29 | - echo ' |
|
28 | + if (!empty($context['move_board'])) { |
|
29 | + echo ' |
|
30 | 30 | <div class="noticebox"> |
31 | 31 | ', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', ' |
32 | 32 | </div>'; |
33 | + } |
|
33 | 34 | |
34 | 35 | // No categories so show a label. |
35 | - if (empty($context['categories'])) |
|
36 | - echo ' |
|
36 | + if (empty($context['categories'])) { |
|
37 | + echo ' |
|
37 | 38 | <div class="windowbg centertext"> |
38 | 39 | ', $txt['mboards_no_cats'], ' |
39 | 40 | </div>'; |
41 | + } |
|
40 | 42 | |
41 | 43 | // Loop through every category, listing the boards in each as we go. |
42 | 44 | foreach ($context['categories'] as $category) |
@@ -54,9 +56,10 @@ discard block |
||
54 | 56 | <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> |
55 | 57 | <ul id="category_', $category['id'], '" class="nolist">'; |
56 | 58 | |
57 | - if (!empty($category['move_link'])) |
|
58 | - echo ' |
|
59 | + if (!empty($category['move_link'])) { |
|
60 | + echo ' |
|
59 | 61 | <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>'; |
62 | + } |
|
60 | 63 | |
61 | 64 | $recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>'; |
62 | 65 | $redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">'; |
@@ -81,9 +84,10 @@ discard block |
||
81 | 84 | echo ' |
82 | 85 | <li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; |
83 | 86 | |
84 | - foreach ($board['move_links'] as $link) |
|
85 | - echo ' |
|
87 | + foreach ($board['move_links'] as $link) { |
|
88 | + echo ' |
|
86 | 89 | <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>'; |
90 | + } |
|
87 | 91 | |
88 | 92 | echo ' |
89 | 93 | </li>'; |
@@ -132,9 +136,10 @@ discard block |
||
132 | 136 | <select name="cat_order">'; |
133 | 137 | |
134 | 138 | // Print every existing category into a select box. |
135 | - foreach ($context['category_order'] as $order) |
|
136 | - echo ' |
|
139 | + foreach ($context['category_order'] as $order) { |
|
140 | + echo ' |
|
137 | 141 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
142 | + } |
|
138 | 143 | echo ' |
139 | 144 | </select> |
140 | 145 | </dd>'; |
@@ -169,14 +174,15 @@ discard block |
||
169 | 174 | { |
170 | 175 | foreach ($context['custom_category_settings'] as $catset_id => $catset) |
171 | 176 | { |
172 | - if (!empty($catset['dt']) && !empty($catset['dd'])) |
|
173 | - echo ' |
|
177 | + if (!empty($catset['dt']) && !empty($catset['dd'])) { |
|
178 | + echo ' |
|
174 | 179 | <dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '"> |
175 | 180 | ', $catset['dt'], ' |
176 | 181 | </dt> |
177 | 182 | <dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '> |
178 | 183 | ', $catset['dd'], ' |
179 | 184 | </dd>'; |
185 | + } |
|
180 | 186 | } |
181 | 187 | } |
182 | 188 | |
@@ -184,21 +190,23 @@ discard block |
||
184 | 190 | echo ' |
185 | 191 | </dl>'; |
186 | 192 | |
187 | - if (isset($context['category']['is_new'])) |
|
188 | - echo ' |
|
193 | + if (isset($context['category']['is_new'])) { |
|
194 | + echo ' |
|
189 | 195 | <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">'; |
190 | - else |
|
191 | - echo ' |
|
196 | + } else { |
|
197 | + echo ' |
|
192 | 198 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button"> |
193 | 199 | <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button you_sure">'; |
200 | + } |
|
194 | 201 | echo ' |
195 | 202 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
196 | 203 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
197 | 204 | |
198 | 205 | // If this category is empty we don't bother with the next confirmation screen. |
199 | - if ($context['category']['is_empty']) |
|
200 | - echo ' |
|
206 | + if ($context['category']['is_empty']) { |
|
207 | + echo ' |
|
201 | 208 | <input type="hidden" name="empty" value="1">'; |
209 | + } |
|
202 | 210 | |
203 | 211 | echo ' |
204 | 212 | </div><!-- .windowbg2 --> |
@@ -225,9 +233,10 @@ discard block |
||
225 | 233 | <p>', $txt['mboards_delete_cat_contains'], ':</p> |
226 | 234 | <ul>'; |
227 | 235 | |
228 | - foreach ($context['category']['children'] as $child) |
|
229 | - echo ' |
|
236 | + foreach ($context['category']['children'] as $child) { |
|
237 | + echo ' |
|
230 | 238 | <li>', $child, '</li>'; |
239 | + } |
|
231 | 240 | |
232 | 241 | echo ' |
233 | 242 | </ul> |
@@ -241,10 +250,11 @@ discard block |
||
241 | 250 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>: |
242 | 251 | <select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>'; |
243 | 252 | |
244 | - foreach ($context['category_order'] as $cat) |
|
245 | - if ($cat['id'] != 0) |
|
253 | + foreach ($context['category_order'] as $cat) { |
|
254 | + if ($cat['id'] != 0) |
|
246 | 255 | echo ' |
247 | 256 | <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; |
257 | + } |
|
248 | 258 | |
249 | 259 | echo ' |
250 | 260 | </select> |
@@ -287,9 +297,10 @@ discard block |
||
287 | 297 | <dd> |
288 | 298 | <select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">'; |
289 | 299 | |
290 | - foreach ($context['categories'] as $category) |
|
291 | - echo ' |
|
300 | + foreach ($context['categories'] as $category) { |
|
301 | + echo ' |
|
292 | 302 | <option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; |
303 | + } |
|
293 | 304 | echo ' |
294 | 305 | </select> |
295 | 306 | </dd>'; |
@@ -317,9 +328,10 @@ discard block |
||
317 | 328 | <select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '> |
318 | 329 | ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; |
319 | 330 | |
320 | - foreach ($context['board_order'] as $order) |
|
321 | - echo ' |
|
331 | + foreach ($context['board_order'] as $order) { |
|
332 | + echo ' |
|
322 | 333 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
334 | + } |
|
323 | 335 | echo ' |
324 | 336 | </select> |
325 | 337 | </dd>'; |
@@ -348,13 +360,15 @@ discard block |
||
348 | 360 | <dd> |
349 | 361 | <select name="profile">'; |
350 | 362 | |
351 | - if (isset($context['board']['is_new'])) |
|
352 | - echo ' |
|
363 | + if (isset($context['board']['is_new'])) { |
|
364 | + echo ' |
|
353 | 365 | <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; |
366 | + } |
|
354 | 367 | |
355 | - foreach ($context['profiles'] as $id => $profile) |
|
356 | - echo ' |
|
368 | + foreach ($context['profiles'] as $id => $profile) { |
|
369 | + echo ' |
|
357 | 370 | <option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
371 | + } |
|
358 | 372 | |
359 | 373 | echo ' |
360 | 374 | </select> |
@@ -367,8 +381,8 @@ discard block |
||
367 | 381 | </dt> |
368 | 382 | <dd>'; |
369 | 383 | |
370 | - if (!empty($modSettings['deny_boards_access'])) |
|
371 | - echo ' |
|
384 | + if (!empty($modSettings['deny_boards_access'])) { |
|
385 | + echo ' |
|
372 | 386 | <table> |
373 | 387 | <tr> |
374 | 388 | <td></td> |
@@ -376,10 +390,11 @@ discard block |
||
376 | 390 | <th>', $txt['permissions_option_off'], '</th> |
377 | 391 | <th>', $txt['permissions_option_deny'], '</th> |
378 | 392 | </tr>'; |
393 | + } |
|
379 | 394 | |
380 | 395 | // List all the membergroups so the user can choose who may access this board. |
381 | - foreach ($context['groups'] as $group) |
|
382 | - if (empty($modSettings['deny_boards_access'])) |
|
396 | + foreach ($context['groups'] as $group) { |
|
397 | + if (empty($modSettings['deny_boards_access'])) |
|
383 | 398 | echo ' |
384 | 399 | <label for="groups_', $group['id'], '"> |
385 | 400 | <input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '> |
@@ -387,8 +402,9 @@ discard block |
||
387 | 402 | ', $group['name'], ' |
388 | 403 | </span> |
389 | 404 | </label><br>'; |
390 | - else |
|
391 | - echo ' |
|
405 | + } |
|
406 | + else { |
|
407 | + echo ' |
|
392 | 408 | <tr> |
393 | 409 | <td> |
394 | 410 | <label for="groups_', $group['id'], '_a"> |
@@ -408,16 +424,17 @@ discard block |
||
408 | 424 | </td> |
409 | 425 | <td></td> |
410 | 426 | </tr>'; |
427 | + } |
|
411 | 428 | |
412 | - if (empty($modSettings['deny_boards_access'])) |
|
413 | - echo ' |
|
429 | + if (empty($modSettings['deny_boards_access'])) { |
|
430 | + echo ' |
|
414 | 431 | <span class="select_all_box"> |
415 | 432 | <em>', $txt['check_all'], '</em> <input type="checkbox" onclick="invertAll(this, this.form, \'groups[\');"> |
416 | 433 | </span> |
417 | 434 | <br><br> |
418 | 435 | </dd>'; |
419 | - else |
|
420 | - echo ' |
|
436 | + } else { |
|
437 | + echo ' |
|
421 | 438 | <tr class="select_all_box"> |
422 | 439 | <td> |
423 | 440 | </td> |
@@ -436,6 +453,7 @@ discard block |
||
436 | 453 | </tr> |
437 | 454 | </table> |
438 | 455 | </dd>'; |
456 | + } |
|
439 | 457 | |
440 | 458 | // Options to choose moderators, specify as announcement board and choose whether to count posts here. |
441 | 459 | echo ' |
@@ -490,8 +508,8 @@ discard block |
||
490 | 508 | </dl> |
491 | 509 | </div>'; |
492 | 510 | |
493 | - if ($context['board']['redirect']) |
|
494 | - echo ' |
|
511 | + if ($context['board']['redirect']) { |
|
512 | + echo ' |
|
495 | 513 | <div id="reset_redirect_div"> |
496 | 514 | <dl class="settings"> |
497 | 515 | <dt> |
@@ -504,6 +522,7 @@ discard block |
||
504 | 522 | </dd> |
505 | 523 | </dl> |
506 | 524 | </div>'; |
525 | + } |
|
507 | 526 | } |
508 | 527 | |
509 | 528 | echo ' |
@@ -531,9 +550,10 @@ discard block |
||
531 | 550 | <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> |
532 | 551 | <option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>'; |
533 | 552 | |
534 | - foreach ($context['themes'] as $theme) |
|
535 | - echo ' |
|
553 | + foreach ($context['themes'] as $theme) { |
|
554 | + echo ' |
|
536 | 555 | <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
556 | + } |
|
537 | 557 | |
538 | 558 | echo ' |
539 | 559 | </select> |
@@ -562,14 +582,15 @@ discard block |
||
562 | 582 | |
563 | 583 | foreach ($context['custom_board_settings'] as $cbs_id => $cbs) |
564 | 584 | { |
565 | - if (!empty($cbs['dt']) && !empty($cbs['dd'])) |
|
566 | - echo ' |
|
585 | + if (!empty($cbs['dt']) && !empty($cbs['dd'])) { |
|
586 | + echo ' |
|
567 | 587 | <dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '"> |
568 | 588 | ', $cbs['dt'], ' |
569 | 589 | </dt> |
570 | 590 | <dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '> |
571 | 591 | ', $cbs['dd'], ' |
572 | 592 | </dd>'; |
593 | + } |
|
573 | 594 | } |
574 | 595 | |
575 | 596 | echo ' |
@@ -577,9 +598,10 @@ discard block |
||
577 | 598 | </div>'; |
578 | 599 | } |
579 | 600 | |
580 | - if (!empty($context['board']['is_recycle'])) |
|
581 | - echo ' |
|
601 | + if (!empty($context['board']['is_recycle'])) { |
|
602 | + echo ' |
|
582 | 603 | <div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>'; |
604 | + } |
|
583 | 605 | |
584 | 606 | echo ' |
585 | 607 | <input type="hidden" name="rid" value="', $context['redirect_location'], '"> |
@@ -587,21 +609,24 @@ discard block |
||
587 | 609 | <input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">'; |
588 | 610 | |
589 | 611 | // If this board has no children don't bother with the next confirmation screen. |
590 | - if ($context['board']['no_children']) |
|
591 | - echo ' |
|
612 | + if ($context['board']['no_children']) { |
|
613 | + echo ' |
|
592 | 614 | <input type="hidden" name="no_children" value="1">'; |
615 | + } |
|
593 | 616 | |
594 | - if (isset($context['board']['is_new'])) |
|
595 | - echo ' |
|
617 | + if (isset($context['board']['is_new'])) { |
|
618 | + echo ' |
|
596 | 619 | <input type="hidden" name="cur_cat" value="', $context['board']['category'], '"> |
597 | 620 | <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
598 | - else |
|
599 | - echo ' |
|
621 | + } else { |
|
622 | + echo ' |
|
600 | 623 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
624 | + } |
|
601 | 625 | |
602 | - if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) |
|
603 | - echo ' |
|
626 | + if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) { |
|
627 | + echo ' |
|
604 | 628 | <input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button you_sure">'; |
629 | + } |
|
605 | 630 | echo ' |
606 | 631 | </div><!-- .windowbg2 --> |
607 | 632 | </form> |
@@ -622,12 +647,13 @@ discard block |
||
622 | 647 | sItemListContainerId: \'moderator_container\', |
623 | 648 | aListItems: ['; |
624 | 649 | |
625 | - foreach ($context['board']['moderators'] as $id_member => $member_name) |
|
626 | - echo ' |
|
650 | + foreach ($context['board']['moderators'] as $id_member => $member_name) { |
|
651 | + echo ' |
|
627 | 652 | { |
628 | 653 | sItemId: ', JavaScriptEscape($id_member), ', |
629 | 654 | sItemName: ', JavaScriptEscape($member_name), ' |
630 | 655 | }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; |
656 | + } |
|
631 | 657 | |
632 | 658 | echo ' |
633 | 659 | ] |
@@ -647,12 +673,13 @@ discard block |
||
647 | 673 | sItemListContainerId: \'moderator_group_container\', |
648 | 674 | aListItems: ['; |
649 | 675 | |
650 | - foreach ($context['board']['moderator_groups'] as $id_group => $group_name) |
|
651 | - echo ' |
|
676 | + foreach ($context['board']['moderator_groups'] as $id_group => $group_name) { |
|
677 | + echo ' |
|
652 | 678 | { |
653 | 679 | sItemId: ', JavaScriptEscape($id_group), ', |
654 | 680 | sItemName: ', JavaScriptEscape($group_name), ' |
655 | 681 | }', $id_group == $context['board']['last_moderator_group_id'] ? '' : ','; |
682 | + } |
|
656 | 683 | |
657 | 684 | echo ' |
658 | 685 | ] |
@@ -678,17 +705,19 @@ discard block |
||
678 | 705 | echo ' |
679 | 706 | document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; |
680 | 707 | |
681 | - if ($context['board']['redirect']) |
|
682 | - echo ' |
|
708 | + if ($context['board']['redirect']) { |
|
709 | + echo ' |
|
683 | 710 | document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; |
711 | + } |
|
684 | 712 | } |
685 | 713 | |
686 | 714 | // Include any JavaScript added by mods using the 'integrate_edit_board' hook. |
687 | 715 | if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions'])) |
688 | 716 | { |
689 | - foreach ($context['custom_refreshOptions'] as $refreshOption) |
|
690 | - echo ' |
|
717 | + foreach ($context['custom_refreshOptions'] as $refreshOption) { |
|
718 | + echo ' |
|
691 | 719 | ', $refreshOption; |
720 | + } |
|
692 | 721 | } |
693 | 722 | |
694 | 723 | echo ' |
@@ -717,9 +746,10 @@ discard block |
||
717 | 746 | <p>', $txt['mboards_delete_board_contains'], '</p> |
718 | 747 | <ul>'; |
719 | 748 | |
720 | - foreach ($context['children'] as $child) |
|
721 | - echo ' |
|
749 | + foreach ($context['children'] as $child) { |
|
750 | + echo ' |
|
722 | 751 | <li>', $child['node']['name'], '</li>'; |
752 | + } |
|
723 | 753 | |
724 | 754 | echo ' |
725 | 755 | </ul> |
@@ -733,10 +763,11 @@ discard block |
||
733 | 763 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>: |
734 | 764 | <select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>'; |
735 | 765 | |
736 | - foreach ($context['board_order'] as $board) |
|
737 | - if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
766 | + foreach ($context['board_order'] as $board) { |
|
767 | + if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
738 | 768 | echo ' |
739 | 769 | <option value="', $board['id'], '">', $board['name'], '</option>'; |
770 | + } |
|
740 | 771 | |
741 | 772 | echo ' |
742 | 773 | </select> |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | foreach ($message['custom_fields']['above_member'] as $custom) |
233 | 233 | echo ' |
234 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
234 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
235 | 235 | |
236 | 236 | echo ' |
237 | 237 | </ul> |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | if (!empty($message['custom_fields']['below_avatar'])) |
267 | 267 | foreach ($message['custom_fields']['below_avatar'] as $custom) |
268 | 268 | echo ' |
269 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
269 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
270 | 270 | |
271 | 271 | if (!$message['member']['is_guest']) |
272 | 272 | echo ' |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | |
309 | 309 | foreach ($message['custom_fields']['icons'] as $custom) |
310 | 310 | echo ' |
311 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
311 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
312 | 312 | |
313 | 313 | echo ' |
314 | 314 | </ol> |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | if (!empty($message['custom_fields']['standard'])) |
373 | 373 | foreach ($message['custom_fields']['standard'] as $custom) |
374 | 374 | echo ' |
375 | - <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
375 | + <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
376 | 376 | |
377 | 377 | // Are we showing the warning status? |
378 | 378 | if ($message['member']['can_see_warning']) |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | if (!empty($message['custom_fields']['bottom_poster'])) |
384 | 384 | foreach ($message['custom_fields']['bottom_poster'] as $custom) |
385 | 385 | echo ' |
386 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
386 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | // Done with the information about the poster... on to the post itself. |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | |
485 | 485 | foreach ($message['custom_fields']['above_signature'] as $custom) |
486 | 486 | echo ' |
487 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
487 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
488 | 488 | |
489 | 489 | echo ' |
490 | 490 | </ul> |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | |
508 | 508 | foreach ($message['custom_fields']['below_signature'] as $custom) |
509 | 509 | echo ' |
510 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
510 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
511 | 511 | |
512 | 512 | echo ' |
513 | 513 | </ul> |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | while ($message = $context['get_pmessage']('subject')) |
644 | 644 | { |
645 | 645 | echo ' |
646 | - <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','"> |
|
646 | + <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '"> |
|
647 | 647 | <td class="table_icon"> |
648 | 648 | <script> |
649 | 649 | currentLabels[', $message['id'], '] = {'; |
@@ -922,13 +922,13 @@ discard block |
||
922 | 922 | // You can only reply if they are not a guest... |
923 | 923 | if (!$message['member']['is_guest']) |
924 | 924 | echo ' |
925 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
|
926 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
|
925 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], ' |
|
926 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator']; |
|
927 | 927 | |
928 | 928 | // This is for "forwarding" - even if the member is gone. |
929 | 929 | else |
930 | 930 | echo ' |
931 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
|
931 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator']; |
|
932 | 932 | } |
933 | 933 | |
934 | 934 | echo ' |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> |
1032 | 1032 | <dl> |
1033 | 1033 | <dt> |
1034 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
1034 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
1035 | 1035 | </dt> |
1036 | 1036 | <dd class="error" id="error_list"> |
1037 | 1037 | ', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), ' |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | <span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span> |
1088 | 1088 | </dt> |
1089 | 1089 | <dd id="pm_subject"> |
1090 | - <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '> |
|
1090 | + <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '> |
|
1091 | 1091 | </dd> |
1092 | 1092 | </dl> |
1093 | 1093 | <hr>'; |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | echo ' |
1453 | 1453 | <div class="padding"> |
1454 | 1454 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
1455 | - <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
|
1455 | + <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure"> |
|
1456 | 1456 | </div>'; |
1457 | 1457 | |
1458 | 1458 | echo ' |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | if (!empty($context['rules'])) |
1618 | 1618 | echo ' |
1619 | 1619 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1620 | - <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
|
1620 | + <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">'; |
|
1621 | 1621 | |
1622 | 1622 | echo ' |
1623 | 1623 | </div> |
@@ -1860,9 +1860,9 @@ discard block |
||
1860 | 1860 | |
1861 | 1861 | echo ' |
1862 | 1862 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
1863 | - <option value="">', $txt['pm_rule_sel_action'] , ':</option> |
|
1864 | - <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option> |
|
1865 | - <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option> |
|
1863 | + <option value="">', $txt['pm_rule_sel_action'], ':</option> |
|
1864 | + <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option> |
|
1865 | + <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option> |
|
1866 | 1866 | </select> |
1867 | 1867 | <span id="labdiv', $k, '"> |
1868 | 1868 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
@@ -1974,7 +1974,7 @@ discard block |
||
1974 | 1974 | </div> |
1975 | 1975 | <ul class="quickbuttons"> |
1976 | 1976 | <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li> |
1977 | - <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
1977 | + <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
1978 | 1978 | </ul> |
1979 | 1979 | </div><!-- .windowbg -->'; |
1980 | 1980 | } |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | <div id="personal_messages">'; |
22 | 22 | |
23 | 23 | // Show the capacity bar, if available. |
24 | - if (!empty($context['limit_bar'])) |
|
25 | - echo ' |
|
24 | + if (!empty($context['limit_bar'])) { |
|
25 | + echo ' |
|
26 | 26 | <div class="cat_bar"> |
27 | 27 | <h3 class="catbg"> |
28 | 28 | <span class="floatleft">', $txt['pm_capacity'], ':</span> |
@@ -32,14 +32,16 @@ discard block |
||
32 | 32 | <span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span> |
33 | 33 | </h3> |
34 | 34 | </div>'; |
35 | + } |
|
35 | 36 | |
36 | 37 | // Message sent? Show a small indication. |
37 | - if (isset($context['pm_sent'])) |
|
38 | - echo ' |
|
38 | + if (isset($context['pm_sent'])) { |
|
39 | + echo ' |
|
39 | 40 | <div class="infobox"> |
40 | 41 | ', $txt['pm_sent'], ' |
41 | 42 | </div>'; |
42 | -} |
|
43 | + } |
|
44 | + } |
|
43 | 45 | |
44 | 46 | /** |
45 | 47 | * Just the end of the index bar, nothing special. |
@@ -68,13 +70,13 @@ discard block |
||
68 | 70 | </div> |
69 | 71 | <div class="pm_unread">'; |
70 | 72 | |
71 | - if (empty($context['unread_pms'])) |
|
72 | - echo ' |
|
73 | + if (empty($context['unread_pms'])) { |
|
74 | + echo ' |
|
73 | 75 | <div class="no_unread">', $txt['pm_no_unread'], '</div>'; |
74 | - else |
|
76 | + } else |
|
75 | 77 | { |
76 | - foreach ($context['unread_pms'] as $id_pm => $pm_details) |
|
77 | - echo ' |
|
78 | + foreach ($context['unread_pms'] as $id_pm => $pm_details) { |
|
79 | + echo ' |
|
78 | 80 | <div class="unread"> |
79 | 81 | ', !empty($pm_details['member']) ? $pm_details['member']['avatar']['image'] : '', ' |
80 | 82 | <div class="details"> |
@@ -85,6 +87,7 @@ discard block |
||
85 | 87 | </div> |
86 | 88 | </div> |
87 | 89 | </div>'; |
90 | + } |
|
88 | 91 | } |
89 | 92 | |
90 | 93 | echo ' |
@@ -193,14 +196,15 @@ discard block |
||
193 | 196 | if ($context['get_pmessage']('message', true)) |
194 | 197 | { |
195 | 198 | // Show the helpful titlebar - generally. |
196 | - if ($context['display_mode'] != 1) |
|
197 | - echo ' |
|
199 | + if ($context['display_mode'] != 1) { |
|
200 | + echo ' |
|
198 | 201 | <div class="cat_bar"> |
199 | 202 | <h3 class="catbg"> |
200 | 203 | <span id="author">', $txt['author'], '</span> |
201 | 204 | <span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span> |
202 | 205 | </h3> |
203 | 206 | </div>'; |
207 | + } |
|
204 | 208 | |
205 | 209 | // Show a few buttons if we are in conversation mode and outputting the first message. |
206 | 210 | if ($context['display_mode'] == 2) |
@@ -229,9 +233,10 @@ discard block |
||
229 | 233 | <div class="custom_fields_above_member"> |
230 | 234 | <ul class="nolist">'; |
231 | 235 | |
232 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
233 | - echo ' |
|
236 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
237 | + echo ' |
|
234 | 238 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
239 | + } |
|
235 | 240 | |
236 | 241 | echo ' |
237 | 242 | </ul> |
@@ -243,25 +248,28 @@ discard block |
||
243 | 248 | <a id="msg', $message['id'], '"></a>'; |
244 | 249 | |
245 | 250 | // Show online and offline buttons? |
246 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
247 | - echo ' |
|
251 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
252 | + echo ' |
|
248 | 253 | <span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>'; |
254 | + } |
|
249 | 255 | |
250 | 256 | // Custom fields BEFORE the username? |
251 | - if (!empty($message['custom_fields']['before_member'])) |
|
252 | - foreach ($message['custom_fields']['before_member'] as $custom) |
|
257 | + if (!empty($message['custom_fields']['before_member'])) { |
|
258 | + foreach ($message['custom_fields']['before_member'] as $custom) |
|
253 | 259 | echo ' |
254 | 260 | <span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>'; |
261 | + } |
|
255 | 262 | |
256 | 263 | // Show a link to the member's profile. |
257 | 264 | echo ' |
258 | 265 | ', $message['member']['link']; |
259 | 266 | |
260 | 267 | // Custom fields AFTER the username? |
261 | - if (!empty($message['custom_fields']['after_member'])) |
|
262 | - foreach ($message['custom_fields']['after_member'] as $custom) |
|
268 | + if (!empty($message['custom_fields']['after_member'])) { |
|
269 | + foreach ($message['custom_fields']['after_member'] as $custom) |
|
263 | 270 | echo ' |
264 | 271 | <span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>'; |
272 | + } |
|
265 | 273 | |
266 | 274 | echo ' |
267 | 275 | </h4>'; |
@@ -270,48 +278,56 @@ discard block |
||
270 | 278 | <ul class="user_info">'; |
271 | 279 | |
272 | 280 | // Show the user's avatar. |
273 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
274 | - echo ' |
|
281 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
282 | + echo ' |
|
275 | 283 | <li class="avatar"> |
276 | 284 | <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a> |
277 | 285 | </li>'; |
286 | + } |
|
278 | 287 | |
279 | 288 | // Are there any custom fields below the avatar? |
280 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
281 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
289 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
290 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
282 | 291 | echo ' |
283 | 292 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
293 | + } |
|
284 | 294 | |
285 | - if (!$message['member']['is_guest']) |
|
286 | - echo ' |
|
295 | + if (!$message['member']['is_guest']) { |
|
296 | + echo ' |
|
287 | 297 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
298 | + } |
|
288 | 299 | // Show the member's primary group (like 'Administrator') if they have one. |
289 | - if (isset($message['member']['group']) && $message['member']['group'] != '') |
|
290 | - echo ' |
|
300 | + if (isset($message['member']['group']) && $message['member']['group'] != '') { |
|
301 | + echo ' |
|
291 | 302 | <li class="membergroup">', $message['member']['group'], '</li>'; |
303 | + } |
|
292 | 304 | |
293 | 305 | // Show the member's custom title, if they have one. |
294 | - if (isset($message['member']['title']) && $message['member']['title'] != '') |
|
295 | - echo ' |
|
306 | + if (isset($message['member']['title']) && $message['member']['title'] != '') { |
|
307 | + echo ' |
|
296 | 308 | <li class="title">', $message['member']['title'], '</li>'; |
309 | + } |
|
297 | 310 | |
298 | 311 | // Don't show these things for guests. |
299 | 312 | if (!$message['member']['is_guest']) |
300 | 313 | { |
301 | 314 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
302 | - if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') |
|
303 | - echo ' |
|
315 | + if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') { |
|
316 | + echo ' |
|
304 | 317 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
318 | + } |
|
305 | 319 | |
306 | 320 | // Show how many posts they have made. |
307 | - if (!isset($context['disabled_fields']['posts'])) |
|
308 | - echo ' |
|
321 | + if (!isset($context['disabled_fields']['posts'])) { |
|
322 | + echo ' |
|
309 | 323 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
324 | + } |
|
310 | 325 | |
311 | 326 | // Show their personal text? |
312 | - if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') |
|
313 | - echo ' |
|
327 | + if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') { |
|
328 | + echo ' |
|
314 | 329 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
330 | + } |
|
315 | 331 | |
316 | 332 | // Any custom fields to show as icons? |
317 | 333 | if (!empty($message['custom_fields']['icons'])) |
@@ -320,9 +336,10 @@ discard block |
||
320 | 336 | <li class="im_icons"> |
321 | 337 | <ol>'; |
322 | 338 | |
323 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
324 | - echo ' |
|
339 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
340 | + echo ' |
|
325 | 341 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
342 | + } |
|
326 | 343 | |
327 | 344 | echo ' |
328 | 345 | </ol> |
@@ -330,25 +347,28 @@ discard block |
||
330 | 347 | } |
331 | 348 | |
332 | 349 | // Show the IP to this user for this post - because you can moderate? |
333 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
334 | - echo ' |
|
350 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
351 | + echo ' |
|
335 | 352 | <li class="poster_ip"> |
336 | 353 | <a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a> |
337 | 354 | </li>'; |
355 | + } |
|
338 | 356 | |
339 | 357 | // Or, should we show it because this is you? |
340 | - elseif ($message['can_see_ip']) |
|
341 | - echo ' |
|
358 | + elseif ($message['can_see_ip']) { |
|
359 | + echo ' |
|
342 | 360 | <li class="poster_ip"> |
343 | 361 | <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a> |
344 | 362 | </li>'; |
363 | + } |
|
345 | 364 | |
346 | 365 | // Okay, you are logged in, then we can show something about why IPs are logged... |
347 | - else |
|
348 | - echo ' |
|
366 | + else { |
|
367 | + echo ' |
|
349 | 368 | <li class="poster_ip"> |
350 | 369 | <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a> |
351 | 370 | </li>'; |
371 | + } |
|
352 | 372 | |
353 | 373 | // Show the profile, website, email address, and personal message buttons. |
354 | 374 | if ($message['member']['show_profile_buttons']) |
@@ -358,24 +378,28 @@ discard block |
||
358 | 378 | <ol class="profile_icons">'; |
359 | 379 | |
360 | 380 | // Show the profile button |
361 | - if ($message['member']['can_view_profile']) |
|
362 | - echo ' |
|
381 | + if ($message['member']['can_view_profile']) { |
|
382 | + echo ' |
|
363 | 383 | <li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>'; |
384 | + } |
|
364 | 385 | |
365 | 386 | // Don't show an icon if they haven't specified a website. |
366 | - if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) |
|
367 | - echo ' |
|
387 | + if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) { |
|
388 | + echo ' |
|
368 | 389 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" rel="noopener">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
390 | + } |
|
369 | 391 | |
370 | 392 | // Don't show the email address if they want it hidden. |
371 | - if ($message['member']['show_email']) |
|
372 | - echo ' |
|
393 | + if ($message['member']['show_email']) { |
|
394 | + echo ' |
|
373 | 395 | <li><a href="mailto:', $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
396 | + } |
|
374 | 397 | |
375 | 398 | // Since we know this person isn't a guest, you *can* message them. |
376 | - if ($context['can_send_pm']) |
|
377 | - echo ' |
|
399 | + if ($context['can_send_pm']) { |
|
400 | + echo ' |
|
378 | 401 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
402 | + } |
|
379 | 403 | |
380 | 404 | echo ' |
381 | 405 | </ol> |
@@ -383,21 +407,24 @@ discard block |
||
383 | 407 | } |
384 | 408 | |
385 | 409 | // Any custom fields for standard placement? |
386 | - if (!empty($message['custom_fields']['standard'])) |
|
387 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
410 | + if (!empty($message['custom_fields']['standard'])) { |
|
411 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
388 | 412 | echo ' |
389 | 413 | <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
414 | + } |
|
390 | 415 | |
391 | 416 | // Are we showing the warning status? |
392 | - if ($message['member']['can_see_warning']) |
|
393 | - echo ' |
|
417 | + if ($message['member']['can_see_warning']) { |
|
418 | + echo ' |
|
394 | 419 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span>', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
420 | + } |
|
395 | 421 | |
396 | 422 | // Are there any custom fields to show at the bottom of the poster info? |
397 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
398 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
423 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
424 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
399 | 425 | echo ' |
400 | 426 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
427 | + } |
|
401 | 428 | } |
402 | 429 | |
403 | 430 | // Done with the information about the poster... on to the post itself. |
@@ -416,25 +443,29 @@ discard block |
||
416 | 443 | <span class="smalltext">« <strong> ', $txt['sent_to'], ':</strong> '; |
417 | 444 | |
418 | 445 | // People it was sent directly to.... |
419 | - if (!empty($message['recipients']['to'])) |
|
420 | - echo implode(', ', $message['recipients']['to']); |
|
446 | + if (!empty($message['recipients']['to'])) { |
|
447 | + echo implode(', ', $message['recipients']['to']); |
|
448 | + } |
|
421 | 449 | |
422 | 450 | // Otherwise, we're just going to say "some people"... |
423 | - elseif ($context['folder'] != 'sent') |
|
424 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
451 | + elseif ($context['folder'] != 'sent') { |
|
452 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
453 | + } |
|
425 | 454 | |
426 | 455 | echo ' |
427 | 456 | <strong> ', $txt['on'], ':</strong> ', $message['time'], ' » |
428 | 457 | </span>'; |
429 | 458 | |
430 | 459 | // If we're in the sent items, show who it was sent to besides the "To:" people. |
431 | - if (!empty($message['recipients']['bcc'])) |
|
432 | - echo '<br> |
|
460 | + if (!empty($message['recipients']['bcc'])) { |
|
461 | + echo '<br> |
|
433 | 462 | <span class="smalltext">« <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' »</span>'; |
463 | + } |
|
434 | 464 | |
435 | - if (!empty($message['is_replied_to'])) |
|
436 | - echo '<br> |
|
465 | + if (!empty($message['is_replied_to'])) { |
|
466 | + echo '<br> |
|
437 | 467 | <span class="smalltext">« ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' »</span>'; |
468 | + } |
|
438 | 469 | |
439 | 470 | echo ' |
440 | 471 | </div><!-- .keyinfo --> |
@@ -444,13 +475,15 @@ discard block |
||
444 | 475 | ', $message['body'], ' |
445 | 476 | </div>'; |
446 | 477 | |
447 | - if ($message['can_report'] || $context['can_send_pm']) |
|
448 | - echo ' |
|
478 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
479 | + echo ' |
|
449 | 480 | <div class="under_message">'; |
481 | + } |
|
450 | 482 | |
451 | - if ($message['can_report']) |
|
452 | - echo ' |
|
483 | + if ($message['can_report']) { |
|
484 | + echo ' |
|
453 | 485 | <a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>'; |
486 | + } |
|
454 | 487 | |
455 | 488 | echo ' |
456 | 489 | <ul class="quickbuttons">'; |
@@ -462,32 +495,36 @@ discard block |
||
462 | 495 | if (!$message['member']['is_guest']) |
463 | 496 | { |
464 | 497 | // Is there than more than one recipient you can reply to? |
465 | - if ($message['number_recipients'] > 1) |
|
466 | - echo ' |
|
498 | + if ($message['number_recipients'] > 1) { |
|
499 | + echo ' |
|
467 | 500 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>'; |
501 | + } |
|
468 | 502 | |
469 | 503 | echo ' |
470 | 504 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li> |
471 | 505 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
472 | 506 | } |
473 | 507 | // This is for "forwarding" - even if the member is gone. |
474 | - else |
|
475 | - echo ' |
|
508 | + else { |
|
509 | + echo ' |
|
476 | 510 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>'; |
511 | + } |
|
477 | 512 | } |
478 | 513 | echo ' |
479 | 514 | <li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>'; |
480 | 515 | |
481 | - if (empty($context['display_mode'])) |
|
482 | - echo ' |
|
516 | + if (empty($context['display_mode'])) { |
|
517 | + echo ' |
|
483 | 518 | <li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;"></li>'; |
519 | + } |
|
484 | 520 | |
485 | 521 | echo ' |
486 | 522 | </ul>'; |
487 | 523 | |
488 | - if ($message['can_report'] || $context['can_send_pm']) |
|
489 | - echo ' |
|
524 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
525 | + echo ' |
|
490 | 526 | </div><!-- .under_message -->'; |
527 | + } |
|
491 | 528 | |
492 | 529 | // Are there any custom profile fields for above the signature? |
493 | 530 | if (!empty($message['custom_fields']['above_signature'])) |
@@ -496,9 +533,10 @@ discard block |
||
496 | 533 | <div class="custom_fields_above_signature"> |
497 | 534 | <ul class="nolist">'; |
498 | 535 | |
499 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
500 | - echo ' |
|
536 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
537 | + echo ' |
|
501 | 538 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
539 | + } |
|
502 | 540 | |
503 | 541 | echo ' |
504 | 542 | </ul> |
@@ -506,11 +544,12 @@ discard block |
||
506 | 544 | } |
507 | 545 | |
508 | 546 | // Show the member's signature? |
509 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
510 | - echo ' |
|
547 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
548 | + echo ' |
|
511 | 549 | <div class="signature"> |
512 | 550 | ', $message['member']['signature'], ' |
513 | 551 | </div>'; |
552 | + } |
|
514 | 553 | |
515 | 554 | // Are there any custom profile fields for below the signature? |
516 | 555 | if (!empty($message['custom_fields']['below_signature'])) |
@@ -519,9 +558,10 @@ discard block |
||
519 | 558 | <div class="custom_fields_below_signature"> |
520 | 559 | <ul class="nolist">'; |
521 | 560 | |
522 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
523 | - echo ' |
|
561 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
562 | + echo ' |
|
524 | 563 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
564 | + } |
|
525 | 565 | |
526 | 566 | echo ' |
527 | 567 | </ul> |
@@ -548,10 +588,11 @@ discard block |
||
548 | 588 | echo ' |
549 | 589 | <option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>'; |
550 | 590 | |
551 | - foreach ($context['labels'] as $label) |
|
552 | - if (!isset($message['labels'][$label['id']])) |
|
591 | + foreach ($context['labels'] as $label) { |
|
592 | + if (!isset($message['labels'][$label['id']])) |
|
553 | 593 | echo ' |
554 | 594 | <option value="', $label['id'], '">', $label['name'], '</option>'; |
595 | + } |
|
555 | 596 | } |
556 | 597 | |
557 | 598 | // ... and are there any that can be removed? |
@@ -560,9 +601,10 @@ discard block |
||
560 | 601 | echo ' |
561 | 602 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
562 | 603 | |
563 | - foreach ($message['labels'] as $label) |
|
564 | - echo ' |
|
604 | + foreach ($message['labels'] as $label) { |
|
605 | + echo ' |
|
565 | 606 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
607 | + } |
|
566 | 608 | } |
567 | 609 | echo ' |
568 | 610 | </select> |
@@ -581,14 +623,15 @@ discard block |
||
581 | 623 | </div><!-- .windowbg -->'; |
582 | 624 | } |
583 | 625 | |
584 | - if (empty($context['display_mode'])) |
|
585 | - echo ' |
|
626 | + if (empty($context['display_mode'])) { |
|
627 | + echo ' |
|
586 | 628 | <div class="pagesection"> |
587 | 629 | <div class="floatleft">', $context['page_index'], '</div> |
588 | 630 | <div class="floatright"> |
589 | 631 | <input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button"> |
590 | 632 | </div> |
591 | 633 | </div>'; |
634 | + } |
|
592 | 635 | |
593 | 636 | // Show a few buttons if we are in conversation mode and outputting the first message. |
594 | 637 | elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons'])) |
@@ -648,11 +691,12 @@ discard block |
||
648 | 691 | </thead> |
649 | 692 | <tbody>'; |
650 | 693 | |
651 | - if (!$context['show_delete']) |
|
652 | - echo ' |
|
694 | + if (!$context['show_delete']) { |
|
695 | + echo ' |
|
653 | 696 | <tr class="windowbg"> |
654 | 697 | <td colspan="5">', $txt['pm_alert_none'], '</td> |
655 | 698 | </tr>'; |
699 | + } |
|
656 | 700 | |
657 | 701 | while ($message = $context['get_pmessage']('subject')) |
658 | 702 | { |
@@ -710,17 +754,19 @@ discard block |
||
710 | 754 | |
711 | 755 | foreach ($context['labels'] as $label) |
712 | 756 | { |
713 | - if ($label['id'] != $context['current_label_id']) |
|
714 | - echo ' |
|
757 | + if ($label['id'] != $context['current_label_id']) { |
|
758 | + echo ' |
|
715 | 759 | <option value="add_', $label['id'], '"> ', $label['name'], '</option>'; |
760 | + } |
|
716 | 761 | } |
717 | 762 | |
718 | 763 | echo ' |
719 | 764 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
720 | 765 | |
721 | - foreach ($context['labels'] as $label) |
|
722 | - echo ' |
|
766 | + foreach ($context['labels'] as $label) { |
|
767 | + echo ' |
|
723 | 768 | <option value="rem_', $label['id'], '"> ', $label['name'], '</option>'; |
769 | + } |
|
724 | 770 | |
725 | 771 | echo ' |
726 | 772 | </select> |
@@ -751,11 +797,12 @@ discard block |
||
751 | 797 | <h3 class="catbg">', $txt['pm_search_title'], '</h3> |
752 | 798 | </div>'; |
753 | 799 | |
754 | - if (!empty($context['search_errors'])) |
|
755 | - echo ' |
|
800 | + if (!empty($context['search_errors'])) { |
|
801 | + echo ' |
|
756 | 802 | <div class="errorbox"> |
757 | 803 | ', implode('<br>', $context['search_errors']['messages']), ' |
758 | 804 | </div>'; |
805 | + } |
|
759 | 806 | |
760 | 807 | |
761 | 808 | echo ' |
@@ -804,9 +851,10 @@ discard block |
||
804 | 851 | </dd> |
805 | 852 | </dl>'; |
806 | 853 | |
807 | - if (!$context['currently_using_labels']) |
|
808 | - echo ' |
|
854 | + if (!$context['currently_using_labels']) { |
|
855 | + echo ' |
|
809 | 856 | <input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button">'; |
857 | + } |
|
810 | 858 | |
811 | 859 | echo ' |
812 | 860 | <br class="clear_right"> |
@@ -827,12 +875,13 @@ discard block |
||
827 | 875 | <div id="advanced_panel_div"> |
828 | 876 | <ul id="searchLabelsExpand">'; |
829 | 877 | |
830 | - foreach ($context['search_labels'] as $label) |
|
831 | - echo ' |
|
878 | + foreach ($context['search_labels'] as $label) { |
|
879 | + echo ' |
|
832 | 880 | <li> |
833 | 881 | <label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', '> |
834 | 882 | ', $label['name'], '</label> |
835 | 883 | </li>'; |
884 | + } |
|
836 | 885 | |
837 | 886 | echo ' |
838 | 887 | </ul> |
@@ -894,8 +943,8 @@ discard block |
||
894 | 943 | </div>'; |
895 | 944 | |
896 | 945 | // Complete results? |
897 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
898 | - echo ' |
|
946 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
947 | + echo ' |
|
899 | 948 | <table class="table_grid"> |
900 | 949 | <thead> |
901 | 950 | <tr class="title_bar"> |
@@ -905,6 +954,7 @@ discard block |
||
905 | 954 | </tr> |
906 | 955 | </thead> |
907 | 956 | <tbody>'; |
957 | + } |
|
908 | 958 | |
909 | 959 | // Print each message out... |
910 | 960 | foreach ($context['personal_messages'] as $message) |
@@ -924,12 +974,14 @@ discard block |
||
924 | 974 | |
925 | 975 | // Show the recipients. |
926 | 976 | // @todo This doesn't deal with the sent item searching quite right for bcc. |
927 | - if (!empty($message['recipients']['to'])) |
|
928 | - echo implode(', ', $message['recipients']['to']); |
|
977 | + if (!empty($message['recipients']['to'])) { |
|
978 | + echo implode(', ', $message['recipients']['to']); |
|
979 | + } |
|
929 | 980 | |
930 | 981 | // Otherwise, we're just going to say "some people"... |
931 | - elseif ($context['folder'] != 'sent') |
|
932 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
982 | + elseif ($context['folder'] != 'sent') { |
|
983 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
984 | + } |
|
933 | 985 | |
934 | 986 | echo ' |
935 | 987 | </h3> |
@@ -944,15 +996,17 @@ discard block |
||
944 | 996 | $reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"'); |
945 | 997 | |
946 | 998 | // You can only reply if they are not a guest... |
947 | - if (!$message['member']['is_guest']) |
|
948 | - echo ' |
|
999 | + if (!$message['member']['is_guest']) { |
|
1000 | + echo ' |
|
949 | 1001 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
950 | 1002 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
1003 | + } |
|
951 | 1004 | |
952 | 1005 | // This is for "forwarding" - even if the member is gone. |
953 | - else |
|
954 | - echo ' |
|
1006 | + else { |
|
1007 | + echo ' |
|
955 | 1008 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
1009 | + } |
|
956 | 1010 | } |
957 | 1011 | |
958 | 1012 | echo ' |
@@ -961,27 +1015,30 @@ discard block |
||
961 | 1015 | } |
962 | 1016 | // Otherwise just a simple list! |
963 | 1017 | // @todo No context at all of the search? |
964 | - else |
|
965 | - echo ' |
|
1018 | + else { |
|
1019 | + echo ' |
|
966 | 1020 | <tr class="windowbg"> |
967 | 1021 | <td>', $message['time'], '</td> |
968 | 1022 | <td>', $message['link'], '</td> |
969 | 1023 | <td>', $message['member']['link'], '</td> |
970 | 1024 | </tr>'; |
1025 | + } |
|
971 | 1026 | } |
972 | 1027 | |
973 | 1028 | // Finish off the page... |
974 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
975 | - echo ' |
|
1029 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
1030 | + echo ' |
|
976 | 1031 | </tbody> |
977 | 1032 | </table>'; |
1033 | + } |
|
978 | 1034 | |
979 | 1035 | // No results? |
980 | - if (empty($context['personal_messages'])) |
|
981 | - echo ' |
|
1036 | + if (empty($context['personal_messages'])) { |
|
1037 | + echo ' |
|
982 | 1038 | <div class="windowbg"> |
983 | 1039 | <p class="centertext">', $txt['pm_search_none_found'], '</p> |
984 | 1040 | </div>'; |
1041 | + } |
|
985 | 1042 | |
986 | 1043 | echo ' |
987 | 1044 | <div class="pagesection"> |
@@ -1006,15 +1063,17 @@ discard block |
||
1006 | 1063 | </div> |
1007 | 1064 | <div class="windowbg">'; |
1008 | 1065 | |
1009 | - if (!empty($context['send_log']['sent'])) |
|
1010 | - foreach ($context['send_log']['sent'] as $log_entry) |
|
1066 | + if (!empty($context['send_log']['sent'])) { |
|
1067 | + foreach ($context['send_log']['sent'] as $log_entry) |
|
1011 | 1068 | echo ' |
1012 | 1069 | <span class="error">', $log_entry, '</span><br>'; |
1070 | + } |
|
1013 | 1071 | |
1014 | - if (!empty($context['send_log']['failed'])) |
|
1015 | - foreach ($context['send_log']['failed'] as $log_entry) |
|
1072 | + if (!empty($context['send_log']['failed'])) { |
|
1073 | + foreach ($context['send_log']['failed'] as $log_entry) |
|
1016 | 1074 | echo ' |
1017 | 1075 | <span class="error">', $log_entry, '</span><br>'; |
1076 | + } |
|
1018 | 1077 | |
1019 | 1078 | echo ' |
1020 | 1079 | </div> |
@@ -1063,12 +1122,13 @@ discard block |
||
1063 | 1122 | </dl> |
1064 | 1123 | </div>'; |
1065 | 1124 | |
1066 | - if (!empty($modSettings['drafts_pm_enabled'])) |
|
1067 | - echo ' |
|
1125 | + if (!empty($modSettings['drafts_pm_enabled'])) { |
|
1126 | + echo ' |
|
1068 | 1127 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
1069 | 1128 | sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), ' |
1070 | 1129 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
1071 | 1130 | </div>'; |
1131 | + } |
|
1072 | 1132 | |
1073 | 1133 | echo ' |
1074 | 1134 | <dl id="post_header">'; |
@@ -1117,26 +1177,29 @@ discard block |
||
1117 | 1177 | <hr>'; |
1118 | 1178 | |
1119 | 1179 | // Showing BBC? |
1120 | - if ($context['show_bbc']) |
|
1121 | - echo ' |
|
1180 | + if ($context['show_bbc']) { |
|
1181 | + echo ' |
|
1122 | 1182 | <div id="bbcBox_message"></div>'; |
1183 | + } |
|
1123 | 1184 | |
1124 | 1185 | // What about smileys? |
1125 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
1126 | - echo ' |
|
1186 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
1187 | + echo ' |
|
1127 | 1188 | <div id="smileyBox_message"></div>'; |
1189 | + } |
|
1128 | 1190 | |
1129 | 1191 | // Show BBC buttons, smileys and textbox. |
1130 | 1192 | echo ' |
1131 | 1193 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
1132 | 1194 | |
1133 | 1195 | // Require an image to be typed to save spamming? |
1134 | - if ($context['require_verification']) |
|
1135 | - echo ' |
|
1196 | + if ($context['require_verification']) { |
|
1197 | + echo ' |
|
1136 | 1198 | <div class="post_verification"> |
1137 | 1199 | <strong>', $txt['pm_visual_verification_label'], ':</strong> |
1138 | 1200 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
1139 | 1201 | </div>'; |
1202 | + } |
|
1140 | 1203 | |
1141 | 1204 | // Send, Preview, spellcheck buttons. |
1142 | 1205 | echo ' |
@@ -1169,10 +1232,11 @@ discard block |
||
1169 | 1232 | <dt><strong>', $txt['subject'], '</strong></dt> |
1170 | 1233 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
1171 | 1234 | |
1172 | - foreach ($context['drafts'] as $draft) |
|
1173 | - echo ' |
|
1235 | + foreach ($context['drafts'] as $draft) { |
|
1236 | + echo ' |
|
1174 | 1237 | <dt>', $draft['link'], '</dt> |
1175 | 1238 | <dd>', $draft['poster_time'], '</dd>'; |
1239 | + } |
|
1176 | 1240 | echo ' |
1177 | 1241 | </dl> |
1178 | 1242 | </div>'; |
@@ -1279,8 +1343,8 @@ discard block |
||
1279 | 1343 | }'; |
1280 | 1344 | |
1281 | 1345 | // Code for showing and hiding drafts |
1282 | - if (!empty($context['drafts'])) |
|
1283 | - echo ' |
|
1346 | + if (!empty($context['drafts'])) { |
|
1347 | + echo ' |
|
1284 | 1348 | var oSwapDraftOptions = new smc_Toggle({ |
1285 | 1349 | bToggleEnabled: true, |
1286 | 1350 | bCurrentlyCollapsed: true, |
@@ -1302,13 +1366,14 @@ discard block |
||
1302 | 1366 | } |
1303 | 1367 | ] |
1304 | 1368 | });'; |
1369 | + } |
|
1305 | 1370 | |
1306 | 1371 | echo ' |
1307 | 1372 | </script>'; |
1308 | 1373 | |
1309 | 1374 | // Show the message you're replying to. |
1310 | - if ($context['reply']) |
|
1311 | - echo ' |
|
1375 | + if ($context['reply']) { |
|
1376 | + echo ' |
|
1312 | 1377 | <br><br> |
1313 | 1378 | <div class="cat_bar"> |
1314 | 1379 | <h3 class="catbg">', $txt['subject'], ': ', $context['quoted_message']['subject'], '</h3> |
@@ -1322,6 +1387,7 @@ discard block |
||
1322 | 1387 | ', $context['quoted_message']['body'], ' |
1323 | 1388 | </div> |
1324 | 1389 | <br class="clear">'; |
1390 | + } |
|
1325 | 1391 | |
1326 | 1392 | echo ' |
1327 | 1393 | <script> |
@@ -1333,23 +1399,25 @@ discard block |
||
1333 | 1399 | sToControlId: \'to_control\', |
1334 | 1400 | aToRecipients: ['; |
1335 | 1401 | |
1336 | - foreach ($context['recipients']['to'] as $i => $member) |
|
1337 | - echo ' |
|
1402 | + foreach ($context['recipients']['to'] as $i => $member) { |
|
1403 | + echo ' |
|
1338 | 1404 | { |
1339 | 1405 | sItemId: ', JavaScriptEscape($member['id']), ', |
1340 | 1406 | sItemName: ', JavaScriptEscape($member['name']), ' |
1341 | 1407 | }', $i == count($context['recipients']['to']) - 1 ? '' : ','; |
1408 | + } |
|
1342 | 1409 | |
1343 | 1410 | echo ' |
1344 | 1411 | ], |
1345 | 1412 | aBccRecipients: ['; |
1346 | 1413 | |
1347 | - foreach ($context['recipients']['bcc'] as $i => $member) |
|
1348 | - echo ' |
|
1414 | + foreach ($context['recipients']['bcc'] as $i => $member) { |
|
1415 | + echo ' |
|
1349 | 1416 | { |
1350 | 1417 | sItemId: ', JavaScriptEscape($member['id']), ', |
1351 | 1418 | sItemName: ', JavaScriptEscape($member['name']), ' |
1352 | 1419 | }', $i == count($context['recipients']['bcc']) - 1 ? '' : ','; |
1420 | + } |
|
1353 | 1421 | |
1354 | 1422 | echo ' |
1355 | 1423 | ], |
@@ -1438,26 +1506,28 @@ discard block |
||
1438 | 1506 | </th> |
1439 | 1507 | <th class="centertext table_icon">'; |
1440 | 1508 | |
1441 | - if (count($context['labels']) > 2) |
|
1442 | - echo ' |
|
1509 | + if (count($context['labels']) > 2) { |
|
1510 | + echo ' |
|
1443 | 1511 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
1512 | + } |
|
1444 | 1513 | |
1445 | 1514 | echo ' |
1446 | 1515 | </th> |
1447 | 1516 | </tr> |
1448 | 1517 | </thead> |
1449 | 1518 | <tbody>'; |
1450 | - if (count($context['labels']) < 2) |
|
1451 | - echo ' |
|
1519 | + if (count($context['labels']) < 2) { |
|
1520 | + echo ' |
|
1452 | 1521 | <tr class="windowbg"> |
1453 | 1522 | <td colspan="2">', $txt['pm_labels_no_exist'], '</td> |
1454 | 1523 | </tr>'; |
1455 | - else |
|
1524 | + } else |
|
1456 | 1525 | { |
1457 | 1526 | foreach ($context['labels'] as $label) |
1458 | 1527 | { |
1459 | - if ($label['id'] == -1) |
|
1460 | - continue; |
|
1528 | + if ($label['id'] == -1) { |
|
1529 | + continue; |
|
1530 | + } |
|
1461 | 1531 | |
1462 | 1532 | echo ' |
1463 | 1533 | <tr class="windowbg"> |
@@ -1472,12 +1542,13 @@ discard block |
||
1472 | 1542 | </tbody> |
1473 | 1543 | </table>'; |
1474 | 1544 | |
1475 | - if (!count($context['labels']) < 2) |
|
1476 | - echo ' |
|
1545 | + if (!count($context['labels']) < 2) { |
|
1546 | + echo ' |
|
1477 | 1547 | <div class="padding"> |
1478 | 1548 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
1479 | 1549 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
1480 | 1550 | </div>'; |
1551 | + } |
|
1481 | 1552 | |
1482 | 1553 | echo ' |
1483 | 1554 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1534,9 +1605,10 @@ discard block |
||
1534 | 1605 | <select name="id_admin"> |
1535 | 1606 | <option value="0">', $txt['pm_report_all_admins'], '</option>'; |
1536 | 1607 | |
1537 | - foreach ($context['admins'] as $id => $name) |
|
1538 | - echo ' |
|
1608 | + foreach ($context['admins'] as $id => $name) { |
|
1609 | + echo ' |
|
1539 | 1610 | <option value="', $id, '">', $name, '</option>'; |
1611 | + } |
|
1540 | 1612 | |
1541 | 1613 | echo ' |
1542 | 1614 | </select> |
@@ -1599,9 +1671,10 @@ discard block |
||
1599 | 1671 | </th> |
1600 | 1672 | <th class="centertext table_icon">'; |
1601 | 1673 | |
1602 | - if (!empty($context['rules'])) |
|
1603 | - echo ' |
|
1674 | + if (!empty($context['rules'])) { |
|
1675 | + echo ' |
|
1604 | 1676 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
1677 | + } |
|
1605 | 1678 | |
1606 | 1679 | echo ' |
1607 | 1680 | </th> |
@@ -1609,16 +1682,17 @@ discard block |
||
1609 | 1682 | </thead> |
1610 | 1683 | <tbody>'; |
1611 | 1684 | |
1612 | - if (empty($context['rules'])) |
|
1613 | - echo ' |
|
1685 | + if (empty($context['rules'])) { |
|
1686 | + echo ' |
|
1614 | 1687 | <tr class="windowbg"> |
1615 | 1688 | <td colspan="2"> |
1616 | 1689 | ', $txt['pm_rules_none'], ' |
1617 | 1690 | </td> |
1618 | 1691 | </tr>'; |
1692 | + } |
|
1619 | 1693 | |
1620 | - foreach ($context['rules'] as $rule) |
|
1621 | - echo ' |
|
1694 | + foreach ($context['rules'] as $rule) { |
|
1695 | + echo ' |
|
1622 | 1696 | <tr class="windowbg"> |
1623 | 1697 | <td> |
1624 | 1698 | <a href="', $scripturl, '?action=pm;sa=manrules;add;rid=', $rule['id'], '">', $rule['name'], '</a> |
@@ -1627,6 +1701,7 @@ discard block |
||
1627 | 1701 | <input type="checkbox" name="delrule[', $rule['id'], ']"> |
1628 | 1702 | </td> |
1629 | 1703 | </tr>'; |
1704 | + } |
|
1630 | 1705 | |
1631 | 1706 | echo ' |
1632 | 1707 | </tbody> |
@@ -1634,14 +1709,16 @@ discard block |
||
1634 | 1709 | <div class="righttext"> |
1635 | 1710 | <a class="button" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>'; |
1636 | 1711 | |
1637 | - if (!empty($context['rules'])) |
|
1638 | - echo ' |
|
1712 | + if (!empty($context['rules'])) { |
|
1713 | + echo ' |
|
1639 | 1714 | [<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]'; |
1715 | + } |
|
1640 | 1716 | |
1641 | - if (!empty($context['rules'])) |
|
1642 | - echo ' |
|
1717 | + if (!empty($context['rules'])) { |
|
1718 | + echo ' |
|
1643 | 1719 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1644 | 1720 | <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
1721 | + } |
|
1645 | 1722 | |
1646 | 1723 | echo ' |
1647 | 1724 | </div> |
@@ -1663,14 +1740,16 @@ discard block |
||
1663 | 1740 | var groups = new Array() |
1664 | 1741 | var labels = new Array()'; |
1665 | 1742 | |
1666 | - foreach ($context['groups'] as $id => $title) |
|
1667 | - echo ' |
|
1743 | + foreach ($context['groups'] as $id => $title) { |
|
1744 | + echo ' |
|
1668 | 1745 | groups[', $id, '] = "', addslashes($title), '";'; |
1746 | + } |
|
1669 | 1747 | |
1670 | - foreach ($context['labels'] as $label) |
|
1671 | - if ($label['id'] != -1) |
|
1748 | + foreach ($context['labels'] as $label) { |
|
1749 | + if ($label['id'] != -1) |
|
1672 | 1750 | echo ' |
1673 | 1751 | labels[', ($label['id']), '] = "', addslashes($label['name']), '";'; |
1752 | + } |
|
1674 | 1753 | |
1675 | 1754 | echo ' |
1676 | 1755 | function addCriteriaOption() |
@@ -1685,8 +1764,9 @@ discard block |
||
1685 | 1764 | |
1686 | 1765 | setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select> <span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value=""><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>'; |
1687 | 1766 | |
1688 | - foreach ($context['groups'] as $id => $group) |
|
1689 | - echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
1767 | + foreach ($context['groups'] as $id => $group) { |
|
1768 | + echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
1769 | + } |
|
1690 | 1770 | |
1691 | 1771 | echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\'); |
1692 | 1772 | } |
@@ -1703,9 +1783,10 @@ discard block |
||
1703 | 1783 | |
1704 | 1784 | setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select> <span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>'; |
1705 | 1785 | |
1706 | - foreach ($context['labels'] as $label) |
|
1707 | - if ($label['id'] != -1) |
|
1786 | + foreach ($context['labels'] as $label) { |
|
1787 | + if ($label['id'] != -1) |
|
1708 | 1788 | echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>'; |
1789 | + } |
|
1709 | 1790 | |
1710 | 1791 | echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\'); |
1711 | 1792 | } |
@@ -1819,19 +1900,20 @@ discard block |
||
1819 | 1900 | $isFirst = true; |
1820 | 1901 | foreach ($context['rule']['criteria'] as $k => $criteria) |
1821 | 1902 | { |
1822 | - if (!$isFirst && $criteria['t'] == '') |
|
1823 | - echo '<div id="removeonjs1">'; |
|
1824 | - |
|
1825 | - elseif (!$isFirst) |
|
1826 | - echo '<br>'; |
|
1903 | + if (!$isFirst && $criteria['t'] == '') { |
|
1904 | + echo '<div id="removeonjs1">'; |
|
1905 | + } elseif (!$isFirst) { |
|
1906 | + echo '<br>'; |
|
1907 | + } |
|
1827 | 1908 | |
1828 | 1909 | echo ' |
1829 | 1910 | <select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();"> |
1830 | 1911 | <option value="">', $txt['pm_rule_criteria_pick'], ':</option>'; |
1831 | 1912 | |
1832 | - foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) |
|
1833 | - echo ' |
|
1913 | + foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) { |
|
1914 | + echo ' |
|
1834 | 1915 | <option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>'; |
1916 | + } |
|
1835 | 1917 | |
1836 | 1918 | echo ' |
1837 | 1919 | </select> |
@@ -1842,19 +1924,20 @@ discard block |
||
1842 | 1924 | <select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();"> |
1843 | 1925 | <option value="">', $txt['pm_rule_sel_group'], '</option>'; |
1844 | 1926 | |
1845 | - foreach ($context['groups'] as $id => $group) |
|
1846 | - echo ' |
|
1927 | + foreach ($context['groups'] as $id => $group) { |
|
1928 | + echo ' |
|
1847 | 1929 | <option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>'; |
1930 | + } |
|
1848 | 1931 | echo ' |
1849 | 1932 | </select> |
1850 | 1933 | </span>'; |
1851 | 1934 | |
1852 | 1935 | // If this is the dummy we add a means to hide for non js users. |
1853 | - if ($isFirst) |
|
1854 | - $isFirst = false; |
|
1855 | - |
|
1856 | - elseif ($criteria['t'] == '') |
|
1857 | - echo '</div><!-- .removeonjs1 -->'; |
|
1936 | + if ($isFirst) { |
|
1937 | + $isFirst = false; |
|
1938 | + } elseif ($criteria['t'] == '') { |
|
1939 | + echo '</div><!-- .removeonjs1 -->'; |
|
1940 | + } |
|
1858 | 1941 | } |
1859 | 1942 | |
1860 | 1943 | echo ' |
@@ -1877,10 +1960,11 @@ discard block |
||
1877 | 1960 | $isFirst = true; |
1878 | 1961 | foreach ($context['rule']['actions'] as $k => $action) |
1879 | 1962 | { |
1880 | - if (!$isFirst && $action['t'] == '') |
|
1881 | - echo '<div id="removeonjs2">'; |
|
1882 | - elseif (!$isFirst) |
|
1883 | - echo '<br>'; |
|
1963 | + if (!$isFirst && $action['t'] == '') { |
|
1964 | + echo '<div id="removeonjs2">'; |
|
1965 | + } elseif (!$isFirst) { |
|
1966 | + echo '<br>'; |
|
1967 | + } |
|
1884 | 1968 | |
1885 | 1969 | echo ' |
1886 | 1970 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
@@ -1892,20 +1976,21 @@ discard block |
||
1892 | 1976 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
1893 | 1977 | <option value="">', $txt['pm_rule_sel_label'], '</option>'; |
1894 | 1978 | |
1895 | - foreach ($context['labels'] as $label) |
|
1896 | - if ($label['id'] != -1) |
|
1979 | + foreach ($context['labels'] as $label) { |
|
1980 | + if ($label['id'] != -1) |
|
1897 | 1981 | echo ' |
1898 | 1982 | <option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>'; |
1983 | + } |
|
1899 | 1984 | |
1900 | 1985 | echo ' |
1901 | 1986 | </select> |
1902 | 1987 | </span>'; |
1903 | 1988 | |
1904 | - if ($isFirst) |
|
1905 | - $isFirst = false; |
|
1906 | - |
|
1907 | - elseif ($action['t'] == '') |
|
1908 | - echo '</div><!-- .removeonjs2 -->'; |
|
1989 | + if ($isFirst) { |
|
1990 | + $isFirst = false; |
|
1991 | + } elseif ($action['t'] == '') { |
|
1992 | + echo '</div><!-- .removeonjs2 -->'; |
|
1993 | + } |
|
1909 | 1994 | } |
1910 | 1995 | |
1911 | 1996 | echo ' |
@@ -1929,22 +2014,25 @@ discard block |
||
1929 | 2014 | echo ' |
1930 | 2015 | <script>'; |
1931 | 2016 | |
1932 | - foreach ($context['rule']['criteria'] as $k => $c) |
|
1933 | - echo ' |
|
2017 | + foreach ($context['rule']['criteria'] as $k => $c) { |
|
2018 | + echo ' |
|
1934 | 2019 | updateRuleDef(', $k, ');'; |
2020 | + } |
|
1935 | 2021 | |
1936 | - foreach ($context['rule']['actions'] as $k => $c) |
|
1937 | - echo ' |
|
2022 | + foreach ($context['rule']['actions'] as $k => $c) { |
|
2023 | + echo ' |
|
1938 | 2024 | updateActionDef(', $k, ');'; |
2025 | + } |
|
1939 | 2026 | |
1940 | 2027 | echo ' |
1941 | 2028 | rebuildRuleDesc();'; |
1942 | 2029 | |
1943 | 2030 | // If this isn't a new rule and we have JS enabled remove the JS compatibility stuff. |
1944 | - if ($context['rid']) |
|
1945 | - echo ' |
|
2031 | + if ($context['rid']) { |
|
2032 | + echo ' |
|
1946 | 2033 | document.getElementById("removeonjs1").style.display = "none"; |
1947 | 2034 | document.getElementById("removeonjs2").style.display = "none";'; |
2035 | + } |
|
1948 | 2036 | |
1949 | 2037 | echo ' |
1950 | 2038 | document.getElementById("addonjs1").style.display = ""; |
@@ -1972,12 +2060,12 @@ discard block |
||
1972 | 2060 | </div>'; |
1973 | 2061 | |
1974 | 2062 | // No drafts? Just show an informative message. |
1975 | - if (empty($context['drafts'])) |
|
1976 | - echo ' |
|
2063 | + if (empty($context['drafts'])) { |
|
2064 | + echo ' |
|
1977 | 2065 | <div class="windowbg2 centertext"> |
1978 | 2066 | ', $txt['draft_none'], ' |
1979 | 2067 | </div>'; |
1980 | - else |
|
2068 | + } else |
|
1981 | 2069 | { |
1982 | 2070 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
1983 | 2071 | foreach ($context['drafts'] as $draft) |
@@ -54,9 +54,10 @@ discard block |
||
54 | 54 | <dd> |
55 | 55 | <div id="known_themes_list">'; |
56 | 56 | |
57 | - foreach ($context['themes'] as $theme) |
|
58 | - echo ' |
|
57 | + foreach ($context['themes'] as $theme) { |
|
58 | + echo ' |
|
59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $theme['name'], '</label><br>'; |
60 | + } |
|
60 | 61 | |
61 | 62 | echo ' |
62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
74 | 75 | |
75 | 76 | // Put an option for each theme in the select box. |
76 | - foreach ($context['themes'] as $theme) |
|
77 | - echo ' |
|
77 | + foreach ($context['themes'] as $theme) { |
|
78 | + echo ' |
|
78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
80 | + } |
|
79 | 81 | |
80 | 82 | echo ' |
81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
91 | 93 | |
92 | 94 | // Same thing, this time for changing the theme of everyone. |
93 | - foreach ($context['themes'] as $theme) |
|
94 | - echo ' |
|
95 | + foreach ($context['themes'] as $theme) { |
|
96 | + echo ' |
|
95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
98 | + } |
|
96 | 99 | |
97 | 100 | echo ' |
98 | 101 | </select> |
@@ -187,11 +190,12 @@ discard block |
||
187 | 190 | global $context, $scripturl, $txt; |
188 | 191 | |
189 | 192 | // Show a nice confirmation message. |
190 | - if (isset($_GET['done'])) |
|
191 | - echo ' |
|
193 | + if (isset($_GET['done'])) { |
|
194 | + echo ' |
|
192 | 195 | <div class="infobox"> |
193 | 196 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
194 | 197 | </div>'; |
198 | + } |
|
195 | 199 | |
196 | 200 | echo ' |
197 | 201 | <div id="admincenter"> |
@@ -354,11 +358,12 @@ discard block |
||
354 | 358 | if (empty($setting) || !is_array($setting)) |
355 | 359 | { |
356 | 360 | // Insert a separator (unless this is the first item in the list) |
357 | - if ($i !== $first_option_key) |
|
358 | - echo ' |
|
361 | + if ($i !== $first_option_key) { |
|
362 | + echo ' |
|
359 | 363 | </dl> |
360 | 364 | <hr> |
361 | 365 | <dl class="settings">'; |
366 | + } |
|
362 | 367 | |
363 | 368 | // Should we give a name to this section? |
364 | 369 | if (is_string($setting) && !empty($setting)) |
@@ -367,9 +372,9 @@ discard block |
||
367 | 372 | echo ' |
368 | 373 | <dt><strong>' . $setting . '</strong></dt> |
369 | 374 | <dd></dd>'; |
375 | + } else { |
|
376 | + $titled_section = false; |
|
370 | 377 | } |
371 | - else |
|
372 | - $titled_section = false; |
|
373 | 378 | |
374 | 379 | continue; |
375 | 380 | } |
@@ -378,8 +383,8 @@ discard block |
||
378 | 383 | <dt>'; |
379 | 384 | |
380 | 385 | // Show the change option box? |
381 | - if ($context['theme_options_reset']) |
|
382 | - echo ' |
|
386 | + if ($context['theme_options_reset']) { |
|
387 | + echo ' |
|
383 | 388 | <span class="floatleft"> |
384 | 389 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
385 | 390 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -387,23 +392,26 @@ discard block |
||
387 | 392 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
388 | 393 | </select> |
389 | 394 | </span>'; |
395 | + } |
|
390 | 396 | |
391 | 397 | echo ' |
392 | 398 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
393 | 399 | |
394 | - if (isset($setting['description'])) |
|
395 | - echo ' |
|
400 | + if (isset($setting['description'])) { |
|
401 | + echo ' |
|
396 | 402 | <br> |
397 | 403 | <span class="smalltext">', $setting['description'], '</span>'; |
404 | + } |
|
398 | 405 | echo ' |
399 | 406 | </dt>'; |
400 | 407 | |
401 | 408 | // Display checkbox options |
402 | - if ($setting['type'] == 'checkbox') |
|
403 | - echo ' |
|
409 | + if ($setting['type'] == 'checkbox') { |
|
410 | + echo ' |
|
404 | 411 | <dd> |
405 | 412 | <input type="hidden" name="' . (!empty($setting['default']) ? 'default_' : '') . 'options[' . $setting['id'] . ']" value="0"> |
406 | 413 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', $context['theme_options_reset'] ? ' disabled' : '', ' value="1" class="floatleft">'; |
414 | + } |
|
407 | 415 | |
408 | 416 | // How about selection lists, we all love them |
409 | 417 | elseif ($setting['type'] == 'list') |
@@ -412,9 +420,10 @@ discard block |
||
412 | 420 | <dd> |
413 | 421 | <select class="floatleft" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
414 | 422 | |
415 | - foreach ($setting['options'] as $value => $label) |
|
416 | - echo ' |
|
423 | + foreach ($setting['options'] as $value => $label) { |
|
424 | + echo ' |
|
417 | 425 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
426 | + } |
|
418 | 427 | |
419 | 428 | echo ' |
420 | 429 | </select>'; |
@@ -433,14 +442,13 @@ discard block |
||
433 | 442 | |
434 | 443 | echo ' |
435 | 444 | <input type="number"', $min . $max . $step; |
436 | - } |
|
437 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
438 | - echo' |
|
445 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
446 | + echo' |
|
439 | 447 | <input type="url"'; |
440 | - |
|
441 | - else |
|
442 | - echo ' |
|
448 | + } else { |
|
449 | + echo ' |
|
443 | 450 | <input type="text"'; |
451 | + } |
|
444 | 452 | |
445 | 453 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
446 | 454 | } |
@@ -479,8 +487,8 @@ discard block |
||
479 | 487 | <br>'; |
480 | 488 | |
481 | 489 | // @todo Why can't I edit the default theme popup. |
482 | - if ($context['theme_settings']['theme_id'] != 1) |
|
483 | - echo ' |
|
490 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
491 | + echo ' |
|
484 | 492 | <div class="cat_bar"> |
485 | 493 | <h3 class="catbg config_hd"> |
486 | 494 | ', $txt['theme_edit'], ' |
@@ -496,6 +504,7 @@ discard block |
||
496 | 504 | </li> |
497 | 505 | </ul> |
498 | 506 | </div>'; |
507 | + } |
|
499 | 508 | |
500 | 509 | echo ' |
501 | 510 | <div class="cat_bar"> |
@@ -549,9 +558,10 @@ discard block |
||
549 | 558 | <dd> |
550 | 559 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
551 | 560 | |
552 | - foreach ($context['theme_variants'] as $key => $variant) |
|
553 | - echo ' |
|
561 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
562 | + echo ' |
|
554 | 563 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
564 | + } |
|
555 | 565 | |
556 | 566 | echo ' |
557 | 567 | </select> |
@@ -587,11 +597,12 @@ discard block |
||
587 | 597 | if (empty($setting) || !is_array($setting)) |
588 | 598 | { |
589 | 599 | // We don't need a separator before the first list element |
590 | - if ($i !== $first_setting_key) |
|
591 | - echo ' |
|
600 | + if ($i !== $first_setting_key) { |
|
601 | + echo ' |
|
592 | 602 | </dl> |
593 | 603 | <hr> |
594 | 604 | <dl class="settings">'; |
605 | + } |
|
595 | 606 | |
596 | 607 | // Add a fake heading? |
597 | 608 | if (is_string($setting) && !empty($setting)) |
@@ -600,9 +611,9 @@ discard block |
||
600 | 611 | echo ' |
601 | 612 | <dt><strong>' . $setting . '</strong></dt> |
602 | 613 | <dd></dd>'; |
614 | + } else { |
|
615 | + $titled_section = false; |
|
603 | 616 | } |
604 | - else |
|
605 | - $titled_section = false; |
|
606 | 617 | |
607 | 618 | continue; |
608 | 619 | } |
@@ -611,20 +622,22 @@ discard block |
||
611 | 622 | <dt> |
612 | 623 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
613 | 624 | |
614 | - if (isset($setting['description'])) |
|
615 | - echo '<br> |
|
625 | + if (isset($setting['description'])) { |
|
626 | + echo '<br> |
|
616 | 627 | <span class="smalltext">', $setting['description'], '</span>'; |
628 | + } |
|
617 | 629 | |
618 | 630 | echo ' |
619 | 631 | </dt>'; |
620 | 632 | |
621 | 633 | // A checkbox? |
622 | - if ($setting['type'] == 'checkbox') |
|
623 | - echo ' |
|
634 | + if ($setting['type'] == 'checkbox') { |
|
635 | + echo ' |
|
624 | 636 | <dd> |
625 | 637 | <input type="hidden" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" value="0"> |
626 | 638 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', ' value="1"> |
627 | 639 | </dd>'; |
640 | + } |
|
628 | 641 | |
629 | 642 | // A list with options? |
630 | 643 | elseif ($setting['type'] == 'list') |
@@ -633,9 +646,10 @@ discard block |
||
633 | 646 | <dd> |
634 | 647 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
635 | 648 | |
636 | - foreach ($setting['options'] as $value => $label) |
|
637 | - echo ' |
|
649 | + foreach ($setting['options'] as $value => $label) { |
|
650 | + echo ' |
|
638 | 651 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
652 | + } |
|
639 | 653 | |
640 | 654 | echo ' |
641 | 655 | </select> |
@@ -663,14 +677,13 @@ discard block |
||
663 | 677 | |
664 | 678 | echo ' |
665 | 679 | <input type="number"', $min . $max . $step; |
666 | - } |
|
667 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
668 | - echo' |
|
680 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
681 | + echo' |
|
669 | 682 | <input type="url"'; |
670 | - |
|
671 | - else |
|
672 | - echo ' |
|
683 | + } else { |
|
684 | + echo ' |
|
673 | 685 | <input type="text"'; |
686 | + } |
|
674 | 687 | |
675 | 688 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : (empty($settings['size']) ? ' size="40"' : ' size="' . $setting['size'] . '"'), '> |
676 | 689 | </dd>'; |
@@ -742,9 +755,10 @@ discard block |
||
742 | 755 | <label for="variant', $theme['id'], '"><strong>', $theme['pick_label'], '</strong></label>: |
743 | 756 | <select id="variant', $theme['id'], '" name="vrt[', $theme['id'], ']" onchange="changeVariant', $theme['id'], '(this.value);">'; |
744 | 757 | |
745 | - foreach ($theme['variants'] as $key => $variant) |
|
746 | - echo ' |
|
758 | + foreach ($theme['variants'] as $key => $variant) { |
|
759 | + echo ' |
|
747 | 760 | <option value="', $key, '"', $theme['selected_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
761 | + } |
|
748 | 762 | |
749 | 763 | echo ' |
750 | 764 | </select> |
@@ -822,21 +836,23 @@ discard block |
||
822 | 836 | <div class="windowbg">'; |
823 | 837 | |
824 | 838 | // Oops! there was an error :( |
825 | - if (!empty($context['error_message'])) |
|
826 | - echo ' |
|
839 | + if (!empty($context['error_message'])) { |
|
840 | + echo ' |
|
827 | 841 | <p> |
828 | 842 | ', $context['error_message'], ' |
829 | 843 | </p>'; |
844 | + } |
|
830 | 845 | |
831 | 846 | // Not much to show except a link back... |
832 | - else |
|
833 | - echo ' |
|
847 | + else { |
|
848 | + echo ' |
|
834 | 849 | <p> |
835 | 850 | <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], ' |
836 | 851 | </p> |
837 | 852 | <p> |
838 | 853 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
839 | 854 | </p>'; |
855 | + } |
|
840 | 856 | |
841 | 857 | echo ' |
842 | 858 | </div><!-- .windowbg --> |
@@ -903,11 +919,12 @@ discard block |
||
903 | 919 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
904 | 920 | <span class="floatright">'; |
905 | 921 | |
906 | - if ($template['can_copy']) |
|
907 | - echo ' |
|
922 | + if ($template['can_copy']) { |
|
923 | + echo ' |
|
908 | 924 | <a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
909 | - else |
|
910 | - echo $txt['themeadmin_edit_no_copy']; |
|
925 | + } else { |
|
926 | + echo $txt['themeadmin_edit_no_copy']; |
|
927 | + } |
|
911 | 928 | |
912 | 929 | echo ' |
913 | 930 | </span> |
@@ -930,11 +947,12 @@ discard block |
||
930 | 947 | echo ' |
931 | 948 | <div id="admincenter">'; |
932 | 949 | |
933 | - if (!empty($context['browse_title'])) |
|
934 | - echo ' |
|
950 | + if (!empty($context['browse_title'])) { |
|
951 | + echo ' |
|
935 | 952 | <div class="cat_bar"> |
936 | 953 | <h3 class="catbg">', $context['browse_title'], '</h3> |
937 | 954 | </div>'; |
955 | + } |
|
938 | 956 | |
939 | 957 | echo ' |
940 | 958 | <table class="table_grid tborder"> |
@@ -954,16 +972,15 @@ discard block |
||
954 | 972 | <tr class="windowbg"> |
955 | 973 | <td>'; |
956 | 974 | |
957 | - if ($file['is_editable']) |
|
958 | - echo ' |
|
975 | + if ($file['is_editable']) { |
|
976 | + echo ' |
|
959 | 977 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
960 | - |
|
961 | - elseif ($file['is_directory']) |
|
962 | - echo ' |
|
978 | + } elseif ($file['is_directory']) { |
|
979 | + echo ' |
|
963 | 980 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
964 | - |
|
965 | - else |
|
966 | - echo $file['filename']; |
|
981 | + } else { |
|
982 | + echo $file['filename']; |
|
983 | + } |
|
967 | 984 | |
968 | 985 | echo ' |
969 | 986 | </td> |
@@ -985,11 +1002,12 @@ discard block |
||
985 | 1002 | { |
986 | 1003 | global $context, $settings, $scripturl, $txt; |
987 | 1004 | |
988 | - if ($context['session_error']) |
|
989 | - echo ' |
|
1005 | + if ($context['session_error']) { |
|
1006 | + echo ' |
|
990 | 1007 | <div class="errorbox"> |
991 | 1008 | ', $txt['error_session_timeout'], ' |
992 | 1009 | </div>'; |
1010 | + } |
|
993 | 1011 | |
994 | 1012 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
995 | 1013 | echo ' |
@@ -1053,17 +1071,18 @@ discard block |
||
1053 | 1071 | { |
1054 | 1072 | '; |
1055 | 1073 | |
1056 | - if (isBrowser('is_ie')) |
|
1057 | - echo ' |
|
1074 | + if (isBrowser('is_ie')) { |
|
1075 | + echo ' |
|
1058 | 1076 | var sheets = frames["css_preview_box"].document.styleSheets; |
1059 | 1077 | for (var j = 0; j < sheets.length; j++) |
1060 | 1078 | { |
1061 | 1079 | if (sheets[j].id == "css_preview_box") |
1062 | 1080 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
1063 | 1081 | }'; |
1064 | - else |
|
1065 | - echo ' |
|
1082 | + } else { |
|
1083 | + echo ' |
|
1066 | 1084 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
1085 | + } |
|
1067 | 1086 | echo ' |
1068 | 1087 | } |
1069 | 1088 | catch (e) |
@@ -1115,9 +1134,10 @@ discard block |
||
1115 | 1134 | </div> |
1116 | 1135 | <div class="windowbg">'; |
1117 | 1136 | |
1118 | - if (!$context['allow_save']) |
|
1119 | - echo ' |
|
1137 | + if (!$context['allow_save']) { |
|
1138 | + echo ' |
|
1120 | 1139 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1140 | + } |
|
1121 | 1141 | |
1122 | 1142 | echo ' |
1123 | 1143 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1131,9 +1151,10 @@ discard block |
||
1131 | 1151 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1132 | 1152 | |
1133 | 1153 | // Hopefully it exists. |
1134 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1135 | - echo ' |
|
1154 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1155 | + echo ' |
|
1136 | 1156 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1157 | + } |
|
1137 | 1158 | |
1138 | 1159 | echo ' |
1139 | 1160 | </form> |
@@ -1147,18 +1168,20 @@ discard block |
||
1147 | 1168 | { |
1148 | 1169 | global $context, $scripturl, $txt; |
1149 | 1170 | |
1150 | - if ($context['session_error']) |
|
1151 | - echo ' |
|
1171 | + if ($context['session_error']) { |
|
1172 | + echo ' |
|
1152 | 1173 | <div class="errorbox"> |
1153 | 1174 | ', $txt['error_session_timeout'], ' |
1154 | 1175 | </div>'; |
1176 | + } |
|
1155 | 1177 | |
1156 | - if (isset($context['parse_error'])) |
|
1157 | - echo ' |
|
1178 | + if (isset($context['parse_error'])) { |
|
1179 | + echo ' |
|
1158 | 1180 | <div class="errorbox"> |
1159 | 1181 | ', $txt['themeadmin_edit_error'], ' |
1160 | 1182 | <div><pre>', $context['parse_error'], '</pre></div> |
1161 | 1183 | </div>'; |
1184 | + } |
|
1162 | 1185 | |
1163 | 1186 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1164 | 1187 | echo ' |
@@ -1169,16 +1192,18 @@ discard block |
||
1169 | 1192 | </div> |
1170 | 1193 | <div class="windowbg">'; |
1171 | 1194 | |
1172 | - if (!$context['allow_save']) |
|
1173 | - echo ' |
|
1195 | + if (!$context['allow_save']) { |
|
1196 | + echo ' |
|
1174 | 1197 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1198 | + } |
|
1175 | 1199 | |
1176 | - foreach ($context['file_parts'] as $part) |
|
1177 | - echo ' |
|
1200 | + foreach ($context['file_parts'] as $part) { |
|
1201 | + echo ' |
|
1178 | 1202 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
1179 | 1203 | <div class="centertext"> |
1180 | 1204 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
1181 | 1205 | </div>'; |
1206 | + } |
|
1182 | 1207 | |
1183 | 1208 | echo ' |
1184 | 1209 | <div class="padding righttext"> |
@@ -1187,9 +1212,10 @@ discard block |
||
1187 | 1212 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1188 | 1213 | |
1189 | 1214 | // Hopefully it exists. |
1190 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1191 | - echo ' |
|
1215 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1216 | + echo ' |
|
1192 | 1217 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1218 | + } |
|
1193 | 1219 | |
1194 | 1220 | echo ' |
1195 | 1221 | </div><!-- .righttext --> |
@@ -1205,18 +1231,20 @@ discard block |
||
1205 | 1231 | { |
1206 | 1232 | global $context, $scripturl, $txt; |
1207 | 1233 | |
1208 | - if ($context['session_error']) |
|
1209 | - echo ' |
|
1234 | + if ($context['session_error']) { |
|
1235 | + echo ' |
|
1210 | 1236 | <div class="errorbox"> |
1211 | 1237 | ', $txt['error_session_timeout'], ' |
1212 | 1238 | </div>'; |
1239 | + } |
|
1213 | 1240 | |
1214 | 1241 | // Is this file writeable? |
1215 | - if (!$context['allow_save']) |
|
1216 | - echo ' |
|
1242 | + if (!$context['allow_save']) { |
|
1243 | + echo ' |
|
1217 | 1244 | <div class="errorbox"> |
1218 | 1245 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
1219 | 1246 | </div>'; |
1247 | + } |
|
1220 | 1248 | |
1221 | 1249 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1222 | 1250 | echo ' |
@@ -1232,9 +1260,10 @@ discard block |
||
1232 | 1260 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1233 | 1261 | |
1234 | 1262 | // Hopefully it exists. |
1235 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1236 | - echo ' |
|
1263 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1264 | + echo ' |
|
1237 | 1265 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1266 | + } |
|
1238 | 1267 | |
1239 | 1268 | echo ' |
1240 | 1269 | </div><!-- .windowbg --> |
@@ -89,16 +89,18 @@ discard block |
||
89 | 89 | foreach ($section['areas'] as $i => $area) |
90 | 90 | { |
91 | 91 | // Not supposed to be printed? |
92 | - if (empty($area['label'])) |
|
93 | - continue; |
|
92 | + if (empty($area['label'])) { |
|
93 | + continue; |
|
94 | + } |
|
94 | 95 | |
95 | 96 | echo ' |
96 | 97 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '> |
97 | 98 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
98 | 99 | |
99 | 100 | // Is this the current area, or just some area? |
100 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
101 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
101 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
102 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
103 | + } |
|
102 | 104 | |
103 | 105 | // Are there any subsections? |
104 | 106 | if (!empty($area['subsections'])) |
@@ -108,8 +110,9 @@ discard block |
||
108 | 110 | |
109 | 111 | foreach ($area['subsections'] as $sa => $sub) |
110 | 112 | { |
111 | - if (!empty($sub['disabled'])) |
|
112 | - continue; |
|
113 | + if (!empty($sub['disabled'])) { |
|
114 | + continue; |
|
115 | + } |
|
113 | 116 | |
114 | 117 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
115 | 118 | |
@@ -156,8 +159,9 @@ discard block |
||
156 | 159 | <h3 class="catbg">'; |
157 | 160 | |
158 | 161 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
159 | - if (function_exists('template_admin_quick_search')) |
|
160 | - template_admin_quick_search(); |
|
162 | + if (function_exists('template_admin_quick_search')) { |
|
163 | + template_admin_quick_search(); |
|
164 | + } |
|
161 | 165 | |
162 | 166 | // Exactly how many tabs do we have? |
163 | 167 | if (!empty($context['tabs'])) |
@@ -172,30 +176,36 @@ discard block |
||
172 | 176 | } |
173 | 177 | |
174 | 178 | // Did this not even exist - or do we not have a label? |
175 | - if (!isset($tab_context['tabs'][$id])) |
|
176 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
177 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
178 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
179 | + if (!isset($tab_context['tabs'][$id])) { |
|
180 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
181 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
182 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
183 | + } |
|
179 | 184 | |
180 | 185 | // Has a custom URL defined in the main admin structure? |
181 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
182 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
186 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
187 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
188 | + } |
|
183 | 189 | |
184 | 190 | // Any additional paramaters for the url? |
185 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
186 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
191 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
192 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
193 | + } |
|
187 | 194 | |
188 | 195 | // Has it been deemed selected? |
189 | - if (!empty($tab['is_selected'])) |
|
190 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
196 | + if (!empty($tab['is_selected'])) { |
|
197 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
198 | + } |
|
191 | 199 | |
192 | 200 | // Does it have its own help? |
193 | - if (!empty($tab['help'])) |
|
194 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
201 | + if (!empty($tab['help'])) { |
|
202 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
203 | + } |
|
195 | 204 | |
196 | 205 | // Is this the last one? |
197 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
198 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
206 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
207 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
208 | + } |
|
199 | 209 | } |
200 | 210 | |
201 | 211 | // Find the selected tab |
@@ -212,22 +222,24 @@ discard block |
||
212 | 222 | // Show an icon and/or a help item? |
213 | 223 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
214 | 224 | { |
215 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
216 | - echo ' |
|
225 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
226 | + echo ' |
|
217 | 227 | <span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
218 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
219 | - echo ' |
|
228 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
229 | + echo ' |
|
220 | 230 | <img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
231 | + } |
|
221 | 232 | |
222 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
223 | - echo ' |
|
233 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
234 | + echo ' |
|
224 | 235 | <a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
236 | + } |
|
225 | 237 | |
226 | 238 | echo $tab_context['title']; |
227 | - } |
|
228 | - else |
|
229 | - echo ' |
|
239 | + } else { |
|
240 | + echo ' |
|
230 | 241 | ', $tab_context['title']; |
242 | + } |
|
231 | 243 | |
232 | 244 | echo ' |
233 | 245 | </h3>', (function_exists('template_admin_quick_search') ? ' |
@@ -236,11 +248,12 @@ discard block |
||
236 | 248 | } |
237 | 249 | |
238 | 250 | // Shall we use the tabs? Yes, it's the only known way! |
239 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
240 | - echo ' |
|
251 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
252 | + echo ' |
|
241 | 253 | <p class="information"> |
242 | 254 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
243 | 255 | </p>'; |
256 | + } |
|
244 | 257 | |
245 | 258 | // Print out all the items in this tab (if any). |
246 | 259 | if (!empty($context['tabs'])) |
@@ -252,19 +265,21 @@ discard block |
||
252 | 265 | |
253 | 266 | foreach ($tab_context['tabs'] as $sa => $tab) |
254 | 267 | { |
255 | - if (!empty($tab['disabled'])) |
|
256 | - continue; |
|
268 | + if (!empty($tab['disabled'])) { |
|
269 | + continue; |
|
270 | + } |
|
257 | 271 | |
258 | - if (!empty($tab['is_selected'])) |
|
259 | - echo ' |
|
272 | + if (!empty($tab['is_selected'])) { |
|
273 | + echo ' |
|
260 | 274 | <li> |
261 | 275 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
262 | 276 | </li>'; |
263 | - else |
|
264 | - echo ' |
|
277 | + } else { |
|
278 | + echo ' |
|
265 | 279 | <li> |
266 | 280 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
267 | 281 | </li>'; |
282 | + } |
|
268 | 283 | } |
269 | 284 | |
270 | 285 | // The end of tabs |