@@ -54,9 +54,10 @@ discard block |
||
54 | 54 | <dd> |
55 | 55 | <div id="known_themes_list">'; |
56 | 56 | |
57 | - foreach ($context['themes'] as $theme) |
|
58 | - echo ' |
|
57 | + foreach ($context['themes'] as $theme) { |
|
58 | + echo ' |
|
59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $theme['name'], '</label><br>'; |
60 | + } |
|
60 | 61 | |
61 | 62 | echo ' |
62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
74 | 75 | |
75 | 76 | // Put an option for each theme in the select box. |
76 | - foreach ($context['themes'] as $theme) |
|
77 | - echo ' |
|
77 | + foreach ($context['themes'] as $theme) { |
|
78 | + echo ' |
|
78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
80 | + } |
|
79 | 81 | |
80 | 82 | echo ' |
81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
91 | 93 | |
92 | 94 | // Same thing, this time for changing the theme of everyone. |
93 | - foreach ($context['themes'] as $theme) |
|
94 | - echo ' |
|
95 | + foreach ($context['themes'] as $theme) { |
|
96 | + echo ' |
|
95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
98 | + } |
|
96 | 99 | |
97 | 100 | echo ' |
98 | 101 | </select> |
@@ -187,11 +190,12 @@ discard block |
||
187 | 190 | global $context, $scripturl, $txt; |
188 | 191 | |
189 | 192 | // Show a nice confirmation message. |
190 | - if (isset($_GET['done'])) |
|
191 | - echo ' |
|
193 | + if (isset($_GET['done'])) { |
|
194 | + echo ' |
|
192 | 195 | <div class="infobox"> |
193 | 196 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
194 | 197 | </div>'; |
198 | + } |
|
195 | 199 | |
196 | 200 | echo ' |
197 | 201 | <div id="admincenter"> |
@@ -354,11 +358,12 @@ discard block |
||
354 | 358 | if (empty($setting) || !is_array($setting)) |
355 | 359 | { |
356 | 360 | // Insert a separator (unless this is the first item in the list) |
357 | - if ($i !== $first_option_key) |
|
358 | - echo ' |
|
361 | + if ($i !== $first_option_key) { |
|
362 | + echo ' |
|
359 | 363 | </dl> |
360 | 364 | <hr> |
361 | 365 | <dl class="settings">'; |
366 | + } |
|
362 | 367 | |
363 | 368 | // Should we give a name to this section? |
364 | 369 | if (is_string($setting) && !empty($setting)) |
@@ -367,9 +372,9 @@ discard block |
||
367 | 372 | echo ' |
368 | 373 | <dt><strong>' . $setting . '</strong></dt> |
369 | 374 | <dd></dd>'; |
375 | + } else { |
|
376 | + $titled_section = false; |
|
370 | 377 | } |
371 | - else |
|
372 | - $titled_section = false; |
|
373 | 378 | |
374 | 379 | continue; |
375 | 380 | } |
@@ -378,8 +383,8 @@ discard block |
||
378 | 383 | <dt>'; |
379 | 384 | |
380 | 385 | // Show the change option box? |
381 | - if ($context['theme_options_reset']) |
|
382 | - echo ' |
|
386 | + if ($context['theme_options_reset']) { |
|
387 | + echo ' |
|
383 | 388 | <span class="floatleft"> |
384 | 389 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
385 | 390 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -387,23 +392,26 @@ discard block |
||
387 | 392 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
388 | 393 | </select> |
389 | 394 | </span>'; |
395 | + } |
|
390 | 396 | |
391 | 397 | echo ' |
392 | 398 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
393 | 399 | |
394 | - if (isset($setting['description'])) |
|
395 | - echo ' |
|
400 | + if (isset($setting['description'])) { |
|
401 | + echo ' |
|
396 | 402 | <br> |
397 | 403 | <span class="smalltext">', $setting['description'], '</span>'; |
404 | + } |
|
398 | 405 | echo ' |
399 | 406 | </dt>'; |
400 | 407 | |
401 | 408 | // Display checkbox options |
402 | - if ($setting['type'] == 'checkbox') |
|
403 | - echo ' |
|
409 | + if ($setting['type'] == 'checkbox') { |
|
410 | + echo ' |
|
404 | 411 | <dd> |
405 | 412 | <input type="hidden" name="' . (!empty($setting['default']) ? 'default_' : '') . 'options[' . $setting['id'] . ']" value="0"> |
406 | 413 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', $context['theme_options_reset'] ? ' disabled' : '', ' value="1" class="floatleft">'; |
414 | + } |
|
407 | 415 | |
408 | 416 | // How about selection lists, we all love them |
409 | 417 | elseif ($setting['type'] == 'list') |
@@ -412,9 +420,10 @@ discard block |
||
412 | 420 | <dd> |
413 | 421 | <select class="floatleft" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
414 | 422 | |
415 | - foreach ($setting['options'] as $value => $label) |
|
416 | - echo ' |
|
423 | + foreach ($setting['options'] as $value => $label) { |
|
424 | + echo ' |
|
417 | 425 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
426 | + } |
|
418 | 427 | |
419 | 428 | echo ' |
420 | 429 | </select>'; |
@@ -433,14 +442,13 @@ discard block |
||
433 | 442 | |
434 | 443 | echo ' |
435 | 444 | <input type="number"', $min . $max . $step; |
436 | - } |
|
437 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
438 | - echo' |
|
445 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
446 | + echo' |
|
439 | 447 | <input type="url"'; |
440 | - |
|
441 | - else |
|
442 | - echo ' |
|
448 | + } else { |
|
449 | + echo ' |
|
443 | 450 | <input type="text"'; |
451 | + } |
|
444 | 452 | |
445 | 453 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
446 | 454 | } |
@@ -479,8 +487,8 @@ discard block |
||
479 | 487 | <br>'; |
480 | 488 | |
481 | 489 | // @todo Why can't I edit the default theme popup. |
482 | - if ($context['theme_settings']['theme_id'] != 1) |
|
483 | - echo ' |
|
490 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
491 | + echo ' |
|
484 | 492 | <div class="cat_bar"> |
485 | 493 | <h3 class="catbg config_hd"> |
486 | 494 | ', $txt['theme_edit'], ' |
@@ -496,6 +504,7 @@ discard block |
||
496 | 504 | </li> |
497 | 505 | </ul> |
498 | 506 | </div>'; |
507 | + } |
|
499 | 508 | |
500 | 509 | echo ' |
501 | 510 | <div class="cat_bar"> |
@@ -549,9 +558,10 @@ discard block |
||
549 | 558 | <dd> |
550 | 559 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
551 | 560 | |
552 | - foreach ($context['theme_variants'] as $key => $variant) |
|
553 | - echo ' |
|
561 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
562 | + echo ' |
|
554 | 563 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
564 | + } |
|
555 | 565 | |
556 | 566 | echo ' |
557 | 567 | </select> |
@@ -587,11 +597,12 @@ discard block |
||
587 | 597 | if (empty($setting) || !is_array($setting)) |
588 | 598 | { |
589 | 599 | // We don't need a separator before the first list element |
590 | - if ($i !== $first_setting_key) |
|
591 | - echo ' |
|
600 | + if ($i !== $first_setting_key) { |
|
601 | + echo ' |
|
592 | 602 | </dl> |
593 | 603 | <hr> |
594 | 604 | <dl class="settings">'; |
605 | + } |
|
595 | 606 | |
596 | 607 | // Add a fake heading? |
597 | 608 | if (is_string($setting) && !empty($setting)) |
@@ -600,9 +611,9 @@ discard block |
||
600 | 611 | echo ' |
601 | 612 | <dt><strong>' . $setting . '</strong></dt> |
602 | 613 | <dd></dd>'; |
614 | + } else { |
|
615 | + $titled_section = false; |
|
603 | 616 | } |
604 | - else |
|
605 | - $titled_section = false; |
|
606 | 617 | |
607 | 618 | continue; |
608 | 619 | } |
@@ -611,20 +622,22 @@ discard block |
||
611 | 622 | <dt> |
612 | 623 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
613 | 624 | |
614 | - if (isset($setting['description'])) |
|
615 | - echo '<br> |
|
625 | + if (isset($setting['description'])) { |
|
626 | + echo '<br> |
|
616 | 627 | <span class="smalltext">', $setting['description'], '</span>'; |
628 | + } |
|
617 | 629 | |
618 | 630 | echo ' |
619 | 631 | </dt>'; |
620 | 632 | |
621 | 633 | // A checkbox? |
622 | - if ($setting['type'] == 'checkbox') |
|
623 | - echo ' |
|
634 | + if ($setting['type'] == 'checkbox') { |
|
635 | + echo ' |
|
624 | 636 | <dd> |
625 | 637 | <input type="hidden" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" value="0"> |
626 | 638 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', ' value="1"> |
627 | 639 | </dd>'; |
640 | + } |
|
628 | 641 | |
629 | 642 | // A list with options? |
630 | 643 | elseif ($setting['type'] == 'list') |
@@ -633,9 +646,10 @@ discard block |
||
633 | 646 | <dd> |
634 | 647 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
635 | 648 | |
636 | - foreach ($setting['options'] as $value => $label) |
|
637 | - echo ' |
|
649 | + foreach ($setting['options'] as $value => $label) { |
|
650 | + echo ' |
|
638 | 651 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
652 | + } |
|
639 | 653 | |
640 | 654 | echo ' |
641 | 655 | </select> |
@@ -663,14 +677,13 @@ discard block |
||
663 | 677 | |
664 | 678 | echo ' |
665 | 679 | <input type="number"', $min . $max . $step; |
666 | - } |
|
667 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
668 | - echo' |
|
680 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
681 | + echo' |
|
669 | 682 | <input type="url"'; |
670 | - |
|
671 | - else |
|
672 | - echo ' |
|
683 | + } else { |
|
684 | + echo ' |
|
673 | 685 | <input type="text"'; |
686 | + } |
|
674 | 687 | |
675 | 688 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : (empty($settings['size']) ? ' size="40"' : ' size="' . $setting['size'] . '"'), '> |
676 | 689 | </dd>'; |
@@ -742,9 +755,10 @@ discard block |
||
742 | 755 | <label for="variant', $theme['id'], '"><strong>', $theme['pick_label'], '</strong></label>: |
743 | 756 | <select id="variant', $theme['id'], '" name="vrt[', $theme['id'], ']" onchange="changeVariant', $theme['id'], '(this.value);">'; |
744 | 757 | |
745 | - foreach ($theme['variants'] as $key => $variant) |
|
746 | - echo ' |
|
758 | + foreach ($theme['variants'] as $key => $variant) { |
|
759 | + echo ' |
|
747 | 760 | <option value="', $key, '"', $theme['selected_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
761 | + } |
|
748 | 762 | |
749 | 763 | echo ' |
750 | 764 | </select> |
@@ -822,21 +836,23 @@ discard block |
||
822 | 836 | <div class="windowbg">'; |
823 | 837 | |
824 | 838 | // Oops! there was an error :( |
825 | - if (!empty($context['error_message'])) |
|
826 | - echo ' |
|
839 | + if (!empty($context['error_message'])) { |
|
840 | + echo ' |
|
827 | 841 | <p> |
828 | 842 | ', $context['error_message'], ' |
829 | 843 | </p>'; |
844 | + } |
|
830 | 845 | |
831 | 846 | // Not much to show except a link back... |
832 | - else |
|
833 | - echo ' |
|
847 | + else { |
|
848 | + echo ' |
|
834 | 849 | <p> |
835 | 850 | <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], ' |
836 | 851 | </p> |
837 | 852 | <p> |
838 | 853 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
839 | 854 | </p>'; |
855 | + } |
|
840 | 856 | |
841 | 857 | echo ' |
842 | 858 | </div><!-- .windowbg --> |
@@ -903,11 +919,12 @@ discard block |
||
903 | 919 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
904 | 920 | <span class="floatright">'; |
905 | 921 | |
906 | - if ($template['can_copy']) |
|
907 | - echo ' |
|
922 | + if ($template['can_copy']) { |
|
923 | + echo ' |
|
908 | 924 | <a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
909 | - else |
|
910 | - echo $txt['themeadmin_edit_no_copy']; |
|
925 | + } else { |
|
926 | + echo $txt['themeadmin_edit_no_copy']; |
|
927 | + } |
|
911 | 928 | |
912 | 929 | echo ' |
913 | 930 | </span> |
@@ -930,11 +947,12 @@ discard block |
||
930 | 947 | echo ' |
931 | 948 | <div id="admincenter">'; |
932 | 949 | |
933 | - if (!empty($context['browse_title'])) |
|
934 | - echo ' |
|
950 | + if (!empty($context['browse_title'])) { |
|
951 | + echo ' |
|
935 | 952 | <div class="cat_bar"> |
936 | 953 | <h3 class="catbg">', $context['browse_title'], '</h3> |
937 | 954 | </div>'; |
955 | + } |
|
938 | 956 | |
939 | 957 | echo ' |
940 | 958 | <table class="table_grid tborder"> |
@@ -954,16 +972,15 @@ discard block |
||
954 | 972 | <tr class="windowbg"> |
955 | 973 | <td>'; |
956 | 974 | |
957 | - if ($file['is_editable']) |
|
958 | - echo ' |
|
975 | + if ($file['is_editable']) { |
|
976 | + echo ' |
|
959 | 977 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
960 | - |
|
961 | - elseif ($file['is_directory']) |
|
962 | - echo ' |
|
978 | + } elseif ($file['is_directory']) { |
|
979 | + echo ' |
|
963 | 980 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
964 | - |
|
965 | - else |
|
966 | - echo $file['filename']; |
|
981 | + } else { |
|
982 | + echo $file['filename']; |
|
983 | + } |
|
967 | 984 | |
968 | 985 | echo ' |
969 | 986 | </td> |
@@ -985,11 +1002,12 @@ discard block |
||
985 | 1002 | { |
986 | 1003 | global $context, $settings, $scripturl, $txt; |
987 | 1004 | |
988 | - if ($context['session_error']) |
|
989 | - echo ' |
|
1005 | + if ($context['session_error']) { |
|
1006 | + echo ' |
|
990 | 1007 | <div class="errorbox"> |
991 | 1008 | ', $txt['error_session_timeout'], ' |
992 | 1009 | </div>'; |
1010 | + } |
|
993 | 1011 | |
994 | 1012 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
995 | 1013 | echo ' |
@@ -1053,17 +1071,18 @@ discard block |
||
1053 | 1071 | { |
1054 | 1072 | '; |
1055 | 1073 | |
1056 | - if (isBrowser('is_ie')) |
|
1057 | - echo ' |
|
1074 | + if (isBrowser('is_ie')) { |
|
1075 | + echo ' |
|
1058 | 1076 | var sheets = frames["css_preview_box"].document.styleSheets; |
1059 | 1077 | for (var j = 0; j < sheets.length; j++) |
1060 | 1078 | { |
1061 | 1079 | if (sheets[j].id == "css_preview_box") |
1062 | 1080 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
1063 | 1081 | }'; |
1064 | - else |
|
1065 | - echo ' |
|
1082 | + } else { |
|
1083 | + echo ' |
|
1066 | 1084 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
1085 | + } |
|
1067 | 1086 | echo ' |
1068 | 1087 | } |
1069 | 1088 | catch (e) |
@@ -1115,9 +1134,10 @@ discard block |
||
1115 | 1134 | </div> |
1116 | 1135 | <div class="windowbg">'; |
1117 | 1136 | |
1118 | - if (!$context['allow_save']) |
|
1119 | - echo ' |
|
1137 | + if (!$context['allow_save']) { |
|
1138 | + echo ' |
|
1120 | 1139 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1140 | + } |
|
1121 | 1141 | |
1122 | 1142 | echo ' |
1123 | 1143 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1131,9 +1151,10 @@ discard block |
||
1131 | 1151 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1132 | 1152 | |
1133 | 1153 | // Hopefully it exists. |
1134 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1135 | - echo ' |
|
1154 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1155 | + echo ' |
|
1136 | 1156 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1157 | + } |
|
1137 | 1158 | |
1138 | 1159 | echo ' |
1139 | 1160 | </form> |
@@ -1147,18 +1168,20 @@ discard block |
||
1147 | 1168 | { |
1148 | 1169 | global $context, $scripturl, $txt; |
1149 | 1170 | |
1150 | - if ($context['session_error']) |
|
1151 | - echo ' |
|
1171 | + if ($context['session_error']) { |
|
1172 | + echo ' |
|
1152 | 1173 | <div class="errorbox"> |
1153 | 1174 | ', $txt['error_session_timeout'], ' |
1154 | 1175 | </div>'; |
1176 | + } |
|
1155 | 1177 | |
1156 | - if (isset($context['parse_error'])) |
|
1157 | - echo ' |
|
1178 | + if (isset($context['parse_error'])) { |
|
1179 | + echo ' |
|
1158 | 1180 | <div class="errorbox"> |
1159 | 1181 | ', $txt['themeadmin_edit_error'], ' |
1160 | 1182 | <div><pre>', $context['parse_error'], '</pre></div> |
1161 | 1183 | </div>'; |
1184 | + } |
|
1162 | 1185 | |
1163 | 1186 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1164 | 1187 | echo ' |
@@ -1169,16 +1192,18 @@ discard block |
||
1169 | 1192 | </div> |
1170 | 1193 | <div class="windowbg">'; |
1171 | 1194 | |
1172 | - if (!$context['allow_save']) |
|
1173 | - echo ' |
|
1195 | + if (!$context['allow_save']) { |
|
1196 | + echo ' |
|
1174 | 1197 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1198 | + } |
|
1175 | 1199 | |
1176 | - foreach ($context['file_parts'] as $part) |
|
1177 | - echo ' |
|
1200 | + foreach ($context['file_parts'] as $part) { |
|
1201 | + echo ' |
|
1178 | 1202 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
1179 | 1203 | <div class="centertext"> |
1180 | 1204 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
1181 | 1205 | </div>'; |
1206 | + } |
|
1182 | 1207 | |
1183 | 1208 | echo ' |
1184 | 1209 | <div class="padding righttext"> |
@@ -1187,9 +1212,10 @@ discard block |
||
1187 | 1212 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1188 | 1213 | |
1189 | 1214 | // Hopefully it exists. |
1190 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1191 | - echo ' |
|
1215 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1216 | + echo ' |
|
1192 | 1217 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1218 | + } |
|
1193 | 1219 | |
1194 | 1220 | echo ' |
1195 | 1221 | </div><!-- .righttext --> |
@@ -1205,18 +1231,20 @@ discard block |
||
1205 | 1231 | { |
1206 | 1232 | global $context, $scripturl, $txt; |
1207 | 1233 | |
1208 | - if ($context['session_error']) |
|
1209 | - echo ' |
|
1234 | + if ($context['session_error']) { |
|
1235 | + echo ' |
|
1210 | 1236 | <div class="errorbox"> |
1211 | 1237 | ', $txt['error_session_timeout'], ' |
1212 | 1238 | </div>'; |
1239 | + } |
|
1213 | 1240 | |
1214 | 1241 | // Is this file writeable? |
1215 | - if (!$context['allow_save']) |
|
1216 | - echo ' |
|
1242 | + if (!$context['allow_save']) { |
|
1243 | + echo ' |
|
1217 | 1244 | <div class="errorbox"> |
1218 | 1245 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
1219 | 1246 | </div>'; |
1247 | + } |
|
1220 | 1248 | |
1221 | 1249 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1222 | 1250 | echo ' |
@@ -1232,9 +1260,10 @@ discard block |
||
1232 | 1260 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1233 | 1261 | |
1234 | 1262 | // Hopefully it exists. |
1235 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1236 | - echo ' |
|
1263 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1264 | + echo ' |
|
1237 | 1265 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1266 | + } |
|
1238 | 1267 | |
1239 | 1268 | echo ' |
1240 | 1269 | </div><!-- .windowbg --> |
@@ -89,16 +89,18 @@ discard block |
||
89 | 89 | foreach ($section['areas'] as $i => $area) |
90 | 90 | { |
91 | 91 | // Not supposed to be printed? |
92 | - if (empty($area['label'])) |
|
93 | - continue; |
|
92 | + if (empty($area['label'])) { |
|
93 | + continue; |
|
94 | + } |
|
94 | 95 | |
95 | 96 | echo ' |
96 | 97 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '> |
97 | 98 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
98 | 99 | |
99 | 100 | // Is this the current area, or just some area? |
100 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
101 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
101 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
102 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
103 | + } |
|
102 | 104 | |
103 | 105 | // Are there any subsections? |
104 | 106 | if (!empty($area['subsections'])) |
@@ -108,8 +110,9 @@ discard block |
||
108 | 110 | |
109 | 111 | foreach ($area['subsections'] as $sa => $sub) |
110 | 112 | { |
111 | - if (!empty($sub['disabled'])) |
|
112 | - continue; |
|
113 | + if (!empty($sub['disabled'])) { |
|
114 | + continue; |
|
115 | + } |
|
113 | 116 | |
114 | 117 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
115 | 118 | |
@@ -156,8 +159,9 @@ discard block |
||
156 | 159 | <h3 class="catbg">'; |
157 | 160 | |
158 | 161 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
159 | - if (function_exists('template_admin_quick_search')) |
|
160 | - template_admin_quick_search(); |
|
162 | + if (function_exists('template_admin_quick_search')) { |
|
163 | + template_admin_quick_search(); |
|
164 | + } |
|
161 | 165 | |
162 | 166 | // Exactly how many tabs do we have? |
163 | 167 | if (!empty($context['tabs'])) |
@@ -172,30 +176,36 @@ discard block |
||
172 | 176 | } |
173 | 177 | |
174 | 178 | // Did this not even exist - or do we not have a label? |
175 | - if (!isset($tab_context['tabs'][$id])) |
|
176 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
177 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
178 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
179 | + if (!isset($tab_context['tabs'][$id])) { |
|
180 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
181 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
182 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
183 | + } |
|
179 | 184 | |
180 | 185 | // Has a custom URL defined in the main admin structure? |
181 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
182 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
186 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
187 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
188 | + } |
|
183 | 189 | |
184 | 190 | // Any additional paramaters for the url? |
185 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
186 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
191 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
192 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
193 | + } |
|
187 | 194 | |
188 | 195 | // Has it been deemed selected? |
189 | - if (!empty($tab['is_selected'])) |
|
190 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
196 | + if (!empty($tab['is_selected'])) { |
|
197 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
198 | + } |
|
191 | 199 | |
192 | 200 | // Does it have its own help? |
193 | - if (!empty($tab['help'])) |
|
194 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
201 | + if (!empty($tab['help'])) { |
|
202 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
203 | + } |
|
195 | 204 | |
196 | 205 | // Is this the last one? |
197 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
198 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
206 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
207 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
208 | + } |
|
199 | 209 | } |
200 | 210 | |
201 | 211 | // Find the selected tab |
@@ -212,22 +222,24 @@ discard block |
||
212 | 222 | // Show an icon and/or a help item? |
213 | 223 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
214 | 224 | { |
215 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
216 | - echo ' |
|
225 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
226 | + echo ' |
|
217 | 227 | <span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
218 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
219 | - echo ' |
|
228 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
229 | + echo ' |
|
220 | 230 | <img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
231 | + } |
|
221 | 232 | |
222 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
223 | - echo ' |
|
233 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
234 | + echo ' |
|
224 | 235 | <a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
236 | + } |
|
225 | 237 | |
226 | 238 | echo $tab_context['title']; |
227 | - } |
|
228 | - else |
|
229 | - echo ' |
|
239 | + } else { |
|
240 | + echo ' |
|
230 | 241 | ', $tab_context['title']; |
242 | + } |
|
231 | 243 | |
232 | 244 | echo ' |
233 | 245 | </h3>', (function_exists('template_admin_quick_search') ? ' |
@@ -236,11 +248,12 @@ discard block |
||
236 | 248 | } |
237 | 249 | |
238 | 250 | // Shall we use the tabs? Yes, it's the only known way! |
239 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
240 | - echo ' |
|
251 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
252 | + echo ' |
|
241 | 253 | <p class="information"> |
242 | 254 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
243 | 255 | </p>'; |
256 | + } |
|
244 | 257 | |
245 | 258 | // Print out all the items in this tab (if any). |
246 | 259 | if (!empty($context['tabs'])) |
@@ -252,19 +265,21 @@ discard block |
||
252 | 265 | |
253 | 266 | foreach ($tab_context['tabs'] as $sa => $tab) |
254 | 267 | { |
255 | - if (!empty($tab['disabled'])) |
|
256 | - continue; |
|
268 | + if (!empty($tab['disabled'])) { |
|
269 | + continue; |
|
270 | + } |
|
257 | 271 | |
258 | - if (!empty($tab['is_selected'])) |
|
259 | - echo ' |
|
272 | + if (!empty($tab['is_selected'])) { |
|
273 | + echo ' |
|
260 | 274 | <li> |
261 | 275 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
262 | 276 | </li>'; |
263 | - else |
|
264 | - echo ' |
|
277 | + } else { |
|
278 | + echo ' |
|
265 | 279 | <li> |
266 | 280 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
267 | 281 | </li>'; |
282 | + } |
|
268 | 283 | } |
269 | 284 | |
270 | 285 | // The end of tabs |
@@ -29,9 +29,10 @@ discard block |
||
29 | 29 | // Go through each type of report they can run. |
30 | 30 | foreach ($context['report_types'] as $type) |
31 | 31 | { |
32 | - if (isset($type['description'])) |
|
33 | - echo ' |
|
32 | + if (isset($type['description'])) { |
|
33 | + echo ' |
|
34 | 34 | <dt>', $type['description'], '</dt>'; |
35 | + } |
|
35 | 36 | |
36 | 37 | echo ' |
37 | 38 | <dd> |
@@ -62,8 +63,9 @@ discard block |
||
62 | 63 | </div> |
63 | 64 | <div id="report_buttons">'; |
64 | 65 | |
65 | - if (!empty($context['report_buttons'])) |
|
66 | - template_button_strip($context['report_buttons'], 'right'); |
|
66 | + if (!empty($context['report_buttons'])) { |
|
67 | + template_button_strip($context['report_buttons'], 'right'); |
|
68 | + } |
|
67 | 69 | |
68 | 70 | echo ' |
69 | 71 | </div>'; |
@@ -74,25 +76,27 @@ discard block |
||
74 | 76 | echo ' |
75 | 77 | <table class="table_grid report_results">'; |
76 | 78 | |
77 | - if (!empty($table['title'])) |
|
78 | - echo ' |
|
79 | + if (!empty($table['title'])) { |
|
80 | + echo ' |
|
79 | 81 | <thead> |
80 | 82 | <tr class="title_bar"> |
81 | 83 | <th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th> |
82 | 84 | </tr> |
83 | 85 | </thead> |
84 | 86 | <tbody>'; |
87 | + } |
|
85 | 88 | |
86 | 89 | // Now do each row! |
87 | 90 | $row_number = 0; |
88 | 91 | foreach ($table['data'] as $row) |
89 | 92 | { |
90 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
91 | - echo ' |
|
93 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
94 | + echo ' |
|
92 | 95 | <tr class="windowbg table_caption">'; |
93 | - else |
|
94 | - echo ' |
|
96 | + } else { |
|
97 | + echo ' |
|
95 | 98 | <tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">'; |
99 | + } |
|
96 | 100 | |
97 | 101 | // Now do each column. |
98 | 102 | $column_number = 0; |
@@ -110,16 +114,17 @@ discard block |
||
110 | 114 | } |
111 | 115 | |
112 | 116 | // Shaded? |
113 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
114 | - echo ' |
|
117 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
118 | + echo ' |
|
115 | 119 | <td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
116 | 120 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
117 | 121 | </td>'; |
118 | - else |
|
119 | - echo ' |
|
122 | + } else { |
|
123 | + echo ' |
|
120 | 124 | <td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
121 | 125 | ', $data['v'], ' |
122 | 126 | </td>'; |
127 | + } |
|
123 | 128 | |
124 | 129 | $column_number++; |
125 | 130 | } |
@@ -168,24 +173,26 @@ discard block |
||
168 | 173 | <div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '"> |
169 | 174 | <table class="bordercolor">'; |
170 | 175 | |
171 | - if (!empty($table['title'])) |
|
172 | - echo ' |
|
176 | + if (!empty($table['title'])) { |
|
177 | + echo ' |
|
173 | 178 | <tr class="title_bar"> |
174 | 179 | <td colspan="', $table['column_count'], '"> |
175 | 180 | ', $table['title'], ' |
176 | 181 | </td> |
177 | 182 | </tr>'; |
183 | + } |
|
178 | 184 | |
179 | 185 | // Now do each row! |
180 | 186 | $row_number = 0; |
181 | 187 | foreach ($table['data'] as $row) |
182 | 188 | { |
183 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
184 | - echo ' |
|
189 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
190 | + echo ' |
|
185 | 191 | <tr class="titlebg">'; |
186 | - else |
|
187 | - echo ' |
|
192 | + } else { |
|
193 | + echo ' |
|
188 | 194 | <tr class="windowbg">'; |
195 | + } |
|
189 | 196 | |
190 | 197 | // Now do each column!! |
191 | 198 | $column_number = 0; |
@@ -202,16 +209,17 @@ discard block |
||
202 | 209 | } |
203 | 210 | |
204 | 211 | // Shaded? |
205 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
206 | - echo ' |
|
212 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
213 | + echo ' |
|
207 | 214 | <td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
208 | 215 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
209 | 216 | </td>'; |
210 | - else |
|
211 | - echo ' |
|
217 | + } else { |
|
218 | + echo ' |
|
212 | 219 | <td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
213 | 220 | ', $data['v'], ' |
214 | 221 | </td>'; |
222 | + } |
|
215 | 223 | |
216 | 224 | $column_number++; |
217 | 225 | } |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | <div class="windowbg2 noup"> |
128 | 128 | <dl class="settings">'; |
129 | 129 | |
130 | - if (!empty($context['table_info'])) |
|
131 | - echo ' |
|
130 | + if (!empty($context['table_info'])) { |
|
131 | + echo ' |
|
132 | 132 | <dt> |
133 | 133 | <strong>', $txt['search_method_messages_table_space'], ':</strong> |
134 | 134 | </dt> |
@@ -141,6 +141,7 @@ discard block |
||
141 | 141 | <dd> |
142 | 142 | ', $context['table_info']['index_length'], ' |
143 | 143 | </dd>'; |
144 | + } |
|
144 | 145 | echo ' |
145 | 146 | </dl> |
146 | 147 | ', $context['double_index'] ? '<div class="noticebox"> |
@@ -163,17 +164,17 @@ discard block |
||
163 | 164 | <dd> |
164 | 165 | <span class="smalltext">'; |
165 | 166 | |
166 | - if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) |
|
167 | - echo ' |
|
167 | + if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) { |
|
168 | + echo ' |
|
168 | 169 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]'; |
169 | - |
|
170 | - elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) |
|
171 | - echo ' |
|
170 | + } elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) { |
|
171 | + echo ' |
|
172 | 172 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create']; |
173 | - else |
|
174 | - echo ' |
|
173 | + } else { |
|
174 | + echo ' |
|
175 | 175 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br> |
176 | 176 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length']; |
177 | + } |
|
177 | 178 | echo ' |
178 | 179 | </span> |
179 | 180 | </dd>'; |
@@ -187,26 +188,27 @@ discard block |
||
187 | 188 | <dd> |
188 | 189 | <span class="smalltext">'; |
189 | 190 | |
190 | - if ($context['custom_index']) |
|
191 | - echo ' |
|
191 | + if ($context['custom_index']) { |
|
192 | + echo ' |
|
192 | 193 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br> |
193 | 194 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
194 | - |
|
195 | - elseif ($context['partial_custom_index']) |
|
196 | - echo ' |
|
195 | + } elseif ($context['partial_custom_index']) { |
|
196 | + echo ' |
|
197 | 197 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br> |
198 | 198 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
199 | - else |
|
200 | - echo ' |
|
199 | + } else { |
|
200 | + echo ' |
|
201 | 201 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]'; |
202 | + } |
|
202 | 203 | echo ' |
203 | 204 | </span> |
204 | 205 | </dd>'; |
205 | 206 | |
206 | 207 | foreach ($context['search_apis'] as $api) |
207 | 208 | { |
208 | - if (empty($api['label']) || $api['has_template']) |
|
209 | - continue; |
|
209 | + if (empty($api['label']) || $api['has_template']) { |
|
210 | + continue; |
|
211 | + } |
|
210 | 212 | |
211 | 213 | echo ' |
212 | 214 | <dt> |
@@ -214,11 +216,12 @@ discard block |
||
214 | 216 | ', $api['label'], ' |
215 | 217 | </dt>'; |
216 | 218 | |
217 | - if ($api['desc']) |
|
218 | - echo ' |
|
219 | + if ($api['desc']) { |
|
220 | + echo ' |
|
219 | 221 | <dd> |
220 | 222 | <span class="smalltext">', $api['desc'], '</span> |
221 | 223 | </dd>'; |
224 | + } |
|
222 | 225 | } |
223 | 226 | |
224 | 227 | echo ' |
@@ -22,30 +22,32 @@ discard block |
||
22 | 22 | <div id="calendar">'; |
23 | 23 | |
24 | 24 | // Show the mini-blocks if they're enabled. |
25 | - if (empty($context['blocks_disabled'])) |
|
26 | - echo ' |
|
25 | + if (empty($context['blocks_disabled'])) { |
|
26 | + echo ' |
|
27 | 27 | <div id="month_grid"> |
28 | 28 | ', template_show_month_grid('prev', true), ' |
29 | 29 | ', template_show_month_grid('current', true), ' |
30 | 30 | ', template_show_month_grid('next', true), ' |
31 | 31 | </div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | // What view are we showing? |
34 | - if ($context['calendar_view'] == 'viewlist') |
|
35 | - echo ' |
|
35 | + if ($context['calendar_view'] == 'viewlist') { |
|
36 | + echo ' |
|
36 | 37 | <div id="main_grid"> |
37 | 38 | ', template_show_upcoming_list('main'), ' |
38 | 39 | </div>'; |
39 | - elseif ($context['calendar_view'] == 'viewweek') |
|
40 | - echo ' |
|
40 | + } elseif ($context['calendar_view'] == 'viewweek') { |
|
41 | + echo ' |
|
41 | 42 | <div id="main_grid"> |
42 | 43 | ', template_show_week_grid('main'), ' |
43 | 44 | </div>'; |
44 | - else |
|
45 | - echo ' |
|
45 | + } else { |
|
46 | + echo ' |
|
46 | 47 | <div id="main_grid"> |
47 | 48 | ', template_show_month_grid('main'), ' |
48 | 49 | </div>'; |
50 | + } |
|
49 | 51 | |
50 | 52 | // Close our wrapper. |
51 | 53 | echo ' |
@@ -64,20 +66,22 @@ discard block |
||
64 | 66 | global $context, $scripturl, $txt; |
65 | 67 | |
66 | 68 | // Bail out if we have nothing to work with |
67 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
68 | - return false; |
|
69 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
70 | + return false; |
|
71 | + } |
|
69 | 72 | |
70 | 73 | // Protect programmer sanity |
71 | 74 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
72 | 75 | |
73 | 76 | // Do we want a title? |
74 | - if (empty($calendar_data['disable_title'])) |
|
75 | - echo ' |
|
77 | + if (empty($calendar_data['disable_title'])) { |
|
78 | + echo ' |
|
76 | 79 | <div class="cat_bar"> |
77 | 80 | <h3 class="catbg centertext largetext"> |
78 | 81 | <a href="', $scripturl, '?action=calendar;viewlist;year=', $calendar_data['start_year'], ';month=', $calendar_data['start_month'], ';day=', $calendar_data['start_day'], '">', $txt['calendar_upcoming'], '</a> |
79 | 82 | </h3> |
80 | 83 | </div>'; |
84 | + } |
|
81 | 85 | |
82 | 86 | // Give the user some controls to work with |
83 | 87 | template_calendar_top($calendar_data); |
@@ -100,11 +104,13 @@ discard block |
||
100 | 104 | <li class="windowbg"> |
101 | 105 | <strong class="event_title">', $event['link'], '</strong>'; |
102 | 106 | |
103 | - if ($event['can_edit']) |
|
104 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
107 | + if ($event['can_edit']) { |
|
108 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
109 | + } |
|
105 | 110 | |
106 | - if ($event['can_export']) |
|
107 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
111 | + if ($event['can_export']) { |
|
112 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
113 | + } |
|
108 | 114 | |
109 | 115 | echo ' |
110 | 116 | <br>'; |
@@ -112,14 +118,14 @@ discard block |
||
112 | 118 | if (!empty($event['allday'])) |
113 | 119 | { |
114 | 120 | 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>' : ''; |
115 | - } |
|
116 | - else |
|
121 | + } else |
|
117 | 122 | { |
118 | 123 | // Display event info relative to user's local timezone |
119 | 124 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
120 | 125 | |
121 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
122 | - echo trim($event['end_date_local']) . ', '; |
|
126 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
127 | + echo trim($event['end_date_local']) . ', '; |
|
128 | + } |
|
123 | 129 | |
124 | 130 | echo trim($event['end_time_local']); |
125 | 131 | |
@@ -128,23 +134,27 @@ discard block |
||
128 | 134 | { |
129 | 135 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
130 | 136 | |
131 | - 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']) |
|
132 | - echo trim($event['start_date_orig']), ', '; |
|
137 | + 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']) { |
|
138 | + echo trim($event['start_date_orig']), ', '; |
|
139 | + } |
|
133 | 140 | |
134 | 141 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
135 | 142 | |
136 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
137 | - echo trim($event['end_date_orig']) . ', '; |
|
143 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
144 | + echo trim($event['end_date_orig']) . ', '; |
|
145 | + } |
|
138 | 146 | |
139 | 147 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
140 | 148 | } |
141 | 149 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
142 | - else |
|
143 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
150 | + else { |
|
151 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
152 | + } |
|
144 | 153 | } |
145 | 154 | |
146 | - if (!empty($event['location'])) |
|
147 | - echo '<br>', $event['location']; |
|
155 | + if (!empty($event['location'])) { |
|
156 | + echo '<br>', $event['location']; |
|
157 | + } |
|
148 | 158 | |
149 | 159 | echo ' |
150 | 160 | </li>'; |
@@ -176,8 +186,9 @@ discard block |
||
176 | 186 | |
177 | 187 | $birthdays = array(); |
178 | 188 | |
179 | - foreach ($date as $member) |
|
180 | - $birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>'; |
|
189 | + foreach ($date as $member) { |
|
190 | + $birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>'; |
|
191 | + } |
|
181 | 192 | |
182 | 193 | echo implode(', ', $birthdays); |
183 | 194 | |
@@ -208,8 +219,9 @@ discard block |
||
208 | 219 | $date_local = $date['date_local']; |
209 | 220 | unset($date['date_local']); |
210 | 221 | |
211 | - foreach ($date as $holiday) |
|
212 | - $holidays[] = $holiday . ' (' . $date_local . ')'; |
|
222 | + foreach ($date as $holiday) { |
|
223 | + $holidays[] = $holiday . ' (' . $date_local . ')'; |
|
224 | + } |
|
213 | 225 | } |
214 | 226 | |
215 | 227 | echo implode(', ', $holidays); |
@@ -233,17 +245,19 @@ discard block |
||
233 | 245 | global $context, $txt, $scripturl, $modSettings; |
234 | 246 | |
235 | 247 | // If the grid doesn't exist, no point in proceeding. |
236 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
237 | - return false; |
|
248 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
249 | + return false; |
|
250 | + } |
|
238 | 251 | |
239 | 252 | // A handy little pointer variable. |
240 | 253 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
241 | 254 | |
242 | 255 | // Some conditions for whether or not we should show the week links *here*. |
243 | - if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) |
|
244 | - $show_week_links = true; |
|
245 | - else |
|
246 | - $show_week_links = false; |
|
256 | + if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) { |
|
257 | + $show_week_links = true; |
|
258 | + } else { |
|
259 | + $show_week_links = false; |
|
260 | + } |
|
247 | 261 | |
248 | 262 | // Assuming that we've not disabled it, show the title block! |
249 | 263 | if (empty($calendar_data['disable_title'])) |
@@ -253,18 +267,20 @@ discard block |
||
253 | 267 | <h3 class="catbg centertext largetext">'; |
254 | 268 | |
255 | 269 | // Previous Link: If we're showing prev / next and it's not a mini-calendar. |
256 | - if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) |
|
257 | - echo ' |
|
270 | + if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) { |
|
271 | + echo ' |
|
258 | 272 | <span class="floatleft"> |
259 | 273 | <a href="', $calendar_data['previous_calendar']['href'], '">«</a> |
260 | 274 | </span>'; |
275 | + } |
|
261 | 276 | |
262 | 277 | // Next Link: if we're showing prev / next and it's not a mini-calendar. |
263 | - if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) |
|
264 | - echo ' |
|
278 | + if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) { |
|
279 | + echo ' |
|
265 | 280 | <span class="floatright"> |
266 | 281 | <a href="', $calendar_data['next_calendar']['href'], '">»</a> |
267 | 282 | </span>'; |
283 | + } |
|
268 | 284 | |
269 | 285 | // Arguably the most exciting part, the title! |
270 | 286 | echo ' |
@@ -274,8 +290,9 @@ discard block |
||
274 | 290 | } |
275 | 291 | |
276 | 292 | // Show the controls on main grids |
277 | - if ($is_mini === false) |
|
278 | - template_calendar_top($calendar_data); |
|
293 | + if ($is_mini === false) { |
|
294 | + template_calendar_top($calendar_data); |
|
295 | + } |
|
279 | 296 | |
280 | 297 | // Finally, the main calendar table. |
281 | 298 | echo ' |
@@ -288,14 +305,16 @@ discard block |
||
288 | 305 | <tr>'; |
289 | 306 | |
290 | 307 | // If we're showing week links, there's an extra column ahead of the week links, so let's think ahead and be prepared! |
291 | - if ($show_week_links === true) |
|
292 | - echo ' |
|
308 | + if ($show_week_links === true) { |
|
309 | + echo ' |
|
293 | 310 | <th></th>'; |
311 | + } |
|
294 | 312 | |
295 | 313 | // Now, loop through each actual day of the week. |
296 | - foreach ($calendar_data['week_days'] as $day) |
|
297 | - echo ' |
|
314 | + foreach ($calendar_data['week_days'] as $day) { |
|
315 | + echo ' |
|
298 | 316 | <th class="days" scope="col">', !empty($calendar_data['short_day_titles']) || $is_mini === true ? $txt['days_short'][$day] : $txt['days'][$day], '</th>'; |
317 | + } |
|
299 | 318 | |
300 | 319 | echo ' |
301 | 320 | </tr>'; |
@@ -314,11 +333,12 @@ discard block |
||
314 | 333 | <tr class="days_wrapper">'; |
315 | 334 | |
316 | 335 | // This is where we add the actual week link, if enabled on this location. |
317 | - if ($show_week_links === true) |
|
318 | - echo ' |
|
336 | + if ($show_week_links === true) { |
|
337 | + echo ' |
|
319 | 338 | <td class="windowbg2 weeks"> |
320 | 339 | <a href="', $scripturl, '?action=calendar;viewweek;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $week['days'][0]['day'], '" title="', $txt['calendar_view_week'], '">»</a> |
321 | 340 | </td>'; |
341 | + } |
|
322 | 342 | |
323 | 343 | // Now loop through each day in the week we're on. |
324 | 344 | foreach ($week['days'] as $day) |
@@ -335,27 +355,29 @@ discard block |
||
335 | 355 | // Additional classes are given for events, holidays, and birthdays. |
336 | 356 | if (!empty($day['events']) && !empty($calendar_data['highlight']['events'])) |
337 | 357 | { |
338 | - if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) |
|
339 | - $classes[] = 'events'; |
|
340 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) |
|
341 | - $classes[] = 'events'; |
|
358 | + if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) { |
|
359 | + $classes[] = 'events'; |
|
360 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) { |
|
361 | + $classes[] = 'events'; |
|
362 | + } |
|
342 | 363 | } |
343 | 364 | if (!empty($day['holidays']) && !empty($calendar_data['highlight']['holidays'])) |
344 | 365 | { |
345 | - if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) |
|
346 | - $classes[] = 'holidays'; |
|
347 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) |
|
348 | - $classes[] = 'holidays'; |
|
366 | + if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) { |
|
367 | + $classes[] = 'holidays'; |
|
368 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) { |
|
369 | + $classes[] = 'holidays'; |
|
370 | + } |
|
349 | 371 | } |
350 | 372 | if (!empty($day['birthdays']) && !empty($calendar_data['highlight']['birthdays'])) |
351 | 373 | { |
352 | - if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) |
|
353 | - $classes[] = 'birthdays'; |
|
354 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) |
|
355 | - $classes[] = 'birthdays'; |
|
374 | + if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) { |
|
375 | + $classes[] = 'birthdays'; |
|
376 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) { |
|
377 | + $classes[] = 'birthdays'; |
|
378 | + } |
|
356 | 379 | } |
357 | - } |
|
358 | - else |
|
380 | + } else |
|
359 | 381 | { |
360 | 382 | // Default Classes (either compact or comfortable and disabled). |
361 | 383 | $classes[] = !empty($calendar_data['size']) && $calendar_data['size'] == 'small' ? 'compact' : 'comfortable'; |
@@ -374,25 +396,27 @@ discard block |
||
374 | 396 | $title_prefix = !empty($day['is_first_of_month']) && $context['current_month'] == $calendar_data['current_month'] && $is_mini === false ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$calendar_data['current_month']] . ' ' : $txt['months_titles'][$calendar_data['current_month']] . ' ') : ''; |
375 | 397 | |
376 | 398 | // The actual day number - be it a link, or just plain old text! |
377 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
378 | - echo ' |
|
399 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
400 | + echo ' |
|
379 | 401 | <a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
380 | - elseif ($is_mini) |
|
381 | - echo ' |
|
402 | + } elseif ($is_mini) { |
|
403 | + echo ' |
|
382 | 404 | <a href="', $scripturl, '?action=calendar;', $context['calendar_view'], ';year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
383 | - else |
|
384 | - echo ' |
|
405 | + } else { |
|
406 | + echo ' |
|
385 | 407 | <span class="day_text">', $title_prefix, $day['day'], '</span>'; |
408 | + } |
|
386 | 409 | |
387 | 410 | // A lot of stuff, we're not showing on mini-calendars to conserve space. |
388 | 411 | if ($is_mini === false) |
389 | 412 | { |
390 | 413 | // Holidays are always fun, let's show them! |
391 | - if (!empty($day['holidays'])) |
|
392 | - echo ' |
|
414 | + if (!empty($day['holidays'])) { |
|
415 | + echo ' |
|
393 | 416 | <div class="smalltext holiday"> |
394 | 417 | <span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), ' |
395 | 418 | </div>'; |
419 | + } |
|
396 | 420 | |
397 | 421 | // Happy Birthday Dear Member! |
398 | 422 | if (!empty($day['birthdays'])) |
@@ -410,15 +434,17 @@ discard block |
||
410 | 434 | echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '"><span class="fix_rtl_names">', $member['name'], '</span>', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', '; |
411 | 435 | |
412 | 436 | // 9...10! Let's stop there. |
413 | - if ($birthday_count == 10 && $use_js_hide) |
|
414 | - // !!TODO - Inline CSS and JavaScript should be moved. |
|
437 | + if ($birthday_count == 10 && $use_js_hide) { |
|
438 | + // !!TODO - Inline CSS and JavaScript should be moved. |
|
415 | 439 | echo '<span class="hidelink" id="bdhidelink_', $day['day'], '">...<br><a href="', $scripturl, '?action=calendar;month=', $calendar_data['current_month'], ';year=', $calendar_data['current_year'], ';showbd" onclick="document.getElementById(\'bdhide_', $day['day'], '\').style.display = \'\'; document.getElementById(\'bdhidelink_', $day['day'], '\').style.display = \'none\'; return false;">(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ')</a></span><span id="bdhide_', $day['day'], '" style="display: none;">, '; |
440 | + } |
|
416 | 441 | |
417 | 442 | ++$birthday_count; |
418 | 443 | } |
419 | - if ($use_js_hide) |
|
420 | - echo ' |
|
444 | + if ($use_js_hide) { |
|
445 | + echo ' |
|
421 | 446 | </span>'; |
447 | + } |
|
422 | 448 | |
423 | 449 | echo ' |
424 | 450 | </div><!-- .smalltext -->'; |
@@ -429,8 +455,9 @@ discard block |
||
429 | 455 | { |
430 | 456 | // Sort events by start time (all day events will be listed first) |
431 | 457 | uasort($day['events'], function($a, $b) { |
432 | - if ($a['start_timestamp'] == $b['start_timestamp']) |
|
433 | - return 0; |
|
458 | + if ($a['start_timestamp'] == $b['start_timestamp']) { |
|
459 | + return 0; |
|
460 | + } |
|
434 | 461 | |
435 | 462 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
436 | 463 | }); |
@@ -450,20 +477,22 @@ discard block |
||
450 | 477 | ', $event['link'], '<br> |
451 | 478 | <span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">'; |
452 | 479 | |
453 | - if (!empty($event['start_time_local']) && $event['starts_today'] == true) |
|
454 | - echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); |
|
455 | - elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) |
|
456 | - echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); |
|
457 | - elseif (!empty($event['allday'])) |
|
458 | - echo $txt['calendar_allday']; |
|
480 | + if (!empty($event['start_time_local']) && $event['starts_today'] == true) { |
|
481 | + echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); |
|
482 | + } elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) { |
|
483 | + echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); |
|
484 | + } elseif (!empty($event['allday'])) { |
|
485 | + echo $txt['calendar_allday']; |
|
486 | + } |
|
459 | 487 | |
460 | 488 | echo ' |
461 | 489 | </span>'; |
462 | 490 | |
463 | - if (!empty($event['location'])) |
|
464 | - echo ' |
|
491 | + if (!empty($event['location'])) { |
|
492 | + echo ' |
|
465 | 493 | <br> |
466 | 494 | <span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>'; |
495 | + } |
|
467 | 496 | |
468 | 497 | if ($event['can_edit'] || $event['can_export']) |
469 | 498 | { |
@@ -471,18 +500,20 @@ discard block |
||
471 | 500 | <span class="modify_event_links">'; |
472 | 501 | |
473 | 502 | // If they can edit the event, show an icon they can click on.... |
474 | - if ($event['can_edit']) |
|
475 | - echo ' |
|
503 | + if ($event['can_edit']) { |
|
504 | + echo ' |
|
476 | 505 | <a class="modify_event" href="', $event['modify_href'], '"> |
477 | 506 | <span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span> |
478 | 507 | </a>'; |
508 | + } |
|
479 | 509 | |
480 | 510 | // Exporting! |
481 | - if ($event['can_export']) |
|
482 | - echo ' |
|
511 | + if ($event['can_export']) { |
|
512 | + echo ' |
|
483 | 513 | <a class="modify_event" href="', $event['export_href'], '"> |
484 | 514 | <span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span> |
485 | 515 | </a>'; |
516 | + } |
|
486 | 517 | |
487 | 518 | echo ' |
488 | 519 | </span><br class="clear">'; |
@@ -501,10 +532,11 @@ discard block |
||
501 | 532 | // Otherwise, assuming it's not a mini-calendar, we can show previous / next month days! |
502 | 533 | elseif ($is_mini === false) |
503 | 534 | { |
504 | - if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) |
|
505 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>'; |
|
506 | - elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) |
|
507 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
535 | + if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) { |
|
536 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>'; |
|
537 | + } elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) { |
|
538 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
539 | + } |
|
508 | 540 | } |
509 | 541 | |
510 | 542 | // Close this day and increase var count. |
@@ -534,8 +566,9 @@ discard block |
||
534 | 566 | global $context, $txt, $scripturl, $modSettings; |
535 | 567 | |
536 | 568 | // We might have no reason to proceed, if the variable isn't there. |
537 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
538 | - return false; |
|
569 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
570 | + return false; |
|
571 | + } |
|
539 | 572 | |
540 | 573 | // Handy pointer. |
541 | 574 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
@@ -552,22 +585,25 @@ discard block |
||
552 | 585 | <h3 class="catbg centertext largetext">'; |
553 | 586 | |
554 | 587 | // Previous Week Link... |
555 | - if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) |
|
556 | - echo ' |
|
588 | + if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) { |
|
589 | + echo ' |
|
557 | 590 | <span class="floatleft"> |
558 | 591 | <a href="', $calendar_data['previous_week']['href'], '">«</a> |
559 | 592 | </span>'; |
593 | + } |
|
560 | 594 | |
561 | 595 | // Next Week Link... |
562 | - if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) |
|
563 | - echo ' |
|
596 | + if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) { |
|
597 | + echo ' |
|
564 | 598 | <span class="floatright"> |
565 | 599 | <a href="', $calendar_data['next_week']['href'], '">»</a> |
566 | 600 | </span>'; |
601 | + } |
|
567 | 602 | |
568 | 603 | // The Month Title + Week Number... |
569 | - if (!empty($calendar_data['week_title'])) |
|
570 | - echo $calendar_data['week_title']; |
|
604 | + if (!empty($calendar_data['week_title'])) { |
|
605 | + echo $calendar_data['week_title']; |
|
606 | + } |
|
571 | 607 | |
572 | 608 | echo ' |
573 | 609 | </h3> |
@@ -608,11 +644,12 @@ discard block |
||
608 | 644 | <td class="', implode(' ', $classes), ' act_day">'; |
609 | 645 | |
610 | 646 | // Should the day number be a link? |
611 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
612 | - echo ' |
|
647 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
648 | + echo ' |
|
613 | 649 | <a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>'; |
614 | - else |
|
615 | - echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
650 | + } else { |
|
651 | + echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
652 | + } |
|
616 | 653 | |
617 | 654 | echo ' |
618 | 655 | </td> |
@@ -623,8 +660,9 @@ discard block |
||
623 | 660 | { |
624 | 661 | // Sort events by start time (all day events will be listed first) |
625 | 662 | uasort($day['events'], function($a, $b) { |
626 | - if ($a['start_timestamp'] == $b['start_timestamp']) |
|
627 | - return 0; |
|
663 | + if ($a['start_timestamp'] == $b['start_timestamp']) { |
|
664 | + return 0; |
|
665 | + } |
|
628 | 666 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
629 | 667 | }); |
630 | 668 | |
@@ -638,35 +676,39 @@ discard block |
||
638 | 676 | echo $event['link'], '<br> |
639 | 677 | <span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">'; |
640 | 678 | |
641 | - if (!empty($event['start_time_local'])) |
|
642 | - echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; |
|
643 | - else |
|
644 | - echo $txt['calendar_allday']; |
|
679 | + if (!empty($event['start_time_local'])) { |
|
680 | + echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; |
|
681 | + } else { |
|
682 | + echo $txt['calendar_allday']; |
|
683 | + } |
|
645 | 684 | |
646 | 685 | echo ' |
647 | 686 | </span>'; |
648 | 687 | |
649 | - if (!empty($event['location'])) |
|
650 | - echo '<br> |
|
688 | + if (!empty($event['location'])) { |
|
689 | + echo '<br> |
|
651 | 690 | <span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>'; |
691 | + } |
|
652 | 692 | |
653 | 693 | if (!empty($event_icons_needed)) |
654 | 694 | { |
655 | 695 | echo ' <span class="modify_event_links">'; |
656 | 696 | |
657 | 697 | // If they can edit the event, show a star they can click on.... |
658 | - if (!empty($event['can_edit'])) |
|
659 | - echo ' |
|
698 | + if (!empty($event['can_edit'])) { |
|
699 | + echo ' |
|
660 | 700 | <a class="modify_event" href="', $event['modify_href'], '"> |
661 | 701 | <span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span> |
662 | 702 | </a>'; |
703 | + } |
|
663 | 704 | |
664 | 705 | // Can we export? Sweet. |
665 | - if (!empty($event['can_export'])) |
|
666 | - echo ' |
|
706 | + if (!empty($event['can_export'])) { |
|
707 | + echo ' |
|
667 | 708 | <a class="modify_event" href="', $event['export_href'], '"> |
668 | 709 | <span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span> |
669 | 710 | </a>'; |
711 | + } |
|
670 | 712 | |
671 | 713 | echo ' |
672 | 714 | </span><br class="clear">'; |
@@ -684,22 +726,23 @@ discard block |
||
684 | 726 | </div> |
685 | 727 | <br class="clear">'; |
686 | 728 | } |
687 | - } |
|
688 | - else |
|
729 | + } else |
|
689 | 730 | { |
690 | - if (!empty($context['can_post'])) |
|
691 | - echo ' |
|
731 | + if (!empty($context['can_post'])) { |
|
732 | + echo ' |
|
692 | 733 | <div class="week_add_event"> |
693 | 734 | <a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['calendar_post_event'], '</a> |
694 | 735 | </div>'; |
736 | + } |
|
695 | 737 | } |
696 | 738 | echo ' |
697 | 739 | </td> |
698 | 740 | <td class="', implode(' ', $classes), !empty($day['holidays']) ? ' holidays' : ' disabled', ' holiday_col" data-css-prefix="' . $txt['calendar_prompt'] . ' ">'; |
699 | 741 | |
700 | 742 | // Show any holidays! |
701 | - if (!empty($day['holidays'])) |
|
702 | - echo implode('<br>', $day['holidays']); |
|
743 | + if (!empty($day['holidays'])) { |
|
744 | + echo implode('<br>', $day['holidays']); |
|
745 | + } |
|
703 | 746 | |
704 | 747 | echo ' |
705 | 748 | </td> |
@@ -708,11 +751,12 @@ discard block |
||
708 | 751 | // Show any birthdays... |
709 | 752 | if (!empty($day['birthdays'])) |
710 | 753 | { |
711 | - foreach ($day['birthdays'] as $member) |
|
712 | - echo ' |
|
754 | + foreach ($day['birthdays'] as $member) { |
|
755 | + echo ' |
|
713 | 756 | <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], '</a> |
714 | 757 | ', isset($member['age']) ? ' (' . $member['age'] . ')' : '', ' |
715 | 758 | ', $member['is_last'] ? '' : '<br>'; |
759 | + } |
|
716 | 760 | } |
717 | 761 | echo ' |
718 | 762 | </td> |
@@ -758,26 +802,27 @@ discard block |
||
758 | 802 | <input type="text" name="end_date" id="end_date" maxlength="10" value="', $calendar_data['end_date'], '" tabindex="', $context['tabindex']++, '" class="date_input end" data-type="date"> |
759 | 803 | <input type="submit" class="button" style="float:none" id="view_button" value="', $txt['view'], '"> |
760 | 804 | </form>'; |
761 | - } |
|
762 | - else |
|
805 | + } else |
|
763 | 806 | { |
764 | 807 | echo' |
765 | 808 | <form action="', $scripturl, '?action=calendar" id="calendar_navigation" method="post" accept-charset="', $context['character_set'], '"> |
766 | 809 | <select name="month" id="input_month">'; |
767 | 810 | |
768 | 811 | // Show a select box with all the months. |
769 | - foreach ($txt['months_short'] as $number => $month) |
|
770 | - echo ' |
|
812 | + foreach ($txt['months_short'] as $number => $month) { |
|
813 | + echo ' |
|
771 | 814 | <option value="', $number, '"', $number == $context['current_month'] ? ' selected' : '', '>', $month, '</option>'; |
815 | + } |
|
772 | 816 | |
773 | 817 | echo ' |
774 | 818 | </select> |
775 | 819 | <select name="year">'; |
776 | 820 | |
777 | 821 | // Show a link for every year... |
778 | - for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) |
|
779 | - echo ' |
|
822 | + for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) { |
|
823 | + echo ' |
|
780 | 824 | <option value="', $year, '"', $year == $context['current_year'] ? ' selected' : '', '>', $year, '</option>'; |
825 | + } |
|
781 | 826 | |
782 | 827 | echo ' |
783 | 828 | </select> |
@@ -799,9 +844,10 @@ discard block |
||
799 | 844 | echo ' |
800 | 845 | <form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">'; |
801 | 846 | |
802 | - if (!empty($context['event']['new'])) |
|
803 | - echo ' |
|
847 | + if (!empty($context['event']['new'])) { |
|
848 | + echo ' |
|
804 | 849 | <input type="hidden" name="eventid" value="', $context['event']['eventid'], '">'; |
850 | + } |
|
805 | 851 | |
806 | 852 | // Start the main table. |
807 | 853 | echo ' |
@@ -812,8 +858,8 @@ discard block |
||
812 | 858 | </h3> |
813 | 859 | </div>'; |
814 | 860 | |
815 | - if (!empty($context['post_error']['messages'])) |
|
816 | - echo ' |
|
861 | + if (!empty($context['post_error']['messages'])) { |
|
862 | + echo ' |
|
817 | 863 | <div class="errorbox"> |
818 | 864 | <dl class="event_error"> |
819 | 865 | <dt> |
@@ -824,6 +870,7 @@ discard block |
||
824 | 870 | </dt> |
825 | 871 | </dl> |
826 | 872 | </div>'; |
873 | + } |
|
827 | 874 | |
828 | 875 | echo ' |
829 | 876 | <div class="roundframe noup"> |
@@ -851,9 +898,10 @@ discard block |
||
851 | 898 | echo ' |
852 | 899 | <optgroup label="', $category['name'], '">'; |
853 | 900 | |
854 | - foreach ($category['boards'] as $board) |
|
855 | - echo ' |
|
901 | + foreach ($category['boards'] as $board) { |
|
902 | + echo ' |
|
856 | 903 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
904 | + } |
|
857 | 905 | echo ' |
858 | 906 | </optgroup>'; |
859 | 907 | } |
@@ -889,9 +937,10 @@ discard block |
||
889 | 937 | <span class="label">', $txt['calendar_timezone'], '</span> |
890 | 938 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
891 | 939 | |
892 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
893 | - echo ' |
|
940 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
941 | + echo ' |
|
894 | 942 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
943 | + } |
|
895 | 944 | |
896 | 945 | echo ' |
897 | 946 | </select> |
@@ -907,9 +956,10 @@ discard block |
||
907 | 956 | <input type="submit" value="', empty($context['event']['new']) ? $txt['save'] : $txt['post'], '" class="button">'; |
908 | 957 | |
909 | 958 | // Delete button? |
910 | - if (empty($context['event']['new'])) |
|
911 | - echo ' |
|
959 | + if (empty($context['event']['new'])) { |
|
960 | + echo ' |
|
912 | 961 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['calendar_confirm_delete'], '" class="button you_sure">'; |
962 | + } |
|
913 | 963 | |
914 | 964 | echo ' |
915 | 965 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -937,9 +987,10 @@ discard block |
||
937 | 987 | echo ' |
938 | 988 | <td style="padding-', $alt ? 'right' : 'left', ': 1.5em;">'; |
939 | 989 | |
940 | - foreach ($v as $i) |
|
941 | - echo ' |
|
990 | + foreach ($v as $i) { |
|
991 | + echo ' |
|
942 | 992 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '"><br>'; |
993 | + } |
|
943 | 994 | |
944 | 995 | echo ' |
945 | 996 | </td>'; |
@@ -960,9 +1011,10 @@ discard block |
||
960 | 1011 | |
961 | 1012 | foreach ($context['clockicons'] as $t => $v) |
962 | 1013 | { |
963 | - foreach ($v as $i) |
|
964 | - echo ' |
|
1014 | + foreach ($v as $i) { |
|
1015 | + echo ' |
|
965 | 1016 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
1017 | + } |
|
966 | 1018 | } |
967 | 1019 | |
968 | 1020 | echo ' |
@@ -987,13 +1039,14 @@ discard block |
||
987 | 1039 | |
988 | 1040 | foreach ($context['clockicons'] as $t => $v) |
989 | 1041 | { |
990 | - foreach ($v as $i) |
|
991 | - echo ' |
|
1042 | + foreach ($v as $i) { |
|
1043 | + echo ' |
|
992 | 1044 | if (', $t, ' >= ', $i, ') |
993 | 1045 | { |
994 | 1046 | turnon.push("', $t, '_', $i, '"); |
995 | 1047 | ', $t, ' -= ', $i, '; |
996 | 1048 | }'; |
1049 | + } |
|
997 | 1050 | } |
998 | 1051 | |
999 | 1052 | echo ' |
@@ -1037,9 +1090,10 @@ discard block |
||
1037 | 1090 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
1038 | 1091 | <td>'; |
1039 | 1092 | |
1040 | - foreach ($v as $i) |
|
1041 | - echo ' |
|
1093 | + foreach ($v as $i) { |
|
1094 | + echo ' |
|
1042 | 1095 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">'; |
1096 | + } |
|
1043 | 1097 | |
1044 | 1098 | echo ' |
1045 | 1099 | </td> |
@@ -1061,9 +1115,10 @@ discard block |
||
1061 | 1115 | |
1062 | 1116 | foreach ($context['clockicons'] as $t => $v) |
1063 | 1117 | { |
1064 | - foreach ($v as $i) |
|
1065 | - echo ' |
|
1118 | + foreach ($v as $i) { |
|
1119 | + echo ' |
|
1066 | 1120 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
1121 | + } |
|
1067 | 1122 | } |
1068 | 1123 | |
1069 | 1124 | echo ' |
@@ -1080,13 +1135,14 @@ discard block |
||
1080 | 1135 | |
1081 | 1136 | foreach ($context['clockicons'] as $t => $v) |
1082 | 1137 | { |
1083 | - foreach ($v as $i) |
|
1084 | - echo ' |
|
1138 | + foreach ($v as $i) { |
|
1139 | + echo ' |
|
1085 | 1140 | if (', $t, ' >= ', $i, ') |
1086 | 1141 | { |
1087 | 1142 | turnon.push("', $t, '_', $i, '"); |
1088 | 1143 | ', $t, ' -= ', $i, '; |
1089 | 1144 | }'; |
1145 | + } |
|
1090 | 1146 | } |
1091 | 1147 | |
1092 | 1148 | echo ' |
@@ -1130,9 +1186,10 @@ discard block |
||
1130 | 1186 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
1131 | 1187 | <td>'; |
1132 | 1188 | |
1133 | - foreach ($v as $i) |
|
1134 | - echo ' |
|
1189 | + foreach ($v as $i) { |
|
1190 | + echo ' |
|
1135 | 1191 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">'; |
1192 | + } |
|
1136 | 1193 | |
1137 | 1194 | echo ' |
1138 | 1195 | </td> |
@@ -1148,9 +1205,10 @@ discard block |
||
1148 | 1205 | |
1149 | 1206 | foreach ($context['clockicons'] as $t => $v) |
1150 | 1207 | { |
1151 | - foreach ($v as $i) |
|
1152 | - echo ' |
|
1208 | + foreach ($v as $i) { |
|
1209 | + echo ' |
|
1153 | 1210 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
1211 | + } |
|
1154 | 1212 | } |
1155 | 1213 | |
1156 | 1214 | echo ' |
@@ -1171,13 +1229,14 @@ discard block |
||
1171 | 1229 | |
1172 | 1230 | foreach ($context['clockicons'] as $t => $v) |
1173 | 1231 | { |
1174 | - foreach ($v as $i) |
|
1175 | - echo ' |
|
1232 | + foreach ($v as $i) { |
|
1233 | + echo ' |
|
1176 | 1234 | if (', $t, ' >= ', $i, ') |
1177 | 1235 | { |
1178 | 1236 | turnon.push("', $t, '_', $i, '"); |
1179 | 1237 | ', $t, ' -= ', $i, '; |
1180 | 1238 | }'; |
1239 | + } |
|
1181 | 1240 | } |
1182 | 1241 | |
1183 | 1242 | echo ' |
@@ -1221,9 +1280,10 @@ discard block |
||
1221 | 1280 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
1222 | 1281 | <td>'; |
1223 | 1282 | |
1224 | - foreach ($v as $i) |
|
1225 | - echo ' |
|
1283 | + foreach ($v as $i) { |
|
1284 | + echo ' |
|
1226 | 1285 | <img src="', $i ? $context['onimg'] : $context['offimg'], '" alt="" style="padding: 2px;">'; |
1286 | + } |
|
1227 | 1287 | |
1228 | 1288 | echo ' |
1229 | 1289 | </td> |
@@ -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,26 +74,28 @@ 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;"' : '', '> |
89 | 93 | ', $group['num_permissions']['allowed'], ' |
90 | 94 | </td> |
91 | 95 | <td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '> |
92 | 96 | ', $group['num_permissions']['denied'], ' |
93 | 97 | </td>'; |
98 | + } |
|
94 | 99 | |
95 | 100 | echo ' |
96 | 101 | <td> |
@@ -141,10 +146,11 @@ discard block |
||
141 | 146 | <select name="copy_from"> |
142 | 147 | <option value="empty">(', $txt['permissions_select_membergroup'], ')</option>'; |
143 | 148 | |
144 | - foreach ($context['groups'] as $group) |
|
145 | - if ($group['id'] != 1) |
|
149 | + foreach ($context['groups'] as $group) { |
|
150 | + if ($group['id'] != 1) |
|
146 | 151 | echo ' |
147 | 152 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
153 | + } |
|
148 | 154 | |
149 | 155 | echo ' |
150 | 156 | </select> |
@@ -154,9 +160,10 @@ discard block |
||
154 | 160 | <option value="add">', $txt['permissions_add'], '...</option> |
155 | 161 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
156 | 162 | |
157 | - if (!empty($modSettings['permission_enable_deny'])) |
|
158 | - echo ' |
|
163 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
164 | + echo ' |
|
159 | 165 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
166 | + } |
|
160 | 167 | |
161 | 168 | echo ' |
162 | 169 | </select> |
@@ -167,31 +174,35 @@ discard block |
||
167 | 174 | |
168 | 175 | foreach ($context['permissions'] as $permissionType) |
169 | 176 | { |
170 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
171 | - continue; |
|
177 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
178 | + continue; |
|
179 | + } |
|
172 | 180 | |
173 | 181 | foreach ($permissionType['columns'] as $column) |
174 | 182 | { |
175 | 183 | foreach ($column as $permissionGroup) |
176 | 184 | { |
177 | - if ($permissionGroup['hidden']) |
|
178 | - continue; |
|
185 | + if ($permissionGroup['hidden']) { |
|
186 | + continue; |
|
187 | + } |
|
179 | 188 | |
180 | 189 | echo ' |
181 | 190 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
182 | 191 | |
183 | 192 | foreach ($permissionGroup['permissions'] as $perm) |
184 | 193 | { |
185 | - if ($perm['hidden']) |
|
186 | - continue; |
|
194 | + if ($perm['hidden']) { |
|
195 | + continue; |
|
196 | + } |
|
187 | 197 | |
188 | - if ($perm['has_own_any']) |
|
189 | - echo ' |
|
198 | + if ($perm['has_own_any']) { |
|
199 | + echo ' |
|
190 | 200 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
191 | 201 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
192 | - else |
|
193 | - echo ' |
|
202 | + } else { |
|
203 | + echo ' |
|
194 | 204 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
205 | + } |
|
195 | 206 | } |
196 | 207 | } |
197 | 208 | } |
@@ -256,9 +267,10 @@ discard block |
||
256 | 267 | } |
257 | 268 | </script>'; |
258 | 269 | |
259 | - if (!empty($context['profile'])) |
|
260 | - echo ' |
|
270 | + if (!empty($context['profile'])) { |
|
271 | + echo ' |
|
261 | 272 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
273 | + } |
|
262 | 274 | |
263 | 275 | echo ' |
264 | 276 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -303,9 +315,10 @@ discard block |
||
303 | 315 | <h3 class="subbg">', $category['name'], '</h3> |
304 | 316 | </div>'; |
305 | 317 | |
306 | - if (!empty($category['boards'])) |
|
307 | - echo ' |
|
318 | + if (!empty($category['boards'])) { |
|
319 | + echo ' |
|
308 | 320 | <ul class="perm_boards flow_hidden">'; |
321 | + } |
|
309 | 322 | |
310 | 323 | foreach ($category['boards'] as $board) |
311 | 324 | { |
@@ -321,33 +334,36 @@ discard block |
||
321 | 334 | echo ' |
322 | 335 | <select name="boardprofile[', $board['id'], ']">'; |
323 | 336 | |
324 | - foreach ($context['profiles'] as $id => $profile) |
|
325 | - echo ' |
|
337 | + foreach ($context['profiles'] as $id => $profile) { |
|
338 | + echo ' |
|
326 | 339 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
340 | + } |
|
327 | 341 | |
328 | 342 | echo ' |
329 | 343 | </select>'; |
330 | - } |
|
331 | - else |
|
332 | - echo ' |
|
344 | + } else { |
|
345 | + echo ' |
|
333 | 346 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
347 | + } |
|
334 | 348 | |
335 | 349 | echo ' |
336 | 350 | </span> |
337 | 351 | </li>'; |
338 | 352 | } |
339 | 353 | |
340 | - if (!empty($category['boards'])) |
|
341 | - echo ' |
|
354 | + if (!empty($category['boards'])) { |
|
355 | + echo ' |
|
342 | 356 | </ul>'; |
357 | + } |
|
343 | 358 | } |
344 | 359 | |
345 | - if ($context['edit_all']) |
|
346 | - echo ' |
|
360 | + if ($context['edit_all']) { |
|
361 | + echo ' |
|
347 | 362 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button">'; |
348 | - else |
|
349 | - echo ' |
|
363 | + } else { |
|
364 | + echo ' |
|
350 | 365 | <a class="button" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
366 | + } |
|
351 | 367 | |
352 | 368 | echo ' |
353 | 369 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -387,12 +403,13 @@ discard block |
||
387 | 403 | <tr class="windowbg"> |
388 | 404 | <td>'; |
389 | 405 | |
390 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
391 | - echo ' |
|
406 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
407 | + echo ' |
|
392 | 408 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '">'; |
393 | - else |
|
394 | - echo ' |
|
409 | + } else { |
|
410 | + echo ' |
|
395 | 411 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
412 | + } |
|
396 | 413 | |
397 | 414 | echo ' |
398 | 415 | </td> |
@@ -412,9 +429,10 @@ discard block |
||
412 | 429 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
413 | 430 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
414 | 431 | |
415 | - if ($context['can_edit_something']) |
|
416 | - echo ' |
|
432 | + if ($context['can_edit_something']) { |
|
433 | + echo ' |
|
417 | 434 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button">'; |
435 | + } |
|
418 | 436 | |
419 | 437 | echo ' |
420 | 438 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '> |
@@ -439,9 +457,10 @@ discard block |
||
439 | 457 | <dd> |
440 | 458 | <select name="copy_from">'; |
441 | 459 | |
442 | - foreach ($context['profiles'] as $id => $profile) |
|
443 | - echo ' |
|
460 | + foreach ($context['profiles'] as $id => $profile) { |
|
461 | + echo ' |
|
444 | 462 | <option value="', $id, '">', $profile['name'], '</option>'; |
463 | + } |
|
445 | 464 | |
446 | 465 | echo ' |
447 | 466 | </select> |
@@ -463,13 +482,13 @@ discard block |
||
463 | 482 | global $context, $scripturl, $txt, $modSettings; |
464 | 483 | |
465 | 484 | // Cannot be edited? |
466 | - if (!$context['profile']['can_modify']) |
|
467 | - echo ' |
|
485 | + if (!$context['profile']['can_modify']) { |
|
486 | + echo ' |
|
468 | 487 | <div class="errorbox"> |
469 | 488 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
470 | 489 | </div>'; |
471 | - else |
|
472 | - echo ' |
|
490 | + } else { |
|
491 | + echo ' |
|
473 | 492 | <script> |
474 | 493 | window.smf_usedDeny = false; |
475 | 494 | |
@@ -481,27 +500,30 @@ discard block |
||
481 | 500 | return true; |
482 | 501 | } |
483 | 502 | </script>'; |
503 | + } |
|
484 | 504 | |
485 | 505 | echo ' |
486 | 506 | <div id="admincenter"> |
487 | 507 | <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();">'; |
488 | 508 | |
489 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
490 | - echo ' |
|
509 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
510 | + echo ' |
|
491 | 511 | <div class="information"> |
492 | 512 | ', $txt['permissions_option_desc'], ' |
493 | 513 | </div>'; |
514 | + } |
|
494 | 515 | |
495 | 516 | echo ' |
496 | 517 | <div class="cat_bar"> |
497 | 518 | <h3 class="catbg">'; |
498 | 519 | |
499 | - if ($context['permission_type'] == 'board') |
|
500 | - echo ' |
|
520 | + if ($context['permission_type'] == 'board') { |
|
521 | + echo ' |
|
501 | 522 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
502 | - else |
|
503 | - echo ' |
|
523 | + } else { |
|
524 | + echo ' |
|
504 | 525 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
526 | + } |
|
505 | 527 | echo ' |
506 | 528 | </h3> |
507 | 529 | </div>'; |
@@ -524,15 +546,17 @@ discard block |
||
524 | 546 | template_modify_group_display('board'); |
525 | 547 | } |
526 | 548 | |
527 | - if ($context['profile']['can_modify']) |
|
528 | - echo ' |
|
549 | + if ($context['profile']['can_modify']) { |
|
550 | + echo ' |
|
529 | 551 | <div class="padding"> |
530 | 552 | <input type="submit" value="', $txt['permissions_commit'], '" class="button"> |
531 | 553 | </div>'; |
554 | + } |
|
532 | 555 | |
533 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
534 | - echo ' |
|
556 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
557 | + echo ' |
|
535 | 558 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
559 | + } |
|
536 | 560 | |
537 | 561 | echo ' |
538 | 562 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -560,17 +584,19 @@ discard block |
||
560 | 584 | |
561 | 585 | foreach ($column as $permissionGroup) |
562 | 586 | { |
563 | - if (empty($permissionGroup['permissions'])) |
|
564 | - continue; |
|
587 | + if (empty($permissionGroup['permissions'])) { |
|
588 | + continue; |
|
589 | + } |
|
565 | 590 | |
566 | 591 | // Are we likely to have something in this group to display or is it all hidden? |
567 | 592 | $has_display_content = false; |
568 | 593 | if (!$permissionGroup['hidden']) |
569 | 594 | { |
570 | 595 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
571 | - foreach ($permissionGroup['permissions'] as $permission) |
|
572 | - if (!$permission['hidden']) |
|
596 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
597 | + if (!$permission['hidden']) |
|
573 | 598 | $has_display_content = true; |
599 | + } |
|
574 | 600 | |
575 | 601 | if ($has_display_content) |
576 | 602 | { |
@@ -579,10 +605,11 @@ discard block |
||
579 | 605 | <th></th> |
580 | 606 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
581 | 607 | |
582 | - if ($context['group']['id'] != -1) |
|
583 | - echo ' |
|
608 | + if ($context['group']['id'] != -1) { |
|
609 | + echo ' |
|
584 | 610 | <th>', $txt['permissions_option_own'], '</th> |
585 | 611 | <th>', $txt['permissions_option_any'], '</th>'; |
612 | + } |
|
586 | 613 | |
587 | 614 | echo ' |
588 | 615 | </tr>'; |
@@ -605,17 +632,18 @@ discard block |
||
605 | 632 | // Guests can't do their own thing. |
606 | 633 | if ($context['group']['id'] != -1) |
607 | 634 | { |
608 | - if (empty($modSettings['permission_enable_deny'])) |
|
609 | - echo ' |
|
635 | + if (empty($modSettings['permission_enable_deny'])) { |
|
636 | + echo ' |
|
610 | 637 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" ', $disable_field, '>'; |
611 | - else |
|
638 | + } else |
|
612 | 639 | { |
613 | 640 | echo ' |
614 | 641 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
615 | 642 | |
616 | - foreach (array('on', 'off', 'deny') as $c) |
|
617 | - echo ' |
|
643 | + foreach (array('on', 'off', 'deny') as $c) { |
|
644 | + echo ' |
|
618 | 645 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
646 | + } |
|
619 | 647 | echo ' |
620 | 648 | </select>'; |
621 | 649 | } |
@@ -625,39 +653,41 @@ discard block |
||
625 | 653 | <td>'; |
626 | 654 | } |
627 | 655 | |
628 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
629 | - echo ' |
|
656 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
657 | + echo ' |
|
630 | 658 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>'; |
631 | - else |
|
659 | + } else |
|
632 | 660 | { |
633 | 661 | echo ' |
634 | 662 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
635 | 663 | |
636 | - foreach (array('on', 'off', 'deny') as $c) |
|
637 | - echo ' |
|
664 | + foreach (array('on', 'off', 'deny') as $c) { |
|
665 | + echo ' |
|
638 | 666 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
667 | + } |
|
639 | 668 | echo ' |
640 | 669 | </select>'; |
641 | 670 | } |
642 | - } |
|
643 | - else |
|
671 | + } else |
|
644 | 672 | { |
645 | - if ($context['group']['id'] != -1) |
|
646 | - echo ' |
|
673 | + if ($context['group']['id'] != -1) { |
|
674 | + echo ' |
|
647 | 675 | </td> |
648 | 676 | <td>'; |
677 | + } |
|
649 | 678 | |
650 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
651 | - echo ' |
|
679 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
680 | + echo ' |
|
652 | 681 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>'; |
653 | - else |
|
682 | + } else |
|
654 | 683 | { |
655 | 684 | echo ' |
656 | 685 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
657 | 686 | |
658 | - foreach (array('on', 'off', 'deny') as $c) |
|
659 | - echo ' |
|
687 | + foreach (array('on', 'off', 'deny') as $c) { |
|
688 | + echo ' |
|
660 | 689 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
690 | + } |
|
661 | 691 | echo ' |
662 | 692 | </select>'; |
663 | 693 | } |
@@ -689,11 +719,11 @@ discard block |
||
689 | 719 | <fieldset id="', $context['current_permission'], '"> |
690 | 720 | <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>'; |
691 | 721 | |
692 | - if (empty($modSettings['permission_enable_deny'])) |
|
693 | - echo ' |
|
722 | + if (empty($modSettings['permission_enable_deny'])) { |
|
723 | + echo ' |
|
694 | 724 | <ul>'; |
695 | - else |
|
696 | - echo ' |
|
725 | + } else { |
|
726 | + echo ' |
|
697 | 727 | <div class="information">', $txt['permissions_option_desc'], '</div> |
698 | 728 | <dl class="settings"> |
699 | 729 | <dt> |
@@ -703,47 +733,52 @@ discard block |
||
703 | 733 | </dt> |
704 | 734 | <dd> |
705 | 735 | </dd>'; |
736 | + } |
|
706 | 737 | |
707 | 738 | foreach ($context['member_groups'] as $group) |
708 | 739 | { |
709 | - if (!empty($modSettings['permission_enable_deny'])) |
|
710 | - echo ' |
|
740 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
741 | + echo ' |
|
711 | 742 | <dt>'; |
712 | - else |
|
713 | - echo ' |
|
743 | + } else { |
|
744 | + echo ' |
|
714 | 745 | <li>'; |
746 | + } |
|
715 | 747 | |
716 | - if (empty($modSettings['permission_enable_deny'])) |
|
717 | - echo ' |
|
748 | + if (empty($modSettings['permission_enable_deny'])) { |
|
749 | + echo ' |
|
718 | 750 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '>'; |
719 | - else |
|
720 | - echo ' |
|
751 | + } else { |
|
752 | + echo ' |
|
721 | 753 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '></span> |
722 | 754 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', '></span> |
723 | 755 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', '></span>'; |
756 | + } |
|
724 | 757 | |
725 | - if (!empty($modSettings['permission_enable_deny'])) |
|
726 | - echo ' |
|
758 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
759 | + echo ' |
|
727 | 760 | </dt> |
728 | 761 | <dd> |
729 | 762 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
730 | 763 | </dd>'; |
731 | - else |
|
732 | - echo ' |
|
764 | + } else { |
|
765 | + echo ' |
|
733 | 766 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
734 | 767 | </li>'; |
768 | + } |
|
735 | 769 | } |
736 | 770 | |
737 | - if (empty($modSettings['permission_enable_deny'])) |
|
738 | - echo ' |
|
771 | + if (empty($modSettings['permission_enable_deny'])) { |
|
772 | + echo ' |
|
739 | 773 | <li> |
740 | 774 | <input type="checkbox" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');"> |
741 | 775 | <span>', $txt['check_all'], '</span> |
742 | 776 | </li> |
743 | 777 | </ul>'; |
744 | - else |
|
745 | - echo ' |
|
778 | + } else { |
|
779 | + echo ' |
|
746 | 780 | </dl>'; |
781 | + } |
|
747 | 782 | |
748 | 783 | echo ' |
749 | 784 | </fieldset> |
@@ -783,9 +818,10 @@ discard block |
||
783 | 818 | if (!empty($modSettings['postmod_active'])) |
784 | 819 | { |
785 | 820 | // Got advanced permissions - if so warn! |
786 | - if (!empty($modSettings['permission_enable_deny'])) |
|
787 | - echo ' |
|
821 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
822 | + echo ' |
|
788 | 823 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
824 | + } |
|
789 | 825 | |
790 | 826 | echo ' |
791 | 827 | <div class="padding"> |
@@ -800,10 +836,11 @@ discard block |
||
800 | 836 | ', $txt['permissions_post_moderation_select'], ': |
801 | 837 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
802 | 838 | |
803 | - foreach ($context['profiles'] as $profile) |
|
804 | - if ($profile['can_modify']) |
|
839 | + foreach ($context['profiles'] as $profile) { |
|
840 | + if ($profile['can_modify']) |
|
805 | 841 | echo ' |
806 | 842 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
843 | + } |
|
807 | 844 | |
808 | 845 | echo ' |
809 | 846 | </select> |
@@ -824,11 +861,12 @@ discard block |
||
824 | 861 | ', $txt['permissions_post_moderation_replies_any'], ' |
825 | 862 | </th>'; |
826 | 863 | |
827 | - if ($modSettings['attachmentEnable'] == 1) |
|
828 | - echo ' |
|
864 | + if ($modSettings['attachmentEnable'] == 1) { |
|
865 | + echo ' |
|
829 | 866 | <th class="centercol" colspan="3"> |
830 | 867 | ', $txt['permissions_post_moderation_attachments'], ' |
831 | 868 | </th>'; |
869 | + } |
|
832 | 870 | |
833 | 871 | echo ' |
834 | 872 | </tr> |
@@ -846,11 +884,12 @@ discard block |
||
846 | 884 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
847 | 885 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
848 | 886 | |
849 | - if ($modSettings['attachmentEnable'] == 1) |
|
850 | - echo ' |
|
887 | + if ($modSettings['attachmentEnable'] == 1) { |
|
888 | + echo ' |
|
851 | 889 | <th><span class="generic_icons post_moderation_allow"></span></th> |
852 | 890 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
853 | 891 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
892 | + } |
|
854 | 893 | |
855 | 894 | echo ' |
856 | 895 | </tr> |
@@ -864,10 +903,11 @@ discard block |
||
864 | 903 | <td class="half_table"> |
865 | 904 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
866 | 905 | |
867 | - if (!empty($group['children'])) |
|
868 | - echo ' |
|
906 | + if (!empty($group['children'])) { |
|
907 | + echo ' |
|
869 | 908 | <br> |
870 | 909 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
910 | + } |
|
871 | 911 | |
872 | 912 | echo ' |
873 | 913 | </td> |
@@ -882,11 +922,11 @@ discard block |
||
882 | 922 | </td>'; |
883 | 923 | |
884 | 924 | // Guests can't have "own" permissions |
885 | - if ($group['id'] == '-1') |
|
886 | - echo ' |
|
925 | + if ($group['id'] == '-1') { |
|
926 | + echo ' |
|
887 | 927 | <td colspan="3"></td>'; |
888 | - else |
|
889 | - echo ' |
|
928 | + } else { |
|
929 | + echo ' |
|
890 | 930 | <td class="centercol"> |
891 | 931 | <input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', '> |
892 | 932 | </td> |
@@ -896,6 +936,7 @@ discard block |
||
896 | 936 | <td class="centercol"> |
897 | 937 | <input type="radio" name="replies_own[', $group['id'], ']" value="disallow"', $group['replies_own'] == 'disallow' ? ' checked' : '', '> |
898 | 938 | </td>'; |
939 | + } |
|
899 | 940 | |
900 | 941 | echo ' |
901 | 942 | <td class="centercol"> |
@@ -908,8 +949,8 @@ discard block |
||
908 | 949 | <input type="radio" name="replies_any[', $group['id'], ']" value="disallow"', $group['replies_any'] == 'disallow' ? ' checked' : '', '> |
909 | 950 | </td>'; |
910 | 951 | |
911 | - if ($modSettings['attachmentEnable'] == 1) |
|
912 | - echo ' |
|
952 | + if ($modSettings['attachmentEnable'] == 1) { |
|
953 | + echo ' |
|
913 | 954 | <td class="centercol"> |
914 | 955 | <input type="radio" name="attachment[', $group['id'], ']" value="allow"', $group['attachment'] == 'allow' ? ' checked' : '', '> |
915 | 956 | </td> |
@@ -919,6 +960,7 @@ discard block |
||
919 | 960 | <td class="centercol"> |
920 | 961 | <input type="radio" name="attachment[', $group['id'], ']" value="disallow"', $group['attachment'] == 'disallow' ? ' checked' : '', '> |
921 | 962 | </td>'; |
963 | + } |
|
922 | 964 | |
923 | 965 | echo ' |
924 | 966 | </tr>'; |
@@ -53,14 +53,15 @@ discard block |
||
53 | 53 | foreach ($context['smileys'] as $location => $smileyRows) |
54 | 54 | { |
55 | 55 | $countLocations--; |
56 | - if ($location == 'postform') |
|
57 | - echo ' |
|
56 | + if ($location == 'postform') { |
|
57 | + echo ' |
|
58 | 58 | dropdown: |
59 | 59 | {'; |
60 | - elseif ($location == 'popup') |
|
61 | - echo ' |
|
60 | + } elseif ($location == 'popup') { |
|
61 | + echo ' |
|
62 | 62 | popup: |
63 | 63 | {'; |
64 | + } |
|
64 | 65 | |
65 | 66 | $numRows = count($smileyRows); |
66 | 67 | |
@@ -68,25 +69,27 @@ discard block |
||
68 | 69 | $emptyPlaceholder = 0; |
69 | 70 | foreach ($smileyRows as $smileyRow) |
70 | 71 | { |
71 | - foreach ($smileyRow['smileys'] as $smiley) |
|
72 | - echo ' |
|
72 | + foreach ($smileyRow['smileys'] as $smiley) { |
|
73 | + echo ' |
|
73 | 74 | ', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), empty($smiley['isLast']) ? ',' : ''; |
75 | + } |
|
74 | 76 | |
75 | - if (empty($smileyRow['isLast']) && $numRows != 1) |
|
76 | - echo ', |
|
77 | + if (empty($smileyRow['isLast']) && $numRows != 1) { |
|
78 | + echo ', |
|
77 | 79 | \'-', $emptyPlaceholder++, '\': \'\','; |
80 | + } |
|
78 | 81 | } |
79 | 82 | echo ' |
80 | 83 | }', $countLocations != 0 ? ',' : ''; |
81 | 84 | } |
82 | 85 | echo ' |
83 | 86 | }'; |
84 | - } |
|
85 | - else |
|
86 | - echo ', |
|
87 | + } else { |
|
88 | + echo ', |
|
87 | 89 | emoticons: |
88 | 90 | {}, |
89 | 91 | emoticonsEnabled:false'; |
92 | + } |
|
90 | 93 | |
91 | 94 | if ($context['show_bbc'] && $bbcContainer !== null) |
92 | 95 | { |
@@ -100,15 +103,16 @@ discard block |
||
100 | 103 | |
101 | 104 | $count_tags--; |
102 | 105 | |
103 | - if (!empty($count_tags)) |
|
104 | - echo '||'; |
|
106 | + if (!empty($count_tags)) { |
|
107 | + echo '||'; |
|
108 | + } |
|
105 | 109 | } |
106 | 110 | |
107 | 111 | echo '",'; |
108 | - } |
|
109 | - else |
|
110 | - echo ', |
|
112 | + } else { |
|
113 | + echo ', |
|
111 | 114 | toolbar: "",'; |
115 | + } |
|
112 | 116 | |
113 | 117 | echo ' |
114 | 118 | }); |
@@ -150,42 +154,47 @@ discard block |
||
150 | 154 | |
151 | 155 | $tempTab = $context['tabindex']; |
152 | 156 | |
153 | - if (!empty($context['drafts_pm_save'])) |
|
154 | - $tempTab++; |
|
155 | - elseif (!empty($context['drafts_save'])) |
|
156 | - $tempTab++; |
|
157 | - elseif ($editor_context['preview_type']) |
|
158 | - $tempTab++; |
|
159 | - elseif ($context['show_spellchecking']) |
|
160 | - $tempTab++; |
|
157 | + if (!empty($context['drafts_pm_save'])) { |
|
158 | + $tempTab++; |
|
159 | + } elseif (!empty($context['drafts_save'])) { |
|
160 | + $tempTab++; |
|
161 | + } elseif ($editor_context['preview_type']) { |
|
162 | + $tempTab++; |
|
163 | + } elseif ($context['show_spellchecking']) { |
|
164 | + $tempTab++; |
|
165 | + } |
|
161 | 166 | |
162 | 167 | $tempTab++; |
163 | 168 | $context['tabindex'] = $tempTab; |
164 | 169 | |
165 | - if (!empty($context['drafts_pm_save'])) |
|
166 | - echo ' |
|
170 | + if (!empty($context['drafts_pm_save'])) { |
|
171 | + echo ' |
|
167 | 172 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button"> |
168 | 173 | <input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">'; |
174 | + } |
|
169 | 175 | |
170 | - if (!empty($context['drafts_save'])) |
|
171 | - echo ' |
|
176 | + if (!empty($context['drafts_save'])) { |
|
177 | + echo ' |
|
172 | 178 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" class="button"> |
173 | 179 | <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">'; |
180 | + } |
|
174 | 181 | |
175 | - if ($context['show_spellchecking']) |
|
176 | - echo ' |
|
182 | + if ($context['show_spellchecking']) { |
|
183 | + echo ' |
|
177 | 184 | <input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button">'; |
185 | + } |
|
178 | 186 | |
179 | - if ($editor_context['preview_type']) |
|
180 | - echo ' |
|
187 | + if ($editor_context['preview_type']) { |
|
188 | + echo ' |
|
181 | 189 | <input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', --$tempTab, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button">'; |
190 | + } |
|
182 | 191 | |
183 | 192 | echo ' |
184 | 193 | <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button">'; |
185 | 194 | |
186 | 195 | // Load in the PM autosaver if it's enabled |
187 | - if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) |
|
188 | - echo ' |
|
196 | + if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) { |
|
197 | + echo ' |
|
189 | 198 | <span class="righttext padding" style="display: block"> |
190 | 199 | <span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"></span> |
191 | 200 | <span id="draft_lastautosave" ></span> |
@@ -203,10 +212,11 @@ discard block |
||
203 | 212 | iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), ' |
204 | 213 | }); |
205 | 214 | </script>'; |
215 | + } |
|
206 | 216 | |
207 | 217 | // Start an instance of the auto saver if its enabled |
208 | - if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) |
|
209 | - echo ' |
|
218 | + if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) { |
|
219 | + echo ' |
|
210 | 220 | <span class="righttext padding" style="display: block"> |
211 | 221 | <span id="throbber" style="display:none"><img src="', $settings['images_url'], '/loading_sm.gif" alt="" class="centericon"></span> |
212 | 222 | <span id="draft_lastautosave" ></span> |
@@ -223,7 +233,8 @@ discard block |
||
223 | 233 | iFreq: ', $context['drafts_autosave_frequency'], ' |
224 | 234 | }); |
225 | 235 | </script>'; |
226 | -} |
|
236 | + } |
|
237 | + } |
|
227 | 238 | |
228 | 239 | /** |
229 | 240 | * This template displays a verification form |
@@ -240,51 +251,57 @@ discard block |
||
240 | 251 | $verify_context = &$context['controls']['verification'][$verify_id]; |
241 | 252 | |
242 | 253 | // Keep track of where we are. |
243 | - if (empty($verify_context['tracking']) || $reset) |
|
244 | - $verify_context['tracking'] = 0; |
|
254 | + if (empty($verify_context['tracking']) || $reset) { |
|
255 | + $verify_context['tracking'] = 0; |
|
256 | + } |
|
245 | 257 | |
246 | 258 | // How many items are there to display in total. |
247 | 259 | $total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0); |
248 | 260 | |
249 | 261 | // If we've gone too far, stop. |
250 | - if ($verify_context['tracking'] > $total_items) |
|
251 | - return false; |
|
262 | + if ($verify_context['tracking'] > $total_items) { |
|
263 | + return false; |
|
264 | + } |
|
252 | 265 | |
253 | 266 | // Loop through each item to show them. |
254 | 267 | for ($i = 0; $i < $total_items; $i++) |
255 | 268 | { |
256 | 269 | // If we're after a single item only show it if we're in the right place. |
257 | - if ($display_type == 'single' && $verify_context['tracking'] != $i) |
|
258 | - continue; |
|
270 | + if ($display_type == 'single' && $verify_context['tracking'] != $i) { |
|
271 | + continue; |
|
272 | + } |
|
259 | 273 | |
260 | - if ($display_type != 'single') |
|
261 | - echo ' |
|
274 | + if ($display_type != 'single') { |
|
275 | + echo ' |
|
262 | 276 | <div id="verification_control_', $i, '" class="verification_control">'; |
277 | + } |
|
263 | 278 | |
264 | 279 | // Display empty field, but only if we have one, and it's the first time. |
265 | - if ($verify_context['empty_field'] && empty($i)) |
|
266 | - echo ' |
|
280 | + if ($verify_context['empty_field'] && empty($i)) { |
|
281 | + echo ' |
|
267 | 282 | <div class="smalltext vv_special"> |
268 | 283 | ', $txt['visual_verification_hidden'], ': |
269 | 284 | <input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value=""> |
270 | 285 | </div>'; |
286 | + } |
|
271 | 287 | |
272 | 288 | // Do the actual stuff |
273 | 289 | if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha'])) |
274 | 290 | { |
275 | 291 | if ($verify_context['show_visual']) |
276 | 292 | { |
277 | - if ($context['use_graphic_library']) |
|
278 | - echo ' |
|
293 | + if ($context['use_graphic_library']) { |
|
294 | + echo ' |
|
279 | 295 | <img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">'; |
280 | - else |
|
281 | - echo ' |
|
296 | + } else { |
|
297 | + echo ' |
|
282 | 298 | <img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1"> |
283 | 299 | <img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2"> |
284 | 300 | <img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3"> |
285 | 301 | <img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4"> |
286 | 302 | <img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5"> |
287 | 303 | <img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">'; |
304 | + } |
|
288 | 305 | |
289 | 306 | echo ' |
290 | 307 | <div class="smalltext" style="margin: 4px 0 8px 0;"> |
@@ -294,13 +311,13 @@ discard block |
||
294 | 311 | </div>'; |
295 | 312 | } |
296 | 313 | |
297 | - if ($verify_context['can_recaptcha']) |
|
298 | - echo ' |
|
314 | + if ($verify_context['can_recaptcha']) { |
|
315 | + echo ' |
|
299 | 316 | <div class="g-recaptcha centertext" data-sitekey="' . $verify_context['recaptcha_site_key'] . '" data-theme="' . $verify_context['recaptcha_theme'] . '"></div> |
300 | 317 | <br> |
301 | 318 | <script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>'; |
302 | - } |
|
303 | - else |
|
319 | + } |
|
320 | + } else |
|
304 | 321 | { |
305 | 322 | // Where in the question array is this question? |
306 | 323 | $qIndex = $verify_context['show_visual'] ? $i - 1 : $i; |
@@ -312,21 +329,24 @@ discard block |
||
312 | 329 | </div>'; |
313 | 330 | } |
314 | 331 | |
315 | - if ($display_type != 'single') |
|
316 | - echo ' |
|
332 | + if ($display_type != 'single') { |
|
333 | + echo ' |
|
317 | 334 | </div><!-- #verification_control_[i] -->'; |
335 | + } |
|
318 | 336 | |
319 | 337 | // If we were displaying just one and we did it, break. |
320 | - if ($display_type == 'single' && $verify_context['tracking'] == $i) |
|
321 | - break; |
|
338 | + if ($display_type == 'single' && $verify_context['tracking'] == $i) { |
|
339 | + break; |
|
340 | + } |
|
322 | 341 | } |
323 | 342 | |
324 | 343 | // Assume we found something, always. |
325 | 344 | $verify_context['tracking']++; |
326 | 345 | |
327 | 346 | // Tell something displaying piecemeal to keep going. |
328 | - if ($display_type == 'single') |
|
329 | - return true; |
|
330 | -} |
|
347 | + if ($display_type == 'single') { |
|
348 | + return true; |
|
349 | + } |
|
350 | + } |
|
331 | 351 | |
332 | 352 | ?> |
333 | 353 | \ No newline at end of file |
@@ -22,24 +22,26 @@ discard block |
||
22 | 22 | <script>'; |
23 | 23 | |
24 | 24 | // When using Go Back due to fatal_error, allow the form to be re-submitted with changes. |
25 | - if (isBrowser('is_firefox')) |
|
26 | - echo ' |
|
25 | + if (isBrowser('is_firefox')) { |
|
26 | + echo ' |
|
27 | 27 | window.addEventListener("pageshow", reActivate, false);'; |
28 | + } |
|
28 | 29 | |
29 | 30 | // Start with message icons - and any missing from this theme. |
30 | 31 | echo ' |
31 | 32 | var icon_urls = {'; |
32 | 33 | |
33 | - foreach ($context['icons'] as $icon) |
|
34 | - echo ' |
|
34 | + foreach ($context['icons'] as $icon) { |
|
35 | + echo ' |
|
35 | 36 | \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; |
37 | + } |
|
36 | 38 | |
37 | 39 | echo ' |
38 | 40 | };'; |
39 | 41 | |
40 | 42 | // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. |
41 | - if ($context['make_poll']) |
|
42 | - echo ' |
|
43 | + if ($context['make_poll']) { |
|
44 | + echo ' |
|
43 | 45 | var pollOptionNum = 0, pollTabIndex; |
44 | 46 | var pollOptionId = ', $context['last_choice_id'], '; |
45 | 47 | function addPollOption() |
@@ -58,11 +60,13 @@ discard block |
||
58 | 60 | |
59 | 61 | setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('"></dd><p id="pollMoreOptions"></p>'), '); |
60 | 62 | }'; |
63 | + } |
|
61 | 64 | |
62 | 65 | // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. |
63 | - if ($context['make_event']) |
|
64 | - echo ' |
|
66 | + if ($context['make_event']) { |
|
67 | + echo ' |
|
65 | 68 | var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; |
69 | + } |
|
66 | 70 | |
67 | 71 | // End of the javascript, start the form and display the link tree. |
68 | 72 | echo ' |
@@ -83,9 +87,10 @@ discard block |
||
83 | 87 | </div> |
84 | 88 | <br>'; |
85 | 89 | |
86 | - if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) |
|
87 | - echo ' |
|
90 | + if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { |
|
91 | + echo ' |
|
88 | 92 | <input type="hidden" name="eventid" value="', $context['event']['id'], '">'; |
93 | + } |
|
89 | 94 | |
90 | 95 | // Start the main table. |
91 | 96 | echo ' |
@@ -110,26 +115,29 @@ discard block |
||
110 | 115 | </div>'; |
111 | 116 | |
112 | 117 | // If this won't be approved let them know! |
113 | - if (!$context['becomes_approved']) |
|
114 | - echo ' |
|
118 | + if (!$context['becomes_approved']) { |
|
119 | + echo ' |
|
115 | 120 | <div class="noticebox"> |
116 | 121 | <em>', $txt['wait_for_approval'], '</em> |
117 | 122 | <input type="hidden" name="not_approved" value="1"> |
118 | 123 | </div>'; |
124 | + } |
|
119 | 125 | |
120 | 126 | // If it's locked, show a message to warn the replier. |
121 | - if (!empty($context['locked'])) |
|
122 | - echo ' |
|
127 | + if (!empty($context['locked'])) { |
|
128 | + echo ' |
|
123 | 129 | <div class="errorbox"> |
124 | 130 | ', $txt['topic_locked_no_reply'], ' |
125 | 131 | </div>'; |
132 | + } |
|
126 | 133 | |
127 | - if (!empty($modSettings['drafts_post_enabled'])) |
|
128 | - echo ' |
|
134 | + if (!empty($modSettings['drafts_post_enabled'])) { |
|
135 | + echo ' |
|
129 | 136 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
130 | 137 | sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), ' |
131 | 138 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
132 | 139 | </div>'; |
140 | + } |
|
133 | 141 | |
134 | 142 | // The post header... important stuff |
135 | 143 | echo ' |
@@ -139,14 +147,15 @@ discard block |
||
139 | 147 | // Mod & theme authors can use the 'integrate_post_end' hook to modify or add to these (see Post.php) |
140 | 148 | if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) |
141 | 149 | { |
142 | - foreach ($context['posting_fields'] as $pfid => $pf) |
|
143 | - echo ' |
|
150 | + foreach ($context['posting_fields'] as $pfid => $pf) { |
|
151 | + echo ' |
|
144 | 152 | <dt class="clear', !is_numeric($pfid) ? ' pf_' . $pfid : '', '"> |
145 | 153 | ', $pf['dt'], ' |
146 | 154 | </dt> |
147 | 155 | <dd', !is_numeric($pfid) ? ' class="pf_' . $pfid . '"' : '', '> |
148 | 156 | ', preg_replace('~<(input|select|textarea|button|area|a|object)\b~', '<$1 tabindex="' . $context['tabindex']++ . '"', $pf['dd']), ' |
149 | 157 | </dd>'; |
158 | + } |
|
150 | 159 | } |
151 | 160 | |
152 | 161 | echo ' |
@@ -180,9 +189,10 @@ discard block |
||
180 | 189 | echo ' |
181 | 190 | <optgroup label="', $category['name'], '">'; |
182 | 191 | |
183 | - foreach ($category['boards'] as $board) |
|
184 | - echo ' |
|
192 | + foreach ($category['boards'] as $board) { |
|
193 | + echo ' |
|
185 | 194 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
195 | + } |
|
186 | 196 | echo ' |
187 | 197 | </optgroup>'; |
188 | 198 | } |
@@ -218,9 +228,10 @@ discard block |
||
218 | 228 | <span class="label">', $txt['calendar_timezone'], '</span> |
219 | 229 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
220 | 230 | |
221 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
222 | - echo ' |
|
231 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
232 | + echo ' |
|
223 | 233 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
234 | + } |
|
224 | 235 | |
225 | 236 | echo ' |
226 | 237 | </select> |
@@ -249,14 +260,15 @@ discard block |
||
249 | 260 | </dd>'; |
250 | 261 | |
251 | 262 | // Loop through all the choices and print them out. |
252 | - foreach ($context['choices'] as $choice) |
|
253 | - echo ' |
|
263 | + foreach ($context['choices'] as $choice) { |
|
264 | + echo ' |
|
254 | 265 | <dt> |
255 | 266 | <label for="options-', $choice['id'], '">', $txt['option'], ' ', $choice['number'], '</label>: |
256 | 267 | </dt> |
257 | 268 | <dd> |
258 | 269 | <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="255"> |
259 | 270 | </dd>'; |
271 | + } |
|
260 | 272 | |
261 | 273 | echo ' |
262 | 274 | <p id="pollMoreOptions"></p> |
@@ -286,14 +298,15 @@ discard block |
||
286 | 298 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '> |
287 | 299 | </dd>'; |
288 | 300 | |
289 | - if ($context['poll_options']['guest_vote_enabled']) |
|
290 | - echo ' |
|
301 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
302 | + echo ' |
|
291 | 303 | <dt> |
292 | 304 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
293 | 305 | </dt> |
294 | 306 | <dd> |
295 | 307 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '> |
296 | 308 | </dd>'; |
309 | + } |
|
297 | 310 | |
298 | 311 | echo ' |
299 | 312 | <dt> |
@@ -314,8 +327,8 @@ discard block |
||
314 | 327 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
315 | 328 | |
316 | 329 | // If we're editing and displaying edit details, show a box where they can say why |
317 | - if (isset($context['editing']) && $modSettings['show_modify']) |
|
318 | - echo ' |
|
330 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
331 | + echo ' |
|
319 | 332 | <dl> |
320 | 333 | <dt class="clear"> |
321 | 334 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -324,20 +337,23 @@ discard block |
||
324 | 337 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80"> |
325 | 338 | </dd> |
326 | 339 | </dl>'; |
340 | + } |
|
327 | 341 | |
328 | 342 | // If this message has been edited in the past - display when it was. |
329 | - if (isset($context['last_modified'])) |
|
330 | - echo ' |
|
343 | + if (isset($context['last_modified'])) { |
|
344 | + echo ' |
|
331 | 345 | <div class="padding smalltext"> |
332 | 346 | ', $context['last_modified_text'], ' |
333 | 347 | </div>'; |
348 | + } |
|
334 | 349 | |
335 | 350 | // If the admin has enabled the hiding of the additional options - show a link and image for it. |
336 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
337 | - echo ' |
|
351 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
352 | + echo ' |
|
338 | 353 | <div id="postAdditionalOptionsHeader"> |
339 | 354 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
340 | 355 | </div>'; |
356 | + } |
|
341 | 357 | |
342 | 358 | echo ' |
343 | 359 | <div id="postAdditionalOptions">'; |
@@ -370,19 +386,21 @@ discard block |
||
370 | 386 | ', $txt['uncheck_unwatchd_attach'], ': |
371 | 387 | </dd>'; |
372 | 388 | |
373 | - foreach ($context['current_attachments'] as $attachment) |
|
374 | - echo ' |
|
389 | + foreach ($context['current_attachments'] as $attachment) { |
|
390 | + echo ' |
|
375 | 391 | <dd class="smalltext"> |
376 | 392 | <label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', '> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), |
377 | 393 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1024) / 1024), 0)) : '', '</label> |
378 | 394 | </dd>'; |
395 | + } |
|
379 | 396 | |
380 | 397 | echo ' |
381 | 398 | </dl>'; |
382 | 399 | |
383 | - if (!empty($context['files_in_session_warning'])) |
|
384 | - echo ' |
|
400 | + if (!empty($context['files_in_session_warning'])) { |
|
401 | + echo ' |
|
385 | 402 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
403 | + } |
|
386 | 404 | } |
387 | 405 | |
388 | 406 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -443,8 +461,8 @@ discard block |
||
443 | 461 | ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1024 . '">'); |
444 | 462 | |
445 | 463 | // Show more boxes if they aren't approaching that limit. |
446 | - if ($context['num_allowed_attachments'] > 1) |
|
447 | - echo ' |
|
464 | + if ($context['num_allowed_attachments'] > 1) { |
|
465 | + echo ' |
|
448 | 466 | <script> |
449 | 467 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
450 | 468 | var current_attachment = 1; |
@@ -464,6 +482,7 @@ discard block |
||
464 | 482 | <a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a> |
465 | 483 | </div><!-- .fallback --> |
466 | 484 | </div><!-- #attachUpload -->'; |
485 | + } |
|
467 | 486 | |
468 | 487 | echo ' |
469 | 488 | </dd>'; |
@@ -475,21 +494,25 @@ discard block |
||
475 | 494 | <dd class="smalltext">'; |
476 | 495 | |
477 | 496 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
478 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
479 | - echo ' |
|
497 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
498 | + echo ' |
|
480 | 499 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
500 | + } |
|
481 | 501 | |
482 | - if (!empty($context['attachment_restrictions'])) |
|
483 | - echo ' |
|
502 | + if (!empty($context['attachment_restrictions'])) { |
|
503 | + echo ' |
|
484 | 504 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
505 | + } |
|
485 | 506 | |
486 | - if ($context['num_allowed_attachments'] == 0) |
|
487 | - echo ' |
|
507 | + if ($context['num_allowed_attachments'] == 0) { |
|
508 | + echo ' |
|
488 | 509 | ', $txt['attach_limit_nag'], '<br>'; |
510 | + } |
|
489 | 511 | |
490 | - if (!$context['can_post_attachment_unapproved']) |
|
491 | - echo ' |
|
512 | + if (!$context['can_post_attachment_unapproved']) { |
|
513 | + echo ' |
|
492 | 514 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
515 | + } |
|
493 | 516 | |
494 | 517 | echo ' |
495 | 518 | </dd> |
@@ -513,24 +536,26 @@ discard block |
||
513 | 536 | <dt><strong>', $txt['subject'], '</strong></dt> |
514 | 537 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
515 | 538 | |
516 | - foreach ($context['drafts'] as $draft) |
|
517 | - echo ' |
|
539 | + foreach ($context['drafts'] as $draft) { |
|
540 | + echo ' |
|
518 | 541 | <dt>', $draft['link'], '</dt> |
519 | 542 | <dd>', $draft['poster_time'], '</dd>'; |
543 | + } |
|
520 | 544 | echo ' |
521 | 545 | </dl> |
522 | 546 | </div>'; |
523 | 547 | } |
524 | 548 | |
525 | 549 | // Is visual verification enabled? |
526 | - if ($context['require_verification']) |
|
527 | - echo ' |
|
550 | + if ($context['require_verification']) { |
|
551 | + echo ' |
|
528 | 552 | <div class="post_verification"> |
529 | 553 | <span', !empty($context['post_error']['need_qr_verification']) ? ' class="error"' : '', '> |
530 | 554 | <strong>', $txt['verification'], ':</strong> |
531 | 555 | </span> |
532 | 556 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
533 | 557 | </div>'; |
558 | + } |
|
534 | 559 | |
535 | 560 | // Finally, the submit buttons. |
536 | 561 | echo ' |
@@ -539,9 +564,10 @@ discard block |
||
539 | 564 | ', template_control_richedit_buttons($context['post_box_name']); |
540 | 565 | |
541 | 566 | // Option to delete an event if user is editing one. |
542 | - if ($context['make_event'] && !$context['event']['new']) |
|
543 | - echo ' |
|
567 | + if ($context['make_event'] && !$context['event']['new']) { |
|
568 | + echo ' |
|
544 | 569 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">'; |
570 | + } |
|
545 | 571 | |
546 | 572 | echo ' |
547 | 573 | </span> |
@@ -550,9 +576,10 @@ discard block |
||
550 | 576 | <br class="clear">'; |
551 | 577 | |
552 | 578 | // Assuming this isn't a new topic pass across the last message id. |
553 | - if (isset($context['topic_last_message'])) |
|
554 | - echo ' |
|
579 | + if (isset($context['topic_last_message'])) { |
|
580 | + echo ' |
|
555 | 581 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
582 | + } |
|
556 | 583 | |
557 | 584 | echo ' |
558 | 585 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -694,9 +721,10 @@ discard block |
||
694 | 721 | |
695 | 722 | newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">« <strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \' »</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';'; |
696 | 723 | |
697 | - if ($context['can_quote']) |
|
698 | - echo ' |
|
724 | + if ($context['can_quote']) { |
|
725 | + echo ' |
|
699 | 726 | newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';'; |
727 | + } |
|
700 | 728 | |
701 | 729 | echo ' |
702 | 730 | newPostsHTML += \'<br class="clear">\'; |
@@ -739,8 +767,8 @@ discard block |
||
739 | 767 | }'; |
740 | 768 | |
741 | 769 | // Code for showing and hiding additional options. |
742 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
743 | - echo ' |
|
770 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
771 | + echo ' |
|
744 | 772 | var oSwapAdditionalOptions = new smc_Toggle({ |
745 | 773 | bToggleEnabled: true, |
746 | 774 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -768,10 +796,11 @@ discard block |
||
768 | 796 | } |
769 | 797 | ] |
770 | 798 | });'; |
799 | + } |
|
771 | 800 | |
772 | 801 | // Code for showing and hiding drafts |
773 | - if (!empty($context['drafts'])) |
|
774 | - echo ' |
|
802 | + if (!empty($context['drafts'])) { |
|
803 | + echo ' |
|
775 | 804 | var oSwapDraftOptions = new smc_Toggle({ |
776 | 805 | bToggleEnabled: true, |
777 | 806 | bCurrentlyCollapsed: true, |
@@ -793,6 +822,7 @@ discard block |
||
793 | 822 | } |
794 | 823 | ] |
795 | 824 | });'; |
825 | + } |
|
796 | 826 | |
797 | 827 | echo ' |
798 | 828 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -813,8 +843,9 @@ discard block |
||
813 | 843 | foreach ($context['previous_posts'] as $post) |
814 | 844 | { |
815 | 845 | $ignoring = false; |
816 | - if (!empty($post['is_ignored'])) |
|
817 | - $ignored_posts[] = $ignoring = $post['id']; |
|
846 | + if (!empty($post['is_ignored'])) { |
|
847 | + $ignored_posts[] = $ignoring = $post['id']; |
|
848 | + } |
|
818 | 849 | |
819 | 850 | echo ' |
820 | 851 | <div class="windowbg"> |
@@ -824,22 +855,24 @@ discard block |
||
824 | 855 | </h5> |
825 | 856 | - ', $post['time']; |
826 | 857 | |
827 | - if ($context['can_quote']) |
|
828 | - echo ' |
|
858 | + if ($context['can_quote']) { |
|
859 | + echo ' |
|
829 | 860 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
830 | 861 | <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li> |
831 | 862 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
832 | 863 | </ul>'; |
864 | + } |
|
833 | 865 | |
834 | 866 | echo ' |
835 | 867 | <br class="clear">'; |
836 | 868 | |
837 | - if ($ignoring) |
|
838 | - echo ' |
|
869 | + if ($ignoring) { |
|
870 | + echo ' |
|
839 | 871 | <div id="msg_', $post['id'], '_ignored_prompt" class="smalltext"> |
840 | 872 | ', $txt['ignoring_user'], ' |
841 | 873 | <a href="#" id="msg_', $post['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
842 | 874 | </div>'; |
875 | + } |
|
843 | 876 | |
844 | 877 | echo ' |
845 | 878 | <div class="list_posts smalltext" id="msg_', $post['id'], '_body" data-msgid="', $post['id'], '">', $post['message'], '</div> |
@@ -993,10 +1026,10 @@ discard block |
||
993 | 1026 | <div id="temporary_posting_area" style="display: none;"></div> |
994 | 1027 | <script>'; |
995 | 1028 | |
996 | - if ($context['close_window']) |
|
997 | - echo ' |
|
1029 | + if ($context['close_window']) { |
|
1030 | + echo ' |
|
998 | 1031 | window.close();'; |
999 | - else |
|
1032 | + } else |
|
1000 | 1033 | { |
1001 | 1034 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;) |
1002 | 1035 | echo ' |
@@ -1050,11 +1083,12 @@ discard block |
||
1050 | 1083 | </p> |
1051 | 1084 | <ul>'; |
1052 | 1085 | |
1053 | - foreach ($context['groups'] as $group) |
|
1054 | - echo ' |
|
1086 | + foreach ($context['groups'] as $group) { |
|
1087 | + echo ' |
|
1055 | 1088 | <li> |
1056 | 1089 | <label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em> |
1057 | 1090 | </li>'; |
1091 | + } |
|
1058 | 1092 | |
1059 | 1093 | echo ' |
1060 | 1094 | <li> |
@@ -18,11 +18,12 @@ discard block |
||
18 | 18 | global $context, $settings, $options, $scripturl, $modSettings, $txt; |
19 | 19 | |
20 | 20 | // Let them know why their message became unapproved. |
21 | - if ($context['becomesUnapproved']) |
|
22 | - echo ' |
|
21 | + if ($context['becomesUnapproved']) { |
|
22 | + echo ' |
|
23 | 23 | <div class="noticebox"> |
24 | 24 | ', $txt['post_becomesUnapproved'], ' |
25 | 25 | </div>'; |
26 | + } |
|
26 | 27 | |
27 | 28 | if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) |
28 | 29 | { |
@@ -46,17 +47,19 @@ discard block |
||
46 | 47 | </a>'; |
47 | 48 | |
48 | 49 | // Has it outstanding posts for approval? |
49 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
50 | - echo ' |
|
50 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
51 | + echo ' |
|
51 | 52 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>'; |
53 | + } |
|
52 | 54 | |
53 | 55 | echo ' |
54 | 56 | <p class="board_description">', $board['description'], '</p>'; |
55 | 57 | |
56 | 58 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
57 | - if (!empty($board['moderators']) || !empty($board['moderator_groups'])) |
|
58 | - echo ' |
|
59 | + if (!empty($board['moderators']) || !empty($board['moderator_groups'])) { |
|
60 | + echo ' |
|
59 | 61 | <p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
62 | + } |
|
60 | 63 | |
61 | 64 | // Show some basic information about the number of posts, etc. |
62 | 65 | echo ' |
@@ -68,9 +71,10 @@ discard block |
||
68 | 71 | </div> |
69 | 72 | <div class="lastpost lpr_border">'; |
70 | 73 | |
71 | - if (!empty($board['last_post']['id'])) |
|
72 | - echo ' |
|
74 | + if (!empty($board['last_post']['id'])) { |
|
75 | + echo ' |
|
73 | 76 | <p>', $board['last_post']['last_post_message'], '</p>'; |
77 | + } |
|
74 | 78 | |
75 | 79 | echo ' |
76 | 80 | </div>'; |
@@ -84,14 +88,16 @@ discard block |
||
84 | 88 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
85 | 89 | foreach ($board['children'] as $child) |
86 | 90 | { |
87 | - if (!$child['is_redirect']) |
|
88 | - $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
89 | - else |
|
90 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
91 | + if (!$child['is_redirect']) { |
|
92 | + $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
93 | + } else { |
|
94 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
95 | + } |
|
91 | 96 | |
92 | 97 | // Has it posts awaiting approval? |
93 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) |
|
94 | - $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
98 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) { |
|
99 | + $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
100 | + } |
|
95 | 101 | |
96 | 102 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
97 | 103 | } |
@@ -111,8 +117,9 @@ discard block |
||
111 | 117 | } |
112 | 118 | |
113 | 119 | // They can only mark read if they are logged in and it's enabled! |
114 | - if (!$context['user']['is_logged']) |
|
115 | - unset($context['normal_buttons']['markread']); |
|
120 | + if (!$context['user']['is_logged']) { |
|
121 | + unset($context['normal_buttons']['markread']); |
|
122 | + } |
|
116 | 123 | |
117 | 124 | if (!$context['no_topic_listing']) |
118 | 125 | { |
@@ -139,13 +146,15 @@ discard block |
||
139 | 146 | <h3>', $context['name'], '</h3> |
140 | 147 | <p>'; |
141 | 148 | |
142 | - if ($context['description'] != '') |
|
143 | - echo ' |
|
149 | + if ($context['description'] != '') { |
|
150 | + echo ' |
|
144 | 151 | ', $context['description']; |
152 | + } |
|
145 | 153 | |
146 | - if (!empty($context['moderators'])) |
|
147 | - echo ' |
|
154 | + if (!empty($context['moderators'])) { |
|
155 | + echo ' |
|
148 | 156 | ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.'; |
157 | + } |
|
149 | 158 | |
150 | 159 | echo ' |
151 | 160 | </p> |
@@ -153,9 +162,10 @@ discard block |
||
153 | 162 | } |
154 | 163 | |
155 | 164 | // If Quick Moderation is enabled start the form. |
156 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
157 | - echo ' |
|
165 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
166 | + echo ' |
|
158 | 167 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
168 | + } |
|
159 | 169 | |
160 | 170 | echo ' |
161 | 171 | <div id="messageindex">'; |
@@ -165,11 +175,11 @@ discard block |
||
165 | 175 | echo ' |
166 | 176 | <div class="information">'; |
167 | 177 | |
168 | - if ($settings['display_who_viewing'] == 1) |
|
169 | - echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
170 | - |
|
171 | - else |
|
172 | - 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'] . ')'); |
|
178 | + if ($settings['display_who_viewing'] == 1) { |
|
179 | + echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
180 | + } else { |
|
181 | + 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'] . ')'); |
|
182 | + } |
|
173 | 183 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board']; |
174 | 184 | |
175 | 185 | echo ' |
@@ -189,32 +199,36 @@ discard block |
||
189 | 199 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
190 | 200 | |
191 | 201 | // Show a "select all" box for quick moderation? |
192 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
|
193 | - echo ' |
|
202 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
203 | + echo ' |
|
194 | 204 | <div class="moderation"> |
195 | 205 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
196 | 206 | </div>'; |
207 | + } |
|
197 | 208 | |
198 | 209 | // If it's on in "image" mode, don't show anything but the column. |
199 | - elseif (!empty($context['can_quick_mod'])) |
|
200 | - echo ' |
|
210 | + elseif (!empty($context['can_quick_mod'])) { |
|
211 | + echo ' |
|
201 | 212 | <div class="moderation"></div>'; |
213 | + } |
|
202 | 214 | } |
203 | 215 | |
204 | 216 | // No topics... just say, "sorry bub". |
205 | - else |
|
206 | - echo ' |
|
217 | + else { |
|
218 | + echo ' |
|
207 | 219 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
220 | + } |
|
208 | 221 | |
209 | 222 | echo ' |
210 | 223 | </div><!-- #topic_header -->'; |
211 | 224 | |
212 | 225 | // If this person can approve items and we have some awaiting approval tell them. |
213 | - if (!empty($context['unapproved_posts_message'])) |
|
214 | - echo ' |
|
226 | + if (!empty($context['unapproved_posts_message'])) { |
|
227 | + echo ' |
|
215 | 228 | <div class="information"> |
216 | 229 | <span class="alert">!</span> ', $context['unapproved_posts_message'], ' |
217 | 230 | </div>'; |
231 | + } |
|
218 | 232 | |
219 | 233 | // Contain the topic list |
220 | 234 | echo ' |
@@ -235,25 +249,30 @@ discard block |
||
235 | 249 | echo ' |
236 | 250 | <div class="icons floatright">'; |
237 | 251 | |
238 | - if ($topic['is_watched']) |
|
239 | - echo ' |
|
252 | + if ($topic['is_watched']) { |
|
253 | + echo ' |
|
240 | 254 | <span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
255 | + } |
|
241 | 256 | |
242 | - if ($topic['is_locked']) |
|
243 | - echo ' |
|
257 | + if ($topic['is_locked']) { |
|
258 | + echo ' |
|
244 | 259 | <span class="generic_icons lock"></span>'; |
260 | + } |
|
245 | 261 | |
246 | - if ($topic['is_sticky']) |
|
247 | - echo ' |
|
262 | + if ($topic['is_sticky']) { |
|
263 | + echo ' |
|
248 | 264 | <span class="generic_icons sticky"></span>'; |
265 | + } |
|
249 | 266 | |
250 | - if ($topic['is_redirect']) |
|
251 | - echo ' |
|
267 | + if ($topic['is_redirect']) { |
|
268 | + echo ' |
|
252 | 269 | <span class="generic_icons move"></span>'; |
270 | + } |
|
253 | 271 | |
254 | - if ($topic['is_poll']) |
|
255 | - echo ' |
|
272 | + if ($topic['is_poll']) { |
|
273 | + echo ' |
|
256 | 274 | <span class="generic_icons poll"></span>'; |
275 | + } |
|
257 | 276 | |
258 | 277 | echo ' |
259 | 278 | </div>'; |
@@ -285,26 +304,31 @@ discard block |
||
285 | 304 | echo ' |
286 | 305 | <div class="moderation">'; |
287 | 306 | |
288 | - if ($options['display_quick_mod'] == 1) |
|
289 | - echo ' |
|
307 | + if ($options['display_quick_mod'] == 1) { |
|
308 | + echo ' |
|
290 | 309 | <input type="checkbox" name="topics[]" value="', $topic['id'], '">'; |
291 | - else |
|
310 | + } else |
|
292 | 311 | { |
293 | 312 | // Check permissions on each and show only the ones they are allowed to use. |
294 | - if ($topic['quick_mod']['remove']) |
|
295 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
313 | + if ($topic['quick_mod']['remove']) { |
|
314 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
315 | + } |
|
296 | 316 | |
297 | - if ($topic['quick_mod']['lock']) |
|
298 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
317 | + if ($topic['quick_mod']['lock']) { |
|
318 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
319 | + } |
|
299 | 320 | |
300 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
301 | - echo '<br>'; |
|
321 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
322 | + echo '<br>'; |
|
323 | + } |
|
302 | 324 | |
303 | - if ($topic['quick_mod']['sticky']) |
|
304 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
325 | + if ($topic['quick_mod']['sticky']) { |
|
326 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>'; |
|
327 | + } |
|
305 | 328 | |
306 | - if ($topic['quick_mod']['move']) |
|
307 | - echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
329 | + if ($topic['quick_mod']['move']) { |
|
330 | + echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
331 | + } |
|
308 | 332 | } |
309 | 333 | echo ' |
310 | 334 | </div><!-- .moderation -->'; |
@@ -322,18 +346,20 @@ discard block |
||
322 | 346 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
323 | 347 | <option value="">--------</option>'; |
324 | 348 | |
325 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
326 | - if ($context['can_' . $qmod_action]) |
|
349 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
350 | + if ($context['can_' . $qmod_action]) |
|
327 | 351 | echo ' |
328 | 352 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
353 | + } |
|
329 | 354 | |
330 | 355 | echo ' |
331 | 356 | </select>'; |
332 | 357 | |
333 | 358 | // Show a list of boards they can move the topic to. |
334 | - if ($context['can_move']) |
|
335 | - echo ' |
|
359 | + if ($context['can_move']) { |
|
360 | + echo ' |
|
336 | 361 | <span id="quick_mod_jump_to"></span>'; |
362 | + } |
|
337 | 363 | |
338 | 364 | echo ' |
339 | 365 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button qaction"> |
@@ -344,10 +370,11 @@ discard block |
||
344 | 370 | </div><!-- #messageindex -->'; |
345 | 371 | |
346 | 372 | // Finish off the form - again. |
347 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
348 | - echo ' |
|
373 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
374 | + echo ' |
|
349 | 375 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
350 | 376 | </form>'; |
377 | + } |
|
351 | 378 | |
352 | 379 | // Mobile action buttons (bottom) |
353 | 380 | echo ' |
@@ -369,8 +396,8 @@ discard block |
||
369 | 396 | // Show breadcrumbs at the bottom too. |
370 | 397 | theme_linktree(); |
371 | 398 | |
372 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
373 | - echo ' |
|
399 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
400 | + echo ' |
|
374 | 401 | <script> |
375 | 402 | if (typeof(window.XMLHttpRequest) != "undefined") |
376 | 403 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -389,6 +416,7 @@ discard block |
||
389 | 416 | sCustomName: "move_to" |
390 | 417 | }); |
391 | 418 | </script>'; |
419 | + } |
|
392 | 420 | |
393 | 421 | // Javascript for inline editing. |
394 | 422 | echo ' |
@@ -425,8 +453,8 @@ discard block |
||
425 | 453 | <div class="information"> |
426 | 454 | <p class="floatright" id="message_index_jump_to"></p>'; |
427 | 455 | |
428 | - if (empty($context['no_topic_listing'])) |
|
429 | - echo ' |
|
456 | + if (empty($context['no_topic_listing'])) { |
|
457 | + echo ' |
|
430 | 458 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
431 | 459 | <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', ' |
432 | 460 | '. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br> |
@@ -436,9 +464,10 @@ discard block |
||
436 | 464 | <span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br> |
437 | 465 | <span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br> |
438 | 466 | </p>'; |
467 | + } |
|
439 | 468 | |
440 | - if (!empty($context['jump_to'])) |
|
441 | - echo ' |
|
469 | + if (!empty($context['jump_to'])) { |
|
470 | + echo ' |
|
442 | 471 | <script> |
443 | 472 | if (typeof(window.XMLHttpRequest) != "undefined") |
444 | 473 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -454,6 +483,7 @@ discard block |
||
454 | 483 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
455 | 484 | }); |
456 | 485 | </script>'; |
486 | + } |
|
457 | 487 | |
458 | 488 | echo ' |
459 | 489 | <br class="clear"> |