@@ -51,9 +51,10 @@ discard block |
||
51 | 51 | <dd> |
52 | 52 | <div id="known_themes_list">'; |
53 | 53 | |
54 | - foreach ($context['themes'] as $theme) |
|
55 | - echo ' |
|
54 | + foreach ($context['themes'] as $theme) { |
|
55 | + echo ' |
|
56 | 56 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $theme['name'], '</label><br>'; |
57 | + } |
|
57 | 58 | |
58 | 59 | echo ' |
59 | 60 | </div> |
@@ -70,9 +71,10 @@ discard block |
||
70 | 71 | <select name="options[theme_guests]" id="theme_guests">'; |
71 | 72 | |
72 | 73 | // Put an option for each theme in the select box. |
73 | - foreach ($context['themes'] as $theme) |
|
74 | - echo ' |
|
74 | + foreach ($context['themes'] as $theme) { |
|
75 | + echo ' |
|
75 | 76 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
77 | + } |
|
76 | 78 | |
77 | 79 | echo ' |
78 | 80 | </select> |
@@ -87,9 +89,10 @@ discard block |
||
87 | 89 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
88 | 90 | |
89 | 91 | // Same thing, this time for changing the theme of everyone. |
90 | - foreach ($context['themes'] as $theme) |
|
91 | - echo ' |
|
92 | + foreach ($context['themes'] as $theme) { |
|
93 | + echo ' |
|
92 | 94 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
95 | + } |
|
93 | 96 | |
94 | 97 | echo ' |
95 | 98 | </select> |
@@ -183,11 +186,12 @@ discard block |
||
183 | 186 | global $context, $scripturl, $txt; |
184 | 187 | |
185 | 188 | // Show a nice confirmation message. |
186 | - if (isset($_GET['done'])) |
|
187 | - echo ' |
|
189 | + if (isset($_GET['done'])) { |
|
190 | + echo ' |
|
188 | 191 | <div class="infobox"> |
189 | 192 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
190 | 193 | </div>'; |
194 | + } |
|
191 | 195 | |
192 | 196 | echo ' |
193 | 197 | <div class="cat_bar"> |
@@ -344,11 +348,12 @@ discard block |
||
344 | 348 | if (empty($setting) || !is_array($setting)) |
345 | 349 | { |
346 | 350 | // Insert a separator (unless this is the first item in the list) |
347 | - if ($i !== $first_option_key) |
|
348 | - echo ' |
|
351 | + if ($i !== $first_option_key) { |
|
352 | + echo ' |
|
349 | 353 | </dl> |
350 | 354 | <hr> |
351 | 355 | <dl class="settings">'; |
356 | + } |
|
352 | 357 | |
353 | 358 | // Should we give a name to this section? |
354 | 359 | if (is_string($setting) && !empty($setting)) |
@@ -357,9 +362,9 @@ discard block |
||
357 | 362 | echo ' |
358 | 363 | <dt><strong>' . $setting . '</strong></dt> |
359 | 364 | <dd></dd>'; |
365 | + } else { |
|
366 | + $titled_section = false; |
|
360 | 367 | } |
361 | - else |
|
362 | - $titled_section = false; |
|
363 | 368 | |
364 | 369 | continue; |
365 | 370 | } |
@@ -368,8 +373,8 @@ discard block |
||
368 | 373 | <dt>'; |
369 | 374 | |
370 | 375 | // Show the change option box? |
371 | - if ($context['theme_options_reset']) |
|
372 | - echo ' |
|
376 | + if ($context['theme_options_reset']) { |
|
377 | + echo ' |
|
373 | 378 | <span class="floatleft"> |
374 | 379 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
375 | 380 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -377,23 +382,26 @@ discard block |
||
377 | 382 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
378 | 383 | </select> |
379 | 384 | </span>'; |
385 | + } |
|
380 | 386 | |
381 | 387 | echo ' |
382 | 388 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
383 | 389 | |
384 | - if (isset($setting['description'])) |
|
385 | - echo ' |
|
390 | + if (isset($setting['description'])) { |
|
391 | + echo ' |
|
386 | 392 | <br> |
387 | 393 | <span class="smalltext">', $setting['description'], '</span>'; |
394 | + } |
|
388 | 395 | echo ' |
389 | 396 | </dt>'; |
390 | 397 | |
391 | 398 | // Display checkbox options |
392 | - if ($setting['type'] == 'checkbox') |
|
393 | - echo ' |
|
399 | + if ($setting['type'] == 'checkbox') { |
|
400 | + echo ' |
|
394 | 401 | <dd> |
395 | 402 | <input type="hidden" name="' . (!empty($setting['default']) ? 'default_' : '') . 'options[' . $setting['id'] . ']" value="0"> |
396 | 403 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', $context['theme_options_reset'] ? ' disabled' : '', ' value="1" class="floatleft">'; |
404 | + } |
|
397 | 405 | |
398 | 406 | // How about selection lists, we all love them |
399 | 407 | elseif ($setting['type'] == 'list') |
@@ -402,9 +410,10 @@ discard block |
||
402 | 410 | <dd> |
403 | 411 | <select class="floatleft" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
404 | 412 | |
405 | - foreach ($setting['options'] as $value => $label) |
|
406 | - echo ' |
|
413 | + foreach ($setting['options'] as $value => $label) { |
|
414 | + echo ' |
|
407 | 415 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
416 | + } |
|
408 | 417 | |
409 | 418 | echo ' |
410 | 419 | </select>'; |
@@ -423,14 +432,13 @@ discard block |
||
423 | 432 | |
424 | 433 | echo ' |
425 | 434 | <input type="number"', $min . $max . $step; |
426 | - } |
|
427 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
428 | - echo' |
|
435 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
436 | + echo' |
|
429 | 437 | <input type="url"'; |
430 | - |
|
431 | - else |
|
432 | - echo ' |
|
438 | + } else { |
|
439 | + echo ' |
|
433 | 440 | <input type="text"'; |
441 | + } |
|
434 | 442 | |
435 | 443 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
436 | 444 | } |
@@ -468,8 +476,8 @@ discard block |
||
468 | 476 | <div class="windowbg">'; |
469 | 477 | |
470 | 478 | // @todo Why can't I edit the default theme popup. |
471 | - if ($context['theme_settings']['theme_id'] != 1) |
|
472 | - echo ' |
|
479 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
480 | + echo ' |
|
473 | 481 | <div class="title_bar"> |
474 | 482 | <h3 class="titlebg config_hd"> |
475 | 483 | ', $txt['theme_edit'], ' |
@@ -485,6 +493,7 @@ discard block |
||
485 | 493 | </li> |
486 | 494 | </ul> |
487 | 495 | </div>'; |
496 | + } |
|
488 | 497 | |
489 | 498 | echo ' |
490 | 499 | <div class="title_bar"> |
@@ -535,9 +544,10 @@ discard block |
||
535 | 544 | <dd> |
536 | 545 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
537 | 546 | |
538 | - foreach ($context['theme_variants'] as $key => $variant) |
|
539 | - echo ' |
|
547 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
548 | + echo ' |
|
540 | 549 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
550 | + } |
|
541 | 551 | |
542 | 552 | echo ' |
543 | 553 | </select> |
@@ -571,11 +581,12 @@ discard block |
||
571 | 581 | if (empty($setting) || !is_array($setting)) |
572 | 582 | { |
573 | 583 | // We don't need a separator before the first list element |
574 | - if ($i !== $first_setting_key) |
|
575 | - echo ' |
|
584 | + if ($i !== $first_setting_key) { |
|
585 | + echo ' |
|
576 | 586 | </dl> |
577 | 587 | <hr> |
578 | 588 | <dl class="settings">'; |
589 | + } |
|
579 | 590 | |
580 | 591 | // Add a fake heading? |
581 | 592 | if (is_string($setting) && !empty($setting)) |
@@ -584,9 +595,9 @@ discard block |
||
584 | 595 | echo ' |
585 | 596 | <dt><strong>' . $setting . '</strong></dt> |
586 | 597 | <dd></dd>'; |
598 | + } else { |
|
599 | + $titled_section = false; |
|
587 | 600 | } |
588 | - else |
|
589 | - $titled_section = false; |
|
590 | 601 | |
591 | 602 | continue; |
592 | 603 | } |
@@ -595,20 +606,22 @@ discard block |
||
595 | 606 | <dt> |
596 | 607 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
597 | 608 | |
598 | - if (isset($setting['description'])) |
|
599 | - echo '<br> |
|
609 | + if (isset($setting['description'])) { |
|
610 | + echo '<br> |
|
600 | 611 | <span class="smalltext">', $setting['description'], '</span>'; |
612 | + } |
|
601 | 613 | |
602 | 614 | echo ' |
603 | 615 | </dt>'; |
604 | 616 | |
605 | 617 | // A checkbox? |
606 | - if ($setting['type'] == 'checkbox') |
|
607 | - echo ' |
|
618 | + if ($setting['type'] == 'checkbox') { |
|
619 | + echo ' |
|
608 | 620 | <dd> |
609 | 621 | <input type="hidden" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" value="0"> |
610 | 622 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', ' value="1"> |
611 | 623 | </dd>'; |
624 | + } |
|
612 | 625 | |
613 | 626 | // A list with options? |
614 | 627 | elseif ($setting['type'] == 'list') |
@@ -617,9 +630,10 @@ discard block |
||
617 | 630 | <dd> |
618 | 631 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
619 | 632 | |
620 | - foreach ($setting['options'] as $value => $label) |
|
621 | - echo ' |
|
633 | + foreach ($setting['options'] as $value => $label) { |
|
634 | + echo ' |
|
622 | 635 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
636 | + } |
|
623 | 637 | |
624 | 638 | echo ' |
625 | 639 | </select> |
@@ -647,14 +661,13 @@ discard block |
||
647 | 661 | |
648 | 662 | echo ' |
649 | 663 | <input type="number"', $min . $max . $step; |
650 | - } |
|
651 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
652 | - echo' |
|
664 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
665 | + echo' |
|
653 | 666 | <input type="url"'; |
654 | - |
|
655 | - else |
|
656 | - echo ' |
|
667 | + } else { |
|
668 | + echo ' |
|
657 | 669 | <input type="text"'; |
670 | + } |
|
658 | 671 | |
659 | 672 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : (empty($setting['size']) ? ' size="40"' : ' size="' . $setting['size'] . '"'), '> |
660 | 673 | </dd>'; |
@@ -726,9 +739,10 @@ discard block |
||
726 | 739 | <label for="variant', $theme['id'], '"><strong>', $theme['pick_label'], '</strong></label>: |
727 | 740 | <select id="variant', $theme['id'], '" name="vrt[', $theme['id'], ']" onchange="changeVariant', $theme['id'], '(this.value);">'; |
728 | 741 | |
729 | - foreach ($theme['variants'] as $key => $variant) |
|
730 | - echo ' |
|
742 | + foreach ($theme['variants'] as $key => $variant) { |
|
743 | + echo ' |
|
731 | 744 | <option value="', $key, '"', $theme['selected_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
745 | + } |
|
732 | 746 | |
733 | 747 | echo ' |
734 | 748 | </select> |
@@ -805,21 +819,23 @@ discard block |
||
805 | 819 | <div class="windowbg">'; |
806 | 820 | |
807 | 821 | // Oops! there was an error :( |
808 | - if (!empty($context['error_message'])) |
|
809 | - echo ' |
|
822 | + if (!empty($context['error_message'])) { |
|
823 | + echo ' |
|
810 | 824 | <p> |
811 | 825 | ', $context['error_message'], ' |
812 | 826 | </p>'; |
827 | + } |
|
813 | 828 | |
814 | 829 | // Not much to show except a link back... |
815 | - else |
|
816 | - echo ' |
|
830 | + else { |
|
831 | + echo ' |
|
817 | 832 | <p> |
818 | 833 | <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'], ' |
819 | 834 | </p> |
820 | 835 | <p> |
821 | 836 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
822 | 837 | </p>'; |
838 | + } |
|
823 | 839 | |
824 | 840 | echo ' |
825 | 841 | </div><!-- .windowbg -->'; |
@@ -884,11 +900,12 @@ discard block |
||
884 | 900 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
885 | 901 | <span class="floatright">'; |
886 | 902 | |
887 | - if ($template['can_copy']) |
|
888 | - echo ' |
|
903 | + if ($template['can_copy']) { |
|
904 | + echo ' |
|
889 | 905 | <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>'; |
890 | - else |
|
891 | - echo $txt['themeadmin_edit_no_copy']; |
|
906 | + } else { |
|
907 | + echo $txt['themeadmin_edit_no_copy']; |
|
908 | + } |
|
892 | 909 | |
893 | 910 | echo ' |
894 | 911 | </span> |
@@ -907,11 +924,12 @@ discard block |
||
907 | 924 | { |
908 | 925 | global $context, $txt; |
909 | 926 | |
910 | - if (!empty($context['browse_title'])) |
|
911 | - echo ' |
|
927 | + if (!empty($context['browse_title'])) { |
|
928 | + echo ' |
|
912 | 929 | <div class="cat_bar"> |
913 | 930 | <h3 class="catbg">', $context['browse_title'], '</h3> |
914 | 931 | </div>'; |
932 | + } |
|
915 | 933 | |
916 | 934 | echo ' |
917 | 935 | <table class="table_grid tborder"> |
@@ -930,16 +948,15 @@ discard block |
||
930 | 948 | <tr class="windowbg"> |
931 | 949 | <td>'; |
932 | 950 | |
933 | - if ($file['is_editable']) |
|
934 | - echo ' |
|
951 | + if ($file['is_editable']) { |
|
952 | + echo ' |
|
935 | 953 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
936 | - |
|
937 | - elseif ($file['is_directory']) |
|
938 | - echo ' |
|
954 | + } elseif ($file['is_directory']) { |
|
955 | + echo ' |
|
939 | 956 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
940 | - |
|
941 | - else |
|
942 | - echo $file['filename']; |
|
957 | + } else { |
|
958 | + echo $file['filename']; |
|
959 | + } |
|
943 | 960 | |
944 | 961 | echo ' |
945 | 962 | </td> |
@@ -960,11 +977,12 @@ discard block |
||
960 | 977 | { |
961 | 978 | global $context, $settings, $scripturl, $txt; |
962 | 979 | |
963 | - if ($context['session_error']) |
|
964 | - echo ' |
|
980 | + if ($context['session_error']) { |
|
981 | + echo ' |
|
965 | 982 | <div class="errorbox"> |
966 | 983 | ', $txt['error_session_timeout'], ' |
967 | 984 | </div>'; |
985 | + } |
|
968 | 986 | |
969 | 987 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
970 | 988 | echo ' |
@@ -1027,17 +1045,18 @@ discard block |
||
1027 | 1045 | { |
1028 | 1046 | '; |
1029 | 1047 | |
1030 | - if (isBrowser('is_ie')) |
|
1031 | - echo ' |
|
1048 | + if (isBrowser('is_ie')) { |
|
1049 | + echo ' |
|
1032 | 1050 | var sheets = frames["css_preview_box"].document.styleSheets; |
1033 | 1051 | for (var j = 0; j < sheets.length; j++) |
1034 | 1052 | { |
1035 | 1053 | if (sheets[j].id == "css_preview_box") |
1036 | 1054 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
1037 | 1055 | }'; |
1038 | - else |
|
1039 | - echo ' |
|
1056 | + } else { |
|
1057 | + echo ' |
|
1040 | 1058 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
1059 | + } |
|
1041 | 1060 | echo ' |
1042 | 1061 | } |
1043 | 1062 | catch (e) |
@@ -1089,9 +1108,10 @@ discard block |
||
1089 | 1108 | </div> |
1090 | 1109 | <div class="windowbg">'; |
1091 | 1110 | |
1092 | - if (!$context['allow_save']) |
|
1093 | - echo ' |
|
1111 | + if (!$context['allow_save']) { |
|
1112 | + echo ' |
|
1094 | 1113 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1114 | + } |
|
1095 | 1115 | |
1096 | 1116 | echo ' |
1097 | 1117 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1105,9 +1125,10 @@ discard block |
||
1105 | 1125 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1106 | 1126 | |
1107 | 1127 | // Hopefully it exists. |
1108 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1109 | - echo ' |
|
1128 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1129 | + echo ' |
|
1110 | 1130 | <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'], '">'; |
1131 | + } |
|
1111 | 1132 | |
1112 | 1133 | echo ' |
1113 | 1134 | </form>'; |
@@ -1120,18 +1141,20 @@ discard block |
||
1120 | 1141 | { |
1121 | 1142 | global $context, $scripturl, $txt; |
1122 | 1143 | |
1123 | - if ($context['session_error']) |
|
1124 | - echo ' |
|
1144 | + if ($context['session_error']) { |
|
1145 | + echo ' |
|
1125 | 1146 | <div class="errorbox"> |
1126 | 1147 | ', $txt['error_session_timeout'], ' |
1127 | 1148 | </div>'; |
1149 | + } |
|
1128 | 1150 | |
1129 | - if (isset($context['parse_error'])) |
|
1130 | - echo ' |
|
1151 | + if (isset($context['parse_error'])) { |
|
1152 | + echo ' |
|
1131 | 1153 | <div class="errorbox"> |
1132 | 1154 | ', $txt['themeadmin_edit_error'], ' |
1133 | 1155 | <div><pre>', $context['parse_error'], '</pre></div> |
1134 | 1156 | </div>'; |
1157 | + } |
|
1135 | 1158 | |
1136 | 1159 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1137 | 1160 | echo ' |
@@ -1141,16 +1164,18 @@ discard block |
||
1141 | 1164 | </div> |
1142 | 1165 | <div class="windowbg">'; |
1143 | 1166 | |
1144 | - if (!$context['allow_save']) |
|
1145 | - echo ' |
|
1167 | + if (!$context['allow_save']) { |
|
1168 | + echo ' |
|
1146 | 1169 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1170 | + } |
|
1147 | 1171 | |
1148 | - foreach ($context['file_parts'] as $part) |
|
1149 | - echo ' |
|
1172 | + foreach ($context['file_parts'] as $part) { |
|
1173 | + echo ' |
|
1150 | 1174 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
1151 | 1175 | <div class="centertext"> |
1152 | 1176 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
1153 | 1177 | </div>'; |
1178 | + } |
|
1154 | 1179 | |
1155 | 1180 | echo ' |
1156 | 1181 | <div class="padding righttext"> |
@@ -1159,9 +1184,10 @@ discard block |
||
1159 | 1184 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1160 | 1185 | |
1161 | 1186 | // Hopefully it exists. |
1162 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1163 | - echo ' |
|
1187 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1188 | + echo ' |
|
1164 | 1189 | <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'], '">'; |
1190 | + } |
|
1165 | 1191 | |
1166 | 1192 | echo ' |
1167 | 1193 | </div><!-- .righttext --> |
@@ -1176,18 +1202,20 @@ discard block |
||
1176 | 1202 | { |
1177 | 1203 | global $context, $scripturl, $txt; |
1178 | 1204 | |
1179 | - if ($context['session_error']) |
|
1180 | - echo ' |
|
1205 | + if ($context['session_error']) { |
|
1206 | + echo ' |
|
1181 | 1207 | <div class="errorbox"> |
1182 | 1208 | ', $txt['error_session_timeout'], ' |
1183 | 1209 | </div>'; |
1210 | + } |
|
1184 | 1211 | |
1185 | 1212 | // Is this file writeable? |
1186 | - if (!$context['allow_save']) |
|
1187 | - echo ' |
|
1213 | + if (!$context['allow_save']) { |
|
1214 | + echo ' |
|
1188 | 1215 | <div class="errorbox"> |
1189 | 1216 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
1190 | 1217 | </div>'; |
1218 | + } |
|
1191 | 1219 | |
1192 | 1220 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1193 | 1221 | echo ' |
@@ -1202,9 +1230,10 @@ discard block |
||
1202 | 1230 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1203 | 1231 | |
1204 | 1232 | // Hopefully it exists. |
1205 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1206 | - echo ' |
|
1233 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1234 | + echo ' |
|
1207 | 1235 | <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'], '">'; |
1236 | + } |
|
1208 | 1237 | |
1209 | 1238 | echo ' |
1210 | 1239 | </div><!-- .windowbg --> |