@@ -19,26 +19,28 @@ discard block |
||
19 | 19 | global $context, $settings, $scripturl, $txt, $modSettings; |
20 | 20 | |
21 | 21 | // Not allowed to edit? |
22 | - if (!$context['can_modify']) |
|
23 | - echo ' |
|
22 | + if (!$context['can_modify']) { |
|
23 | + echo ' |
|
24 | 24 | <div class="errorbox"> |
25 | 25 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
26 | 26 | </div>'; |
27 | + } |
|
27 | 28 | |
28 | 29 | echo ' |
29 | 30 | <div id="admin_form_wrapper"> |
30 | 31 | <form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">'; |
31 | 32 | |
32 | - if (!empty($context['profile'])) |
|
33 | - echo ' |
|
33 | + if (!empty($context['profile'])) { |
|
34 | + echo ' |
|
34 | 35 | <div class="cat_bar"> |
35 | 36 | <h3 class="catbg">', $txt['permissions_for_profile'], ': "', $context['profile']['name'], '"</h3> |
36 | 37 | </div>'; |
37 | - else |
|
38 | - echo ' |
|
38 | + } else { |
|
39 | + echo ' |
|
39 | 40 | <div class="cat_bar"> |
40 | 41 | <h3 class="catbg">', $txt['permissions_title'], '</h3> |
41 | 42 | </div>'; |
43 | + } |
|
42 | 44 | |
43 | 45 | echo ' |
44 | 46 | <table class="table_grid"> |
@@ -47,13 +49,14 @@ discard block |
||
47 | 49 | <th>', $txt['membergroups_name'], '</th> |
48 | 50 | <th class="small_table">', $txt['membergroups_members_top'], '</th>'; |
49 | 51 | |
50 | - if (empty($modSettings['permission_enable_deny'])) |
|
51 | - echo ' |
|
52 | + if (empty($modSettings['permission_enable_deny'])) { |
|
53 | + echo ' |
|
52 | 54 | <th class="small_table">', $txt['membergroups_permissions'], '</th>'; |
53 | - else |
|
54 | - echo ' |
|
55 | + } else { |
|
56 | + echo ' |
|
55 | 57 | <th class="small_table">', $txt['permissions_allowed'], '</th> |
56 | 58 | <th class="small_table">', $txt['permissions_denied'], '</th>'; |
59 | + } |
|
57 | 60 | |
58 | 61 | echo ' |
59 | 62 | <th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th> |
@@ -71,22 +74,24 @@ discard block |
||
71 | 74 | <td> |
72 | 75 | ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', ' <span>', $group['name'], '</span>'; |
73 | 76 | |
74 | - if (!empty($group['children'])) |
|
75 | - echo ' |
|
77 | + if (!empty($group['children'])) { |
|
78 | + echo ' |
|
76 | 79 | <br> |
77 | 80 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
81 | + } |
|
78 | 82 | |
79 | 83 | echo ' |
80 | 84 | </td> |
81 | 85 | <td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>'; |
82 | 86 | |
83 | - if (empty($modSettings['permission_enable_deny'])) |
|
84 | - echo ' |
|
87 | + if (empty($modSettings['permission_enable_deny'])) { |
|
88 | + echo ' |
|
85 | 89 | <td>', $group['num_permissions']['allowed'], '</td>'; |
86 | - else |
|
87 | - echo ' |
|
90 | + } else { |
|
91 | + echo ' |
|
88 | 92 | <td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '>', $group['num_permissions']['allowed'], '</td> |
89 | 93 | <td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>', $group['num_permissions']['denied'], '</td>'; |
94 | + } |
|
90 | 95 | |
91 | 96 | echo ' |
92 | 97 | <td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']) . '</a>' : '', '</td> |
@@ -133,9 +138,10 @@ discard block |
||
133 | 138 | <option value="empty">(', $txt['permissions_select_membergroup'], ')</option>'; |
134 | 139 | foreach ($context['groups'] as $group) |
135 | 140 | { |
136 | - if ($group['id'] != 1) |
|
137 | - echo ' |
|
141 | + if ($group['id'] != 1) { |
|
142 | + echo ' |
|
138 | 143 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
144 | + } |
|
139 | 145 | } |
140 | 146 | |
141 | 147 | echo ' |
@@ -145,9 +151,10 @@ discard block |
||
145 | 151 | <select name="add_remove"> |
146 | 152 | <option value="add">', $txt['permissions_add'], '...</option> |
147 | 153 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
148 | - if (!empty($modSettings['permission_enable_deny'])) |
|
149 | - echo ' |
|
154 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
155 | + echo ' |
|
150 | 156 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
157 | + } |
|
151 | 158 | echo ' |
152 | 159 | </select> |
153 | 160 | </dt> |
@@ -156,30 +163,34 @@ discard block |
||
156 | 163 | <option value="">(', $txt['permissions_select_permission'], ')</option>'; |
157 | 164 | foreach ($context['permissions'] as $permissionType) |
158 | 165 | { |
159 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
160 | - continue; |
|
166 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
167 | + continue; |
|
168 | + } |
|
161 | 169 | |
162 | 170 | foreach ($permissionType['columns'] as $column) |
163 | 171 | { |
164 | 172 | foreach ($column as $permissionGroup) |
165 | 173 | { |
166 | - if ($permissionGroup['hidden']) |
|
167 | - continue; |
|
174 | + if ($permissionGroup['hidden']) { |
|
175 | + continue; |
|
176 | + } |
|
168 | 177 | |
169 | 178 | echo ' |
170 | 179 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
171 | 180 | foreach ($permissionGroup['permissions'] as $perm) |
172 | 181 | { |
173 | - if ($perm['hidden']) |
|
174 | - continue; |
|
182 | + if ($perm['hidden']) { |
|
183 | + continue; |
|
184 | + } |
|
175 | 185 | |
176 | - if ($perm['has_own_any']) |
|
177 | - echo ' |
|
186 | + if ($perm['has_own_any']) { |
|
187 | + echo ' |
|
178 | 188 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
179 | 189 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
180 | - else |
|
181 | - echo ' |
|
190 | + } else { |
|
191 | + echo ' |
|
182 | 192 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
193 | + } |
|
183 | 194 | } |
184 | 195 | } |
185 | 196 | } |
@@ -246,17 +257,18 @@ discard block |
||
246 | 257 | } |
247 | 258 | </script>'; |
248 | 259 | |
249 | - if (!empty($context['profile'])) |
|
250 | - echo ' |
|
260 | + if (!empty($context['profile'])) { |
|
261 | + echo ' |
|
251 | 262 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
263 | + } |
|
252 | 264 | |
253 | 265 | echo ' |
254 | 266 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
255 | 267 | <input type="hidden" name="', $context['admin-mpq_token_var'], '" value="', $context['admin-mpq_token'], '">'; |
256 | - } |
|
257 | - else |
|
258 | - echo ' |
|
268 | + } else { |
|
269 | + echo ' |
|
259 | 270 | </table>'; |
271 | + } |
|
260 | 272 | |
261 | 273 | echo ' |
262 | 274 | </form> |
@@ -296,9 +308,10 @@ discard block |
||
296 | 308 | <h3 class="subbg">', $category['name'], '</h3> |
297 | 309 | </div>'; |
298 | 310 | |
299 | - if (!empty($category['boards'])) |
|
300 | - echo ' |
|
311 | + if (!empty($category['boards'])) { |
|
312 | + echo ' |
|
301 | 313 | <ul class="perm_boards flow_hidden">'; |
314 | + } |
|
302 | 315 | |
303 | 316 | foreach ($category['boards'] as $board) |
304 | 317 | { |
@@ -315,33 +328,36 @@ discard block |
||
315 | 328 | echo ' |
316 | 329 | <select name="boardprofile[', $board['id'], ']">'; |
317 | 330 | |
318 | - foreach ($context['profiles'] as $id => $profile) |
|
319 | - echo ' |
|
331 | + foreach ($context['profiles'] as $id => $profile) { |
|
332 | + echo ' |
|
320 | 333 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
334 | + } |
|
321 | 335 | |
322 | 336 | echo ' |
323 | 337 | </select>'; |
324 | - } |
|
325 | - else |
|
326 | - echo ' |
|
338 | + } else { |
|
339 | + echo ' |
|
327 | 340 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
341 | + } |
|
328 | 342 | |
329 | 343 | echo ' |
330 | 344 | </span> |
331 | 345 | </li>'; |
332 | 346 | } |
333 | 347 | |
334 | - if (!empty($category['boards'])) |
|
335 | - echo ' |
|
348 | + if (!empty($category['boards'])) { |
|
349 | + echo ' |
|
336 | 350 | </ul>'; |
351 | + } |
|
337 | 352 | } |
338 | 353 | |
339 | - if ($context['edit_all']) |
|
340 | - echo ' |
|
354 | + if ($context['edit_all']) { |
|
355 | + echo ' |
|
341 | 356 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button_submit">'; |
342 | - else |
|
343 | - echo ' |
|
357 | + } else { |
|
358 | + echo ' |
|
344 | 359 | <a class="button_link" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
360 | + } |
|
345 | 361 | |
346 | 362 | echo ' |
347 | 363 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -381,12 +397,13 @@ discard block |
||
381 | 397 | <tr class="windowbg"> |
382 | 398 | <td>'; |
383 | 399 | |
384 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
385 | - echo ' |
|
400 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
401 | + echo ' |
|
386 | 402 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '" class="input_text">'; |
387 | - else |
|
388 | - echo ' |
|
403 | + } else { |
|
404 | + echo ' |
|
389 | 405 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
406 | + } |
|
390 | 407 | |
391 | 408 | echo ' |
392 | 409 | </td> |
@@ -406,9 +423,10 @@ discard block |
||
406 | 423 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
407 | 424 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
408 | 425 | |
409 | - if ($context['can_edit_something']) |
|
410 | - echo ' |
|
426 | + if ($context['can_edit_something']) { |
|
427 | + echo ' |
|
411 | 428 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button_submit">'; |
429 | + } |
|
412 | 430 | |
413 | 431 | echo ' |
414 | 432 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button_submit" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '/> |
@@ -433,9 +451,10 @@ discard block |
||
433 | 451 | <dd> |
434 | 452 | <select name="copy_from">'; |
435 | 453 | |
436 | - foreach ($context['profiles'] as $id => $profile) |
|
437 | - echo ' |
|
454 | + foreach ($context['profiles'] as $id => $profile) { |
|
455 | + echo ' |
|
438 | 456 | <option value="', $id, '">', $profile['name'], '</option>'; |
457 | + } |
|
439 | 458 | |
440 | 459 | echo ' |
441 | 460 | </select> |
@@ -463,8 +482,7 @@ discard block |
||
463 | 482 | <div class="errorbox"> |
464 | 483 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
465 | 484 | </div>'; |
466 | - } |
|
467 | - else |
|
485 | + } else |
|
468 | 486 | { |
469 | 487 | echo ' |
470 | 488 | <script> |
@@ -484,21 +502,23 @@ discard block |
||
484 | 502 | <div id="admincenter"> |
485 | 503 | <form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">'; |
486 | 504 | |
487 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
488 | - echo ' |
|
505 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
506 | + echo ' |
|
489 | 507 | <div class="information"> |
490 | 508 | ', $txt['permissions_option_desc'], ' |
491 | 509 | </div>'; |
510 | + } |
|
492 | 511 | |
493 | 512 | echo ' |
494 | 513 | <div class="cat_bar"> |
495 | 514 | <h3 class="catbg">'; |
496 | - if ($context['permission_type'] == 'board') |
|
497 | - echo ' |
|
515 | + if ($context['permission_type'] == 'board') { |
|
516 | + echo ' |
|
498 | 517 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
499 | - else |
|
500 | - echo ' |
|
518 | + } else { |
|
519 | + echo ' |
|
501 | 520 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
521 | + } |
|
502 | 522 | echo ' |
503 | 523 | </h3> |
504 | 524 | </div>'; |
@@ -521,15 +541,17 @@ discard block |
||
521 | 541 | template_modify_group_display('board'); |
522 | 542 | } |
523 | 543 | |
524 | - if ($context['profile']['can_modify']) |
|
525 | - echo ' |
|
544 | + if ($context['profile']['can_modify']) { |
|
545 | + echo ' |
|
526 | 546 | <div class="padding"> |
527 | 547 | <input type="submit" value="', $txt['permissions_commit'], '" class="button_submit"> |
528 | 548 | </div>'; |
549 | + } |
|
529 | 550 | |
530 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
531 | - echo ' |
|
551 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
552 | + echo ' |
|
532 | 553 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
554 | + } |
|
533 | 555 | |
534 | 556 | echo ' |
535 | 557 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -557,17 +579,19 @@ discard block |
||
557 | 579 | |
558 | 580 | foreach ($column as $permissionGroup) |
559 | 581 | { |
560 | - if (empty($permissionGroup['permissions'])) |
|
561 | - continue; |
|
582 | + if (empty($permissionGroup['permissions'])) { |
|
583 | + continue; |
|
584 | + } |
|
562 | 585 | |
563 | 586 | // Are we likely to have something in this group to display or is it all hidden? |
564 | 587 | $has_display_content = false; |
565 | 588 | if (!$permissionGroup['hidden']) |
566 | 589 | { |
567 | 590 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
568 | - foreach ($permissionGroup['permissions'] as $permission) |
|
569 | - if (!$permission['hidden']) |
|
591 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
592 | + if (!$permission['hidden']) |
|
570 | 593 | $has_display_content = true; |
594 | + } |
|
571 | 595 | |
572 | 596 | if ($has_display_content) |
573 | 597 | { |
@@ -576,10 +600,11 @@ discard block |
||
576 | 600 | <th></th> |
577 | 601 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
578 | 602 | |
579 | - if ($context['group']['id'] != -1) |
|
580 | - echo ' |
|
603 | + if ($context['group']['id'] != -1) { |
|
604 | + echo ' |
|
581 | 605 | <th>', $txt['permissions_option_own'], '</th> |
582 | 606 | <th>', $txt['permissions_option_any'], '</th>'; |
607 | + } |
|
583 | 608 | |
584 | 609 | echo ' |
585 | 610 | </tr>'; |
@@ -602,17 +627,18 @@ discard block |
||
602 | 627 | // Guests can't do their own thing. |
603 | 628 | if ($context['group']['id'] != -1) |
604 | 629 | { |
605 | - if (empty($modSettings['permission_enable_deny'])) |
|
606 | - echo ' |
|
630 | + if (empty($modSettings['permission_enable_deny'])) { |
|
631 | + echo ' |
|
607 | 632 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" class="input_check" ', $disable_field, '/>'; |
608 | - else |
|
633 | + } else |
|
609 | 634 | { |
610 | 635 | echo ' |
611 | 636 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
612 | 637 | |
613 | - foreach (array('on', 'off', 'deny') as $c) |
|
614 | - echo ' |
|
638 | + foreach (array('on', 'off', 'deny') as $c) { |
|
639 | + echo ' |
|
615 | 640 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
641 | + } |
|
616 | 642 | echo ' |
617 | 643 | </select>'; |
618 | 644 | } |
@@ -622,39 +648,41 @@ discard block |
||
622 | 648 | <td>'; |
623 | 649 | } |
624 | 650 | |
625 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
626 | - echo ' |
|
651 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
652 | + echo ' |
|
627 | 653 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>'; |
628 | - else |
|
654 | + } else |
|
629 | 655 | { |
630 | 656 | echo ' |
631 | 657 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
632 | 658 | |
633 | - foreach (array('on', 'off', 'deny') as $c) |
|
634 | - echo ' |
|
659 | + foreach (array('on', 'off', 'deny') as $c) { |
|
660 | + echo ' |
|
635 | 661 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
662 | + } |
|
636 | 663 | echo ' |
637 | 664 | </select>'; |
638 | 665 | } |
639 | - } |
|
640 | - else |
|
666 | + } else |
|
641 | 667 | { |
642 | - if ($context['group']['id'] != -1) |
|
643 | - echo ' |
|
668 | + if ($context['group']['id'] != -1) { |
|
669 | + echo ' |
|
644 | 670 | </td> |
645 | 671 | <td>'; |
672 | + } |
|
646 | 673 | |
647 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
648 | - echo ' |
|
674 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
675 | + echo ' |
|
649 | 676 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>'; |
650 | - else |
|
677 | + } else |
|
651 | 678 | { |
652 | 679 | echo ' |
653 | 680 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
654 | 681 | |
655 | - foreach (array('on', 'off', 'deny') as $c) |
|
656 | - echo ' |
|
682 | + foreach (array('on', 'off', 'deny') as $c) { |
|
683 | + echo ' |
|
657 | 684 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
685 | + } |
|
658 | 686 | echo ' |
659 | 687 | </select>'; |
660 | 688 | } |
@@ -684,11 +712,11 @@ discard block |
||
684 | 712 | echo ' |
685 | 713 | <fieldset id="', $context['current_permission'], '"> |
686 | 714 | <legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>'; |
687 | - if (empty($modSettings['permission_enable_deny'])) |
|
688 | - echo ' |
|
715 | + if (empty($modSettings['permission_enable_deny'])) { |
|
716 | + echo ' |
|
689 | 717 | <ul>'; |
690 | - else |
|
691 | - echo ' |
|
718 | + } else { |
|
719 | + echo ' |
|
692 | 720 | <div class="information">', $txt['permissions_option_desc'], '</div> |
693 | 721 | <dl class="settings"> |
694 | 722 | <dt> |
@@ -698,46 +726,51 @@ discard block |
||
698 | 726 | </dt> |
699 | 727 | <dd> |
700 | 728 | </dd>'; |
729 | + } |
|
701 | 730 | foreach ($context['member_groups'] as $group) |
702 | 731 | { |
703 | - if (!empty($modSettings['permission_enable_deny'])) |
|
704 | - echo ' |
|
732 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
733 | + echo ' |
|
705 | 734 | <dt>'; |
706 | - else |
|
707 | - echo ' |
|
735 | + } else { |
|
736 | + echo ' |
|
708 | 737 | <li>'; |
738 | + } |
|
709 | 739 | |
710 | - if (empty($modSettings['permission_enable_deny'])) |
|
711 | - echo ' |
|
740 | + if (empty($modSettings['permission_enable_deny'])) { |
|
741 | + echo ' |
|
712 | 742 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_check">'; |
713 | - else |
|
714 | - echo ' |
|
743 | + } else { |
|
744 | + echo ' |
|
715 | 745 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_radio"></span> |
716 | 746 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', ' class="input_radio"></span> |
717 | 747 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', ' class="input_radio"></span>'; |
748 | + } |
|
718 | 749 | |
719 | - if (!empty($modSettings['permission_enable_deny'])) |
|
720 | - echo ' |
|
750 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
751 | + echo ' |
|
721 | 752 | </dt> |
722 | 753 | <dd> |
723 | 754 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
724 | 755 | </dd>'; |
725 | - else |
|
726 | - echo ' |
|
756 | + } else { |
|
757 | + echo ' |
|
727 | 758 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
728 | 759 | </li>'; |
760 | + } |
|
729 | 761 | } |
730 | 762 | |
731 | - if (empty($modSettings['permission_enable_deny'])) |
|
732 | - echo ' |
|
763 | + if (empty($modSettings['permission_enable_deny'])) { |
|
764 | + echo ' |
|
733 | 765 | <li> |
734 | 766 | <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');"> |
735 | 767 | <span>', $txt['check_all'], '</span> |
736 | 768 | </li> |
737 | 769 | </ul>'; |
738 | - else |
|
739 | - echo ' |
|
770 | + } else { |
|
771 | + echo ' |
|
740 | 772 | </dl>'; |
773 | + } |
|
741 | 774 | |
742 | 775 | echo ' |
743 | 776 | </fieldset> |
@@ -777,9 +810,10 @@ discard block |
||
777 | 810 | if (!empty($modSettings['postmod_active'])) |
778 | 811 | { |
779 | 812 | // Got advanced permissions - if so warn! |
780 | - if (!empty($modSettings['permission_enable_deny'])) |
|
781 | - echo ' |
|
813 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
814 | + echo ' |
|
782 | 815 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
816 | + } |
|
783 | 817 | |
784 | 818 | echo ' |
785 | 819 | <div class="padding"> |
@@ -794,10 +828,11 @@ discard block |
||
794 | 828 | ', $txt['permissions_post_moderation_select'], ': |
795 | 829 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
796 | 830 | |
797 | - foreach ($context['profiles'] as $profile) |
|
798 | - if ($profile['can_modify']) |
|
831 | + foreach ($context['profiles'] as $profile) { |
|
832 | + if ($profile['can_modify']) |
|
799 | 833 | echo ' |
800 | 834 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
835 | + } |
|
801 | 836 | |
802 | 837 | echo ' |
803 | 838 | </select> |
@@ -818,11 +853,12 @@ discard block |
||
818 | 853 | ', $txt['permissions_post_moderation_replies_any'], ' |
819 | 854 | </th>'; |
820 | 855 | |
821 | - if ($modSettings['attachmentEnable'] == 1) |
|
822 | - echo ' |
|
856 | + if ($modSettings['attachmentEnable'] == 1) { |
|
857 | + echo ' |
|
823 | 858 | <th class="centercol" colspan="3"> |
824 | 859 | ', $txt['permissions_post_moderation_attachments'], ' |
825 | 860 | </th>'; |
861 | + } |
|
826 | 862 | |
827 | 863 | echo ' |
828 | 864 | </tr> |
@@ -840,11 +876,12 @@ discard block |
||
840 | 876 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
841 | 877 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
842 | 878 | |
843 | - if ($modSettings['attachmentEnable'] == 1) |
|
844 | - echo ' |
|
879 | + if ($modSettings['attachmentEnable'] == 1) { |
|
880 | + echo ' |
|
845 | 881 | <th><span class="generic_icons post_moderation_allow"></span></th> |
846 | 882 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
847 | 883 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
884 | + } |
|
848 | 885 | |
849 | 886 | echo ' |
850 | 887 | </tr> |
@@ -857,9 +894,10 @@ discard block |
||
857 | 894 | <tr class="windowbg"> |
858 | 895 | <td class="half_table"> |
859 | 896 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
860 | - if (!empty($group['children'])) |
|
861 | - echo ' |
|
897 | + if (!empty($group['children'])) { |
|
898 | + echo ' |
|
862 | 899 | <br><span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
900 | + } |
|
863 | 901 | |
864 | 902 | echo ' |
865 | 903 | </td> |
@@ -872,8 +910,7 @@ discard block |
||
872 | 910 | { |
873 | 911 | echo ' |
874 | 912 | <td colspan="3"></td>'; |
875 | - } |
|
876 | - else |
|
913 | + } else |
|
877 | 914 | { |
878 | 915 | echo ' |
879 | 916 | <td class="centercol"><input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', ' class="input_radio"></td> |
@@ -52,9 +52,10 @@ discard block |
||
52 | 52 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
53 | 53 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
54 | 54 | |
55 | - if ($context['allow_protected']) |
|
56 | - echo ' |
|
55 | + if ($context['allow_protected']) { |
|
56 | + echo ' |
|
57 | 57 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
58 | + } |
|
58 | 59 | |
59 | 60 | echo ' |
60 | 61 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -64,14 +65,15 @@ discard block |
||
64 | 65 | </dd>'; |
65 | 66 | } |
66 | 67 | |
67 | - if ($context['post_group'] || $context['undefined_group']) |
|
68 | - echo ' |
|
68 | + if ($context['post_group'] || $context['undefined_group']) { |
|
69 | + echo ' |
|
69 | 70 | <dt id="min_posts_text"> |
70 | 71 | <strong>', $txt['membergroups_min_posts'], ':</strong> |
71 | 72 | </dt> |
72 | 73 | <dd> |
73 | 74 | <input type="number" name="min_posts" id="min_posts_input" size="5" class="input_text"> |
74 | 75 | </dd>'; |
76 | + } |
|
75 | 77 | if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups'])) |
76 | 78 | { |
77 | 79 | echo ' |
@@ -87,9 +89,10 @@ discard block |
||
87 | 89 | <select name="inheritperm" id="inheritperm_select" onclick="document.getElementById(\'perm_type_inherit\').checked = true;"> |
88 | 90 | <option value="-1">', $txt['membergroups_guests'], '</option> |
89 | 91 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
90 | - foreach ($context['groups'] as $group) |
|
91 | - echo ' |
|
92 | + foreach ($context['groups'] as $group) { |
|
93 | + echo ' |
|
92 | 94 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
95 | + } |
|
93 | 96 | echo ' |
94 | 97 | </select> |
95 | 98 | <br> |
@@ -98,9 +101,10 @@ discard block |
||
98 | 101 | <select name="copyperm" id="copyperm_select" onclick="document.getElementById(\'perm_type_copy\').checked = true;"> |
99 | 102 | <option value="-1">', $txt['membergroups_guests'], '</option> |
100 | 103 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
101 | - foreach ($context['groups'] as $group) |
|
102 | - echo ' |
|
104 | + foreach ($context['groups'] as $group) { |
|
105 | + echo ' |
|
103 | 106 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
107 | + } |
|
104 | 108 | echo ' |
105 | 109 | </select> |
106 | 110 | <br> |
@@ -173,8 +177,8 @@ discard block |
||
173 | 177 | <input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30" class="input_text"> |
174 | 178 | </dd>'; |
175 | 179 | |
176 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
177 | - echo ' |
|
180 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
181 | + echo ' |
|
178 | 182 | |
179 | 183 | <dt id="group_desc_text"> |
180 | 184 | <label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label> |
@@ -182,6 +186,7 @@ discard block |
||
182 | 186 | <dd> |
183 | 187 | <textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea> |
184 | 188 | </dd>'; |
189 | + } |
|
185 | 190 | |
186 | 191 | // Group type... |
187 | 192 | if ($context['group']['allow_post_group']) |
@@ -195,9 +200,10 @@ discard block |
||
195 | 200 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
196 | 201 | <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' : '', ' class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
197 | 202 | |
198 | - if ($context['group']['allow_protected']) |
|
199 | - echo ' |
|
203 | + if ($context['group']['allow_protected']) { |
|
204 | + echo ' |
|
200 | 205 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
206 | + } |
|
201 | 207 | |
202 | 208 | echo ' |
203 | 209 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' class="input_radio" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -207,8 +213,8 @@ discard block |
||
207 | 213 | </dd>'; |
208 | 214 | } |
209 | 215 | |
210 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
211 | - echo ' |
|
216 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
217 | + echo ' |
|
212 | 218 | <dt id="group_moderators_text"> |
213 | 219 | <label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label> |
214 | 220 | </dt> |
@@ -226,6 +232,7 @@ discard block |
||
226 | 232 | <option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option> |
227 | 233 | </select> |
228 | 234 | </dd>'; |
235 | + } |
|
229 | 236 | |
230 | 237 | // Can they inherit permissions? |
231 | 238 | if ($context['group']['id'] > 1 && $context['group']['id'] != 3) |
@@ -242,9 +249,10 @@ discard block |
||
242 | 249 | <option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>'; |
243 | 250 | |
244 | 251 | // For all the inheritable groups show an option. |
245 | - foreach ($context['inheritable_groups'] as $id => $group) |
|
246 | - echo ' |
|
252 | + foreach ($context['inheritable_groups'] as $id => $group) { |
|
253 | + echo ' |
|
247 | 254 | <option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>'; |
255 | + } |
|
248 | 256 | |
249 | 257 | echo ' |
250 | 258 | </select> |
@@ -252,8 +260,8 @@ discard block |
||
252 | 260 | </dd>'; |
253 | 261 | } |
254 | 262 | |
255 | - if ($context['group']['allow_post_group']) |
|
256 | - echo ' |
|
263 | + if ($context['group']['allow_post_group']) { |
|
264 | + echo ' |
|
257 | 265 | |
258 | 266 | <dt id="min_posts_text"> |
259 | 267 | <label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label> |
@@ -261,6 +269,7 @@ discard block |
||
261 | 269 | <dd> |
262 | 270 | <input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6" class="input_text"> |
263 | 271 | </dd>'; |
272 | + } |
|
264 | 273 | echo ' |
265 | 274 | <dt> |
266 | 275 | <label for="online_color_input"><strong>', $txt['membergroups_online_color'], ':</strong></label> |
@@ -302,9 +311,10 @@ discard block |
||
302 | 311 | } |
303 | 312 | |
304 | 313 | // No? Hide the entire control. |
305 | - else |
|
306 | - echo ' |
|
314 | + else { |
|
315 | + echo ' |
|
307 | 316 | <input type="hidden" name="icon_image" value="">'; |
317 | + } |
|
308 | 318 | |
309 | 319 | echo ' |
310 | 320 | <dt> |
@@ -315,8 +325,8 @@ discard block |
||
315 | 325 | <input type="text" name="max_messages" id="max_messages_input" value="', $context['group']['id'] == 1 ? 0 : $context['group']['max_messages'], '" size="6"', $context['group']['id'] == 1 ? ' disabled' : '', ' class="input_text"> |
316 | 326 | </dd>'; |
317 | 327 | //Force 2FA for this membergroup? |
318 | - if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) |
|
319 | - echo ' |
|
328 | + if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) { |
|
329 | + echo ' |
|
320 | 330 | <dt> |
321 | 331 | <label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br> |
322 | 332 | <span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span> |
@@ -324,6 +334,7 @@ discard block |
||
324 | 334 | <dd> |
325 | 335 | <input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', ' class="input_check"> |
326 | 336 | </dd>'; |
337 | + } |
|
327 | 338 | |
328 | 339 | if (!empty($context['categories'])) |
329 | 340 | { |
@@ -333,10 +344,11 @@ discard block |
||
333 | 344 | <span class="smalltext">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', ' |
334 | 345 | </dt> |
335 | 346 | <dd>'; |
336 | - if (!empty($context['can_manage_boards'])) |
|
337 | - echo $txt['membergroups_can_manage_access']; |
|
338 | - else |
|
339 | - template_add_edit_group_boards_list(); |
|
347 | + if (!empty($context['can_manage_boards'])) { |
|
348 | + echo $txt['membergroups_can_manage_access']; |
|
349 | + } else { |
|
350 | + template_add_edit_group_boards_list(); |
|
351 | + } |
|
340 | 352 | |
341 | 353 | echo ' |
342 | 354 | </dd>'; |
@@ -365,20 +377,21 @@ discard block |
||
365 | 377 | sItemListContainerId: \'moderator_container\', |
366 | 378 | aListItems: ['; |
367 | 379 | |
368 | - foreach ($context['group']['moderators'] as $id_member => $member_name) |
|
369 | - echo ' |
|
380 | + foreach ($context['group']['moderators'] as $id_member => $member_name) { |
|
381 | + echo ' |
|
370 | 382 | { |
371 | 383 | sItemId: ', JavaScriptEscape($id_member), ', |
372 | 384 | sItemName: ', JavaScriptEscape($member_name), ' |
373 | 385 | }', $id_member == $context['group']['last_moderator_id'] ? '' : ','; |
386 | + } |
|
374 | 387 | |
375 | 388 | echo ' |
376 | 389 | ] |
377 | 390 | }); |
378 | 391 | </script>'; |
379 | 392 | |
380 | - if ($context['group']['allow_post_group']) |
|
381 | - echo ' |
|
393 | + if ($context['group']['allow_post_group']) { |
|
394 | + echo ' |
|
382 | 395 | <script> |
383 | 396 | function swapPostGroup(isChecked) |
384 | 397 | { |
@@ -426,7 +439,8 @@ discard block |
||
426 | 439 | |
427 | 440 | swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', '); |
428 | 441 | </script>'; |
429 | -} |
|
442 | + } |
|
443 | + } |
|
430 | 444 | |
431 | 445 | /** |
432 | 446 | * The template for determining which boards a group has access to. |
@@ -443,13 +457,13 @@ discard block |
||
443 | 457 | |
444 | 458 | foreach ($context['categories'] as $category) |
445 | 459 | { |
446 | - if (empty($modSettings['deny_boards_access'])) |
|
447 | - echo ' |
|
460 | + if (empty($modSettings['deny_boards_access'])) { |
|
461 | + echo ' |
|
448 | 462 | <li class="category"> |
449 | 463 | <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a> |
450 | 464 | <ul style="width:100%">'; |
451 | - else |
|
452 | - echo ' |
|
465 | + } else { |
|
466 | + echo ' |
|
453 | 467 | <li class="category"> |
454 | 468 | <strong>', $category['name'], '</strong> |
455 | 469 | <span class="select_all_box"> |
@@ -462,16 +476,17 @@ discard block |
||
462 | 476 | </select> |
463 | 477 | </span> |
464 | 478 | <ul style="width:100%" id="boards_list_', $category['id'], '">'; |
479 | + } |
|
465 | 480 | |
466 | 481 | foreach ($category['boards'] as $board) |
467 | 482 | { |
468 | - if (empty($modSettings['deny_boards_access'])) |
|
469 | - echo ' |
|
483 | + if (empty($modSettings['deny_boards_access'])) { |
|
484 | + echo ' |
|
470 | 485 | <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
471 | 486 | <input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', ' class="input_check"> <label for="brd', $board['id'], '">', $board['name'], '</label> |
472 | 487 | </li>'; |
473 | - else |
|
474 | - echo ' |
|
488 | + } else { |
|
489 | + echo ' |
|
475 | 490 | <li class="board" style="width:100%"> |
476 | 491 | <span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span> |
477 | 492 | <span style="width:50%;float:right"> |
@@ -480,6 +495,7 @@ discard block |
||
480 | 495 | <input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', ' class="input_check"> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label> |
481 | 496 | </span> |
482 | 497 | </li>'; |
498 | + } |
|
483 | 499 | } |
484 | 500 | |
485 | 501 | echo ' |
@@ -490,13 +506,13 @@ discard block |
||
490 | 506 | echo ' |
491 | 507 | </ul>'; |
492 | 508 | |
493 | - if (empty($modSettings['deny_boards_access'])) |
|
494 | - echo ' |
|
509 | + if (empty($modSettings['deny_boards_access'])) { |
|
510 | + echo ' |
|
495 | 511 | <br class="clear"><br> |
496 | 512 | <input type="checkbox" id="checkall_check" class="input_check" onclick="invertAll(this, this.form, \'boardaccess\');"> <label for="checkall_check"><em>', $txt['check_all'], '</em></label> |
497 | 513 | </fieldset>'; |
498 | - else |
|
499 | - echo ' |
|
514 | + } else { |
|
515 | + echo ' |
|
500 | 516 | <br class="clear"> |
501 | 517 | <span class="select_all_box"> |
502 | 518 | <em>', $txt['all'], ': </em> |
@@ -512,15 +528,17 @@ discard block |
||
512 | 528 | }); |
513 | 529 | }); |
514 | 530 | </script>'; |
531 | + } |
|
515 | 532 | |
516 | - if ($collapse) |
|
517 | - echo ' |
|
533 | + if ($collapse) { |
|
534 | + echo ' |
|
518 | 535 | <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> |
519 | 536 | <script> |
520 | 537 | document.getElementById("visible_boards_link").style.display = ""; |
521 | 538 | document.getElementById("visible_boards").style.display = "none"; |
522 | 539 | </script>'; |
523 | -} |
|
540 | + } |
|
541 | + } |
|
524 | 542 | |
525 | 543 | /** |
526 | 544 | * Templatine for viewing the members of a group. |
@@ -544,14 +562,15 @@ discard block |
||
544 | 562 | <span ', $context['group']['online_color'] ? 'style="color: ' . $context['group']['online_color'] . ';"' : '', '>', $context['group']['name'], '</span> ', $context['group']['icons'], ' |
545 | 563 | </dd>'; |
546 | 564 | //Any description to show? |
547 | - if (!empty($context['group']['description'])) |
|
548 | - echo ' |
|
565 | + if (!empty($context['group']['description'])) { |
|
566 | + echo ' |
|
549 | 567 | <dt> |
550 | 568 | <strong>' . $txt['membergroups_members_description'] . ':</strong> |
551 | 569 | </dt> |
552 | 570 | <dd> |
553 | 571 | ', $context['group']['description'], ' |
554 | 572 | </dd>'; |
573 | + } |
|
555 | 574 | |
556 | 575 | echo ' |
557 | 576 | <dt> |
@@ -564,8 +583,9 @@ discard block |
||
564 | 583 | if (!empty($context['group']['moderators'])) |
565 | 584 | { |
566 | 585 | $moderators = array(); |
567 | - foreach ($context['group']['moderators'] as $moderator) |
|
568 | - $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
586 | + foreach ($context['group']['moderators'] as $moderator) { |
|
587 | + $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
588 | + } |
|
569 | 589 | |
570 | 590 | echo ' |
571 | 591 | <dt> |
@@ -591,27 +611,30 @@ discard block |
||
591 | 611 | <tr class="title_bar"> |
592 | 612 | <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>'; |
593 | 613 | |
594 | - if ($context['can_send_email']) |
|
595 | - echo ' |
|
614 | + if ($context['can_send_email']) { |
|
615 | + echo ' |
|
596 | 616 | <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>'; |
617 | + } |
|
597 | 618 | |
598 | 619 | echo ' |
599 | 620 | <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> |
600 | 621 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['date_registered'], $context['sort_by'] == 'registered' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th> |
601 | 622 | <th ', empty($context['group']['assignable']) ? ' colspan="2"' : '', '><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></th>'; |
602 | - if (!empty($context['group']['assignable'])) |
|
603 | - echo ' |
|
623 | + if (!empty($context['group']['assignable'])) { |
|
624 | + echo ' |
|
604 | 625 | <th style="width: 4%"><input type="checkbox" class="input_check" onclick="invertAll(this, this.form);"></th>'; |
626 | + } |
|
605 | 627 | echo ' |
606 | 628 | </tr> |
607 | 629 | </thead> |
608 | 630 | <tbody>'; |
609 | 631 | |
610 | - if (empty($context['members'])) |
|
611 | - echo ' |
|
632 | + if (empty($context['members'])) { |
|
633 | + echo ' |
|
612 | 634 | <tr class="windowbg"> |
613 | 635 | <td colspan="6">', $txt['membergroups_members_no_members'], '</td> |
614 | 636 | </tr>'; |
637 | + } |
|
615 | 638 | |
616 | 639 | foreach ($context['members'] as $member) |
617 | 640 | { |
@@ -630,9 +653,10 @@ discard block |
||
630 | 653 | <td>', $member['last_online'], '</td> |
631 | 654 | <td>', $member['registered'], '</td> |
632 | 655 | <td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>'; |
633 | - if (!empty($context['group']['assignable'])) |
|
634 | - echo ' |
|
656 | + if (!empty($context['group']['assignable'])) { |
|
657 | + echo ' |
|
635 | 658 | <td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" class="input_check" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>'; |
659 | + } |
|
636 | 660 | echo ' |
637 | 661 | </tr>'; |
638 | 662 | } |
@@ -641,11 +665,12 @@ discard block |
||
641 | 665 | </tbody> |
642 | 666 | </table>'; |
643 | 667 | |
644 | - if (!empty($context['group']['assignable'])) |
|
645 | - echo ' |
|
668 | + if (!empty($context['group']['assignable'])) { |
|
669 | + echo ' |
|
646 | 670 | <div class="floatright"> |
647 | 671 | <input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button_submit "> |
648 | 672 | </div>'; |
673 | + } |
|
649 | 674 | |
650 | 675 | echo ' |
651 | 676 | <div class="pagesection flow_hidden"> |
@@ -679,8 +704,8 @@ discard block |
||
679 | 704 | </form> |
680 | 705 | </div>'; |
681 | 706 | |
682 | - if (!empty($context['group']['assignable'])) |
|
683 | - echo ' |
|
707 | + if (!empty($context['group']['assignable'])) { |
|
708 | + echo ' |
|
684 | 709 | <script> |
685 | 710 | var oAddMemberSuggest = new smc_AutoSuggest({ |
686 | 711 | sSelf: \'oAddMemberSuggest\', |
@@ -696,7 +721,8 @@ discard block |
||
696 | 721 | sItemListContainerId: \'toAddItemContainer\' |
697 | 722 | }); |
698 | 723 | </script>'; |
699 | -} |
|
724 | + } |
|
725 | + } |
|
700 | 726 | |
701 | 727 | /** |
702 | 728 | * Allow the moderator to enter a reason to each user being rejected. |
@@ -716,8 +742,8 @@ discard block |
||
716 | 742 | <dl class="settings">'; |
717 | 743 | |
718 | 744 | // Loop through and print out a reason box for each... |
719 | - foreach ($context['group_requests'] as $request) |
|
720 | - echo ' |
|
745 | + foreach ($context['group_requests'] as $request) { |
|
746 | + echo ' |
|
721 | 747 | <dt> |
722 | 748 | <strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong> |
723 | 749 | </dt> |
@@ -725,6 +751,7 @@ discard block |
||
725 | 751 | <input type="hidden" name="groupr[]" value="', $request['id'], '"> |
726 | 752 | <textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="min-width: 80%; max-width: 99%;"></textarea> |
727 | 753 | </dd>'; |
754 | + } |
|
728 | 755 | |
729 | 756 | echo ' |
730 | 757 | </dl> |
@@ -28,13 +28,14 @@ discard block |
||
28 | 28 | <div id="confirm_buttons">'; |
29 | 29 | |
30 | 30 | // Age restriction in effect? |
31 | - if ($context['show_coppa']) |
|
32 | - echo ' |
|
31 | + if ($context['show_coppa']) { |
|
32 | + echo ' |
|
33 | 33 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br> |
34 | 34 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">'; |
35 | - else |
|
36 | - echo ' |
|
35 | + } else { |
|
36 | + echo ' |
|
37 | 37 | <input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button_submit">'; |
38 | + } |
|
38 | 39 | |
39 | 40 | echo ' |
40 | 41 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -77,9 +78,10 @@ discard block |
||
77 | 78 | <ul>'; |
78 | 79 | |
79 | 80 | // Cycle through each error and display an error message. |
80 | - foreach ($context['registration_errors'] as $error) |
|
81 | - echo ' |
|
81 | + foreach ($context['registration_errors'] as $error) { |
|
82 | + echo ' |
|
82 | 83 | <li>', $error, '</li>'; |
84 | + } |
|
83 | 85 | |
84 | 86 | echo ' |
85 | 87 | </ul> |
@@ -143,14 +145,15 @@ discard block |
||
143 | 145 | |
144 | 146 | <dl class="register_form">'; |
145 | 147 | |
146 | - foreach ($context['custom_fields'] as $field) |
|
147 | - if ($field['show_reg'] > 1) |
|
148 | + foreach ($context['custom_fields'] as $field) { |
|
149 | + if ($field['show_reg'] > 1) |
|
148 | 150 | echo ' |
149 | 151 | <dt> |
150 | 152 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
151 | 153 | <span class="smalltext">', $field['desc'], '</span> |
152 | 154 | </dt> |
153 | 155 | <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>'; |
156 | + } |
|
154 | 157 | |
155 | 158 | echo ' |
156 | 159 | </dl>'; |
@@ -184,41 +187,45 @@ discard block |
||
184 | 187 | $callback_func = 'template_profile_' . $field['callback_func']; |
185 | 188 | $callback_func(); |
186 | 189 | } |
187 | - } |
|
188 | - else |
|
190 | + } else |
|
189 | 191 | { |
190 | 192 | echo ' |
191 | 193 | <dt> |
192 | 194 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>'; |
193 | 195 | |
194 | 196 | // Does it have any subtext to show? |
195 | - if (!empty($field['subtext'])) |
|
196 | - echo ' |
|
197 | + if (!empty($field['subtext'])) { |
|
198 | + echo ' |
|
197 | 199 | <span class="smalltext">', $field['subtext'], '</span>'; |
200 | + } |
|
198 | 201 | |
199 | 202 | echo ' |
200 | 203 | </dt> |
201 | 204 | <dd>'; |
202 | 205 | |
203 | 206 | // Want to put something infront of the box? |
204 | - if (!empty($field['preinput'])) |
|
205 | - echo ' |
|
207 | + if (!empty($field['preinput'])) { |
|
208 | + echo ' |
|
206 | 209 | ', $field['preinput']; |
210 | + } |
|
207 | 211 | |
208 | 212 | // What type of data are we showing? |
209 | - if ($field['type'] == 'label') |
|
210 | - echo ' |
|
213 | + if ($field['type'] == 'label') { |
|
214 | + echo ' |
|
211 | 215 | ', $field['value']; |
216 | + } |
|
212 | 217 | |
213 | 218 | // Maybe it's a text box - very likely! |
214 | - elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) |
|
215 | - echo ' |
|
219 | + elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) { |
|
220 | + echo ' |
|
216 | 221 | <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '">'; |
222 | + } |
|
217 | 223 | |
218 | 224 | // You "checking" me out? ;) |
219 | - elseif ($field['type'] == 'check') |
|
220 | - echo ' |
|
225 | + elseif ($field['type'] == 'check') { |
|
226 | + echo ' |
|
221 | 227 | <input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" class="input_check" ', $field['input_attr'], '>'; |
228 | + } |
|
222 | 229 | |
223 | 230 | // Always fun - select boxes! |
224 | 231 | elseif ($field['type'] == 'select') |
@@ -229,13 +236,15 @@ discard block |
||
229 | 236 | if (isset($field['options'])) |
230 | 237 | { |
231 | 238 | // Is this some code to generate the options? |
232 | - if (!is_array($field['options'])) |
|
233 | - $field['options'] = eval($field['options']); |
|
239 | + if (!is_array($field['options'])) { |
|
240 | + $field['options'] = eval($field['options']); |
|
241 | + } |
|
234 | 242 | // Assuming we now have some! |
235 | - if (is_array($field['options'])) |
|
236 | - foreach ($field['options'] as $value => $name) |
|
243 | + if (is_array($field['options'])) { |
|
244 | + foreach ($field['options'] as $value => $name) |
|
237 | 245 | echo ' |
238 | 246 | <option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
247 | + } |
|
239 | 248 | } |
240 | 249 | |
241 | 250 | echo ' |
@@ -243,9 +252,10 @@ discard block |
||
243 | 252 | } |
244 | 253 | |
245 | 254 | // Something to end with? |
246 | - if (!empty($field['postinput'])) |
|
247 | - echo ' |
|
255 | + if (!empty($field['postinput'])) { |
|
256 | + echo ' |
|
248 | 257 | ', $field['postinput']; |
258 | + } |
|
249 | 259 | |
250 | 260 | echo ' |
251 | 261 | </dd>'; |
@@ -258,13 +268,14 @@ discard block |
||
258 | 268 | { |
259 | 269 | foreach ($context['custom_fields'] as $field) |
260 | 270 | { |
261 | - if ($field['show_reg'] < 2) |
|
262 | - echo ' |
|
271 | + if ($field['show_reg'] < 2) { |
|
272 | + echo ' |
|
263 | 273 | <dt> |
264 | 274 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
265 | 275 | <span class="smalltext">', $field['desc'], '</span> |
266 | 276 | </dt> |
267 | 277 | <dd>', $field['input_html'], '</dd>'; |
278 | + } |
|
268 | 279 | } |
269 | 280 | } |
270 | 281 | |
@@ -294,13 +305,14 @@ discard block |
||
294 | 305 | <div id="confirm_buttons" class="flow_auto">'; |
295 | 306 | |
296 | 307 | // Age restriction in effect? |
297 | - if (!$context['require_agreement'] && $context['show_coppa']) |
|
298 | - echo ' |
|
308 | + if (!$context['require_agreement'] && $context['show_coppa']) { |
|
309 | + echo ' |
|
299 | 310 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br> |
300 | 311 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">'; |
301 | - else |
|
302 | - echo ' |
|
312 | + } else { |
|
313 | + echo ' |
|
303 | 314 | <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit">'; |
315 | + } |
|
304 | 316 | echo ' |
305 | 317 | </div> |
306 | 318 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -445,19 +457,20 @@ discard block |
||
445 | 457 | </head> |
446 | 458 | <body style="margin: 1ex;"> |
447 | 459 | <div class="windowbg description" style="text-align: center;">'; |
448 | - if (isBrowser('is_ie') || isBrowser('is_ie11')) |
|
449 | - echo ' |
|
460 | + if (isBrowser('is_ie') || isBrowser('is_ie11')) { |
|
461 | + echo ' |
|
450 | 462 | <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav"> |
451 | 463 | <param name="AutoStart" value="1"> |
452 | 464 | <param name="FileName" value="', $context['verification_sound_href'], '"> |
453 | 465 | </object>'; |
454 | - else |
|
455 | - echo ' |
|
466 | + } else { |
|
467 | + echo ' |
|
456 | 468 | <audio src="', $context['verification_sound_href'], '" controls> |
457 | 469 | <object type="audio/x-wav" data="', $context['verification_sound_href'], '"> |
458 | 470 | <a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a> |
459 | 471 | </object> |
460 | 472 | </audio>'; |
473 | + } |
|
461 | 474 | echo ' |
462 | 475 | <br> |
463 | 476 | <a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br> |
@@ -484,11 +497,12 @@ discard block |
||
484 | 497 | </div> |
485 | 498 | <div id="register_screen" class="windowbg2 noup">'; |
486 | 499 | |
487 | - if (!empty($context['registration_done'])) |
|
488 | - echo ' |
|
500 | + if (!empty($context['registration_done'])) { |
|
501 | + echo ' |
|
489 | 502 | <div class="infobox"> |
490 | 503 | ', $context['registration_done'], ' |
491 | 504 | </div>'; |
505 | + } |
|
492 | 506 | |
493 | 507 | echo ' |
494 | 508 | <dl class="register_form" id="admin_register_form"> |
@@ -524,9 +538,10 @@ discard block |
||
524 | 538 | <dd> |
525 | 539 | <select name="group" id="group_select" tabindex="', $context['tabindex']++, '">'; |
526 | 540 | |
527 | - foreach ($context['member_groups'] as $id => $name) |
|
528 | - echo ' |
|
541 | + foreach ($context['member_groups'] as $id => $name) { |
|
542 | + echo ' |
|
529 | 543 | <option value="', $id, '">', $name, '</option>'; |
544 | + } |
|
530 | 545 | |
531 | 546 | echo ' |
532 | 547 | </select> |
@@ -534,8 +549,8 @@ discard block |
||
534 | 549 | } |
535 | 550 | |
536 | 551 | // If there is any field marked as required, show it here! |
537 | - if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) |
|
538 | - foreach ($context['custom_fields'] as $field) |
|
552 | + if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) { |
|
553 | + foreach ($context['custom_fields'] as $field) |
|
539 | 554 | if ($field['show_reg'] > 1) |
540 | 555 | echo ' |
541 | 556 | <dt> |
@@ -543,6 +558,7 @@ discard block |
||
543 | 558 | <span class="smalltext">', $field['desc'], '</span> |
544 | 559 | </dt> |
545 | 560 | <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>'; |
561 | + } |
|
546 | 562 | |
547 | 563 | echo ' |
548 | 564 | <dt> |
@@ -579,12 +595,13 @@ discard block |
||
579 | 595 | { |
580 | 596 | global $context, $scripturl, $txt; |
581 | 597 | |
582 | - if (!empty($context['saved_successful'])) |
|
583 | - echo ' |
|
598 | + if (!empty($context['saved_successful'])) { |
|
599 | + echo ' |
|
584 | 600 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
585 | - elseif (!empty($context['could_not_save'])) |
|
586 | - echo ' |
|
601 | + } elseif (!empty($context['could_not_save'])) { |
|
602 | + echo ' |
|
587 | 603 | <div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>'; |
604 | + } |
|
588 | 605 | |
589 | 606 | // Just a big box to edit the text file ;). |
590 | 607 | echo ' |
@@ -594,9 +611,10 @@ discard block |
||
594 | 611 | </div>'; |
595 | 612 | |
596 | 613 | // Warning for if the file isn't writable. |
597 | - if (!empty($context['warning'])) |
|
598 | - echo ' |
|
614 | + if (!empty($context['warning'])) { |
|
615 | + echo ' |
|
599 | 616 | <p class="error">', $context['warning'], '</p>'; |
617 | + } |
|
600 | 618 | |
601 | 619 | echo ' |
602 | 620 | <div class="windowbg2 noup" id="registration_agreement">'; |
@@ -613,9 +631,10 @@ discard block |
||
613 | 631 | <strong>', $txt['admin_agreement_select_language'], ':</strong> |
614 | 632 | <select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">'; |
615 | 633 | |
616 | - foreach ($context['editable_agreements'] as $file => $name) |
|
617 | - echo ' |
|
634 | + foreach ($context['editable_agreements'] as $file => $name) { |
|
635 | + echo ' |
|
618 | 636 | <option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>'; |
637 | + } |
|
619 | 638 | |
620 | 639 | echo ' |
621 | 640 | </select> |
@@ -655,9 +674,10 @@ discard block |
||
655 | 674 | { |
656 | 675 | global $context, $scripturl, $txt; |
657 | 676 | |
658 | - if (!empty($context['saved_successful'])) |
|
659 | - echo ' |
|
677 | + if (!empty($context['saved_successful'])) { |
|
678 | + echo ' |
|
660 | 679 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
680 | + } |
|
661 | 681 | |
662 | 682 | echo ' |
663 | 683 | <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '"> |
@@ -646,12 +646,12 @@ |
||
646 | 646 | </dd>'; |
647 | 647 | } |
648 | 648 | // A Textarea? |
649 | - elseif ($setting['type'] == 'textarea') |
|
649 | + elseif ($setting['type'] == 'textarea') |
|
650 | 650 | { |
651 | 651 | echo ' |
652 | 652 | <dd> |
653 | 653 | <textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>'; |
654 | - echo ' |
|
654 | + echo ' |
|
655 | 655 | </dd>'; |
656 | 656 | } |
657 | 657 | // A regular input box, then? |
@@ -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' : '', ' class="input_check"> ', $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> |
@@ -189,11 +192,12 @@ discard block |
||
189 | 192 | global $context, $scripturl, $txt; |
190 | 193 | |
191 | 194 | // Show a nice confirmation message. |
192 | - if (isset($_GET['done'])) |
|
193 | - echo ' |
|
195 | + if (isset($_GET['done'])) { |
|
196 | + echo ' |
|
194 | 197 | <div class="infobox"> |
195 | 198 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
196 | 199 | </div>'; |
200 | + } |
|
197 | 201 | |
198 | 202 | echo ' |
199 | 203 | <div id="admincenter">'; |
@@ -357,11 +361,12 @@ discard block |
||
357 | 361 | if (empty($setting) || !is_array($setting)) |
358 | 362 | { |
359 | 363 | // Insert a separator (unless this is the first item in the list) |
360 | - if ($i !== $first_option_key) |
|
361 | - echo ' |
|
364 | + if ($i !== $first_option_key) { |
|
365 | + echo ' |
|
362 | 366 | </dl> |
363 | 367 | <hr> |
364 | 368 | <dl class="settings">'; |
369 | + } |
|
365 | 370 | |
366 | 371 | // Should we give a name to this section? |
367 | 372 | if (is_string($setting) && !empty($setting)) |
@@ -369,9 +374,9 @@ discard block |
||
369 | 374 | $titled_section = true; |
370 | 375 | echo ' |
371 | 376 | <dt><b>' . $setting . '</b></dt><dd></dd>'; |
377 | + } else { |
|
378 | + $titled_section = false; |
|
372 | 379 | } |
373 | - else |
|
374 | - $titled_section = false; |
|
375 | 380 | |
376 | 381 | continue; |
377 | 382 | } |
@@ -380,19 +385,21 @@ discard block |
||
380 | 385 | <dt ', $context['theme_options_reset'] ? 'style="width:50%"' : '', '>'; |
381 | 386 | |
382 | 387 | // Show the change option box ? |
383 | - if ($context['theme_options_reset']) |
|
384 | - echo ' |
|
388 | + if ($context['theme_options_reset']) { |
|
389 | + echo ' |
|
385 | 390 | <span class="floatleft"><select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
386 | 391 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
387 | 392 | <option value="1">', $txt['themeadmin_reset_options_change'], '</option> |
388 | 393 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
389 | 394 | </select> </span>'; |
395 | + } |
|
390 | 396 | |
391 | 397 | echo ' |
392 | 398 | <label for="options_', $setting['id'], '">', !$titled_section ? '<b>' : '', $setting['label'], !$titled_section ? '</b>' : '', '</label>'; |
393 | - if (isset($setting['description'])) |
|
394 | - echo ' |
|
399 | + if (isset($setting['description'])) { |
|
400 | + echo ' |
|
395 | 401 | <br><span class="smalltext">', $setting['description'], '</span>'; |
402 | + } |
|
396 | 403 | echo ' |
397 | 404 | </dt>'; |
398 | 405 | |
@@ -434,13 +441,11 @@ discard block |
||
434 | 441 | |
435 | 442 | echo ' |
436 | 443 | <input type="number"', $min . $max . $step; |
437 | - } |
|
438 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
444 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
439 | 445 | { |
440 | 446 | echo' |
441 | 447 | <input type="url"'; |
442 | - } |
|
443 | - else |
|
448 | + } else |
|
444 | 449 | { |
445 | 450 | echo ' |
446 | 451 | <input type="text"'; |
@@ -484,8 +489,8 @@ discard block |
||
484 | 489 | <br>'; |
485 | 490 | |
486 | 491 | // @todo Why can't I edit the default theme popup. |
487 | - if ($context['theme_settings']['theme_id'] != 1) |
|
488 | - echo ' |
|
492 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
493 | + echo ' |
|
489 | 494 | <div class="cat_bar"> |
490 | 495 | <h3 class="catbg config_hd"> |
491 | 496 | ', $txt['theme_edit'], ' |
@@ -501,6 +506,7 @@ discard block |
||
501 | 506 | </li> |
502 | 507 | </ul> |
503 | 508 | </div>'; |
509 | + } |
|
504 | 510 | |
505 | 511 | echo ' |
506 | 512 | <div class="cat_bar"> |
@@ -554,9 +560,10 @@ discard block |
||
554 | 560 | <dd> |
555 | 561 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
556 | 562 | |
557 | - foreach ($context['theme_variants'] as $key => $variant) |
|
558 | - echo ' |
|
563 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
564 | + echo ' |
|
559 | 565 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
566 | + } |
|
560 | 567 | |
561 | 568 | echo ' |
562 | 569 | </select> |
@@ -591,11 +598,12 @@ discard block |
||
591 | 598 | if (empty($setting) || !is_array($setting)) |
592 | 599 | { |
593 | 600 | // We don't need a separator before the first list element |
594 | - if ($i !== $first_setting_key) |
|
595 | - echo ' |
|
601 | + if ($i !== $first_setting_key) { |
|
602 | + echo ' |
|
596 | 603 | </dl> |
597 | 604 | <hr> |
598 | 605 | <dl class="settings">'; |
606 | + } |
|
599 | 607 | |
600 | 608 | // Add a fake heading? |
601 | 609 | if (is_string($setting) && !empty($setting)) |
@@ -603,9 +611,9 @@ discard block |
||
603 | 611 | $titled_section = true; |
604 | 612 | echo ' |
605 | 613 | <dt><b>' . $setting . '</b></dt><dd></dd>'; |
614 | + } else { |
|
615 | + $titled_section = false; |
|
606 | 616 | } |
607 | - else |
|
608 | - $titled_section = false; |
|
609 | 617 | |
610 | 618 | continue; |
611 | 619 | } |
@@ -614,9 +622,10 @@ discard block |
||
614 | 622 | <dt> |
615 | 623 | <label for="', $setting['id'], '">', !$titled_section ? '<b>' : '', $setting['label'], !$titled_section ? '</b>' : '', '</label>:'; |
616 | 624 | |
617 | - if (isset($setting['description'])) |
|
618 | - echo '<br> |
|
625 | + if (isset($setting['description'])) { |
|
626 | + echo '<br> |
|
619 | 627 | <span class="smalltext">', $setting['description'], '</span>'; |
628 | + } |
|
620 | 629 | |
621 | 630 | echo ' |
622 | 631 | </dt>'; |
@@ -637,9 +646,10 @@ discard block |
||
637 | 646 | <dd> |
638 | 647 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
639 | 648 | |
640 | - foreach ($setting['options'] as $value => $label) |
|
641 | - echo ' |
|
649 | + foreach ($setting['options'] as $value => $label) { |
|
650 | + echo ' |
|
642 | 651 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
652 | + } |
|
643 | 653 | |
644 | 654 | echo ' |
645 | 655 | </select> |
@@ -668,13 +678,11 @@ discard block |
||
668 | 678 | |
669 | 679 | echo ' |
670 | 680 | <input type="number"', $min . $max . $step; |
671 | - } |
|
672 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
681 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
673 | 682 | { |
674 | 683 | echo' |
675 | 684 | <input type="url"'; |
676 | - } |
|
677 | - else |
|
685 | + } else |
|
678 | 686 | { |
679 | 687 | echo ' |
680 | 688 | <input type="text"'; |
@@ -827,21 +835,23 @@ discard block |
||
827 | 835 | <div class="windowbg">'; |
828 | 836 | |
829 | 837 | // Oops! there was an error :( |
830 | - if (!empty($context['error_message'])) |
|
831 | - echo ' |
|
838 | + if (!empty($context['error_message'])) { |
|
839 | + echo ' |
|
832 | 840 | <p> |
833 | 841 | ', $context['error_message'], ' |
834 | 842 | </p>'; |
843 | + } |
|
835 | 844 | |
836 | 845 | // Not much to show except a link back... |
837 | - else |
|
838 | - echo ' |
|
846 | + else { |
|
847 | + echo ' |
|
839 | 848 | <p> |
840 | 849 | <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'], ' |
841 | 850 | </p> |
842 | 851 | <p> |
843 | 852 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
844 | 853 | </p>'; |
854 | + } |
|
845 | 855 | |
846 | 856 | echo ' |
847 | 857 | </div> |
@@ -908,10 +918,11 @@ discard block |
||
908 | 918 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
909 | 919 | <span class="floatright">'; |
910 | 920 | |
911 | - if ($template['can_copy']) |
|
912 | - echo '<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>'; |
|
913 | - else |
|
914 | - echo $txt['themeadmin_edit_no_copy']; |
|
921 | + if ($template['can_copy']) { |
|
922 | + echo '<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>'; |
|
923 | + } else { |
|
924 | + echo $txt['themeadmin_edit_no_copy']; |
|
925 | + } |
|
915 | 926 | |
916 | 927 | echo ' |
917 | 928 | </span> |
@@ -934,11 +945,12 @@ discard block |
||
934 | 945 | echo ' |
935 | 946 | <div id="admincenter">'; |
936 | 947 | |
937 | - if (!empty($context['browse_title'])) |
|
938 | - echo ' |
|
948 | + if (!empty($context['browse_title'])) { |
|
949 | + echo ' |
|
939 | 950 | <div class="cat_bar"> |
940 | 951 | <h3 class="catbg">', $context['browse_title'], '</h3> |
941 | 952 | </div>'; |
953 | + } |
|
942 | 954 | |
943 | 955 | echo ' |
944 | 956 | <table class="table_grid tborder"> |
@@ -958,14 +970,13 @@ discard block |
||
958 | 970 | <tr class="windowbg"> |
959 | 971 | <td>'; |
960 | 972 | |
961 | - if ($file['is_editable']) |
|
962 | - echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
|
963 | - |
|
964 | - elseif ($file['is_directory']) |
|
965 | - echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
|
966 | - |
|
967 | - else |
|
968 | - echo $file['filename']; |
|
973 | + if ($file['is_editable']) { |
|
974 | + echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
|
975 | + } elseif ($file['is_directory']) { |
|
976 | + echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
|
977 | + } else { |
|
978 | + echo $file['filename']; |
|
979 | + } |
|
969 | 980 | |
970 | 981 | echo ' |
971 | 982 | </td> |
@@ -987,11 +998,12 @@ discard block |
||
987 | 998 | { |
988 | 999 | global $context, $settings, $scripturl, $txt; |
989 | 1000 | |
990 | - if ($context['session_error']) |
|
991 | - echo ' |
|
1001 | + if ($context['session_error']) { |
|
1002 | + echo ' |
|
992 | 1003 | <div class="errorbox"> |
993 | 1004 | ', $txt['error_session_timeout'], ' |
994 | 1005 | </div>'; |
1006 | + } |
|
995 | 1007 | |
996 | 1008 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
997 | 1009 | echo ' |
@@ -1054,17 +1066,18 @@ discard block |
||
1054 | 1066 | try |
1055 | 1067 | { |
1056 | 1068 | '; |
1057 | - if (isBrowser('is_ie')) |
|
1058 | - echo ' |
|
1069 | + if (isBrowser('is_ie')) { |
|
1070 | + echo ' |
|
1059 | 1071 | var sheets = frames["css_preview_box"].document.styleSheets; |
1060 | 1072 | for (var j = 0; j < sheets.length; j++) |
1061 | 1073 | { |
1062 | 1074 | if (sheets[j].id == "css_preview_box") |
1063 | 1075 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
1064 | 1076 | }'; |
1065 | - else |
|
1066 | - echo ' |
|
1077 | + } else { |
|
1078 | + echo ' |
|
1067 | 1079 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
1080 | + } |
|
1068 | 1081 | echo ' |
1069 | 1082 | } |
1070 | 1083 | catch (e) |
@@ -1116,9 +1129,10 @@ discard block |
||
1116 | 1129 | </div> |
1117 | 1130 | <div class="windowbg">'; |
1118 | 1131 | |
1119 | - if (!$context['allow_save']) |
|
1120 | - echo ' |
|
1132 | + if (!$context['allow_save']) { |
|
1133 | + echo ' |
|
1121 | 1134 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1135 | + } |
|
1122 | 1136 | |
1123 | 1137 | echo ' |
1124 | 1138 | <textarea name="entire_file" cols="80" rows="20" style="width: 96%; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br> |
@@ -1131,9 +1145,10 @@ discard block |
||
1131 | 1145 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1132 | 1146 | |
1133 | 1147 | // Hopefully it exists. |
1134 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1135 | - echo ' |
|
1148 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1149 | + echo ' |
|
1136 | 1150 | <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'], '">'; |
1151 | + } |
|
1137 | 1152 | |
1138 | 1153 | echo ' |
1139 | 1154 | </form> |
@@ -1147,18 +1162,20 @@ discard block |
||
1147 | 1162 | { |
1148 | 1163 | global $context, $scripturl, $txt; |
1149 | 1164 | |
1150 | - if ($context['session_error']) |
|
1151 | - echo ' |
|
1165 | + if ($context['session_error']) { |
|
1166 | + echo ' |
|
1152 | 1167 | <div class="errorbox"> |
1153 | 1168 | ', $txt['error_session_timeout'], ' |
1154 | 1169 | </div>'; |
1170 | + } |
|
1155 | 1171 | |
1156 | - if (isset($context['parse_error'])) |
|
1157 | - echo ' |
|
1172 | + if (isset($context['parse_error'])) { |
|
1173 | + echo ' |
|
1158 | 1174 | <div class="errorbox"> |
1159 | 1175 | ', $txt['themeadmin_edit_error'], ' |
1160 | 1176 | <div><pre>', $context['parse_error'], '</pre></div> |
1161 | 1177 | </div>'; |
1178 | + } |
|
1162 | 1179 | |
1163 | 1180 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1164 | 1181 | echo ' |
@@ -1169,16 +1186,18 @@ discard block |
||
1169 | 1186 | </div> |
1170 | 1187 | <div class="windowbg">'; |
1171 | 1188 | |
1172 | - if (!$context['allow_save']) |
|
1173 | - echo ' |
|
1189 | + if (!$context['allow_save']) { |
|
1190 | + echo ' |
|
1174 | 1191 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1192 | + } |
|
1175 | 1193 | |
1176 | - foreach ($context['file_parts'] as $part) |
|
1177 | - echo ' |
|
1194 | + foreach ($context['file_parts'] as $part) { |
|
1195 | + echo ' |
|
1178 | 1196 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
1179 | 1197 | <div class="centertext"> |
1180 | 1198 | <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 | 1199 | </div>'; |
1200 | + } |
|
1182 | 1201 | |
1183 | 1202 | echo ' |
1184 | 1203 | <div class="padding righttext"> |
@@ -1187,9 +1206,10 @@ discard block |
||
1187 | 1206 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1188 | 1207 | |
1189 | 1208 | // Hopefully it exists. |
1190 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1191 | - echo ' |
|
1209 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1210 | + echo ' |
|
1192 | 1211 | <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'], '">'; |
1212 | + } |
|
1193 | 1213 | |
1194 | 1214 | echo ' |
1195 | 1215 | </div> |
@@ -1205,18 +1225,20 @@ discard block |
||
1205 | 1225 | { |
1206 | 1226 | global $context, $scripturl, $txt; |
1207 | 1227 | |
1208 | - if ($context['session_error']) |
|
1209 | - echo ' |
|
1228 | + if ($context['session_error']) { |
|
1229 | + echo ' |
|
1210 | 1230 | <div class="errorbox"> |
1211 | 1231 | ', $txt['error_session_timeout'], ' |
1212 | 1232 | </div>'; |
1233 | + } |
|
1213 | 1234 | |
1214 | 1235 | //Is this file writeable? |
1215 | - if (!$context['allow_save']) |
|
1216 | - echo ' |
|
1236 | + if (!$context['allow_save']) { |
|
1237 | + echo ' |
|
1217 | 1238 | <div class="errorbox"> |
1218 | 1239 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
1219 | 1240 | </div>'; |
1241 | + } |
|
1220 | 1242 | |
1221 | 1243 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1222 | 1244 | echo ' |
@@ -1232,9 +1254,10 @@ discard block |
||
1232 | 1254 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1233 | 1255 | |
1234 | 1256 | // Hopefully it exists. |
1235 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1236 | - echo ' |
|
1257 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1258 | + echo ' |
|
1237 | 1259 | <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'], '">'; |
1260 | + } |
|
1238 | 1261 | |
1239 | 1262 | echo ' |
1240 | 1263 | </div> |
@@ -25,13 +25,15 @@ discard block |
||
25 | 25 | </h3> |
26 | 26 | </div>'; |
27 | 27 | |
28 | - if (!empty($context['search_errors'])) |
|
29 | - echo ' |
|
28 | + if (!empty($context['search_errors'])) { |
|
29 | + echo ' |
|
30 | 30 | <div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>'; |
31 | + } |
|
31 | 32 | |
32 | - if (!empty($context['search_ignored'])) |
|
33 | - echo ' |
|
33 | + if (!empty($context['search_ignored'])) { |
|
34 | + echo ' |
|
34 | 35 | <p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>'; |
36 | + } |
|
35 | 37 | |
36 | 38 | echo ' |
37 | 39 | <div id="advanced_search" class="roundframe"> |
@@ -42,9 +44,10 @@ discard block |
||
42 | 44 | <dd> |
43 | 45 | <input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text">'; |
44 | 46 | |
45 | - if (empty($modSettings['search_simple_fulltext'])) |
|
46 | - echo ' |
|
47 | + if (empty($modSettings['search_simple_fulltext'])) { |
|
48 | + echo ' |
|
47 | 49 | <br><em class="smalltext">', $txt['search_example'], '</em>'; |
50 | + } |
|
48 | 51 | |
49 | 52 | echo ' |
50 | 53 | </dd> |
@@ -115,11 +118,12 @@ discard block |
||
115 | 118 | } |
116 | 119 | |
117 | 120 | // If $context['search_params']['topic'] is set, that means we're searching just one topic. |
118 | - if (!empty($context['search_params']['topic'])) |
|
119 | - echo ' |
|
121 | + if (!empty($context['search_params']['topic'])) { |
|
122 | + echo ' |
|
120 | 123 | <p>', $txt['search_specific_topic'], ' "', $context['search_topic']['link'], '".</p> |
121 | 124 | <input type="hidden" name="topic" value="', $context['search_topic']['id'], '"> |
122 | 125 | <input type="submit" name="b_search" value="', $txt['search'], '" class="button_submit">'; |
126 | + } |
|
123 | 127 | |
124 | 128 | echo ' |
125 | 129 | </div> |
@@ -150,14 +154,15 @@ discard block |
||
150 | 154 | |
151 | 155 | foreach ($category['boards'] as $board) |
152 | 156 | { |
153 | - if ($i == $limit) |
|
154 | - echo ' |
|
157 | + if ($i == $limit) { |
|
158 | + echo ' |
|
155 | 159 | </ul> |
156 | 160 | </li> |
157 | 161 | </ul> |
158 | 162 | <ul class="ignoreboards floatright"> |
159 | 163 | <li class="category"> |
160 | 164 | <ul>'; |
165 | + } |
|
161 | 166 | |
162 | 167 | echo ' |
163 | 168 | <li class="board"> |
@@ -245,13 +250,15 @@ discard block |
||
245 | 250 | <div class="roundframe">'; |
246 | 251 | |
247 | 252 | // Did they make any typos or mistakes, perhaps? |
248 | - if (isset($context['did_you_mean'])) |
|
249 | - echo ' |
|
253 | + if (isset($context['did_you_mean'])) { |
|
254 | + echo ' |
|
250 | 255 | <p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>'; |
256 | + } |
|
251 | 257 | |
252 | - if (!empty($context['search_ignored'])) |
|
253 | - echo ' |
|
258 | + if (!empty($context['search_ignored'])) { |
|
259 | + echo ' |
|
254 | 260 | <p>', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>'; |
261 | + } |
|
255 | 262 | |
256 | 263 | echo ' |
257 | 264 | <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '"> |
@@ -273,10 +280,11 @@ discard block |
||
273 | 280 | <input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '"> |
274 | 281 | <input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '"> |
275 | 282 | </div>'; |
276 | - if (!empty($context['search_params']['brd'])) |
|
277 | - foreach ($context['search_params']['brd'] as $board_id) |
|
283 | + if (!empty($context['search_params']['brd'])) { |
|
284 | + foreach ($context['search_params']['brd'] as $board_id) |
|
278 | 285 | echo ' |
279 | 286 | <input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">'; |
287 | + } |
|
280 | 288 | |
281 | 289 | echo ' |
282 | 290 | </form> |
@@ -287,17 +295,19 @@ discard block |
||
287 | 295 | if ($context['compact']) |
288 | 296 | { |
289 | 297 | // Quick moderation set to checkboxes? Oh, how fun :/. |
290 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
291 | - echo ' |
|
298 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
299 | + echo ' |
|
292 | 300 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">'; |
301 | + } |
|
293 | 302 | |
294 | 303 | echo ' |
295 | 304 | <div class="cat_bar"> |
296 | 305 | <h3 class="catbg"> |
297 | 306 | <span class="floatright">'; |
298 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
299 | - echo ' |
|
307 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
308 | + echo ' |
|
300 | 309 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">'; |
310 | + } |
|
301 | 311 | echo ' |
302 | 312 | </span> |
303 | 313 | <span class="generic_icons filter"></span> ', $txt['mlist_search_results'], ': ', $context['search_params']['search'], ' |
@@ -305,14 +315,15 @@ discard block |
||
305 | 315 | </div>'; |
306 | 316 | |
307 | 317 | // was anything even found? |
308 | - if (!empty($context['topics'])) |
|
309 | - echo' |
|
318 | + if (!empty($context['topics'])) { |
|
319 | + echo' |
|
310 | 320 | <div class="pagesection"> |
311 | 321 | <span>', $context['page_index'], '</span> |
312 | 322 | </div>'; |
313 | - else |
|
314 | - echo ' |
|
323 | + } else { |
|
324 | + echo ' |
|
315 | 325 | <div class="roundframe">', $txt['find_no_results'], '</div>'; |
326 | + } |
|
316 | 327 | |
317 | 328 | // while we have results to show ... |
318 | 329 | while ($topic = $context['get_topics']()) |
@@ -340,38 +351,43 @@ discard block |
||
340 | 351 | { |
341 | 352 | echo ' |
342 | 353 | <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">'; |
343 | - } |
|
344 | - else |
|
354 | + } else |
|
345 | 355 | { |
346 | - if ($topic['quick_mod']['remove']) |
|
347 | - echo ' |
|
356 | + if ($topic['quick_mod']['remove']) { |
|
357 | + echo ' |
|
348 | 358 | <a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
359 | + } |
|
349 | 360 | |
350 | - if ($topic['quick_mod']['lock']) |
|
351 | - echo ' |
|
361 | + if ($topic['quick_mod']['lock']) { |
|
362 | + echo ' |
|
352 | 363 | <a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
364 | + } |
|
353 | 365 | |
354 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
355 | - echo ' |
|
366 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
367 | + echo ' |
|
356 | 368 | <br>'; |
369 | + } |
|
357 | 370 | |
358 | - if ($topic['quick_mod']['sticky']) |
|
359 | - echo ' |
|
371 | + if ($topic['quick_mod']['sticky']) { |
|
372 | + echo ' |
|
360 | 373 | <a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
374 | + } |
|
361 | 375 | |
362 | - if ($topic['quick_mod']['move']) |
|
363 | - echo ' |
|
376 | + if ($topic['quick_mod']['move']) { |
|
377 | + echo ' |
|
364 | 378 | <a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
379 | + } |
|
365 | 380 | } |
366 | 381 | |
367 | 382 | echo ' |
368 | 383 | </div>'; |
369 | 384 | } |
370 | 385 | |
371 | - if ($message['body_highlighted'] != '') |
|
372 | - echo ' |
|
386 | + if ($message['body_highlighted'] != '') { |
|
387 | + echo ' |
|
373 | 388 | <br class="clear"> |
374 | 389 | <div class="list_posts double_height">', $message['body_highlighted'], '</div>'; |
390 | + } |
|
375 | 391 | } |
376 | 392 | |
377 | 393 | echo ' |
@@ -379,11 +395,12 @@ discard block |
||
379 | 395 | </div>'; |
380 | 396 | |
381 | 397 | } |
382 | - if (!empty($context['topics'])) |
|
383 | - echo ' |
|
398 | + if (!empty($context['topics'])) { |
|
399 | + echo ' |
|
384 | 400 | <div class="pagesection"> |
385 | 401 | <span>', $context['page_index'], '</span> |
386 | 402 | </div>'; |
403 | + } |
|
387 | 404 | |
388 | 405 | if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
389 | 406 | { |
@@ -393,17 +410,19 @@ discard block |
||
393 | 410 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
394 | 411 | <option value="">--------</option>'; |
395 | 412 | |
396 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
397 | - if ($context['can_' . $qmod_action]) |
|
413 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
414 | + if ($context['can_' . $qmod_action]) |
|
398 | 415 | echo ' |
399 | 416 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
417 | + } |
|
400 | 418 | |
401 | 419 | echo ' |
402 | 420 | </select>'; |
403 | 421 | |
404 | - if ($context['can_move']) |
|
405 | - echo ' |
|
422 | + if ($context['can_move']) { |
|
423 | + echo ' |
|
406 | 424 | <span id="quick_mod_jump_to"> </span>'; |
425 | + } |
|
407 | 426 | |
408 | 427 | echo ' |
409 | 428 | <input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '"> |
@@ -413,13 +432,13 @@ discard block |
||
413 | 432 | } |
414 | 433 | |
415 | 434 | |
416 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
|
417 | - echo ' |
|
435 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) { |
|
436 | + echo ' |
|
418 | 437 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
419 | 438 | </form>'; |
439 | + } |
|
420 | 440 | |
421 | - } |
|
422 | - else |
|
441 | + } else |
|
423 | 442 | { |
424 | 443 | echo ' |
425 | 444 | <div class="cat_bar"> |
@@ -431,9 +450,10 @@ discard block |
||
431 | 450 | <span>', $context['page_index'], '</span> |
432 | 451 | </div>'; |
433 | 452 | |
434 | - if (empty($context['topics'])) |
|
435 | - echo ' |
|
453 | + if (empty($context['topics'])) { |
|
454 | + echo ' |
|
436 | 455 | <div class="information">(', $txt['search_no_results'], ')</div>'; |
456 | + } |
|
437 | 457 | |
438 | 458 | while ($topic = $context['get_topics']()) |
439 | 459 | { |
@@ -448,23 +468,27 @@ discard block |
||
448 | 468 | </div> |
449 | 469 | <div class="list_posts">', $message['body_highlighted'], '</div>'; |
450 | 470 | |
451 | - if ($topic['can_reply']) |
|
452 | - echo ' |
|
471 | + if ($topic['can_reply']) { |
|
472 | + echo ' |
|
453 | 473 | <ul class="quickbuttons">'; |
474 | + } |
|
454 | 475 | |
455 | 476 | // If they *can* reply? |
456 | - if ($topic['can_reply']) |
|
457 | - echo ' |
|
477 | + if ($topic['can_reply']) { |
|
478 | + echo ' |
|
458 | 479 | <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
480 | + } |
|
459 | 481 | |
460 | 482 | // If they *can* quote? |
461 | - if ($topic['can_quote']) |
|
462 | - echo ' |
|
483 | + if ($topic['can_quote']) { |
|
484 | + echo ' |
|
463 | 485 | <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
486 | + } |
|
464 | 487 | |
465 | - if ($topic['can_reply']) |
|
466 | - echo ' |
|
488 | + if ($topic['can_reply']) { |
|
489 | + echo ' |
|
467 | 490 | </ul>'; |
491 | + } |
|
468 | 492 | echo ' |
469 | 493 | <br class="clear"> |
470 | 494 | </div>'; |
@@ -483,8 +507,8 @@ discard block |
||
483 | 507 | <div class="smalltext righttext" id="search_jump_to"> </div> |
484 | 508 | <script>'; |
485 | 509 | |
486 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
487 | - echo ' |
|
510 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
511 | + echo ' |
|
488 | 512 | if (typeof(window.XMLHttpRequest) != "undefined") |
489 | 513 | aJumpTo[aJumpTo.length] = new JumpTo({ |
490 | 514 | sContainerId: "quick_mod_jump_to", |
@@ -499,6 +523,7 @@ discard block |
||
499 | 523 | bDisabled: true, |
500 | 524 | sCustomName: "move_to" |
501 | 525 | });'; |
526 | + } |
|
502 | 527 | |
503 | 528 | echo ' |
504 | 529 | if (typeof(window.XMLHttpRequest) != "undefined") |
@@ -51,11 +51,13 @@ discard block |
||
51 | 51 | <p>'; |
52 | 52 | |
53 | 53 | // Show just numbers...? |
54 | - if ($settings['display_who_viewing'] == 1) |
|
55 | - echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
54 | + if ($settings['display_who_viewing'] == 1) { |
|
55 | + echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
56 | + } |
|
56 | 57 | // Or show the actual people viewing the topic? |
57 | - else |
|
58 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
58 | + else { |
|
59 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
60 | + } |
|
59 | 61 | |
60 | 62 | // Now show how many guests are here too. |
61 | 63 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' |
@@ -93,10 +95,11 @@ discard block |
||
93 | 95 | <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> |
94 | 96 | <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; |
95 | 97 | |
96 | - if ($context['allow_results_view']) |
|
97 | - echo ' |
|
98 | + if ($context['allow_results_view']) { |
|
99 | + echo ' |
|
98 | 100 | ', $option['bar_ndt'], ' |
99 | 101 | <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; |
102 | + } |
|
100 | 103 | |
101 | 104 | echo ' |
102 | 105 | </dd>'; |
@@ -105,9 +108,10 @@ discard block |
||
105 | 108 | echo ' |
106 | 109 | </dl>'; |
107 | 110 | |
108 | - if ($context['allow_results_view']) |
|
109 | - echo ' |
|
111 | + if ($context['allow_results_view']) { |
|
112 | + echo ' |
|
110 | 113 | <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; |
114 | + } |
|
111 | 115 | } |
112 | 116 | // They are allowed to vote! Go to it! |
113 | 117 | else |
@@ -116,17 +120,19 @@ discard block |
||
116 | 120 | <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; |
117 | 121 | |
118 | 122 | // Show a warning if they are allowed more than one option. |
119 | - if ($context['poll']['allowed_warning']) |
|
120 | - echo ' |
|
123 | + if ($context['poll']['allowed_warning']) { |
|
124 | + echo ' |
|
121 | 125 | <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; |
126 | + } |
|
122 | 127 | |
123 | 128 | echo ' |
124 | 129 | <ul class="options">'; |
125 | 130 | |
126 | 131 | // Show each option with its button - a radio likely. |
127 | - foreach ($context['poll']['options'] as $option) |
|
128 | - echo ' |
|
132 | + foreach ($context['poll']['options'] as $option) { |
|
133 | + echo ' |
|
129 | 134 | <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; |
135 | + } |
|
130 | 136 | |
131 | 137 | echo ' |
132 | 138 | </ul> |
@@ -138,9 +144,10 @@ discard block |
||
138 | 144 | } |
139 | 145 | |
140 | 146 | // Is the clock ticking? |
141 | - if (!empty($context['poll']['expire_time'])) |
|
142 | - echo ' |
|
147 | + if (!empty($context['poll']['expire_time'])) { |
|
148 | + echo ' |
|
143 | 149 | <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>'; |
150 | + } |
|
144 | 151 | |
145 | 152 | echo ' |
146 | 153 | </div> |
@@ -170,11 +177,13 @@ discard block |
||
170 | 177 | <li> |
171 | 178 | <b class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></b>'; |
172 | 179 | |
173 | - if ($event['can_edit']) |
|
174 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
180 | + if ($event['can_edit']) { |
|
181 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
182 | + } |
|
175 | 183 | |
176 | - if ($event['can_export']) |
|
177 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
184 | + if ($event['can_export']) { |
|
185 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
186 | + } |
|
178 | 187 | |
179 | 188 | echo ' |
180 | 189 | <br>'; |
@@ -182,14 +191,14 @@ discard block |
||
182 | 191 | if (!empty($event['allday'])) |
183 | 192 | { |
184 | 193 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' – <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : ''; |
185 | - } |
|
186 | - else |
|
194 | + } else |
|
187 | 195 | { |
188 | 196 | // Display event info relative to user's local timezone |
189 | 197 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
190 | 198 | |
191 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
192 | - echo trim($event['end_date_local']) . ', '; |
|
199 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
200 | + echo trim($event['end_date_local']) . ', '; |
|
201 | + } |
|
193 | 202 | |
194 | 203 | echo trim($event['end_time_local']); |
195 | 204 | |
@@ -198,23 +207,27 @@ discard block |
||
198 | 207 | { |
199 | 208 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
200 | 209 | |
201 | - if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) |
|
202 | - echo trim($event['start_date_orig']), ', '; |
|
210 | + if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) { |
|
211 | + echo trim($event['start_date_orig']), ', '; |
|
212 | + } |
|
203 | 213 | |
204 | 214 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
205 | 215 | |
206 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
207 | - echo trim($event['end_date_orig']) . ', '; |
|
216 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
217 | + echo trim($event['end_date_orig']) . ', '; |
|
218 | + } |
|
208 | 219 | |
209 | 220 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
210 | 221 | } |
211 | 222 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
212 | - else |
|
213 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
223 | + else { |
|
224 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
225 | + } |
|
214 | 226 | } |
215 | 227 | |
216 | - if (!empty($event['location'])) |
|
217 | - echo '<br>', $event['location']; |
|
228 | + if (!empty($event['location'])) { |
|
229 | + echo '<br>', $event['location']; |
|
230 | + } |
|
218 | 231 | |
219 | 232 | echo ' |
220 | 233 | </li>'; |
@@ -252,8 +265,9 @@ discard block |
||
252 | 265 | $context['removableMessageIDs'] = array(); |
253 | 266 | |
254 | 267 | // Get all the messages... |
255 | - while ($message = $context['get_message']()) |
|
256 | - template_single_post($message); |
|
268 | + while ($message = $context['get_message']()) { |
|
269 | + template_single_post($message); |
|
270 | + } |
|
257 | 271 | |
258 | 272 | echo ' |
259 | 273 | </form> |
@@ -290,8 +304,9 @@ discard block |
||
290 | 304 | <div id="display_jump_to"> </div>'; |
291 | 305 | |
292 | 306 | // Show quickreply |
293 | - if ($context['can_reply']) |
|
294 | - template_quickreply(); |
|
307 | + if ($context['can_reply']) { |
|
308 | + template_quickreply(); |
|
309 | + } |
|
295 | 310 | |
296 | 311 | // User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device. |
297 | 312 | echo ' |
@@ -304,8 +319,8 @@ discard block |
||
304 | 319 | </div>'; |
305 | 320 | |
306 | 321 | // Show the moderation button & pop only if user can moderate |
307 | - if ($context['can_moderate_forum'] || $context['user']['is_mod']) |
|
308 | - echo ' |
|
322 | + if ($context['can_moderate_forum'] || $context['user']['is_mod']) { |
|
323 | + echo ' |
|
309 | 324 | <div id="mobile_moderation" class="popup_container"> |
310 | 325 | <div class="popup_window description"> |
311 | 326 | <div class="popup_heading">', $txt['mobile_moderation'], ' |
@@ -315,6 +330,7 @@ discard block |
||
315 | 330 | </div> |
316 | 331 | </div> |
317 | 332 | </div>'; |
333 | + } |
|
318 | 334 | |
319 | 335 | echo ' |
320 | 336 | <script>'; |
@@ -438,9 +454,10 @@ discard block |
||
438 | 454 | }); |
439 | 455 | }'; |
440 | 456 | |
441 | - if (!empty($context['ignoredMsgs'])) |
|
442 | - echo ' |
|
457 | + if (!empty($context['ignoredMsgs'])) { |
|
458 | + echo ' |
|
443 | 459 | ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; |
460 | + } |
|
444 | 461 | |
445 | 462 | echo ' |
446 | 463 | </script>'; |
@@ -457,8 +474,9 @@ discard block |
||
457 | 474 | |
458 | 475 | $ignoring = false; |
459 | 476 | |
460 | - if ($message['can_remove']) |
|
461 | - $context['removableMessageIDs'][] = $message['id']; |
|
477 | + if ($message['can_remove']) { |
|
478 | + $context['removableMessageIDs'][] = $message['id']; |
|
479 | + } |
|
462 | 480 | |
463 | 481 | // Are we ignoring this message? |
464 | 482 | if (!empty($message['is_ignored'])) |
@@ -484,9 +502,10 @@ discard block |
||
484 | 502 | <div class="custom_fields_above_member"> |
485 | 503 | <ul class="nolist">'; |
486 | 504 | |
487 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
488 | - echo ' |
|
505 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
506 | + echo ' |
|
489 | 507 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
508 | + } |
|
490 | 509 | |
491 | 510 | echo ' |
492 | 511 | </ul> |
@@ -497,9 +516,10 @@ discard block |
||
497 | 516 | <h4>'; |
498 | 517 | |
499 | 518 | // Show online and offline buttons? |
500 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
501 | - echo ' |
|
519 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
520 | + echo ' |
|
502 | 521 | ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : ''; |
522 | + } |
|
503 | 523 | |
504 | 524 | |
505 | 525 | // Show a link to the member's profile. |
@@ -512,51 +532,59 @@ discard block |
||
512 | 532 | |
513 | 533 | |
514 | 534 | // Show the user's avatar. |
515 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
516 | - echo ' |
|
535 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
536 | + echo ' |
|
517 | 537 | <li class="avatar"> |
518 | 538 | <a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a> |
519 | 539 | </li>'; |
540 | + } |
|
520 | 541 | |
521 | 542 | // Are there any custom fields below the avatar? |
522 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
523 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
543 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
544 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
524 | 545 | echo ' |
525 | 546 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
547 | + } |
|
526 | 548 | |
527 | 549 | // Show the post group icons, but not for guests. |
528 | - if (!$message['member']['is_guest']) |
|
529 | - echo ' |
|
550 | + if (!$message['member']['is_guest']) { |
|
551 | + echo ' |
|
530 | 552 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
553 | + } |
|
531 | 554 | |
532 | 555 | // Show the member's primary group (like 'Administrator') if they have one. |
533 | - if (!empty($message['member']['group'])) |
|
534 | - echo ' |
|
556 | + if (!empty($message['member']['group'])) { |
|
557 | + echo ' |
|
535 | 558 | <li class="membergroup">', $message['member']['group'], '</li>'; |
559 | + } |
|
536 | 560 | |
537 | 561 | // Show the member's custom title, if they have one. |
538 | - if (!empty($message['member']['title'])) |
|
539 | - echo ' |
|
562 | + if (!empty($message['member']['title'])) { |
|
563 | + echo ' |
|
540 | 564 | <li class="title">', $message['member']['title'], '</li>'; |
565 | + } |
|
541 | 566 | |
542 | 567 | // Don't show these things for guests. |
543 | 568 | if (!$message['member']['is_guest']) |
544 | 569 | { |
545 | 570 | |
546 | 571 | // 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. |
547 | - if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) |
|
548 | - echo ' |
|
572 | + if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) { |
|
573 | + echo ' |
|
549 | 574 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
575 | + } |
|
550 | 576 | |
551 | 577 | // Show how many posts they have made. |
552 | - if (!isset($context['disabled_fields']['posts'])) |
|
553 | - echo ' |
|
578 | + if (!isset($context['disabled_fields']['posts'])) { |
|
579 | + echo ' |
|
554 | 580 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
581 | + } |
|
555 | 582 | |
556 | 583 | // Show their personal text? |
557 | - if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) |
|
558 | - echo ' |
|
584 | + if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) { |
|
585 | + echo ' |
|
559 | 586 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
587 | + } |
|
560 | 588 | |
561 | 589 | // Any custom fields to show as icons? |
562 | 590 | if (!empty($message['custom_fields']['icons'])) |
@@ -565,9 +593,10 @@ discard block |
||
565 | 593 | <li class="im_icons"> |
566 | 594 | <ol>'; |
567 | 595 | |
568 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
569 | - echo ' |
|
596 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
597 | + echo ' |
|
570 | 598 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
599 | + } |
|
571 | 600 | |
572 | 601 | echo ' |
573 | 602 | </ol> |
@@ -582,19 +611,22 @@ discard block |
||
582 | 611 | <ol class="profile_icons">'; |
583 | 612 | |
584 | 613 | // Don't show an icon if they haven't specified a website. |
585 | - if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) |
|
586 | - echo ' |
|
614 | + if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) { |
|
615 | + echo ' |
|
587 | 616 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
617 | + } |
|
588 | 618 | |
589 | 619 | // Since we know this person isn't a guest, you *can* message them. |
590 | - if ($context['can_send_pm']) |
|
591 | - echo ' |
|
620 | + if ($context['can_send_pm']) { |
|
621 | + echo ' |
|
592 | 622 | <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>'; |
623 | + } |
|
593 | 624 | |
594 | 625 | // Show the email if necessary |
595 | - if (!empty($message['member']['email']) && $message['member']['show_email']) |
|
596 | - echo ' |
|
626 | + if (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
627 | + echo ' |
|
597 | 628 | <li class="email"><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>'; |
629 | + } |
|
598 | 630 | |
599 | 631 | echo ' |
600 | 632 | </ol> |
@@ -602,48 +634,56 @@ discard block |
||
602 | 634 | } |
603 | 635 | |
604 | 636 | // Any custom fields for standard placement? |
605 | - if (!empty($message['custom_fields']['standard'])) |
|
606 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
637 | + if (!empty($message['custom_fields']['standard'])) { |
|
638 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
607 | 639 | echo ' |
608 | 640 | <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
641 | + } |
|
609 | 642 | |
610 | 643 | } |
611 | 644 | // Otherwise, show the guest's email. |
612 | - elseif (!empty($message['member']['email']) && $message['member']['show_email']) |
|
613 | - echo ' |
|
645 | + elseif (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
646 | + echo ' |
|
614 | 647 | <li class="email"><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>'; |
648 | + } |
|
615 | 649 | |
616 | 650 | // Show the IP to this user for this post - because you can moderate? |
617 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
618 | - echo ' |
|
651 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
652 | + echo ' |
|
619 | 653 | <li class="poster_ip"><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></li>'; |
654 | + } |
|
620 | 655 | |
621 | 656 | // Or, should we show it because this is you? |
622 | - elseif ($message['can_see_ip']) |
|
623 | - echo ' |
|
657 | + elseif ($message['can_see_ip']) { |
|
658 | + echo ' |
|
624 | 659 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
660 | + } |
|
625 | 661 | |
626 | 662 | // Okay, are you at least logged in? Then we can show something about why IPs are logged... |
627 | - elseif (!$context['user']['is_guest']) |
|
628 | - echo ' |
|
663 | + elseif (!$context['user']['is_guest']) { |
|
664 | + echo ' |
|
629 | 665 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
666 | + } |
|
630 | 667 | |
631 | 668 | // Otherwise, you see NOTHING! |
632 | - else |
|
633 | - echo ' |
|
669 | + else { |
|
670 | + echo ' |
|
634 | 671 | <li class="poster_ip">', $txt['logged'], '</li>'; |
672 | + } |
|
635 | 673 | |
636 | 674 | // Are we showing the warning status? |
637 | 675 | // Don't show these things for guests. |
638 | - if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) |
|
639 | - echo ' |
|
676 | + if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) { |
|
677 | + echo ' |
|
640 | 678 | <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>'; |
679 | + } |
|
641 | 680 | |
642 | 681 | // Are there any custom fields to show at the bottom of the poster info? |
643 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
644 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
682 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
683 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
645 | 684 | echo ' |
646 | 685 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
686 | + } |
|
647 | 687 | |
648 | 688 | // Poster info ends. |
649 | 689 | echo ' |
@@ -672,9 +712,10 @@ discard block |
||
672 | 712 | echo ' |
673 | 713 | <span class="smalltext modified" id="modified_', $message['id'], '">'; |
674 | 714 | |
675 | - if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
|
676 | - echo |
|
715 | + if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) { |
|
716 | + echo |
|
677 | 717 | $message['modified']['last_edit_text']; |
718 | + } |
|
678 | 719 | |
679 | 720 | echo ' |
680 | 721 | </span>'; |
@@ -685,22 +726,24 @@ discard block |
||
685 | 726 | </div>'; |
686 | 727 | |
687 | 728 | // Ignoring this user? Hide the post. |
688 | - if ($ignoring) |
|
689 | - echo ' |
|
729 | + if ($ignoring) { |
|
730 | + echo ' |
|
690 | 731 | <div id="msg_', $message['id'], '_ignored_prompt"> |
691 | 732 | ', $txt['ignoring_user'], ' |
692 | 733 | <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
693 | 734 | </div>'; |
735 | + } |
|
694 | 736 | |
695 | 737 | // Show the post itself, finally! |
696 | 738 | echo ' |
697 | 739 | <div class="post">'; |
698 | 740 | |
699 | - if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) |
|
700 | - echo ' |
|
741 | + if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { |
|
742 | + echo ' |
|
701 | 743 | <div class="approve_post"> |
702 | 744 | ', $txt['post_awaiting_approval'], ' |
703 | 745 | </div>'; |
746 | + } |
|
704 | 747 | echo ' |
705 | 748 | <div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div> |
706 | 749 | </div>'; |
@@ -717,9 +760,9 @@ discard block |
||
717 | 760 | foreach ($message['attachment'] as $attachment) |
718 | 761 | { |
719 | 762 | // Do we want this attachment to not be showed here? |
720 | - if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) |
|
721 | - continue; |
|
722 | - elseif (!$div_output) |
|
763 | + if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) { |
|
764 | + continue; |
|
765 | + } elseif (!$div_output) |
|
723 | 766 | { |
724 | 767 | $div_output = true; |
725 | 768 | |
@@ -735,9 +778,10 @@ discard block |
||
735 | 778 | <fieldset> |
736 | 779 | <legend>', $txt['attach_awaiting_approve']; |
737 | 780 | |
738 | - if ($context['can_approve']) |
|
739 | - echo ' |
|
781 | + if ($context['can_approve']) { |
|
782 | + echo ' |
|
740 | 783 | [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; |
784 | + } |
|
741 | 785 | |
742 | 786 | echo ' |
743 | 787 | </legend>'; |
@@ -751,12 +795,13 @@ discard block |
||
751 | 795 | echo ' |
752 | 796 | <div class="attachments_top">'; |
753 | 797 | |
754 | - if ($attachment['thumbnail']['has_thumb']) |
|
755 | - echo ' |
|
798 | + if ($attachment['thumbnail']['has_thumb']) { |
|
799 | + echo ' |
|
756 | 800 | <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>'; |
757 | - else |
|
758 | - echo ' |
|
801 | + } else { |
|
802 | + echo ' |
|
759 | 803 | <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">'; |
804 | + } |
|
760 | 805 | |
761 | 806 | echo ' |
762 | 807 | </div>'; |
@@ -766,9 +811,10 @@ discard block |
||
766 | 811 | <div class="attachments_bot"> |
767 | 812 | <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*"> ' . $attachment['name'] . '</a> '; |
768 | 813 | |
769 | - if (!$attachment['is_approved'] && $context['can_approve']) |
|
770 | - echo ' |
|
814 | + if (!$attachment['is_approved'] && $context['can_approve']) { |
|
815 | + echo ' |
|
771 | 816 | [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] '; |
817 | + } |
|
772 | 818 | echo ' |
773 | 819 | <br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), ' |
774 | 820 | </div>'; |
@@ -777,33 +823,38 @@ discard block |
||
777 | 823 | </div>'; |
778 | 824 | |
779 | 825 | // Next attachment line ? |
780 | - if (++$i % $attachments_per_line === 0) |
|
781 | - echo ' |
|
826 | + if (++$i % $attachments_per_line === 0) { |
|
827 | + echo ' |
|
782 | 828 | <br>'; |
829 | + } |
|
783 | 830 | } |
784 | 831 | |
785 | 832 | // If we had unapproved attachments clean up. |
786 | - if ($last_approved_state == 0) |
|
787 | - echo ' |
|
833 | + if ($last_approved_state == 0) { |
|
834 | + echo ' |
|
788 | 835 | </fieldset>'; |
836 | + } |
|
789 | 837 | |
790 | 838 | // Only do this if we output a div above - otherwise it'll break things |
791 | - if ($div_output) |
|
792 | - echo ' |
|
839 | + if ($div_output) { |
|
840 | + echo ' |
|
793 | 841 | </div>'; |
842 | + } |
|
794 | 843 | } |
795 | 844 | |
796 | 845 | // And stuff below the attachments. |
797 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
798 | - echo ' |
|
846 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
847 | + echo ' |
|
799 | 848 | <div class="under_message">'; |
849 | + } |
|
800 | 850 | |
801 | 851 | // Maybe they want to report this post to the moderator(s)? |
802 | - if ($context['can_report_moderator']) |
|
803 | - echo ' |
|
852 | + if ($context['can_report_moderator']) { |
|
853 | + echo ' |
|
804 | 854 | <ul class="floatright smalltext"> |
805 | 855 | <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li> |
806 | 856 | </ul>'; |
857 | + } |
|
807 | 858 | |
808 | 859 | // What about likes? |
809 | 860 | if (!empty($modSettings['enable_likes'])) |
@@ -844,78 +895,91 @@ discard block |
||
844 | 895 | <ul class="quickbuttons">'; |
845 | 896 | |
846 | 897 | // Can they quote? if so they can select and quote as well! |
847 | - if ($context['can_quote']) |
|
848 | - echo ' |
|
898 | + if ($context['can_quote']) { |
|
899 | + echo ' |
|
849 | 900 | <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li> |
850 | 901 | <li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>'; |
902 | + } |
|
851 | 903 | |
852 | 904 | // Can the user modify the contents of this post? Show the modify inline image. |
853 | - if ($message['can_modify']) |
|
854 | - echo ' |
|
905 | + if ($message['can_modify']) { |
|
906 | + echo ' |
|
855 | 907 | <li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>'; |
908 | + } |
|
856 | 909 | |
857 | - if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
858 | - echo ' |
|
910 | + if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
911 | + echo ' |
|
859 | 912 | <li class="post_options">', $txt['post_options']; |
913 | + } |
|
860 | 914 | |
861 | 915 | echo ' |
862 | 916 | <ul>'; |
863 | 917 | |
864 | 918 | // Can the user modify the contents of this post? |
865 | - if ($message['can_modify']) |
|
866 | - echo ' |
|
919 | + if ($message['can_modify']) { |
|
920 | + echo ' |
|
867 | 921 | <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>'; |
922 | + } |
|
868 | 923 | |
869 | 924 | // How about... even... remove it entirely?! |
870 | - if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) |
|
871 | - echo ' |
|
925 | + if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) { |
|
926 | + echo ' |
|
872 | 927 | <li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'], '</a></li>'; |
873 | - elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) |
|
874 | - echo ' |
|
928 | + } elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) { |
|
929 | + echo ' |
|
875 | 930 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
931 | + } |
|
876 | 932 | |
877 | 933 | // What about splitting it off the rest of the topic? |
878 | - if ($context['can_split'] && !empty($context['real_num_replies'])) |
|
879 | - echo ' |
|
934 | + if ($context['can_split'] && !empty($context['real_num_replies'])) { |
|
935 | + echo ' |
|
880 | 936 | <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>'; |
937 | + } |
|
881 | 938 | |
882 | 939 | // Can we issue a warning because of this post? Remember, we can't give guests warnings. |
883 | - if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) |
|
884 | - echo ' |
|
940 | + if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) { |
|
941 | + echo ' |
|
885 | 942 | <li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>'; |
943 | + } |
|
886 | 944 | |
887 | 945 | // Can we restore topics? |
888 | - if ($context['can_restore_msg']) |
|
889 | - echo ' |
|
946 | + if ($context['can_restore_msg']) { |
|
947 | + echo ' |
|
890 | 948 | <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>'; |
949 | + } |
|
891 | 950 | |
892 | 951 | // Maybe we can approve it, maybe we should? |
893 | - if ($message['can_approve']) |
|
894 | - echo ' |
|
952 | + if ($message['can_approve']) { |
|
953 | + echo ' |
|
895 | 954 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>'; |
955 | + } |
|
896 | 956 | |
897 | 957 | // Maybe we can unapprove it? |
898 | - if ($message['can_unapprove']) |
|
899 | - echo ' |
|
958 | + if ($message['can_unapprove']) { |
|
959 | + echo ' |
|
900 | 960 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>'; |
961 | + } |
|
901 | 962 | |
902 | 963 | echo ' |
903 | 964 | </ul> |
904 | 965 | </li>'; |
905 | 966 | |
906 | 967 | // Show a checkbox for quick moderation? |
907 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) |
|
908 | - echo ' |
|
968 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { |
|
969 | + echo ' |
|
909 | 970 | <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; |
971 | + } |
|
910 | 972 | |
911 | - if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
912 | - echo ' |
|
973 | + if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
974 | + echo ' |
|
913 | 975 | </ul>'; |
976 | + } |
|
914 | 977 | } |
915 | 978 | |
916 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
917 | - echo ' |
|
979 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
980 | + echo ' |
|
918 | 981 | </div>'; |
982 | + } |
|
919 | 983 | |
920 | 984 | echo ' |
921 | 985 | </div> |
@@ -928,9 +992,10 @@ discard block |
||
928 | 992 | <div class="custom_fields_above_signature"> |
929 | 993 | <ul class="nolist">'; |
930 | 994 | |
931 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
932 | - echo ' |
|
995 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
996 | + echo ' |
|
933 | 997 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
998 | + } |
|
934 | 999 | |
935 | 1000 | echo ' |
936 | 1001 | </ul> |
@@ -938,9 +1003,10 @@ discard block |
||
938 | 1003 | } |
939 | 1004 | |
940 | 1005 | // Show the member's signature? |
941 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
942 | - echo ' |
|
1006 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
1007 | + echo ' |
|
943 | 1008 | <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>'; |
1009 | + } |
|
944 | 1010 | |
945 | 1011 | |
946 | 1012 | // Are there any custom profile fields for below the signature? |
@@ -950,9 +1016,10 @@ discard block |
||
950 | 1016 | <div class="custom_fields_below_signature"> |
951 | 1017 | <ul class="nolist">'; |
952 | 1018 | |
953 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
954 | - echo ' |
|
1019 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
1020 | + echo ' |
|
955 | 1021 | <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
1022 | + } |
|
956 | 1023 | |
957 | 1024 | echo ' |
958 | 1025 | </ul> |
@@ -1000,8 +1067,8 @@ discard block |
||
1000 | 1067 | <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">'; |
1001 | 1068 | |
1002 | 1069 | // Guests just need more. |
1003 | - if ($context['user']['is_guest']) |
|
1004 | - echo ' |
|
1070 | + if ($context['user']['is_guest']) { |
|
1071 | + echo ' |
|
1005 | 1072 | <dl id="post_header"> |
1006 | 1073 | <dt> |
1007 | 1074 | ', $txt['name'], ': |
@@ -1016,6 +1083,7 @@ discard block |
||
1016 | 1083 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required> |
1017 | 1084 | </dd> |
1018 | 1085 | </dl>'; |
1086 | + } |
|
1019 | 1087 | |
1020 | 1088 | echo ' |
1021 | 1089 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' |
@@ -1063,8 +1131,8 @@ discard block |
||
1063 | 1131 | <br class="clear">'; |
1064 | 1132 | |
1065 | 1133 | // draft autosave available and the user has it enabled? |
1066 | - if (!empty($context['drafts_autosave'])) |
|
1067 | - echo ' |
|
1134 | + if (!empty($context['drafts_autosave'])) { |
|
1135 | + echo ' |
|
1068 | 1136 | <script> |
1069 | 1137 | var oDraftAutoSave = new smf_DraftAutoSave({ |
1070 | 1138 | sSelf: \'oDraftAutoSave\', |
@@ -1076,10 +1144,12 @@ discard block |
||
1076 | 1144 | iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), ' |
1077 | 1145 | }); |
1078 | 1146 | </script>'; |
1147 | + } |
|
1079 | 1148 | |
1080 | - if ($context['show_spellchecking']) |
|
1081 | - echo ' |
|
1149 | + if ($context['show_spellchecking']) { |
|
1150 | + echo ' |
|
1082 | 1151 | <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>'; |
1152 | + } |
|
1083 | 1153 | |
1084 | 1154 | echo ' |
1085 | 1155 | <script> |