@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | </dd>'; |
614 | 614 | } |
615 | 615 | // A Textarea? |
616 | - elseif ($setting['type'] == 'textarea') |
|
616 | + elseif ($setting['type'] == 'textarea') |
|
617 | 617 | { |
618 | 618 | echo ' |
619 | 619 | <dt> |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | </dt> |
627 | 627 | <dd> |
628 | 628 | <textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>'; |
629 | - echo ' |
|
629 | + echo ' |
|
630 | 630 | </dd>'; |
631 | 631 | } |
632 | 632 | // A regular input box, then? |
@@ -54,9 +54,10 @@ discard block |
||
54 | 54 | <dd> |
55 | 55 | <div id="known_themes_list">'; |
56 | 56 | |
57 | - foreach ($context['themes'] as $theme) |
|
58 | - echo ' |
|
57 | + foreach ($context['themes'] as $theme) { |
|
58 | + echo ' |
|
59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>'; |
60 | + } |
|
60 | 61 | |
61 | 62 | echo ' |
62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
74 | 75 | |
75 | 76 | // Put an option for each theme in the select box. |
76 | - foreach ($context['themes'] as $theme) |
|
77 | - echo ' |
|
77 | + foreach ($context['themes'] as $theme) { |
|
78 | + echo ' |
|
78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
80 | + } |
|
79 | 81 | |
80 | 82 | echo ' |
81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
91 | 93 | |
92 | 94 | // Same thing, this time for changing the theme of everyone. |
93 | - foreach ($context['themes'] as $theme) |
|
94 | - echo ' |
|
95 | + foreach ($context['themes'] as $theme) { |
|
96 | + echo ' |
|
95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
98 | + } |
|
96 | 99 | |
97 | 100 | echo ' |
98 | 101 | </select> |
@@ -189,11 +192,12 @@ discard block |
||
189 | 192 | global $context, $scripturl, $txt; |
190 | 193 | |
191 | 194 | // Show a nice confirmation message. |
192 | - if (isset($_GET['done'])) |
|
193 | - echo ' |
|
195 | + if (isset($_GET['done'])) { |
|
196 | + echo ' |
|
194 | 197 | <div class="infobox"> |
195 | 198 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
196 | 199 | </div>'; |
200 | + } |
|
197 | 201 | |
198 | 202 | echo ' |
199 | 203 | <div id="admincenter">'; |
@@ -353,22 +357,24 @@ discard block |
||
353 | 357 | <dt ', $context['theme_options_reset'] ? 'style="width:50%"' : '', '>'; |
354 | 358 | |
355 | 359 | // Show the change option box ? |
356 | - if ($context['theme_options_reset']) |
|
357 | - echo ' |
|
360 | + if ($context['theme_options_reset']) { |
|
361 | + echo ' |
|
358 | 362 | <span class="floatleft"><select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
359 | 363 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
360 | 364 | <option value="1">', $txt['themeadmin_reset_options_change'], '</option> |
361 | 365 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
362 | 366 | </select> </span>'; |
367 | + } |
|
363 | 368 | |
364 | 369 | // display checkbox options |
365 | 370 | if ($setting['type'] == 'checkbox') |
366 | 371 | { |
367 | 372 | echo ' |
368 | 373 | <label for="options_', $setting['id'], '">', $setting['label'], '</label>'; |
369 | - if (isset($setting['description'])) |
|
370 | - echo ' |
|
374 | + if (isset($setting['description'])) { |
|
375 | + echo ' |
|
371 | 376 | <br><span class="smalltext">', $setting['description'], '</span>'; |
377 | + } |
|
372 | 378 | echo ' |
373 | 379 | </dt> |
374 | 380 | <dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '> |
@@ -380,9 +386,10 @@ discard block |
||
380 | 386 | { |
381 | 387 | echo ' |
382 | 388 | <label for="options_', $setting['id'], '">', $setting['label'], '</label>'; |
383 | - if (isset($setting['description'])) |
|
384 | - echo ' |
|
389 | + if (isset($setting['description'])) { |
|
390 | + echo ' |
|
385 | 391 | <br><span class="smalltext">', $setting['description'], '</span>'; |
392 | + } |
|
386 | 393 | echo ' |
387 | 394 | </dt> |
388 | 395 | <dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '> |
@@ -402,9 +409,10 @@ discard block |
||
402 | 409 | { |
403 | 410 | echo ' |
404 | 411 | <label for="options_', $setting['id'], '">', $setting['label'], '</label>'; |
405 | - if (isset($setting['description'])) |
|
406 | - echo ' |
|
412 | + if (isset($setting['description'])) { |
|
413 | + echo ' |
|
407 | 414 | <br><span class="smalltext">', $setting['description'], '</span>'; |
415 | + } |
|
408 | 416 | echo ' |
409 | 417 | </dt> |
410 | 418 | <dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>'; |
@@ -417,13 +425,11 @@ discard block |
||
417 | 425 | |
418 | 426 | echo ' |
419 | 427 | <input type="number"', $min . $max . $step; |
420 | - } |
|
421 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
428 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
422 | 429 | { |
423 | 430 | echo' |
424 | 431 | <input type="url"'; |
425 | - } |
|
426 | - else |
|
432 | + } else |
|
427 | 433 | { |
428 | 434 | echo ' |
429 | 435 | <input type="text"'; |
@@ -467,8 +473,8 @@ discard block |
||
467 | 473 | <br>'; |
468 | 474 | |
469 | 475 | // @todo Why can't I edit the default theme popup. |
470 | - if ($context['theme_settings']['theme_id'] != 1) |
|
471 | - echo ' |
|
476 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
477 | + echo ' |
|
472 | 478 | <div class="cat_bar"> |
473 | 479 | <h3 class="catbg config_hd"> |
474 | 480 | ', $txt['theme_edit'], ' |
@@ -484,6 +490,7 @@ discard block |
||
484 | 490 | </li> |
485 | 491 | </ul> |
486 | 492 | </div>'; |
493 | + } |
|
487 | 494 | |
488 | 495 | echo ' |
489 | 496 | <div class="cat_bar"> |
@@ -537,9 +544,10 @@ discard block |
||
537 | 544 | <dd> |
538 | 545 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
539 | 546 | |
540 | - foreach ($context['theme_variants'] as $key => $variant) |
|
541 | - echo ' |
|
547 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
548 | + echo ' |
|
542 | 549 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
550 | + } |
|
543 | 551 | |
544 | 552 | echo ' |
545 | 553 | </select> |
@@ -582,9 +590,10 @@ discard block |
||
582 | 590 | <dt> |
583 | 591 | <label for="', $setting['id'], '">', $setting['label'], '</label>:'; |
584 | 592 | |
585 | - if (isset($setting['description'])) |
|
586 | - echo '<br> |
|
593 | + if (isset($setting['description'])) { |
|
594 | + echo '<br> |
|
587 | 595 | <span class="smalltext">', $setting['description'], '</span>'; |
596 | + } |
|
588 | 597 | |
589 | 598 | echo ' |
590 | 599 | </dt> |
@@ -600,18 +609,20 @@ discard block |
||
600 | 609 | <dt> |
601 | 610 | <label for="', $setting['id'], '">', $setting['label'], '</label>:'; |
602 | 611 | |
603 | - if (isset($setting['description'])) |
|
604 | - echo '<br> |
|
612 | + if (isset($setting['description'])) { |
|
613 | + echo '<br> |
|
605 | 614 | <span class="smalltext">', $setting['description'], '</span>'; |
615 | + } |
|
606 | 616 | |
607 | 617 | echo ' |
608 | 618 | </dt> |
609 | 619 | <dd> |
610 | 620 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
611 | 621 | |
612 | - foreach ($setting['options'] as $value => $label) |
|
613 | - echo ' |
|
622 | + foreach ($setting['options'] as $value => $label) { |
|
623 | + echo ' |
|
614 | 624 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
625 | + } |
|
615 | 626 | |
616 | 627 | echo ' |
617 | 628 | </select> |
@@ -624,9 +635,10 @@ discard block |
||
624 | 635 | <dt> |
625 | 636 | <label for="', $setting['id'], '">', $setting['label'], '</label>:'; |
626 | 637 | |
627 | - if (isset($setting['description'])) |
|
628 | - echo '<br> |
|
638 | + if (isset($setting['description'])) { |
|
639 | + echo '<br> |
|
629 | 640 | <span class="smalltext">', $setting['description'], '</span>'; |
641 | + } |
|
630 | 642 | echo ' |
631 | 643 | </dt> |
632 | 644 | <dd> |
@@ -641,9 +653,10 @@ discard block |
||
641 | 653 | <dt> |
642 | 654 | <label for="', $setting['id'], '">', $setting['label'], '</label>:'; |
643 | 655 | |
644 | - if (isset($setting['description'])) |
|
645 | - echo '<br> |
|
656 | + if (isset($setting['description'])) { |
|
657 | + echo '<br> |
|
646 | 658 | <span class="smalltext">', $setting['description'], '</span>'; |
659 | + } |
|
647 | 660 | |
648 | 661 | echo ' |
649 | 662 | </dt> |
@@ -657,13 +670,11 @@ discard block |
||
657 | 670 | |
658 | 671 | echo ' |
659 | 672 | <input type="number"', $min . $max . $step; |
660 | - } |
|
661 | - else if (isset($setting['type']) && $setting['type'] == 'url') |
|
673 | + } else if (isset($setting['type']) && $setting['type'] == 'url') |
|
662 | 674 | { |
663 | 675 | echo' |
664 | 676 | <input type="url"'; |
665 | - } |
|
666 | - else |
|
677 | + } else |
|
667 | 678 | { |
668 | 679 | echo ' |
669 | 680 | <input type="text"'; |
@@ -816,21 +827,23 @@ discard block |
||
816 | 827 | <div class="windowbg">'; |
817 | 828 | |
818 | 829 | // Oops! there was an error :( |
819 | - if (!empty($context['error_message'])) |
|
820 | - echo ' |
|
830 | + if (!empty($context['error_message'])) { |
|
831 | + echo ' |
|
821 | 832 | <p> |
822 | 833 | ', $context['error_message'], ' |
823 | 834 | </p>'; |
835 | + } |
|
824 | 836 | |
825 | 837 | // Not much to show except a link back... |
826 | - else |
|
827 | - echo ' |
|
838 | + else { |
|
839 | + echo ' |
|
828 | 840 | <p> |
829 | 841 | <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'], ' |
830 | 842 | </p> |
831 | 843 | <p> |
832 | 844 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
833 | 845 | </p>'; |
846 | + } |
|
834 | 847 | |
835 | 848 | echo ' |
836 | 849 | </div> |
@@ -897,10 +910,11 @@ discard block |
||
897 | 910 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
898 | 911 | <span class="floatright">'; |
899 | 912 | |
900 | - if ($template['can_copy']) |
|
901 | - echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
|
902 | - else |
|
903 | - echo $txt['themeadmin_edit_no_copy']; |
|
913 | + if ($template['can_copy']) { |
|
914 | + echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
|
915 | + } else { |
|
916 | + echo $txt['themeadmin_edit_no_copy']; |
|
917 | + } |
|
904 | 918 | |
905 | 919 | echo ' |
906 | 920 | </span> |
@@ -923,11 +937,12 @@ discard block |
||
923 | 937 | echo ' |
924 | 938 | <div id="admincenter">'; |
925 | 939 | |
926 | - if (!empty($context['browse_title'])) |
|
927 | - echo ' |
|
940 | + if (!empty($context['browse_title'])) { |
|
941 | + echo ' |
|
928 | 942 | <div class="cat_bar"> |
929 | 943 | <h3 class="catbg">', $context['browse_title'], '</h3> |
930 | 944 | </div>'; |
945 | + } |
|
931 | 946 | |
932 | 947 | echo ' |
933 | 948 | <table class="table_grid tborder"> |
@@ -947,14 +962,13 @@ discard block |
||
947 | 962 | <tr class="windowbg"> |
948 | 963 | <td>'; |
949 | 964 | |
950 | - if ($file['is_editable']) |
|
951 | - echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
|
952 | - |
|
953 | - elseif ($file['is_directory']) |
|
954 | - echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
|
955 | - |
|
956 | - else |
|
957 | - echo $file['filename']; |
|
965 | + if ($file['is_editable']) { |
|
966 | + echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
|
967 | + } elseif ($file['is_directory']) { |
|
968 | + echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
|
969 | + } else { |
|
970 | + echo $file['filename']; |
|
971 | + } |
|
958 | 972 | |
959 | 973 | echo ' |
960 | 974 | </td> |
@@ -976,11 +990,12 @@ discard block |
||
976 | 990 | { |
977 | 991 | global $context, $settings, $scripturl, $txt; |
978 | 992 | |
979 | - if ($context['session_error']) |
|
980 | - echo ' |
|
993 | + if ($context['session_error']) { |
|
994 | + echo ' |
|
981 | 995 | <div class="errorbox"> |
982 | 996 | ', $txt['error_session_timeout'], ' |
983 | 997 | </div>'; |
998 | + } |
|
984 | 999 | |
985 | 1000 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
986 | 1001 | echo ' |
@@ -1043,17 +1058,18 @@ discard block |
||
1043 | 1058 | try |
1044 | 1059 | { |
1045 | 1060 | '; |
1046 | - if (isBrowser('is_ie')) |
|
1047 | - echo ' |
|
1061 | + if (isBrowser('is_ie')) { |
|
1062 | + echo ' |
|
1048 | 1063 | var sheets = frames["css_preview_box"].document.styleSheets; |
1049 | 1064 | for (var j = 0; j < sheets.length; j++) |
1050 | 1065 | { |
1051 | 1066 | if (sheets[j].id == "css_preview_box") |
1052 | 1067 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
1053 | 1068 | }'; |
1054 | - else |
|
1055 | - echo ' |
|
1069 | + } else { |
|
1070 | + echo ' |
|
1056 | 1071 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
1072 | + } |
|
1057 | 1073 | echo ' |
1058 | 1074 | } |
1059 | 1075 | catch (e) |
@@ -1105,9 +1121,10 @@ discard block |
||
1105 | 1121 | </div> |
1106 | 1122 | <div class="windowbg">'; |
1107 | 1123 | |
1108 | - if (!$context['allow_save']) |
|
1109 | - echo ' |
|
1124 | + if (!$context['allow_save']) { |
|
1125 | + echo ' |
|
1110 | 1126 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1127 | + } |
|
1111 | 1128 | |
1112 | 1129 | echo ' |
1113 | 1130 | <textarea name="entire_file" cols="80" rows="20" style="width: 96%; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br> |
@@ -1120,9 +1137,10 @@ discard block |
||
1120 | 1137 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1121 | 1138 | |
1122 | 1139 | // Hopefully it exists. |
1123 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1124 | - echo ' |
|
1140 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1141 | + echo ' |
|
1125 | 1142 | <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'], '">'; |
1143 | + } |
|
1126 | 1144 | |
1127 | 1145 | echo ' |
1128 | 1146 | </form> |
@@ -1136,18 +1154,20 @@ discard block |
||
1136 | 1154 | { |
1137 | 1155 | global $context, $scripturl, $txt; |
1138 | 1156 | |
1139 | - if ($context['session_error']) |
|
1140 | - echo ' |
|
1157 | + if ($context['session_error']) { |
|
1158 | + echo ' |
|
1141 | 1159 | <div class="errorbox"> |
1142 | 1160 | ', $txt['error_session_timeout'], ' |
1143 | 1161 | </div>'; |
1162 | + } |
|
1144 | 1163 | |
1145 | - if (isset($context['parse_error'])) |
|
1146 | - echo ' |
|
1164 | + if (isset($context['parse_error'])) { |
|
1165 | + echo ' |
|
1147 | 1166 | <div class="errorbox"> |
1148 | 1167 | ', $txt['themeadmin_edit_error'], ' |
1149 | 1168 | <div><pre>', $context['parse_error'], '</pre></div> |
1150 | 1169 | </div>'; |
1170 | + } |
|
1151 | 1171 | |
1152 | 1172 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1153 | 1173 | echo ' |
@@ -1158,16 +1178,18 @@ discard block |
||
1158 | 1178 | </div> |
1159 | 1179 | <div class="windowbg">'; |
1160 | 1180 | |
1161 | - if (!$context['allow_save']) |
|
1162 | - echo ' |
|
1181 | + if (!$context['allow_save']) { |
|
1182 | + echo ' |
|
1163 | 1183 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1184 | + } |
|
1164 | 1185 | |
1165 | - foreach ($context['file_parts'] as $part) |
|
1166 | - echo ' |
|
1186 | + foreach ($context['file_parts'] as $part) { |
|
1187 | + echo ' |
|
1167 | 1188 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
1168 | 1189 | <div class="centertext"> |
1169 | 1190 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
1170 | 1191 | </div>'; |
1192 | + } |
|
1171 | 1193 | |
1172 | 1194 | echo ' |
1173 | 1195 | <div class="padding righttext"> |
@@ -1176,9 +1198,10 @@ discard block |
||
1176 | 1198 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1177 | 1199 | |
1178 | 1200 | // Hopefully it exists. |
1179 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1180 | - echo ' |
|
1201 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1202 | + echo ' |
|
1181 | 1203 | <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'], '">'; |
1204 | + } |
|
1182 | 1205 | |
1183 | 1206 | echo ' |
1184 | 1207 | </div> |
@@ -1194,18 +1217,20 @@ discard block |
||
1194 | 1217 | { |
1195 | 1218 | global $context, $scripturl, $txt; |
1196 | 1219 | |
1197 | - if ($context['session_error']) |
|
1198 | - echo ' |
|
1220 | + if ($context['session_error']) { |
|
1221 | + echo ' |
|
1199 | 1222 | <div class="errorbox"> |
1200 | 1223 | ', $txt['error_session_timeout'], ' |
1201 | 1224 | </div>'; |
1225 | + } |
|
1202 | 1226 | |
1203 | 1227 | //Is this file writeable? |
1204 | - if (!$context['allow_save']) |
|
1205 | - echo ' |
|
1228 | + if (!$context['allow_save']) { |
|
1229 | + echo ' |
|
1206 | 1230 | <div class="errorbox"> |
1207 | 1231 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
1208 | 1232 | </div>'; |
1233 | + } |
|
1209 | 1234 | |
1210 | 1235 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1211 | 1236 | echo ' |
@@ -1221,9 +1246,10 @@ discard block |
||
1221 | 1246 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1222 | 1247 | |
1223 | 1248 | // Hopefully it exists. |
1224 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1225 | - echo ' |
|
1249 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1250 | + echo ' |
|
1226 | 1251 | <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'], '">'; |
1252 | + } |
|
1227 | 1253 | |
1228 | 1254 | echo ' |
1229 | 1255 | </div> |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | foreach ($context['posting_fields'] as $pf) |
140 | 140 | echo ' |
141 | 141 | <dt> |
142 | - ', $pf['dt'] ,' |
|
142 | + ', $pf['dt'], ' |
|
143 | 143 | </dt> |
144 | 144 | <dd> |
145 | - ', $pf['dd'] ,' |
|
145 | + ', $pf['dd'], ' |
|
146 | 146 | </dd>'; |
147 | 147 | |
148 | 148 | |
@@ -459,13 +459,13 @@ discard block |
||
459 | 459 | <p class="message" data-dz-message></p> |
460 | 460 | <p class="attached_BBC"> |
461 | 461 | <input type="text" name="attachBBC" value="" readonly> |
462 | - <a class="button_submit insertBBC">', $txt['attached_insertBBC'] ,'</a> |
|
462 | + <a class="button_submit insertBBC">', $txt['attached_insertBBC'], '</a> |
|
463 | 463 | </p> |
464 | 464 | <p class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></p> |
465 | 465 | </div> |
466 | 466 | <div class="attach-ui"> |
467 | - <a data-dz-remove class="button_submit delete">', $txt['modify_cancel'] ,'</a> |
|
468 | - <a class="button_submit start">', $txt['upload'] ,'</a> |
|
467 | + <a data-dz-remove class="button_submit delete">', $txt['modify_cancel'], '</a> |
|
468 | + <a class="button_submit start">', $txt['upload'], '</a> |
|
469 | 469 | </div> |
470 | 470 | </div> |
471 | 471 | </div> |
@@ -482,10 +482,10 @@ discard block |
||
482 | 482 | </dt> |
483 | 483 | <dd class="smalltext fallback"> |
484 | 484 | <div id="attachUpload" class="descbox"> |
485 | - <h5>', $txt['attach_drop_zone'] ,'</h5> |
|
486 | - <a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a> |
|
487 | - <a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a> |
|
488 | - <a class="button_submit fileinput-button">', $txt['attach_add'] ,'</a> |
|
485 | + <h5>', $txt['attach_drop_zone'], '</h5> |
|
486 | + <a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a> |
|
487 | + <a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a> |
|
488 | + <a class="button_submit fileinput-button">', $txt['attach_add'], '</a> |
|
489 | 489 | <div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
490 | 490 | <div class="fallback"> |
491 | 491 | <input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="input_file fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | // Option to delete an event if user is editing one. |
593 | 593 | if ($context['make_event'] && !$context['event']['new']) |
594 | 594 | echo ' |
595 | - <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">'; |
|
595 | + <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button_submit you_sure">'; |
|
596 | 596 | |
597 | 597 | echo ' |
598 | 598 | </span> |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | });'; |
847 | 847 | |
848 | 848 | echo ' |
849 | - var oEditorID = "', $context['post_box_name'] ,'"; |
|
849 | + var oEditorID = "', $context['post_box_name'], '"; |
|
850 | 850 | var oEditorObject = oEditorHandle_', $context['post_box_name'], '; |
851 | 851 | </script>'; |
852 | 852 | |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | { |
879 | 879 | echo ' |
880 | 880 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
881 | - <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> |
|
881 | + <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> |
|
882 | 882 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
883 | 883 | </ul>'; |
884 | 884 | } |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | <head> |
966 | 966 | <meta charset="', $context['character_set'], '"> |
967 | 967 | <title>', $txt['spell_check'], '</title> |
968 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
968 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
969 | 969 | <style> |
970 | 970 | body, td |
971 | 971 | { |
@@ -998,8 +998,8 @@ discard block |
||
998 | 998 | var spell_formname = window.opener.spell_formname; |
999 | 999 | var spell_fieldname = window.opener.spell_fieldname; |
1000 | 1000 | </script> |
1001 | - <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script> |
|
1002 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
1001 | + <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script> |
|
1002 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
1003 | 1003 | <script> |
1004 | 1004 | ', $context['spell_js'], ' |
1005 | 1005 | </script> |
@@ -1041,7 +1041,7 @@ discard block |
||
1041 | 1041 | <head> |
1042 | 1042 | <meta charset="', $context['character_set'], '"> |
1043 | 1043 | <title>', $txt['retrieving_quote'], '</title> |
1044 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
1044 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
1045 | 1045 | </head> |
1046 | 1046 | <body> |
1047 | 1047 | ', $txt['retrieving_quote'], ' |
@@ -22,22 +22,24 @@ 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 | - foreach ($context['icons'] as $icon) |
|
33 | - echo ' |
|
33 | + foreach ($context['icons'] as $icon) { |
|
34 | + echo ' |
|
34 | 35 | \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; |
36 | + } |
|
35 | 37 | echo ' |
36 | 38 | };'; |
37 | 39 | |
38 | 40 | // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. |
39 | - if ($context['make_poll']) |
|
40 | - echo ' |
|
41 | + if ($context['make_poll']) { |
|
42 | + echo ' |
|
41 | 43 | var pollOptionNum = 0, pollTabIndex; |
42 | 44 | var pollOptionId = ', $context['last_choice_id'], '; |
43 | 45 | function addPollOption() |
@@ -56,11 +58,13 @@ discard block |
||
56 | 58 | |
57 | 59 | 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('" class="input_text"></dd><p id="pollMoreOptions"></p>'), '); |
58 | 60 | }'; |
61 | + } |
|
59 | 62 | |
60 | 63 | // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. |
61 | - if ($context['make_event']) |
|
62 | - echo ' |
|
64 | + if ($context['make_event']) { |
|
65 | + echo ' |
|
63 | 66 | var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; |
67 | + } |
|
64 | 68 | |
65 | 69 | // End of the javascript, start the form and display the link tree. |
66 | 70 | echo ' |
@@ -80,9 +84,10 @@ discard block |
||
80 | 84 | </div> |
81 | 85 | </div><br>'; |
82 | 86 | |
83 | - if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) |
|
84 | - echo ' |
|
87 | + if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { |
|
88 | + echo ' |
|
85 | 89 | <input type="hidden" name="eventid" value="', $context['event']['id'], '">'; |
90 | + } |
|
86 | 91 | |
87 | 92 | // Start the main table. |
88 | 93 | echo ' |
@@ -117,26 +122,28 @@ discard block |
||
117 | 122 | } |
118 | 123 | |
119 | 124 | // If it's locked, show a message to warn the replier. |
120 | - if (!empty($context['locked'])) |
|
121 | - echo ' |
|
125 | + if (!empty($context['locked'])) { |
|
126 | + echo ' |
|
122 | 127 | <p class="errorbox"> |
123 | 128 | ', $txt['topic_locked_no_reply'], ' |
124 | 129 | </p>'; |
130 | + } |
|
125 | 131 | |
126 | - if (!empty($modSettings['drafts_post_enabled'])) |
|
127 | - echo ' |
|
132 | + if (!empty($modSettings['drafts_post_enabled'])) { |
|
133 | + echo ' |
|
128 | 134 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
129 | 135 | sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), ' |
130 | 136 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
131 | 137 | </div>'; |
138 | + } |
|
132 | 139 | |
133 | 140 | // The post header... important stuff |
134 | 141 | echo ' |
135 | 142 | <dl id="post_header">'; |
136 | 143 | |
137 | 144 | // Custom posting fields. |
138 | - if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) |
|
139 | - foreach ($context['posting_fields'] as $pf) |
|
145 | + if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) { |
|
146 | + foreach ($context['posting_fields'] as $pf) |
|
140 | 147 | echo ' |
141 | 148 | <dt> |
142 | 149 | ', $pf['dt'] ,' |
@@ -144,6 +151,7 @@ discard block |
||
144 | 151 | <dd> |
145 | 152 | ', $pf['dd'] ,' |
146 | 153 | </dd>'; |
154 | + } |
|
147 | 155 | |
148 | 156 | |
149 | 157 | // Guests have to put in their name and email... |
@@ -157,14 +165,15 @@ discard block |
||
157 | 165 | <input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text"> |
158 | 166 | </dd>'; |
159 | 167 | |
160 | - if (empty($modSettings['guest_post_no_email'])) |
|
161 | - echo ' |
|
168 | + if (empty($modSettings['guest_post_no_email'])) { |
|
169 | + echo ' |
|
162 | 170 | <dt> |
163 | 171 | <span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span> |
164 | 172 | </dt> |
165 | 173 | <dd> |
166 | 174 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required> |
167 | 175 | </dd>'; |
176 | + } |
|
168 | 177 | } |
169 | 178 | |
170 | 179 | // Now show the subject box for this post. |
@@ -182,9 +191,10 @@ discard block |
||
182 | 191 | <select name="icon" id="icon" onchange="showimage()">'; |
183 | 192 | |
184 | 193 | // Loop through each message icon allowed, adding it to the drop down list. |
185 | - foreach ($context['icons'] as $icon) |
|
186 | - echo ' |
|
194 | + foreach ($context['icons'] as $icon) { |
|
195 | + echo ' |
|
187 | 196 | <option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected' : '', '>', $icon['name'], '</option>'; |
197 | + } |
|
188 | 198 | |
189 | 199 | echo ' |
190 | 200 | </select> |
@@ -219,9 +229,10 @@ discard block |
||
219 | 229 | { |
220 | 230 | echo ' |
221 | 231 | <optgroup label="', $category['name'], '">'; |
222 | - foreach ($category['boards'] as $board) |
|
223 | - echo ' |
|
232 | + foreach ($category['boards'] as $board) { |
|
233 | + echo ' |
|
224 | 234 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], ' </option>'; |
235 | + } |
|
225 | 236 | echo ' |
226 | 237 | </optgroup>'; |
227 | 238 | } |
@@ -257,9 +268,10 @@ discard block |
||
257 | 268 | <span class="label">', $txt['calendar_timezone'], '</span> |
258 | 269 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
259 | 270 | |
260 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
261 | - echo ' |
|
271 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
272 | + echo ' |
|
262 | 273 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
274 | + } |
|
263 | 275 | |
264 | 276 | echo ' |
265 | 277 | </select> |
@@ -325,14 +337,15 @@ discard block |
||
325 | 337 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check"> |
326 | 338 | </dd>'; |
327 | 339 | |
328 | - if ($context['poll_options']['guest_vote_enabled']) |
|
329 | - echo ' |
|
340 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
341 | + echo ' |
|
330 | 342 | <dt> |
331 | 343 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
332 | 344 | </dt> |
333 | 345 | <dd> |
334 | 346 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', ' class="input_check"> |
335 | 347 | </dd>'; |
348 | + } |
|
336 | 349 | |
337 | 350 | echo ' |
338 | 351 | <dt> |
@@ -353,8 +366,8 @@ discard block |
||
353 | 366 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
354 | 367 | |
355 | 368 | // If we're editing and displaying edit details, show a box where they can say why |
356 | - if (isset($context['editing']) && $modSettings['show_modify']) |
|
357 | - echo ' |
|
369 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
370 | + echo ' |
|
358 | 371 | <dl> |
359 | 372 | <dt class="clear"> |
360 | 373 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -363,20 +376,23 @@ discard block |
||
363 | 376 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text"> |
364 | 377 | </dd> |
365 | 378 | </dl>'; |
379 | + } |
|
366 | 380 | |
367 | 381 | // If this message has been edited in the past - display when it was. |
368 | - if (isset($context['last_modified'])) |
|
369 | - echo ' |
|
382 | + if (isset($context['last_modified'])) { |
|
383 | + echo ' |
|
370 | 384 | <div class="padding smalltext"> |
371 | 385 | ', $context['last_modified_text'], ' |
372 | 386 | </div>'; |
387 | + } |
|
373 | 388 | |
374 | 389 | // If the admin has enabled the hiding of the additional options - show a link and image for it. |
375 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
376 | - echo ' |
|
390 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
391 | + echo ' |
|
377 | 392 | <div id="postAdditionalOptionsHeader"> |
378 | 393 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
379 | 394 | </div>'; |
395 | + } |
|
380 | 396 | |
381 | 397 | echo ' |
382 | 398 | <div id="postAdditionalOptions">'; |
@@ -408,19 +424,21 @@ discard block |
||
408 | 424 | <input type="hidden" name="attach_del[]" value="0"> |
409 | 425 | ', $txt['uncheck_unwatchd_attach'], ': |
410 | 426 | </dd>'; |
411 | - foreach ($context['current_attachments'] as $attachment) |
|
412 | - echo ' |
|
427 | + foreach ($context['current_attachments'] as $attachment) { |
|
428 | + echo ' |
|
413 | 429 | <dd class="smalltext"> |
414 | 430 | <label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', ' class="input_check"> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), |
415 | 431 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label> |
416 | 432 | </dd>'; |
433 | + } |
|
417 | 434 | |
418 | 435 | echo ' |
419 | 436 | </dl>'; |
420 | 437 | |
421 | - if (!empty($context['files_in_session_warning'])) |
|
422 | - echo ' |
|
438 | + if (!empty($context['files_in_session_warning'])) { |
|
439 | + echo ' |
|
423 | 440 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
441 | + } |
|
424 | 442 | } |
425 | 443 | |
426 | 444 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -473,8 +491,8 @@ discard block |
||
473 | 491 | ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '">'); |
474 | 492 | |
475 | 493 | // Show more boxes if they aren't approaching that limit. |
476 | - if ($context['num_allowed_attachments'] > 1) |
|
477 | - echo ' |
|
494 | + if ($context['num_allowed_attachments'] > 1) { |
|
495 | + echo ' |
|
478 | 496 | <script> |
479 | 497 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
480 | 498 | var current_attachment = 1; |
@@ -495,9 +513,10 @@ discard block |
||
495 | 513 | </div> |
496 | 514 | </div> |
497 | 515 | </dd>'; |
498 | - else |
|
499 | - echo ' |
|
516 | + } else { |
|
517 | + echo ' |
|
500 | 518 | </dd>'; |
519 | + } |
|
501 | 520 | |
502 | 521 | // Add any template changes for an alternative upload system here. |
503 | 522 | call_integration_hook('integrate_upload_template'); |
@@ -506,21 +525,25 @@ discard block |
||
506 | 525 | <dd class="smalltext">'; |
507 | 526 | |
508 | 527 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
509 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
510 | - echo ' |
|
528 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
529 | + echo ' |
|
511 | 530 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
531 | + } |
|
512 | 532 | |
513 | - if (!empty($context['attachment_restrictions'])) |
|
514 | - echo ' |
|
533 | + if (!empty($context['attachment_restrictions'])) { |
|
534 | + echo ' |
|
515 | 535 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
536 | + } |
|
516 | 537 | |
517 | - if ($context['num_allowed_attachments'] == 0) |
|
518 | - echo ' |
|
538 | + if ($context['num_allowed_attachments'] == 0) { |
|
539 | + echo ' |
|
519 | 540 | ', $txt['attach_limit_nag'], '<br>'; |
541 | + } |
|
520 | 542 | |
521 | - if (!$context['can_post_attachment_unapproved']) |
|
522 | - echo ' |
|
543 | + if (!$context['can_post_attachment_unapproved']) { |
|
544 | + echo ' |
|
523 | 545 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
546 | + } |
|
524 | 547 | |
525 | 548 | echo ' |
526 | 549 | </dd> |
@@ -543,10 +566,11 @@ discard block |
||
543 | 566 | <dt><strong>', $txt['subject'], '</strong></dt> |
544 | 567 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
545 | 568 | |
546 | - foreach ($context['drafts'] as $draft) |
|
547 | - echo ' |
|
569 | + foreach ($context['drafts'] as $draft) { |
|
570 | + echo ' |
|
548 | 571 | <dt>', $draft['link'], '</dt> |
549 | 572 | <dd>', $draft['poster_time'], '</dd>'; |
573 | + } |
|
550 | 574 | echo ' |
551 | 575 | </dl> |
552 | 576 | </div>'; |
@@ -571,9 +595,10 @@ discard block |
||
571 | 595 | ', template_control_richedit_buttons($context['post_box_name']); |
572 | 596 | |
573 | 597 | // Option to delete an event if user is editing one. |
574 | - if ($context['make_event'] && !$context['event']['new']) |
|
575 | - echo ' |
|
598 | + if ($context['make_event'] && !$context['event']['new']) { |
|
599 | + echo ' |
|
576 | 600 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">'; |
601 | + } |
|
577 | 602 | |
578 | 603 | echo ' |
579 | 604 | </span> |
@@ -582,9 +607,10 @@ discard block |
||
582 | 607 | <br class="clear">'; |
583 | 608 | |
584 | 609 | // Assuming this isn't a new topic pass across the last message id. |
585 | - if (isset($context['topic_last_message'])) |
|
586 | - echo ' |
|
610 | + if (isset($context['topic_last_message'])) { |
|
611 | + echo ' |
|
587 | 612 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
613 | + } |
|
588 | 614 | |
589 | 615 | echo ' |
590 | 616 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -726,9 +752,10 @@ discard block |
||
726 | 752 | |
727 | 753 | 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>\';'; |
728 | 754 | |
729 | - if ($context['can_quote']) |
|
730 | - echo ' |
|
755 | + if ($context['can_quote']) { |
|
756 | + echo ' |
|
731 | 757 | 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>\';'; |
758 | + } |
|
732 | 759 | |
733 | 760 | echo ' |
734 | 761 | newPostsHTML += \'<br class="clear">\'; |
@@ -771,8 +798,8 @@ discard block |
||
771 | 798 | }'; |
772 | 799 | |
773 | 800 | // Code for showing and hiding additional options. |
774 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
775 | - echo ' |
|
801 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
802 | + echo ' |
|
776 | 803 | var oSwapAdditionalOptions = new smc_Toggle({ |
777 | 804 | bToggleEnabled: true, |
778 | 805 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -800,10 +827,11 @@ discard block |
||
800 | 827 | } |
801 | 828 | ] |
802 | 829 | });'; |
830 | + } |
|
803 | 831 | |
804 | 832 | // Code for showing and hiding drafts |
805 | - if (!empty($context['drafts'])) |
|
806 | - echo ' |
|
833 | + if (!empty($context['drafts'])) { |
|
834 | + echo ' |
|
807 | 835 | var oSwapDraftOptions = new smc_Toggle({ |
808 | 836 | bToggleEnabled: true, |
809 | 837 | bCurrentlyCollapsed: true, |
@@ -825,6 +853,7 @@ discard block |
||
825 | 853 | } |
826 | 854 | ] |
827 | 855 | });'; |
856 | + } |
|
828 | 857 | |
829 | 858 | echo ' |
830 | 859 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -845,8 +874,9 @@ discard block |
||
845 | 874 | foreach ($context['previous_posts'] as $post) |
846 | 875 | { |
847 | 876 | $ignoring = false; |
848 | - if (!empty($post['is_ignored'])) |
|
849 | - $ignored_posts[] = $ignoring = $post['id']; |
|
877 | + if (!empty($post['is_ignored'])) { |
|
878 | + $ignored_posts[] = $ignoring = $post['id']; |
|
879 | + } |
|
850 | 880 | |
851 | 881 | echo ' |
852 | 882 | <div class="windowbg"> |
@@ -1029,10 +1059,10 @@ discard block |
||
1029 | 1059 | <div id="temporary_posting_area" style="display: none;"></div> |
1030 | 1060 | <script>'; |
1031 | 1061 | |
1032 | - if ($context['close_window']) |
|
1033 | - echo ' |
|
1062 | + if ($context['close_window']) { |
|
1063 | + echo ' |
|
1034 | 1064 | window.close();'; |
1035 | - else |
|
1065 | + } else |
|
1036 | 1066 | { |
1037 | 1067 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;). |
1038 | 1068 | echo ' |
@@ -1086,11 +1116,12 @@ discard block |
||
1086 | 1116 | </p> |
1087 | 1117 | <ul>'; |
1088 | 1118 | |
1089 | - foreach ($context['groups'] as $group) |
|
1090 | - echo ' |
|
1119 | + foreach ($context['groups'] as $group) { |
|
1120 | + echo ' |
|
1091 | 1121 | <li> |
1092 | 1122 | <label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em> |
1093 | 1123 | </li>'; |
1124 | + } |
|
1094 | 1125 | |
1095 | 1126 | echo ' |
1096 | 1127 | <li> |
@@ -48,17 +48,19 @@ discard block |
||
48 | 48 | </a>'; |
49 | 49 | |
50 | 50 | // Has it outstanding posts for approval? |
51 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
52 | - echo ' |
|
51 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
52 | + echo ' |
|
53 | 53 | <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>'; |
54 | + } |
|
54 | 55 | |
55 | 56 | echo ' |
56 | 57 | <p class="board_description">', $board['description'] , '</p>'; |
57 | 58 | |
58 | 59 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
59 | - if (!empty($board['moderators']) || !empty($board['moderator_groups'])) |
|
60 | - echo ' |
|
60 | + if (!empty($board['moderators']) || !empty($board['moderator_groups'])) { |
|
61 | + echo ' |
|
61 | 62 | <p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
63 | + } |
|
62 | 64 | |
63 | 65 | // Show some basic information about the number of posts, etc. |
64 | 66 | echo ' |
@@ -70,9 +72,10 @@ discard block |
||
70 | 72 | </div> |
71 | 73 | <div class="lastpost lpr_border">'; |
72 | 74 | |
73 | - if (!empty($board['last_post']['id'])) |
|
74 | - echo ' |
|
75 | + if (!empty($board['last_post']['id'])) { |
|
76 | + echo ' |
|
75 | 77 | <p>', $board['last_post']['last_post_message'], '</p>'; |
78 | + } |
|
76 | 79 | echo ' |
77 | 80 | </div>'; |
78 | 81 | |
@@ -85,14 +88,16 @@ discard block |
||
85 | 88 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
86 | 89 | foreach ($board['children'] as $child) |
87 | 90 | { |
88 | - if (!$child['is_redirect']) |
|
89 | - $child['link'] = '<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'] . ($child['new'] ? '</a> <a ' . ($child['new'] ? 'class="new_posts" ' : '') . '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>'; |
|
90 | - else |
|
91 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
91 | + if (!$child['is_redirect']) { |
|
92 | + $child['link'] = '<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'] . ($child['new'] ? '</a> <a ' . ($child['new'] ? 'class="new_posts" ' : '') . '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>'; |
|
93 | + } else { |
|
94 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
95 | + } |
|
92 | 96 | |
93 | 97 | // Has it posts awaiting approval? |
94 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) |
|
95 | - $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 | + } |
|
96 | 101 | |
97 | 102 | $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link']; |
98 | 103 | } |
@@ -111,8 +116,9 @@ discard block |
||
111 | 116 | } |
112 | 117 | |
113 | 118 | // 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']); |
|
119 | + if (!$context['user']['is_logged']) { |
|
120 | + unset($context['normal_buttons']['markread']); |
|
121 | + } |
|
116 | 122 | |
117 | 123 | if (!$context['no_topic_listing']) |
118 | 124 | { |
@@ -135,13 +141,15 @@ discard block |
||
135 | 141 | <div id="description_board" class="generic_list_wrapper"> |
136 | 142 | <h3>', $context['name'], '</h3> |
137 | 143 | <p>'; |
138 | - if ($context['description'] != '') |
|
139 | - echo ' |
|
144 | + if ($context['description'] != '') { |
|
145 | + echo ' |
|
140 | 146 | ', $context['description'], ' '; |
147 | + } |
|
141 | 148 | |
142 | - if (!empty($context['moderators'])) |
|
143 | - echo ' |
|
149 | + if (!empty($context['moderators'])) { |
|
150 | + echo ' |
|
144 | 151 | ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.'; |
152 | + } |
|
145 | 153 | |
146 | 154 | echo ' |
147 | 155 | </p> |
@@ -149,9 +157,10 @@ discard block |
||
149 | 157 | } |
150 | 158 | |
151 | 159 | // If Quick Moderation is enabled start the form. |
152 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
153 | - echo ' |
|
160 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
161 | + echo ' |
|
154 | 162 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
163 | + } |
|
155 | 164 | |
156 | 165 | echo ' |
157 | 166 | <div id="messageindex">'; |
@@ -159,10 +168,11 @@ discard block |
||
159 | 168 | { |
160 | 169 | echo ' |
161 | 170 | <div class="information">'; |
162 | - if ($settings['display_who_viewing'] == 1) |
|
163 | - echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
164 | - else |
|
165 | - 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'] . ')'); |
|
171 | + if ($settings['display_who_viewing'] == 1) { |
|
172 | + echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
173 | + } else { |
|
174 | + 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'] . ')'); |
|
175 | + } |
|
166 | 176 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board']; |
167 | 177 | |
168 | 178 | echo ' |
@@ -181,19 +191,22 @@ discard block |
||
181 | 191 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
182 | 192 | |
183 | 193 | // Show a "select all" box for quick moderation? |
184 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
|
185 | - echo ' |
|
194 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
195 | + echo ' |
|
186 | 196 | <div class="moderation"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check"></div>'; |
197 | + } |
|
187 | 198 | |
188 | 199 | // If it's on in "image" mode, don't show anything but the column. |
189 | - elseif (!empty($context['can_quick_mod'])) |
|
190 | - echo ' |
|
200 | + elseif (!empty($context['can_quick_mod'])) { |
|
201 | + echo ' |
|
191 | 202 | <div class="moderation"> </div>'; |
203 | + } |
|
192 | 204 | } |
193 | 205 | // No topics.... just say, "sorry bub". |
194 | - else |
|
195 | - echo ' |
|
206 | + else { |
|
207 | + echo ' |
|
196 | 208 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
209 | + } |
|
197 | 210 | |
198 | 211 | echo ' |
199 | 212 | </div>'; |
@@ -225,21 +238,26 @@ discard block |
||
225 | 238 | // Now we handle the icons |
226 | 239 | echo ' |
227 | 240 | <div class="icons floatright">'; |
228 | - if ($topic['is_watched']) |
|
229 | - echo ' |
|
241 | + if ($topic['is_watched']) { |
|
242 | + echo ' |
|
230 | 243 | <span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
231 | - if ($topic['is_locked']) |
|
232 | - echo ' |
|
244 | + } |
|
245 | + if ($topic['is_locked']) { |
|
246 | + echo ' |
|
233 | 247 | <span class="generic_icons lock"></span>'; |
234 | - if ($topic['is_sticky']) |
|
235 | - echo ' |
|
248 | + } |
|
249 | + if ($topic['is_sticky']) { |
|
250 | + echo ' |
|
236 | 251 | <span class="generic_icons sticky"></span>'; |
237 | - if ($topic['is_redirect']) |
|
238 | - echo ' |
|
252 | + } |
|
253 | + if ($topic['is_redirect']) { |
|
254 | + echo ' |
|
239 | 255 | <span class="generic_icons move"></span>'; |
240 | - if ($topic['is_poll']) |
|
241 | - echo ' |
|
256 | + } |
|
257 | + if ($topic['is_poll']) { |
|
258 | + echo ' |
|
242 | 259 | <span class="generic_icons poll"></span>'; |
260 | + } |
|
243 | 261 | echo ' |
244 | 262 | </div>'; |
245 | 263 | |
@@ -265,26 +283,31 @@ discard block |
||
265 | 283 | { |
266 | 284 | echo ' |
267 | 285 | <div class="moderation">'; |
268 | - if ($options['display_quick_mod'] == 1) |
|
269 | - echo ' |
|
286 | + if ($options['display_quick_mod'] == 1) { |
|
287 | + echo ' |
|
270 | 288 | <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">'; |
271 | - else |
|
289 | + } else |
|
272 | 290 | { |
273 | 291 | // Check permissions on each and show only the ones they are allowed to use. |
274 | - if ($topic['quick_mod']['remove']) |
|
275 | - 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>'; |
|
292 | + if ($topic['quick_mod']['remove']) { |
|
293 | + 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>'; |
|
294 | + } |
|
276 | 295 | |
277 | - if ($topic['quick_mod']['lock']) |
|
278 | - 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>'; |
|
296 | + if ($topic['quick_mod']['lock']) { |
|
297 | + 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>'; |
|
298 | + } |
|
279 | 299 | |
280 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
281 | - echo '<br>'; |
|
300 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
301 | + echo '<br>'; |
|
302 | + } |
|
282 | 303 | |
283 | - if ($topic['quick_mod']['sticky']) |
|
284 | - 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>'; |
|
304 | + if ($topic['quick_mod']['sticky']) { |
|
305 | + 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>'; |
|
306 | + } |
|
285 | 307 | |
286 | - if ($topic['quick_mod']['move']) |
|
287 | - 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>'; |
|
308 | + if ($topic['quick_mod']['move']) { |
|
309 | + 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>'; |
|
310 | + } |
|
288 | 311 | } |
289 | 312 | echo ' |
290 | 313 | </div>'; |
@@ -302,18 +325,20 @@ discard block |
||
302 | 325 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
303 | 326 | <option value="">--------</option>'; |
304 | 327 | |
305 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
306 | - if ($context['can_' . $qmod_action]) |
|
328 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
329 | + if ($context['can_' . $qmod_action]) |
|
307 | 330 | echo ' |
308 | 331 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
332 | + } |
|
309 | 333 | |
310 | 334 | echo ' |
311 | 335 | </select>'; |
312 | 336 | |
313 | 337 | // Show a list of boards they can move the topic to. |
314 | - if ($context['can_move']) |
|
315 | - echo ' |
|
338 | + if ($context['can_move']) { |
|
339 | + echo ' |
|
316 | 340 | <span id="quick_mod_jump_to"> </span>'; |
341 | + } |
|
317 | 342 | |
318 | 343 | echo ' |
319 | 344 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction"> |
@@ -324,10 +349,11 @@ discard block |
||
324 | 349 | </div>'; |
325 | 350 | |
326 | 351 | // Finish off the form - again. |
327 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
328 | - echo ' |
|
352 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
353 | + echo ' |
|
329 | 354 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
330 | 355 | </form>'; |
356 | + } |
|
331 | 357 | |
332 | 358 | // Mobile action buttons (bottom) |
333 | 359 | echo ' |
@@ -346,8 +372,8 @@ discard block |
||
346 | 372 | // Show breadcrumbs at the bottom too. |
347 | 373 | theme_linktree(); |
348 | 374 | |
349 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
350 | - echo ' |
|
375 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
376 | + echo ' |
|
351 | 377 | <script> |
352 | 378 | if (typeof(window.XMLHttpRequest) != "undefined") |
353 | 379 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -366,6 +392,7 @@ discard block |
||
366 | 392 | sCustomName: "move_to" |
367 | 393 | }); |
368 | 394 | </script>'; |
395 | + } |
|
369 | 396 | |
370 | 397 | // Javascript for inline editing. |
371 | 398 | echo ' |
@@ -401,8 +428,8 @@ discard block |
||
401 | 428 | <div class="information"> |
402 | 429 | <p class="floatright" id="message_index_jump_to"> </p>'; |
403 | 430 | |
404 | - if (empty($context['no_topic_listing'])) |
|
405 | - echo ' |
|
431 | + if (empty($context['no_topic_listing'])) { |
|
432 | + echo ' |
|
406 | 433 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
407 | 434 | <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', ' |
408 | 435 | '. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br> |
@@ -412,9 +439,10 @@ discard block |
||
412 | 439 | <span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br> |
413 | 440 | <span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br> |
414 | 441 | </p>'; |
442 | + } |
|
415 | 443 | |
416 | - if (!empty($context['jump_to'])) |
|
417 | - echo ' |
|
444 | + if (!empty($context['jump_to'])) { |
|
445 | + echo ' |
|
418 | 446 | <script> |
419 | 447 | if (typeof(window.XMLHttpRequest) != "undefined") |
420 | 448 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -430,6 +458,7 @@ discard block |
||
430 | 458 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
431 | 459 | }); |
432 | 460 | </script>'; |
461 | + } |
|
433 | 462 | |
434 | 463 | echo ' |
435 | 464 | <br class="clear"> |
@@ -25,13 +25,15 @@ discard block |
||
25 | 25 | </h3> |
26 | 26 | </div>'; |
27 | 27 | |
28 | - if (!empty($context['search_errors'])) |
|
29 | - echo ' |
|
28 | + if (!empty($context['search_errors'])) { |
|
29 | + echo ' |
|
30 | 30 | <div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>'; |
31 | + } |
|
31 | 32 | |
32 | - if (!empty($context['search_ignored'])) |
|
33 | - echo ' |
|
33 | + if (!empty($context['search_ignored'])) { |
|
34 | + echo ' |
|
34 | 35 | <p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>'; |
36 | + } |
|
35 | 37 | |
36 | 38 | echo ' |
37 | 39 | <fieldset id="advanced_search"> |
@@ -43,9 +45,10 @@ discard block |
||
43 | 45 | <dd> |
44 | 46 | <input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text">'; |
45 | 47 | |
46 | - if (empty($modSettings['search_simple_fulltext'])) |
|
47 | - echo ' |
|
48 | + if (empty($modSettings['search_simple_fulltext'])) { |
|
49 | + echo ' |
|
48 | 50 | <em class="smalltext">', $txt['search_example'], '</em>'; |
51 | + } |
|
49 | 52 | |
50 | 53 | echo ' |
51 | 54 | </dd> |
@@ -112,11 +115,12 @@ discard block |
||
112 | 115 | } |
113 | 116 | |
114 | 117 | // If $context['search_params']['topic'] is set, that means we're searching just one topic. |
115 | - if (!empty($context['search_params']['topic'])) |
|
116 | - echo ' |
|
118 | + if (!empty($context['search_params']['topic'])) { |
|
119 | + echo ' |
|
117 | 120 | <p>', $txt['search_specific_topic'], ' "', $context['search_topic']['link'], '".</p> |
118 | 121 | <input type="hidden" name="topic" value="', $context['search_topic']['id'], '"> |
119 | 122 | <input type="submit" name="b_search" value="', $txt['search'], '" class="button_submit">'; |
123 | + } |
|
120 | 124 | |
121 | 125 | echo ' |
122 | 126 | </div> |
@@ -147,14 +151,15 @@ discard block |
||
147 | 151 | |
148 | 152 | foreach ($category['boards'] as $board) |
149 | 153 | { |
150 | - if ($i == $limit) |
|
151 | - echo ' |
|
154 | + if ($i == $limit) { |
|
155 | + echo ' |
|
152 | 156 | </ul> |
153 | 157 | </li> |
154 | 158 | </ul> |
155 | 159 | <ul class="ignoreboards floatright"> |
156 | 160 | <li class="category"> |
157 | 161 | <ul>'; |
162 | + } |
|
158 | 163 | |
159 | 164 | echo ' |
160 | 165 | <li class="board"> |
@@ -242,13 +247,15 @@ discard block |
||
242 | 247 | <div class="roundframe">'; |
243 | 248 | |
244 | 249 | // Did they make any typos or mistakes, perhaps? |
245 | - if (isset($context['did_you_mean'])) |
|
246 | - echo ' |
|
250 | + if (isset($context['did_you_mean'])) { |
|
251 | + echo ' |
|
247 | 252 | <p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>'; |
253 | + } |
|
248 | 254 | |
249 | - if (!empty($context['search_ignored'])) |
|
250 | - echo ' |
|
255 | + if (!empty($context['search_ignored'])) { |
|
256 | + echo ' |
|
251 | 257 | <p>', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>'; |
258 | + } |
|
252 | 259 | |
253 | 260 | echo ' |
254 | 261 | <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '"> |
@@ -270,10 +277,11 @@ discard block |
||
270 | 277 | <input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '"> |
271 | 278 | <input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '"> |
272 | 279 | </div>'; |
273 | - if (!empty($context['search_params']['brd'])) |
|
274 | - foreach ($context['search_params']['brd'] as $board_id) |
|
280 | + if (!empty($context['search_params']['brd'])) { |
|
281 | + foreach ($context['search_params']['brd'] as $board_id) |
|
275 | 282 | echo ' |
276 | 283 | <input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">'; |
284 | + } |
|
277 | 285 | |
278 | 286 | echo ' |
279 | 287 | </form> |
@@ -284,17 +292,19 @@ discard block |
||
284 | 292 | if ($context['compact']) |
285 | 293 | { |
286 | 294 | // Quick moderation set to checkboxes? Oh, how fun :/. |
287 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
288 | - echo ' |
|
295 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
296 | + echo ' |
|
289 | 297 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">'; |
298 | + } |
|
290 | 299 | |
291 | 300 | echo ' |
292 | 301 | <div class="cat_bar"> |
293 | 302 | <h3 class="catbg"> |
294 | 303 | <span class="floatright">'; |
295 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
296 | - echo ' |
|
304 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
305 | + echo ' |
|
297 | 306 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">'; |
307 | + } |
|
298 | 308 | echo ' |
299 | 309 | </span> |
300 | 310 | <span class="generic_icons filter"></span> ', $txt['mlist_search_results'],': ',$context['search_params']['search'],' |
@@ -302,14 +312,15 @@ discard block |
||
302 | 312 | </div>'; |
303 | 313 | |
304 | 314 | // was anything even found? |
305 | - if (!empty($context['topics'])) |
|
306 | - echo' |
|
315 | + if (!empty($context['topics'])) { |
|
316 | + echo' |
|
307 | 317 | <div class="pagesection"> |
308 | 318 | <span>', $context['page_index'], '</span> |
309 | 319 | </div>'; |
310 | - else |
|
311 | - echo ' |
|
320 | + } else { |
|
321 | + echo ' |
|
312 | 322 | <div class="roundframe">', $txt['find_no_results'], '</div>'; |
323 | + } |
|
313 | 324 | |
314 | 325 | // while we have results to show ... |
315 | 326 | while ($topic = $context['get_topics']()) |
@@ -337,38 +348,43 @@ discard block |
||
337 | 348 | { |
338 | 349 | echo ' |
339 | 350 | <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">'; |
340 | - } |
|
341 | - else |
|
351 | + } else |
|
342 | 352 | { |
343 | - if ($topic['quick_mod']['remove']) |
|
344 | - echo ' |
|
353 | + if ($topic['quick_mod']['remove']) { |
|
354 | + echo ' |
|
345 | 355 | <a href="', $scripturl, '?action=quickmod;board='. $topic['board']['id']. '.0;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
356 | + } |
|
346 | 357 | |
347 | - if ($topic['quick_mod']['lock']) |
|
348 | - echo ' |
|
358 | + if ($topic['quick_mod']['lock']) { |
|
359 | + echo ' |
|
349 | 360 | <a href="', $scripturl, '?action=quickmod;board='. $topic['board']['id']. '.0;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
361 | + } |
|
350 | 362 | |
351 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
352 | - echo ' |
|
363 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
364 | + echo ' |
|
353 | 365 | <br>'; |
366 | + } |
|
354 | 367 | |
355 | - if ($topic['quick_mod']['sticky']) |
|
356 | - echo ' |
|
368 | + if ($topic['quick_mod']['sticky']) { |
|
369 | + echo ' |
|
357 | 370 | <a href="', $scripturl, '?action=quickmod;board='. $topic['board']['id']. '.0;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
371 | + } |
|
358 | 372 | |
359 | - if ($topic['quick_mod']['move']) |
|
360 | - echo ' |
|
373 | + if ($topic['quick_mod']['move']) { |
|
374 | + echo ' |
|
361 | 375 | <a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
376 | + } |
|
362 | 377 | } |
363 | 378 | |
364 | 379 | echo ' |
365 | 380 | </div>'; |
366 | 381 | } |
367 | 382 | |
368 | - if ($message['body_highlighted'] != '') |
|
369 | - echo ' |
|
383 | + if ($message['body_highlighted'] != '') { |
|
384 | + echo ' |
|
370 | 385 | <br class="clear"> |
371 | 386 | <div class="list_posts double_height">', $message['body_highlighted'], '</div>'; |
387 | + } |
|
372 | 388 | } |
373 | 389 | |
374 | 390 | echo ' |
@@ -376,11 +392,12 @@ discard block |
||
376 | 392 | </div>'; |
377 | 393 | |
378 | 394 | } |
379 | - if (!empty($context['topics'])) |
|
380 | - echo ' |
|
395 | + if (!empty($context['topics'])) { |
|
396 | + echo ' |
|
381 | 397 | <div class="pagesection"> |
382 | 398 | <span>', $context['page_index'], '</span> |
383 | 399 | </div>'; |
400 | + } |
|
384 | 401 | |
385 | 402 | if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
386 | 403 | { |
@@ -390,17 +407,19 @@ discard block |
||
390 | 407 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
391 | 408 | <option value="">--------</option>'; |
392 | 409 | |
393 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
394 | - if ($context['can_' . $qmod_action]) |
|
410 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
411 | + if ($context['can_' . $qmod_action]) |
|
395 | 412 | echo ' |
396 | 413 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
414 | + } |
|
397 | 415 | |
398 | 416 | echo ' |
399 | 417 | </select>'; |
400 | 418 | |
401 | - if ($context['can_move']) |
|
402 | - echo ' |
|
419 | + if ($context['can_move']) { |
|
420 | + echo ' |
|
403 | 421 | <span id="quick_mod_jump_to"> </span>'; |
422 | + } |
|
404 | 423 | |
405 | 424 | echo ' |
406 | 425 | <input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '"> |
@@ -410,13 +429,13 @@ discard block |
||
410 | 429 | } |
411 | 430 | |
412 | 431 | |
413 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
|
414 | - echo ' |
|
432 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) { |
|
433 | + echo ' |
|
415 | 434 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
416 | 435 | </form>'; |
436 | + } |
|
417 | 437 | |
418 | - } |
|
419 | - else |
|
438 | + } else |
|
420 | 439 | { |
421 | 440 | echo ' |
422 | 441 | <div class="cat_bar"> |
@@ -428,9 +447,10 @@ discard block |
||
428 | 447 | <span>', $context['page_index'], '</span> |
429 | 448 | </div>'; |
430 | 449 | |
431 | - if (empty($context['topics'])) |
|
432 | - echo ' |
|
450 | + if (empty($context['topics'])) { |
|
451 | + echo ' |
|
433 | 452 | <div class="information">(', $txt['search_no_results'], ')</div>'; |
453 | + } |
|
434 | 454 | |
435 | 455 | while ($topic = $context['get_topics']()) |
436 | 456 | { |
@@ -445,23 +465,27 @@ discard block |
||
445 | 465 | </div> |
446 | 466 | <div class="list_posts">', $message['body_highlighted'], '</div>'; |
447 | 467 | |
448 | - if ($topic['can_reply']) |
|
449 | - echo ' |
|
468 | + if ($topic['can_reply']) { |
|
469 | + echo ' |
|
450 | 470 | <ul class="quickbuttons">'; |
471 | + } |
|
451 | 472 | |
452 | 473 | // If they *can* reply? |
453 | - if ($topic['can_reply']) |
|
454 | - echo ' |
|
474 | + if ($topic['can_reply']) { |
|
475 | + echo ' |
|
455 | 476 | <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
477 | + } |
|
456 | 478 | |
457 | 479 | // If they *can* quote? |
458 | - if ($topic['can_quote']) |
|
459 | - echo ' |
|
480 | + if ($topic['can_quote']) { |
|
481 | + echo ' |
|
460 | 482 | <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
483 | + } |
|
461 | 484 | |
462 | - if ($topic['can_reply']) |
|
463 | - echo ' |
|
485 | + if ($topic['can_reply']) { |
|
486 | + echo ' |
|
464 | 487 | </ul>'; |
488 | + } |
|
465 | 489 | echo ' |
466 | 490 | <br class="clear"> |
467 | 491 | </div>'; |
@@ -480,8 +504,8 @@ discard block |
||
480 | 504 | <div class="smalltext righttext" id="search_jump_to"> </div> |
481 | 505 | <script>'; |
482 | 506 | |
483 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
484 | - echo ' |
|
507 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
508 | + echo ' |
|
485 | 509 | if (typeof(window.XMLHttpRequest) != "undefined") |
486 | 510 | aJumpTo[aJumpTo.length] = new JumpTo({ |
487 | 511 | sContainerId: "quick_mod_jump_to", |
@@ -496,6 +520,7 @@ discard block |
||
496 | 520 | bDisabled: true, |
497 | 521 | sCustomName: "move_to" |
498 | 522 | });'; |
523 | + } |
|
499 | 524 | |
500 | 525 | echo ' |
501 | 526 | if (typeof(window.XMLHttpRequest) != "undefined") |
@@ -26,9 +26,10 @@ discard block |
||
26 | 26 | </h3> |
27 | 27 | </div>'; |
28 | 28 | |
29 | - if ($context['ban']['is_new']) |
|
30 | - echo ' |
|
29 | + if ($context['ban']['is_new']) { |
|
30 | + echo ' |
|
31 | 31 | <div class="information noup">', $txt['ban_add_notes'], '</div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | // If there were errors creating the ban, show them. |
34 | 35 | if (!empty($context['error_messages'])) |
@@ -38,9 +39,10 @@ discard block |
||
38 | 39 | <strong>', $txt['ban_errors_detected'], '</strong> |
39 | 40 | <ul>'; |
40 | 41 | |
41 | - foreach ($context['error_messages'] as $error) |
|
42 | - echo ' |
|
42 | + foreach ($context['error_messages'] as $error) { |
|
43 | + echo ' |
|
43 | 44 | <li class="error">', $error, '</li>'; |
45 | + } |
|
44 | 46 | |
45 | 47 | echo ' |
46 | 48 | </ul> |
@@ -57,8 +59,8 @@ discard block |
||
57 | 59 | <input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60" class="input_text"> |
58 | 60 | </dd>'; |
59 | 61 | |
60 | - if (isset($context['ban']['reason'])) |
|
61 | - echo ' |
|
62 | + if (isset($context['ban']['reason'])) { |
|
63 | + echo ' |
|
62 | 64 | <dt> |
63 | 65 | <strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br> |
64 | 66 | <span class="smalltext">', $txt['ban_reason_desc'], '</span> |
@@ -66,9 +68,10 @@ discard block |
||
66 | 68 | <dd> |
67 | 69 | <textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea> |
68 | 70 | </dd>'; |
71 | + } |
|
69 | 72 | |
70 | - if (isset($context['ban']['notes'])) |
|
71 | - echo ' |
|
73 | + if (isset($context['ban']['notes'])) { |
|
74 | + echo ' |
|
72 | 75 | <dt> |
73 | 76 | <strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br> |
74 | 77 | <span class="smalltext">', $txt['ban_notes_desc'], '</span> |
@@ -76,6 +79,7 @@ discard block |
||
76 | 79 | <dd> |
77 | 80 | <textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea> |
78 | 81 | </dd>'; |
82 | + } |
|
79 | 83 | |
80 | 84 | echo ' |
81 | 85 | </dl> |
@@ -115,8 +119,8 @@ discard block |
||
115 | 119 | <input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text"> |
116 | 120 | </dd>'; |
117 | 121 | |
118 | - if (empty($modSettings['disableHostnameLookup'])) |
|
119 | - echo ' |
|
122 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
123 | + echo ' |
|
120 | 124 | <dt> |
121 | 125 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '> |
122 | 126 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -124,6 +128,7 @@ discard block |
||
124 | 128 | <dd> |
125 | 129 | <input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text"> |
126 | 130 | </dd>'; |
131 | + } |
|
127 | 132 | |
128 | 133 | echo ' |
129 | 134 | <dt> |
@@ -153,14 +158,15 @@ discard block |
||
153 | 158 | <dl class="settings">'; |
154 | 159 | |
155 | 160 | $count = 0; |
156 | - foreach ($ban_ips as $ip) |
|
157 | - echo ' |
|
161 | + foreach ($ban_ips as $ip) { |
|
162 | + echo ' |
|
158 | 163 | <dt> |
159 | 164 | <input type="checkbox" id="suggestions_', $key ,'_', $count, '" name="ban_suggestions[', $key ,'][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '" class="input_check"> |
160 | 165 | </dt> |
161 | 166 | <dd> |
162 | 167 | <label for="suggestions_', $key ,'_', $count++, '">', $ip, '</label> |
163 | 168 | </dd>'; |
169 | + } |
|
164 | 170 | |
165 | 171 | echo ' |
166 | 172 | </dl>'; |
@@ -202,8 +208,8 @@ discard block |
||
202 | 208 | addLoadEvent(fUpdateStatus);'; |
203 | 209 | |
204 | 210 | // Auto suggest only needed for adding new bans, not editing |
205 | - if ($context['ban']['is_new'] && empty($_REQUEST['u'])) |
|
206 | - echo ' |
|
211 | + if ($context['ban']['is_new'] && empty($_REQUEST['u'])) { |
|
212 | + echo ' |
|
207 | 213 | var oAddMemberSuggest = new smc_AutoSuggest({ |
208 | 214 | sSelf: \'oAddMemberSuggest\', |
209 | 215 | sSessionId: smf_session_id, |
@@ -221,6 +227,7 @@ discard block |
||
221 | 227 | return true; |
222 | 228 | } |
223 | 229 | oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');'; |
230 | + } |
|
224 | 231 | |
225 | 232 | echo ' |
226 | 233 | function confirmBan(aForm) |
@@ -268,8 +275,8 @@ discard block |
||
268 | 275 | <input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text"> |
269 | 276 | </dd>'; |
270 | 277 | |
271 | - if (empty($modSettings['disableHostnameLookup'])) |
|
272 | - echo ' |
|
278 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
279 | + echo ' |
|
273 | 280 | <dt> |
274 | 281 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '> |
275 | 282 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -277,6 +284,7 @@ discard block |
||
277 | 284 | <dd> |
278 | 285 | <input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text"> |
279 | 286 | </dd>'; |
287 | + } |
|
280 | 288 | |
281 | 289 | echo ' |
282 | 290 | <dt> |
@@ -65,18 +65,19 @@ discard block |
||
65 | 65 | </dt> |
66 | 66 | <dd> |
67 | 67 | ', $modSettings['smileys_url'], '/'; |
68 | - if ($context['current_set']['id'] == 'default') |
|
69 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
70 | - elseif (empty($context['smiley_set_dirs'])) |
|
71 | - echo ' |
|
68 | + if ($context['current_set']['id'] == 'default') { |
|
69 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
70 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
71 | + echo ' |
|
72 | 72 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '" class="input_text"> '; |
73 | - else |
|
73 | + } else |
|
74 | 74 | { |
75 | 75 | echo ' |
76 | 76 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
77 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
78 | - echo ' |
|
77 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
78 | + echo ' |
|
79 | 79 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
80 | + } |
|
80 | 81 | echo ' |
81 | 82 | </select> '; |
82 | 83 | } |
@@ -91,14 +92,15 @@ discard block |
||
91 | 92 | </dd>'; |
92 | 93 | |
93 | 94 | // If this is a new smiley set they have the option to import smileys already in the directory. |
94 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
95 | - echo ' |
|
95 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
96 | + echo ' |
|
96 | 97 | <dt> |
97 | 98 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
98 | 99 | </dt> |
99 | 100 | <dd> |
100 | 101 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1" class="input_check"> |
101 | 102 | </dd>'; |
103 | + } |
|
102 | 104 | |
103 | 105 | echo ' |
104 | 106 | </dl> |
@@ -132,9 +134,10 @@ discard block |
||
132 | 134 | <dd> |
133 | 135 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">'; |
134 | 136 | |
135 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
136 | - echo ' |
|
137 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
138 | + echo ' |
|
137 | 139 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
140 | + } |
|
138 | 141 | |
139 | 142 | echo ' |
140 | 143 | </select>) |
@@ -149,16 +152,17 @@ discard block |
||
149 | 152 | <strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong> |
150 | 153 | </dt> |
151 | 154 | <dd>'; |
152 | - if (empty($context['filenames'])) |
|
153 | - echo ' |
|
155 | + if (empty($context['filenames'])) { |
|
156 | + echo ' |
|
154 | 157 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" class="input_text">'; |
155 | - else |
|
158 | + } else |
|
156 | 159 | { |
157 | 160 | echo ' |
158 | 161 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
159 | - foreach ($context['filenames'] as $filename) |
|
160 | - echo ' |
|
162 | + foreach ($context['filenames'] as $filename) { |
|
163 | + echo ' |
|
161 | 164 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
165 | + } |
|
162 | 166 | echo ' |
163 | 167 | </select>'; |
164 | 168 | } |
@@ -227,9 +231,10 @@ discard block |
||
227 | 231 | <dd> |
228 | 232 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
229 | 233 | |
230 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
231 | - echo ' |
|
234 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
235 | + echo ' |
|
232 | 236 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
237 | + } |
|
233 | 238 | |
234 | 239 | echo ' |
235 | 240 | </select> |
@@ -238,16 +243,17 @@ discard block |
||
238 | 243 | <strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong> |
239 | 244 | </dt> |
240 | 245 | <dd>'; |
241 | - if (empty($context['filenames'])) |
|
242 | - echo ' |
|
246 | + if (empty($context['filenames'])) { |
|
247 | + echo ' |
|
243 | 248 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');" class="input_text">'; |
244 | - else |
|
249 | + } else |
|
245 | 250 | { |
246 | 251 | echo ' |
247 | 252 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
248 | - foreach ($context['filenames'] as $filename) |
|
249 | - echo ' |
|
253 | + foreach ($context['filenames'] as $filename) { |
|
254 | + echo ' |
|
250 | 255 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
256 | + } |
|
251 | 257 | echo ' |
252 | 258 | </select>'; |
253 | 259 | } |
@@ -275,14 +281,15 @@ discard block |
||
275 | 281 | </fieldset> |
276 | 282 | |
277 | 283 | <dl id="uploadMore" style="display: none;" class="settings">'; |
278 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
279 | - echo ' |
|
284 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
285 | + echo ' |
|
280 | 286 | <dt> |
281 | 287 | ', $txt['smileys_add_upload_for1'], ' <strong>', $smiley_set['name'], '</strong> ', $txt['smileys_add_upload_for2'], ': |
282 | 288 | </dt> |
283 | 289 | <dd> |
284 | 290 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');" class="input_file"> |
285 | 291 | </dd>'; |
292 | + } |
|
286 | 293 | echo ' |
287 | 294 | </dl> |
288 | 295 | </div> |
@@ -351,24 +358,27 @@ discard block |
||
351 | 358 | <strong>', empty($context['move_smiley']) ? $txt['smileys_move_select_smiley'] : $txt['smileys_move_select_destination'], '...</strong><br>'; |
352 | 359 | foreach ($location['rows'] as $row) |
353 | 360 | { |
354 | - if (!empty($context['move_smiley'])) |
|
355 | - echo ' |
|
361 | + if (!empty($context['move_smiley'])) { |
|
362 | + echo ' |
|
356 | 363 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
364 | + } |
|
357 | 365 | |
358 | 366 | foreach ($row as $smiley) |
359 | 367 | { |
360 | - if (empty($context['move_smiley'])) |
|
361 | - echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>'; |
|
362 | - else |
|
363 | - echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
|
368 | + if (empty($context['move_smiley'])) { |
|
369 | + echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>'; |
|
370 | + } else { |
|
371 | + echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
|
372 | + } |
|
364 | 373 | } |
365 | 374 | |
366 | 375 | echo ' |
367 | 376 | <br>'; |
368 | 377 | } |
369 | - if (!empty($context['move_smiley'])) |
|
370 | - echo ' |
|
378 | + if (!empty($context['move_smiley'])) { |
|
379 | + echo ' |
|
371 | 380 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
381 | + } |
|
372 | 382 | echo ' |
373 | 383 | </div> |
374 | 384 | <input type="hidden" name="reorder" value="1"> |
@@ -404,14 +414,15 @@ discard block |
||
404 | 414 | </div> |
405 | 415 | <div class="windowbg2"> |
406 | 416 | <dl class="settings">'; |
407 | - if (!$context['new_icon']) |
|
408 | - echo ' |
|
417 | + if (!$context['new_icon']) { |
|
418 | + echo ' |
|
409 | 419 | <dt> |
410 | 420 | <strong>', $txt['smiley_preview'], ': </strong> |
411 | 421 | </dt> |
412 | 422 | <dd> |
413 | 423 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
414 | 424 | </dd>'; |
425 | + } |
|
415 | 426 | echo ' |
416 | 427 | <dt> |
417 | 428 | <strong><label for="icon_filename">', $txt['smileys_filename'], '</label>: </strong><br><span class="smalltext">', $txt['icons_filename_all_png'], '</span> |
@@ -436,9 +447,10 @@ discard block |
||
436 | 447 | { |
437 | 448 | echo ' |
438 | 449 | <optgroup label="', $category['name'], '">'; |
439 | - foreach ($category['boards'] as $board) |
|
440 | - echo ' |
|
450 | + foreach ($category['boards'] as $board) { |
|
451 | + echo ' |
|
441 | 452 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
453 | + } |
|
442 | 454 | echo ' |
443 | 455 | </optgroup>'; |
444 | 456 | } |
@@ -453,19 +465,21 @@ discard block |
||
453 | 465 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
454 | 466 | |
455 | 467 | // Print the list of all the icons it can be put after... |
456 | - foreach ($context['icons'] as $id => $data) |
|
457 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
468 | + foreach ($context['icons'] as $id => $data) { |
|
469 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
458 | 470 | echo ' |
459 | 471 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
472 | + } |
|
460 | 473 | |
461 | 474 | echo ' |
462 | 475 | </select> |
463 | 476 | </dd> |
464 | 477 | </dl>'; |
465 | 478 | |
466 | - if (!$context['new_icon']) |
|
467 | - echo ' |
|
479 | + if (!$context['new_icon']) { |
|
480 | + echo ' |
|
468 | 481 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
482 | + } |
|
469 | 483 | |
470 | 484 | echo ' |
471 | 485 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button_submit"> |
@@ -72,9 +72,10 @@ discard block |
||
72 | 72 | |
73 | 73 | // Allow css/js files to be disable for this specific theme. |
74 | 74 | // Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference. |
75 | - if (!isset($settings['disable_files'])) |
|
76 | - $settings['disable_files'] = array(); |
|
77 | -} |
|
75 | + if (!isset($settings['disable_files'])) { |
|
76 | + $settings['disable_files'] = array(); |
|
77 | + } |
|
78 | + } |
|
78 | 79 | |
79 | 80 | /** |
80 | 81 | * The main sub template above the content. |
@@ -111,8 +112,9 @@ discard block |
||
111 | 112 | echo ' |
112 | 113 | <meta'; |
113 | 114 | |
114 | - foreach ($meta_tag as $meta_key => $meta_value) |
|
115 | - echo ' ', $meta_key, '="', $meta_value, '"'; |
|
115 | + foreach ($meta_tag as $meta_key => $meta_value) { |
|
116 | + echo ' ', $meta_key, '="', $meta_value, '"'; |
|
117 | + } |
|
116 | 118 | |
117 | 119 | echo '>'; |
118 | 120 | } |
@@ -123,14 +125,16 @@ discard block |
||
123 | 125 | <meta name="theme-color" content="#557EA0">'; |
124 | 126 | |
125 | 127 | // Please don't index these Mr Robot. |
126 | - if (!empty($context['robot_no_index'])) |
|
127 | - echo ' |
|
128 | + if (!empty($context['robot_no_index'])) { |
|
129 | + echo ' |
|
128 | 130 | <meta name="robots" content="noindex">'; |
131 | + } |
|
129 | 132 | |
130 | 133 | // Present a canonical url for search engines to prevent duplicate content in their indices. |
131 | - if (!empty($context['canonical_url'])) |
|
132 | - echo ' |
|
134 | + if (!empty($context['canonical_url'])) { |
|
135 | + echo ' |
|
133 | 136 | <link rel="canonical" href="', $context['canonical_url'], '">'; |
137 | + } |
|
134 | 138 | |
135 | 139 | // Show all the relative links, such as help, search, contents, and the like. |
136 | 140 | echo ' |
@@ -139,10 +143,11 @@ discard block |
||
139 | 143 | <link rel="search" href="' . $scripturl . '?action=search">' : ''); |
140 | 144 | |
141 | 145 | // If RSS feeds are enabled, advertise the presence of one. |
142 | - if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) |
|
143 | - echo ' |
|
146 | + if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) { |
|
147 | + echo ' |
|
144 | 148 | <link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?type=rss2;action=.xml"> |
145 | 149 | <link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?type=atom;action=.xml">'; |
150 | + } |
|
146 | 151 | |
147 | 152 | // If we're viewing a topic, these should be the previous and next topics, respectively. |
148 | 153 | if (!empty($context['links']['next'])) |
@@ -158,9 +163,10 @@ discard block |
||
158 | 163 | } |
159 | 164 | |
160 | 165 | // If we're in a board, or a topic for that matter, the index will be the board's index. |
161 | - if (!empty($context['current_board'])) |
|
162 | - echo ' |
|
166 | + if (!empty($context['current_board'])) { |
|
167 | + echo ' |
|
163 | 168 | <link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">'; |
169 | + } |
|
164 | 170 | |
165 | 171 | // Output any remaining HTML headers. (from mods, maybe?) |
166 | 172 | echo $context['html_headers']; |
@@ -191,8 +197,9 @@ discard block |
||
191 | 197 | <ul class="floatleft" id="top_info"> |
192 | 198 | <li> |
193 | 199 | <a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">'; |
194 | - if (!empty($context['user']['avatar'])) |
|
195 | - echo $context['user']['avatar']['image']; |
|
200 | + if (!empty($context['user']['avatar'])) { |
|
201 | + echo $context['user']['avatar']['image']; |
|
202 | + } |
|
196 | 203 | echo $context['user']['name'], '</a> |
197 | 204 | <div id="profile_menu" class="top_menu"></div> |
198 | 205 | </li>'; |
@@ -219,11 +226,12 @@ discard block |
||
219 | 226 | </ul>'; |
220 | 227 | } |
221 | 228 | // Otherwise they're a guest. Ask them to either register or login. |
222 | - else |
|
223 | - echo ' |
|
229 | + else { |
|
230 | + echo ' |
|
224 | 231 | <ul class="floatleft welcome"> |
225 | 232 | <li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li> |
226 | 233 | </ul>'; |
234 | + } |
|
227 | 235 | |
228 | 236 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
229 | 237 | { |
@@ -231,9 +239,10 @@ discard block |
||
231 | 239 | <form id="languages_form" method="get" class="floatright"> |
232 | 240 | <select id="language_select" name="language" onchange="this.form.submit()">'; |
233 | 241 | |
234 | - foreach ($context['languages'] as $language) |
|
235 | - echo ' |
|
242 | + foreach ($context['languages'] as $language) { |
|
243 | + echo ' |
|
236 | 244 | <option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>'; |
245 | + } |
|
237 | 246 | |
238 | 247 | echo ' |
239 | 248 | </select> |
@@ -257,31 +266,36 @@ discard block |
||
257 | 266 | <option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>'; |
258 | 267 | |
259 | 268 | // Can't limit it to a specific topic if we are not in one |
260 | - if (!empty($context['current_topic'])) |
|
261 | - echo ' |
|
269 | + if (!empty($context['current_topic'])) { |
|
270 | + echo ' |
|
262 | 271 | <option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>'; |
272 | + } |
|
263 | 273 | |
264 | 274 | // Can't limit it to a specific board if we are not in one |
265 | - if (!empty($context['current_board'])) |
|
266 | - echo ' |
|
275 | + if (!empty($context['current_board'])) { |
|
276 | + echo ' |
|
267 | 277 | <option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>'; |
278 | + } |
|
268 | 279 | |
269 | 280 | // Can't search for members if we can't see the memberlist |
270 | - if (!empty($context['allow_memberlist'])) |
|
271 | - echo ' |
|
281 | + if (!empty($context['allow_memberlist'])) { |
|
282 | + echo ' |
|
272 | 283 | <option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>'; |
284 | + } |
|
273 | 285 | |
274 | 286 | echo ' |
275 | 287 | </select>'; |
276 | 288 | |
277 | 289 | // Search within current topic? |
278 | - if (!empty($context['current_topic'])) |
|
279 | - echo ' |
|
290 | + if (!empty($context['current_topic'])) { |
|
291 | + echo ' |
|
280 | 292 | <input type="hidden" name="sd_topic" value="', $context['current_topic'], '">'; |
293 | + } |
|
281 | 294 | // If we're on a certain board, limit it to this board ;). |
282 | - elseif (!empty($context['current_board'])) |
|
283 | - echo ' |
|
295 | + elseif (!empty($context['current_board'])) { |
|
296 | + echo ' |
|
284 | 297 | <input type="hidden" name="sd_brd" value="', $context['current_board'], '">'; |
298 | + } |
|
285 | 299 | |
286 | 300 | echo ' |
287 | 301 | <input type="submit" name="search2" value="', $txt['search'], '" class="button_submit"> |
@@ -311,12 +325,13 @@ discard block |
||
311 | 325 | ', $context['current_time'], ' |
312 | 326 | </div>'; |
313 | 327 | // Show a random news item? (or you could pick one from news_lines...) |
314 | - if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) |
|
315 | - echo ' |
|
328 | + if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) { |
|
329 | + echo ' |
|
316 | 330 | <div class="news"> |
317 | 331 | <h2>', $txt['news'], ': </h2> |
318 | 332 | <p>', $context['random_news_line'], '</p> |
319 | 333 | </div>'; |
334 | + } |
|
320 | 335 | |
321 | 336 | echo ' |
322 | 337 | <hr class="clear"> |
@@ -379,9 +394,10 @@ discard block |
||
379 | 394 | </ul>'; |
380 | 395 | |
381 | 396 | // Show the load time? |
382 | - if ($context['show_load_time']) |
|
383 | - echo ' |
|
397 | + if ($context['show_load_time']) { |
|
398 | + echo ' |
|
384 | 399 | <p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>'; |
400 | + } |
|
385 | 401 | |
386 | 402 | echo ' |
387 | 403 | </div>'; |
@@ -411,19 +427,21 @@ discard block |
||
411 | 427 | global $context, $shown_linktree, $scripturl, $txt; |
412 | 428 | |
413 | 429 | // If linktree is empty, just return - also allow an override. |
414 | - if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) |
|
415 | - return; |
|
430 | + if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) { |
|
431 | + return; |
|
432 | + } |
|
416 | 433 | |
417 | 434 | echo ' |
418 | 435 | <div class="navigate_section"> |
419 | 436 | <ul>'; |
420 | 437 | |
421 | - if ($context['user']['is_logged']) |
|
422 | - echo ' |
|
438 | + if ($context['user']['is_logged']) { |
|
439 | + echo ' |
|
423 | 440 | <li class="unread_links"> |
424 | 441 | <a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a> |
425 | 442 | <a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a> |
426 | 443 | </li>'; |
444 | + } |
|
427 | 445 | |
428 | 446 | // Each tree item has a URL and name. Some may have extra_before and extra_after. |
429 | 447 | foreach ($context['linktree'] as $link_num => $tree) |
@@ -434,25 +452,29 @@ discard block |
||
434 | 452 | // Don't show a separator for the first one. |
435 | 453 | // Better here. Always points to the next level when the linktree breaks to a second line. |
436 | 454 | // Picked a better looking HTML entity, and added support for RTL plus a span for styling. |
437 | - if ($link_num != 0) |
|
438 | - echo ' |
|
455 | + if ($link_num != 0) { |
|
456 | + echo ' |
|
439 | 457 | <span class="dividers">', $context['right_to_left'] ? ' ◄ ' : ' ► ', '</span>'; |
458 | + } |
|
440 | 459 | |
441 | 460 | // Show something before the link? |
442 | - if (isset($tree['extra_before'])) |
|
443 | - echo $tree['extra_before'], ' '; |
|
461 | + if (isset($tree['extra_before'])) { |
|
462 | + echo $tree['extra_before'], ' '; |
|
463 | + } |
|
444 | 464 | |
445 | 465 | // Show the link, including a URL if it should have one. |
446 | - if (isset($tree['url'])) |
|
447 | - echo ' |
|
466 | + if (isset($tree['url'])) { |
|
467 | + echo ' |
|
448 | 468 | <a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>'; |
449 | - else |
|
450 | - echo ' |
|
469 | + } else { |
|
470 | + echo ' |
|
451 | 471 | <span>' . $tree['name'] . '</span>'; |
472 | + } |
|
452 | 473 | |
453 | 474 | // Show something after the link...? |
454 | - if (isset($tree['extra_after'])) |
|
455 | - echo ' ', $tree['extra_after']; |
|
475 | + if (isset($tree['extra_after'])) { |
|
476 | + echo ' ', $tree['extra_after']; |
|
477 | + } |
|
456 | 478 | |
457 | 479 | echo ' |
458 | 480 | </li>'; |
@@ -502,13 +524,14 @@ discard block |
||
502 | 524 | echo ' |
503 | 525 | <ul>'; |
504 | 526 | |
505 | - foreach ($childbutton['sub_buttons'] as $grandchildbutton) |
|
506 | - echo ' |
|
527 | + foreach ($childbutton['sub_buttons'] as $grandchildbutton) { |
|
528 | + echo ' |
|
507 | 529 | <li> |
508 | 530 | <a href="', $grandchildbutton['href'], '"' , isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '> |
509 | 531 | ', $grandchildbutton['title'], ' |
510 | 532 | </a> |
511 | 533 | </li>'; |
534 | + } |
|
512 | 535 | |
513 | 536 | echo ' |
514 | 537 | </ul>'; |
@@ -539,8 +562,9 @@ discard block |
||
539 | 562 | { |
540 | 563 | global $context, $txt; |
541 | 564 | |
542 | - if (!is_array($strip_options)) |
|
543 | - $strip_options = array(); |
|
565 | + if (!is_array($strip_options)) { |
|
566 | + $strip_options = array(); |
|
567 | + } |
|
544 | 568 | |
545 | 569 | // Create the buttons... |
546 | 570 | $buttons = array(); |
@@ -549,8 +573,9 @@ discard block |
||
549 | 573 | // As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!) |
550 | 574 | if (!isset($value['test']) || !empty($context[$value['test']])) |
551 | 575 | { |
552 | - if (!isset($value['id'])) |
|
553 | - $value['id'] = $key; |
|
576 | + if (!isset($value['id'])) { |
|
577 | + $value['id'] = $key; |
|
578 | + } |
|
554 | 579 | |
555 | 580 | $button = ' |
556 | 581 | <a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' '. $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="'. $value['url'] .'"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>'; |
@@ -563,13 +588,15 @@ discard block |
||
563 | 588 | <div class="overview">'; |
564 | 589 | foreach ($value['sub_buttons'] as $element) |
565 | 590 | { |
566 | - if (isset($element['test']) && empty($context[$element['test']])) |
|
567 | - continue; |
|
591 | + if (isset($element['test']) && empty($context[$element['test']])) { |
|
592 | + continue; |
|
593 | + } |
|
568 | 594 | |
569 | 595 | $button .= ' |
570 | 596 | <a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>'; |
571 | - if (isset($txt[$element['text'] . '_desc'])) |
|
572 | - $button .= '<br /><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
597 | + if (isset($txt[$element['text'] . '_desc'])) { |
|
598 | + $button .= '<br /><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
599 | + } |
|
573 | 600 | $button .= '</a>'; |
574 | 601 | } |
575 | 602 | $button .= ' |
@@ -583,8 +610,9 @@ discard block |
||
583 | 610 | } |
584 | 611 | |
585 | 612 | // No buttons? No button strip either. |
586 | - if (empty($buttons)) |
|
587 | - return; |
|
613 | + if (empty($buttons)) { |
|
614 | + return; |
|
615 | + } |
|
588 | 616 | |
589 | 617 | echo ' |
590 | 618 | <div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"': ''), '> |
@@ -26,9 +26,10 @@ discard block |
||
26 | 26 | <div class="cat_bar"> |
27 | 27 | <h3 class="catbg"> |
28 | 28 | <span class="floatleft">', $txt['members_list'], '</span>'; |
29 | - if (!isset($context['old_search'])) |
|
30 | - echo ' |
|
29 | + if (!isset($context['old_search'])) { |
|
30 | + echo ' |
|
31 | 31 | <span class="floatright">', $context['letter_links'], '</span>'; |
32 | + } |
|
32 | 33 | echo ' |
33 | 34 | </h3> |
34 | 35 | </div>'; |
@@ -43,19 +44,22 @@ discard block |
||
43 | 44 | foreach ($context['columns'] as $key => $column) |
44 | 45 | { |
45 | 46 | // @TODO maybe find something nicer? |
46 | - if ($key == 'email_address' && !$context['can_send_email']) |
|
47 | - continue; |
|
47 | + if ($key == 'email_address' && !$context['can_send_email']) { |
|
48 | + continue; |
|
49 | + } |
|
48 | 50 | |
49 | 51 | // This is a selected column, so underline it or some such. |
50 | - if ($column['selected']) |
|
51 | - echo ' |
|
52 | + if ($column['selected']) { |
|
53 | + echo ' |
|
52 | 54 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '> |
53 | 55 | <a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></th>'; |
56 | + } |
|
54 | 57 | // This is just some column... show the link and be done with it. |
55 | - else |
|
56 | - echo ' |
|
58 | + else { |
|
59 | + echo ' |
|
57 | 60 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '> |
58 | 61 | ', $column['link'], '</th>'; |
62 | + } |
|
59 | 63 | } |
60 | 64 | echo ' |
61 | 65 | </tr> |
@@ -74,9 +78,10 @@ discard block |
||
74 | 78 | </td> |
75 | 79 | <td class="lefttext">', $member['link'], '</td>'; |
76 | 80 | |
77 | - if (!isset($context['disabled_fields']['website'])) |
|
78 | - echo ' |
|
81 | + if (!isset($context['disabled_fields']['website'])) { |
|
82 | + echo ' |
|
79 | 83 | <td class="centertext website_url">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank" class="new_win"><span class="generic_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>'; |
84 | + } |
|
80 | 85 | |
81 | 86 | // Group and date. |
82 | 87 | echo ' |
@@ -89,11 +94,12 @@ discard block |
||
89 | 94 | <td class="centertext" style="white-space: nowrap; width: 15px">', $member['posts'], '</td> |
90 | 95 | <td class="centertext statsbar" style="width: 120px">'; |
91 | 96 | |
92 | - if (!empty($member['post_percent'])) |
|
93 | - echo ' |
|
97 | + if (!empty($member['post_percent'])) { |
|
98 | + echo ' |
|
94 | 99 | <div class="bar" style="width: ', $member['post_percent'] + 4, 'px;"> |
95 | 100 | <div style="width: ', $member['post_percent'], 'px;"></div> |
96 | 101 | </div>'; |
102 | + } |
|
97 | 103 | |
98 | 104 | echo ' |
99 | 105 | </td>'; |
@@ -102,9 +108,10 @@ discard block |
||
102 | 108 | // Show custom fields marked to be shown here |
103 | 109 | if (!empty($context['custom_profile_fields']['columns'])) |
104 | 110 | { |
105 | - foreach ($context['custom_profile_fields']['columns'] as $key => $column) |
|
106 | - echo ' |
|
111 | + foreach ($context['custom_profile_fields']['columns'] as $key => $column) { |
|
112 | + echo ' |
|
107 | 113 | <td class="righttext">', $member['options'][$key], '</td>'; |
114 | + } |
|
108 | 115 | } |
109 | 116 | |
110 | 117 | echo ' |
@@ -112,11 +119,12 @@ discard block |
||
112 | 119 | } |
113 | 120 | } |
114 | 121 | // No members? |
115 | - else |
|
116 | - echo ' |
|
122 | + else { |
|
123 | + echo ' |
|
117 | 124 | <tr> |
118 | 125 | <td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td> |
119 | 126 | </tr>'; |
127 | + } |
|
120 | 128 | |
121 | 129 | echo ' |
122 | 130 | </tbody> |
@@ -129,9 +137,10 @@ discard block |
||
129 | 137 | <div class="pagelinks floatleft">', $context['page_index'], '</div>'; |
130 | 138 | |
131 | 139 | // If it is displaying the result of a search show a "search again" link to edit their criteria. |
132 | - if (isset($context['old_search'])) |
|
133 | - echo ' |
|
140 | + if (isset($context['old_search'])) { |
|
141 | + echo ' |
|
134 | 142 | <a class="button_link" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>'; |
143 | + } |
|
135 | 144 | echo ' |
136 | 145 | </div> |
137 | 146 | </div>'; |
@@ -62,16 +62,17 @@ |
||
62 | 62 | <div id="error_box" class="errorbox"> |
63 | 63 | <ul id="error_list">'; |
64 | 64 | |
65 | - foreach ($context['post_errors'] as $key => $error) |
|
66 | - echo ' |
|
65 | + foreach ($context['post_errors'] as $key => $error) { |
|
66 | + echo ' |
|
67 | 67 | <li id="error_', $key, '" class="error">', $error, '</li>'; |
68 | + } |
|
68 | 69 | |
69 | 70 | echo ' |
70 | 71 | </ul>'; |
71 | - } |
|
72 | - else |
|
73 | - echo ' |
|
72 | + } else { |
|
73 | + echo ' |
|
74 | 74 | <div style="display:none" id="error_box" class="errorbox">'; |
75 | + } |
|
75 | 76 | |
76 | 77 | echo ' |
77 | 78 | </div>'; |