@@ -54,9 +54,10 @@ discard block |
||
| 54 | 54 | <dd> |
| 55 | 55 | <div id="known_themes_list">'; |
| 56 | 56 | |
| 57 | - foreach ($context['themes'] as $theme) |
|
| 58 | - echo ' |
|
| 57 | + foreach ($context['themes'] as $theme) { |
|
| 58 | + echo ' |
|
| 59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $theme['name'], '</label><br>'; |
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | echo ' |
| 62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
| 73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
| 74 | 75 | |
| 75 | 76 | // Put an option for each theme in the select box. |
| 76 | - foreach ($context['themes'] as $theme) |
|
| 77 | - echo ' |
|
| 77 | + foreach ($context['themes'] as $theme) { |
|
| 78 | + echo ' |
|
| 78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
| 80 | + } |
|
| 79 | 81 | |
| 80 | 82 | echo ' |
| 81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
| 90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
| 91 | 93 | |
| 92 | 94 | // Same thing, this time for changing the theme of everyone. |
| 93 | - foreach ($context['themes'] as $theme) |
|
| 94 | - echo ' |
|
| 95 | + foreach ($context['themes'] as $theme) { |
|
| 96 | + echo ' |
|
| 95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
| 98 | + } |
|
| 96 | 99 | |
| 97 | 100 | echo ' |
| 98 | 101 | </select> |
@@ -187,11 +190,12 @@ discard block |
||
| 187 | 190 | global $context, $scripturl, $txt; |
| 188 | 191 | |
| 189 | 192 | // Show a nice confirmation message. |
| 190 | - if (isset($_GET['done'])) |
|
| 191 | - echo ' |
|
| 193 | + if (isset($_GET['done'])) { |
|
| 194 | + echo ' |
|
| 192 | 195 | <div class="infobox"> |
| 193 | 196 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
| 194 | 197 | </div>'; |
| 198 | + } |
|
| 195 | 199 | |
| 196 | 200 | echo ' |
| 197 | 201 | <div id="admincenter"> |
@@ -354,11 +358,12 @@ discard block |
||
| 354 | 358 | if (empty($setting) || !is_array($setting)) |
| 355 | 359 | { |
| 356 | 360 | // Insert a separator (unless this is the first item in the list) |
| 357 | - if ($i !== $first_option_key) |
|
| 358 | - echo ' |
|
| 361 | + if ($i !== $first_option_key) { |
|
| 362 | + echo ' |
|
| 359 | 363 | </dl> |
| 360 | 364 | <hr> |
| 361 | 365 | <dl class="settings">'; |
| 366 | + } |
|
| 362 | 367 | |
| 363 | 368 | // Should we give a name to this section? |
| 364 | 369 | if (is_string($setting) && !empty($setting)) |
@@ -367,9 +372,9 @@ discard block |
||
| 367 | 372 | echo ' |
| 368 | 373 | <dt><strong>' . $setting . '</strong></dt> |
| 369 | 374 | <dd></dd>'; |
| 375 | + } else { |
|
| 376 | + $titled_section = false; |
|
| 370 | 377 | } |
| 371 | - else |
|
| 372 | - $titled_section = false; |
|
| 373 | 378 | |
| 374 | 379 | continue; |
| 375 | 380 | } |
@@ -378,8 +383,8 @@ discard block |
||
| 378 | 383 | <dt>'; |
| 379 | 384 | |
| 380 | 385 | // Show the change option box? |
| 381 | - if ($context['theme_options_reset']) |
|
| 382 | - echo ' |
|
| 386 | + if ($context['theme_options_reset']) { |
|
| 387 | + echo ' |
|
| 383 | 388 | <span class="floatleft"> |
| 384 | 389 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
| 385 | 390 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -387,23 +392,26 @@ discard block |
||
| 387 | 392 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
| 388 | 393 | </select> |
| 389 | 394 | </span>'; |
| 395 | + } |
|
| 390 | 396 | |
| 391 | 397 | echo ' |
| 392 | 398 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
| 393 | 399 | |
| 394 | - if (isset($setting['description'])) |
|
| 395 | - echo ' |
|
| 400 | + if (isset($setting['description'])) { |
|
| 401 | + echo ' |
|
| 396 | 402 | <br> |
| 397 | 403 | <span class="smalltext">', $setting['description'], '</span>'; |
| 404 | + } |
|
| 398 | 405 | echo ' |
| 399 | 406 | </dt>'; |
| 400 | 407 | |
| 401 | 408 | // Display checkbox options |
| 402 | - if ($setting['type'] == 'checkbox') |
|
| 403 | - echo ' |
|
| 409 | + if ($setting['type'] == 'checkbox') { |
|
| 410 | + echo ' |
|
| 404 | 411 | <dd> |
| 405 | 412 | <input type="hidden" name="' . (!empty($setting['default']) ? 'default_' : '') . 'options[' . $setting['id'] . ']" value="0"> |
| 406 | 413 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', $context['theme_options_reset'] ? ' disabled' : '', ' value="1" class="floatleft">'; |
| 414 | + } |
|
| 407 | 415 | |
| 408 | 416 | // How about selection lists, we all love them |
| 409 | 417 | elseif ($setting['type'] == 'list') |
@@ -412,9 +420,10 @@ discard block |
||
| 412 | 420 | <dd> |
| 413 | 421 | <select class="floatleft" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
| 414 | 422 | |
| 415 | - foreach ($setting['options'] as $value => $label) |
|
| 416 | - echo ' |
|
| 423 | + foreach ($setting['options'] as $value => $label) { |
|
| 424 | + echo ' |
|
| 417 | 425 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 426 | + } |
|
| 418 | 427 | |
| 419 | 428 | echo ' |
| 420 | 429 | </select>'; |
@@ -433,14 +442,13 @@ discard block |
||
| 433 | 442 | |
| 434 | 443 | echo ' |
| 435 | 444 | <input type="number"', $min . $max . $step; |
| 436 | - } |
|
| 437 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
| 438 | - echo' |
|
| 445 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
| 446 | + echo' |
|
| 439 | 447 | <input type="url"'; |
| 440 | - |
|
| 441 | - else |
|
| 442 | - echo ' |
|
| 448 | + } else { |
|
| 449 | + echo ' |
|
| 443 | 450 | <input type="text"'; |
| 451 | + } |
|
| 444 | 452 | |
| 445 | 453 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
| 446 | 454 | } |
@@ -479,8 +487,8 @@ discard block |
||
| 479 | 487 | <br>'; |
| 480 | 488 | |
| 481 | 489 | // @todo Why can't I edit the default theme popup. |
| 482 | - if ($context['theme_settings']['theme_id'] != 1) |
|
| 483 | - echo ' |
|
| 490 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
| 491 | + echo ' |
|
| 484 | 492 | <div class="cat_bar"> |
| 485 | 493 | <h3 class="catbg config_hd"> |
| 486 | 494 | ', $txt['theme_edit'], ' |
@@ -496,6 +504,7 @@ discard block |
||
| 496 | 504 | </li> |
| 497 | 505 | </ul> |
| 498 | 506 | </div>'; |
| 507 | + } |
|
| 499 | 508 | |
| 500 | 509 | echo ' |
| 501 | 510 | <div class="cat_bar"> |
@@ -549,9 +558,10 @@ discard block |
||
| 549 | 558 | <dd> |
| 550 | 559 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
| 551 | 560 | |
| 552 | - foreach ($context['theme_variants'] as $key => $variant) |
|
| 553 | - echo ' |
|
| 561 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
| 562 | + echo ' |
|
| 554 | 563 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 564 | + } |
|
| 555 | 565 | |
| 556 | 566 | echo ' |
| 557 | 567 | </select> |
@@ -587,11 +597,12 @@ discard block |
||
| 587 | 597 | if (empty($setting) || !is_array($setting)) |
| 588 | 598 | { |
| 589 | 599 | // We don't need a separator before the first list element |
| 590 | - if ($i !== $first_setting_key) |
|
| 591 | - echo ' |
|
| 600 | + if ($i !== $first_setting_key) { |
|
| 601 | + echo ' |
|
| 592 | 602 | </dl> |
| 593 | 603 | <hr> |
| 594 | 604 | <dl class="settings">'; |
| 605 | + } |
|
| 595 | 606 | |
| 596 | 607 | // Add a fake heading? |
| 597 | 608 | if (is_string($setting) && !empty($setting)) |
@@ -600,9 +611,9 @@ discard block |
||
| 600 | 611 | echo ' |
| 601 | 612 | <dt><strong>' . $setting . '</strong></dt> |
| 602 | 613 | <dd></dd>'; |
| 614 | + } else { |
|
| 615 | + $titled_section = false; |
|
| 603 | 616 | } |
| 604 | - else |
|
| 605 | - $titled_section = false; |
|
| 606 | 617 | |
| 607 | 618 | continue; |
| 608 | 619 | } |
@@ -611,20 +622,22 @@ discard block |
||
| 611 | 622 | <dt> |
| 612 | 623 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
| 613 | 624 | |
| 614 | - if (isset($setting['description'])) |
|
| 615 | - echo '<br> |
|
| 625 | + if (isset($setting['description'])) { |
|
| 626 | + echo '<br> |
|
| 616 | 627 | <span class="smalltext">', $setting['description'], '</span>'; |
| 628 | + } |
|
| 617 | 629 | |
| 618 | 630 | echo ' |
| 619 | 631 | </dt>'; |
| 620 | 632 | |
| 621 | 633 | // A checkbox? |
| 622 | - if ($setting['type'] == 'checkbox') |
|
| 623 | - echo ' |
|
| 634 | + if ($setting['type'] == 'checkbox') { |
|
| 635 | + echo ' |
|
| 624 | 636 | <dd> |
| 625 | 637 | <input type="hidden" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" value="0"> |
| 626 | 638 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', ' value="1"> |
| 627 | 639 | </dd>'; |
| 640 | + } |
|
| 628 | 641 | |
| 629 | 642 | // A list with options? |
| 630 | 643 | elseif ($setting['type'] == 'list') |
@@ -633,9 +646,10 @@ discard block |
||
| 633 | 646 | <dd> |
| 634 | 647 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
| 635 | 648 | |
| 636 | - foreach ($setting['options'] as $value => $label) |
|
| 637 | - echo ' |
|
| 649 | + foreach ($setting['options'] as $value => $label) { |
|
| 650 | + echo ' |
|
| 638 | 651 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 652 | + } |
|
| 639 | 653 | |
| 640 | 654 | echo ' |
| 641 | 655 | </select> |
@@ -663,14 +677,13 @@ discard block |
||
| 663 | 677 | |
| 664 | 678 | echo ' |
| 665 | 679 | <input type="number"', $min . $max . $step; |
| 666 | - } |
|
| 667 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
| 668 | - echo' |
|
| 680 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
| 681 | + echo' |
|
| 669 | 682 | <input type="url"'; |
| 670 | - |
|
| 671 | - else |
|
| 672 | - echo ' |
|
| 683 | + } else { |
|
| 684 | + echo ' |
|
| 673 | 685 | <input type="text"'; |
| 686 | + } |
|
| 674 | 687 | |
| 675 | 688 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : (empty($settings['size']) ? ' size="40"' : ' size="' . $setting['size'] . '"'), '> |
| 676 | 689 | </dd>'; |
@@ -742,9 +755,10 @@ discard block |
||
| 742 | 755 | <label for="variant', $theme['id'], '"><strong>', $theme['pick_label'], '</strong></label>: |
| 743 | 756 | <select id="variant', $theme['id'], '" name="vrt[', $theme['id'], ']" onchange="changeVariant', $theme['id'], '(this.value);">'; |
| 744 | 757 | |
| 745 | - foreach ($theme['variants'] as $key => $variant) |
|
| 746 | - echo ' |
|
| 758 | + foreach ($theme['variants'] as $key => $variant) { |
|
| 759 | + echo ' |
|
| 747 | 760 | <option value="', $key, '"', $theme['selected_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 761 | + } |
|
| 748 | 762 | |
| 749 | 763 | echo ' |
| 750 | 764 | </select> |
@@ -822,21 +836,23 @@ discard block |
||
| 822 | 836 | <div class="windowbg">'; |
| 823 | 837 | |
| 824 | 838 | // Oops! there was an error :( |
| 825 | - if (!empty($context['error_message'])) |
|
| 826 | - echo ' |
|
| 839 | + if (!empty($context['error_message'])) { |
|
| 840 | + echo ' |
|
| 827 | 841 | <p> |
| 828 | 842 | ', $context['error_message'], ' |
| 829 | 843 | </p>'; |
| 844 | + } |
|
| 830 | 845 | |
| 831 | 846 | // Not much to show except a link back... |
| 832 | - else |
|
| 833 | - echo ' |
|
| 847 | + else { |
|
| 848 | + echo ' |
|
| 834 | 849 | <p> |
| 835 | 850 | <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], ' |
| 836 | 851 | </p> |
| 837 | 852 | <p> |
| 838 | 853 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
| 839 | 854 | </p>'; |
| 855 | + } |
|
| 840 | 856 | |
| 841 | 857 | echo ' |
| 842 | 858 | </div><!-- .windowbg --> |
@@ -903,11 +919,12 @@ discard block |
||
| 903 | 919 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
| 904 | 920 | <span class="floatright">'; |
| 905 | 921 | |
| 906 | - if ($template['can_copy']) |
|
| 907 | - echo ' |
|
| 922 | + if ($template['can_copy']) { |
|
| 923 | + echo ' |
|
| 908 | 924 | <a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
| 909 | - else |
|
| 910 | - echo $txt['themeadmin_edit_no_copy']; |
|
| 925 | + } else { |
|
| 926 | + echo $txt['themeadmin_edit_no_copy']; |
|
| 927 | + } |
|
| 911 | 928 | |
| 912 | 929 | echo ' |
| 913 | 930 | </span> |
@@ -930,11 +947,12 @@ discard block |
||
| 930 | 947 | echo ' |
| 931 | 948 | <div id="admincenter">'; |
| 932 | 949 | |
| 933 | - if (!empty($context['browse_title'])) |
|
| 934 | - echo ' |
|
| 950 | + if (!empty($context['browse_title'])) { |
|
| 951 | + echo ' |
|
| 935 | 952 | <div class="cat_bar"> |
| 936 | 953 | <h3 class="catbg">', $context['browse_title'], '</h3> |
| 937 | 954 | </div>'; |
| 955 | + } |
|
| 938 | 956 | |
| 939 | 957 | echo ' |
| 940 | 958 | <table class="table_grid tborder"> |
@@ -954,16 +972,15 @@ discard block |
||
| 954 | 972 | <tr class="windowbg"> |
| 955 | 973 | <td>'; |
| 956 | 974 | |
| 957 | - if ($file['is_editable']) |
|
| 958 | - echo ' |
|
| 975 | + if ($file['is_editable']) { |
|
| 976 | + echo ' |
|
| 959 | 977 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
| 960 | - |
|
| 961 | - elseif ($file['is_directory']) |
|
| 962 | - echo ' |
|
| 978 | + } elseif ($file['is_directory']) { |
|
| 979 | + echo ' |
|
| 963 | 980 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
| 964 | - |
|
| 965 | - else |
|
| 966 | - echo $file['filename']; |
|
| 981 | + } else { |
|
| 982 | + echo $file['filename']; |
|
| 983 | + } |
|
| 967 | 984 | |
| 968 | 985 | echo ' |
| 969 | 986 | </td> |
@@ -985,11 +1002,12 @@ discard block |
||
| 985 | 1002 | { |
| 986 | 1003 | global $context, $settings, $scripturl, $txt; |
| 987 | 1004 | |
| 988 | - if ($context['session_error']) |
|
| 989 | - echo ' |
|
| 1005 | + if ($context['session_error']) { |
|
| 1006 | + echo ' |
|
| 990 | 1007 | <div class="errorbox"> |
| 991 | 1008 | ', $txt['error_session_timeout'], ' |
| 992 | 1009 | </div>'; |
| 1010 | + } |
|
| 993 | 1011 | |
| 994 | 1012 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
| 995 | 1013 | echo ' |
@@ -1053,17 +1071,18 @@ discard block |
||
| 1053 | 1071 | { |
| 1054 | 1072 | '; |
| 1055 | 1073 | |
| 1056 | - if (isBrowser('is_ie')) |
|
| 1057 | - echo ' |
|
| 1074 | + if (isBrowser('is_ie')) { |
|
| 1075 | + echo ' |
|
| 1058 | 1076 | var sheets = frames["css_preview_box"].document.styleSheets; |
| 1059 | 1077 | for (var j = 0; j < sheets.length; j++) |
| 1060 | 1078 | { |
| 1061 | 1079 | if (sheets[j].id == "css_preview_box") |
| 1062 | 1080 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
| 1063 | 1081 | }'; |
| 1064 | - else |
|
| 1065 | - echo ' |
|
| 1082 | + } else { |
|
| 1083 | + echo ' |
|
| 1066 | 1084 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
| 1085 | + } |
|
| 1067 | 1086 | echo ' |
| 1068 | 1087 | } |
| 1069 | 1088 | catch (e) |
@@ -1115,9 +1134,10 @@ discard block |
||
| 1115 | 1134 | </div> |
| 1116 | 1135 | <div class="windowbg">'; |
| 1117 | 1136 | |
| 1118 | - if (!$context['allow_save']) |
|
| 1119 | - echo ' |
|
| 1137 | + if (!$context['allow_save']) { |
|
| 1138 | + echo ' |
|
| 1120 | 1139 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1140 | + } |
|
| 1121 | 1141 | |
| 1122 | 1142 | echo ' |
| 1123 | 1143 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1131,9 +1151,10 @@ discard block |
||
| 1131 | 1151 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1132 | 1152 | |
| 1133 | 1153 | // Hopefully it exists. |
| 1134 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1135 | - echo ' |
|
| 1154 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1155 | + echo ' |
|
| 1136 | 1156 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1157 | + } |
|
| 1137 | 1158 | |
| 1138 | 1159 | echo ' |
| 1139 | 1160 | </form> |
@@ -1147,18 +1168,20 @@ discard block |
||
| 1147 | 1168 | { |
| 1148 | 1169 | global $context, $scripturl, $txt; |
| 1149 | 1170 | |
| 1150 | - if ($context['session_error']) |
|
| 1151 | - echo ' |
|
| 1171 | + if ($context['session_error']) { |
|
| 1172 | + echo ' |
|
| 1152 | 1173 | <div class="errorbox"> |
| 1153 | 1174 | ', $txt['error_session_timeout'], ' |
| 1154 | 1175 | </div>'; |
| 1176 | + } |
|
| 1155 | 1177 | |
| 1156 | - if (isset($context['parse_error'])) |
|
| 1157 | - echo ' |
|
| 1178 | + if (isset($context['parse_error'])) { |
|
| 1179 | + echo ' |
|
| 1158 | 1180 | <div class="errorbox"> |
| 1159 | 1181 | ', $txt['themeadmin_edit_error'], ' |
| 1160 | 1182 | <div><pre>', $context['parse_error'], '</pre></div> |
| 1161 | 1183 | </div>'; |
| 1184 | + } |
|
| 1162 | 1185 | |
| 1163 | 1186 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1164 | 1187 | echo ' |
@@ -1169,16 +1192,18 @@ discard block |
||
| 1169 | 1192 | </div> |
| 1170 | 1193 | <div class="windowbg">'; |
| 1171 | 1194 | |
| 1172 | - if (!$context['allow_save']) |
|
| 1173 | - echo ' |
|
| 1195 | + if (!$context['allow_save']) { |
|
| 1196 | + echo ' |
|
| 1174 | 1197 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1198 | + } |
|
| 1175 | 1199 | |
| 1176 | - foreach ($context['file_parts'] as $part) |
|
| 1177 | - echo ' |
|
| 1200 | + foreach ($context['file_parts'] as $part) { |
|
| 1201 | + echo ' |
|
| 1178 | 1202 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
| 1179 | 1203 | <div class="centertext"> |
| 1180 | 1204 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
| 1181 | 1205 | </div>'; |
| 1206 | + } |
|
| 1182 | 1207 | |
| 1183 | 1208 | echo ' |
| 1184 | 1209 | <div class="padding righttext"> |
@@ -1187,9 +1212,10 @@ discard block |
||
| 1187 | 1212 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1188 | 1213 | |
| 1189 | 1214 | // Hopefully it exists. |
| 1190 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1191 | - echo ' |
|
| 1215 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1216 | + echo ' |
|
| 1192 | 1217 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1218 | + } |
|
| 1193 | 1219 | |
| 1194 | 1220 | echo ' |
| 1195 | 1221 | </div><!-- .righttext --> |
@@ -1205,18 +1231,20 @@ discard block |
||
| 1205 | 1231 | { |
| 1206 | 1232 | global $context, $scripturl, $txt; |
| 1207 | 1233 | |
| 1208 | - if ($context['session_error']) |
|
| 1209 | - echo ' |
|
| 1234 | + if ($context['session_error']) { |
|
| 1235 | + echo ' |
|
| 1210 | 1236 | <div class="errorbox"> |
| 1211 | 1237 | ', $txt['error_session_timeout'], ' |
| 1212 | 1238 | </div>'; |
| 1239 | + } |
|
| 1213 | 1240 | |
| 1214 | 1241 | // Is this file writeable? |
| 1215 | - if (!$context['allow_save']) |
|
| 1216 | - echo ' |
|
| 1242 | + if (!$context['allow_save']) { |
|
| 1243 | + echo ' |
|
| 1217 | 1244 | <div class="errorbox"> |
| 1218 | 1245 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
| 1219 | 1246 | </div>'; |
| 1247 | + } |
|
| 1220 | 1248 | |
| 1221 | 1249 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1222 | 1250 | echo ' |
@@ -1232,9 +1260,10 @@ discard block |
||
| 1232 | 1260 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1233 | 1261 | |
| 1234 | 1262 | // Hopefully it exists. |
| 1235 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1236 | - echo ' |
|
| 1263 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1264 | + echo ' |
|
| 1237 | 1265 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1266 | + } |
|
| 1238 | 1267 | |
| 1239 | 1268 | echo ' |
| 1240 | 1269 | </div><!-- .windowbg --> |
@@ -89,16 +89,18 @@ discard block |
||
| 89 | 89 | foreach ($section['areas'] as $i => $area) |
| 90 | 90 | { |
| 91 | 91 | // Not supposed to be printed? |
| 92 | - if (empty($area['label'])) |
|
| 93 | - continue; |
|
| 92 | + if (empty($area['label'])) { |
|
| 93 | + continue; |
|
| 94 | + } |
|
| 94 | 95 | |
| 95 | 96 | echo ' |
| 96 | 97 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '> |
| 97 | 98 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
| 98 | 99 | |
| 99 | 100 | // Is this the current area, or just some area? |
| 100 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
| 101 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
| 101 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
| 102 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
| 103 | + } |
|
| 102 | 104 | |
| 103 | 105 | // Are there any subsections? |
| 104 | 106 | if (!empty($area['subsections'])) |
@@ -108,8 +110,9 @@ discard block |
||
| 108 | 110 | |
| 109 | 111 | foreach ($area['subsections'] as $sa => $sub) |
| 110 | 112 | { |
| 111 | - if (!empty($sub['disabled'])) |
|
| 112 | - continue; |
|
| 113 | + if (!empty($sub['disabled'])) { |
|
| 114 | + continue; |
|
| 115 | + } |
|
| 113 | 116 | |
| 114 | 117 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
| 115 | 118 | |
@@ -156,8 +159,9 @@ discard block |
||
| 156 | 159 | <h3 class="catbg">'; |
| 157 | 160 | |
| 158 | 161 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
| 159 | - if (function_exists('template_admin_quick_search')) |
|
| 160 | - template_admin_quick_search(); |
|
| 162 | + if (function_exists('template_admin_quick_search')) { |
|
| 163 | + template_admin_quick_search(); |
|
| 164 | + } |
|
| 161 | 165 | |
| 162 | 166 | // Exactly how many tabs do we have? |
| 163 | 167 | if (!empty($context['tabs'])) |
@@ -172,30 +176,36 @@ discard block |
||
| 172 | 176 | } |
| 173 | 177 | |
| 174 | 178 | // Did this not even exist - or do we not have a label? |
| 175 | - if (!isset($tab_context['tabs'][$id])) |
|
| 176 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
| 177 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
| 178 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
| 179 | + if (!isset($tab_context['tabs'][$id])) { |
|
| 180 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
| 181 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
| 182 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
| 183 | + } |
|
| 179 | 184 | |
| 180 | 185 | // Has a custom URL defined in the main admin structure? |
| 181 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
| 182 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
| 186 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
| 187 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
| 188 | + } |
|
| 183 | 189 | |
| 184 | 190 | // Any additional paramaters for the url? |
| 185 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
| 186 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
| 191 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
| 192 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
| 193 | + } |
|
| 187 | 194 | |
| 188 | 195 | // Has it been deemed selected? |
| 189 | - if (!empty($tab['is_selected'])) |
|
| 190 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
| 196 | + if (!empty($tab['is_selected'])) { |
|
| 197 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
| 198 | + } |
|
| 191 | 199 | |
| 192 | 200 | // Does it have its own help? |
| 193 | - if (!empty($tab['help'])) |
|
| 194 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
| 201 | + if (!empty($tab['help'])) { |
|
| 202 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
| 203 | + } |
|
| 195 | 204 | |
| 196 | 205 | // Is this the last one? |
| 197 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
| 198 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
| 206 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
| 207 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
| 208 | + } |
|
| 199 | 209 | } |
| 200 | 210 | |
| 201 | 211 | // Find the selected tab |
@@ -212,22 +222,24 @@ discard block |
||
| 212 | 222 | // Show an icon and/or a help item? |
| 213 | 223 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
| 214 | 224 | { |
| 215 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
| 216 | - echo ' |
|
| 225 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
| 226 | + echo ' |
|
| 217 | 227 | <span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
| 218 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
| 219 | - echo ' |
|
| 228 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
| 229 | + echo ' |
|
| 220 | 230 | <img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
| 231 | + } |
|
| 221 | 232 | |
| 222 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
| 223 | - echo ' |
|
| 233 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
| 234 | + echo ' |
|
| 224 | 235 | <a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
| 236 | + } |
|
| 225 | 237 | |
| 226 | 238 | echo $tab_context['title']; |
| 227 | - } |
|
| 228 | - else |
|
| 229 | - echo ' |
|
| 239 | + } else { |
|
| 240 | + echo ' |
|
| 230 | 241 | ', $tab_context['title']; |
| 242 | + } |
|
| 231 | 243 | |
| 232 | 244 | echo ' |
| 233 | 245 | </h3>', (function_exists('template_admin_quick_search') ? ' |
@@ -236,11 +248,12 @@ discard block |
||
| 236 | 248 | } |
| 237 | 249 | |
| 238 | 250 | // Shall we use the tabs? Yes, it's the only known way! |
| 239 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
| 240 | - echo ' |
|
| 251 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
| 252 | + echo ' |
|
| 241 | 253 | <p class="information"> |
| 242 | 254 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
| 243 | 255 | </p>'; |
| 256 | + } |
|
| 244 | 257 | |
| 245 | 258 | // Print out all the items in this tab (if any). |
| 246 | 259 | if (!empty($context['tabs'])) |
@@ -252,19 +265,21 @@ discard block |
||
| 252 | 265 | |
| 253 | 266 | foreach ($tab_context['tabs'] as $sa => $tab) |
| 254 | 267 | { |
| 255 | - if (!empty($tab['disabled'])) |
|
| 256 | - continue; |
|
| 268 | + if (!empty($tab['disabled'])) { |
|
| 269 | + continue; |
|
| 270 | + } |
|
| 257 | 271 | |
| 258 | - if (!empty($tab['is_selected'])) |
|
| 259 | - echo ' |
|
| 272 | + if (!empty($tab['is_selected'])) { |
|
| 273 | + echo ' |
|
| 260 | 274 | <li> |
| 261 | 275 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
| 262 | 276 | </li>'; |
| 263 | - else |
|
| 264 | - echo ' |
|
| 277 | + } else { |
|
| 278 | + echo ' |
|
| 265 | 279 | <li> |
| 266 | 280 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
| 267 | 281 | </li>'; |
| 282 | + } |
|
| 268 | 283 | } |
| 269 | 284 | |
| 270 | 285 | // The end of tabs |
@@ -29,9 +29,10 @@ discard block |
||
| 29 | 29 | // Go through each type of report they can run. |
| 30 | 30 | foreach ($context['report_types'] as $type) |
| 31 | 31 | { |
| 32 | - if (isset($type['description'])) |
|
| 33 | - echo ' |
|
| 32 | + if (isset($type['description'])) { |
|
| 33 | + echo ' |
|
| 34 | 34 | <dt>', $type['description'], '</dt>'; |
| 35 | + } |
|
| 35 | 36 | |
| 36 | 37 | echo ' |
| 37 | 38 | <dd> |
@@ -62,8 +63,9 @@ discard block |
||
| 62 | 63 | </div> |
| 63 | 64 | <div id="report_buttons">'; |
| 64 | 65 | |
| 65 | - if (!empty($context['report_buttons'])) |
|
| 66 | - template_button_strip($context['report_buttons'], 'right'); |
|
| 66 | + if (!empty($context['report_buttons'])) { |
|
| 67 | + template_button_strip($context['report_buttons'], 'right'); |
|
| 68 | + } |
|
| 67 | 69 | |
| 68 | 70 | echo ' |
| 69 | 71 | </div>'; |
@@ -74,25 +76,27 @@ discard block |
||
| 74 | 76 | echo ' |
| 75 | 77 | <table class="table_grid report_results">'; |
| 76 | 78 | |
| 77 | - if (!empty($table['title'])) |
|
| 78 | - echo ' |
|
| 79 | + if (!empty($table['title'])) { |
|
| 80 | + echo ' |
|
| 79 | 81 | <thead> |
| 80 | 82 | <tr class="title_bar"> |
| 81 | 83 | <th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th> |
| 82 | 84 | </tr> |
| 83 | 85 | </thead> |
| 84 | 86 | <tbody>'; |
| 87 | + } |
|
| 85 | 88 | |
| 86 | 89 | // Now do each row! |
| 87 | 90 | $row_number = 0; |
| 88 | 91 | foreach ($table['data'] as $row) |
| 89 | 92 | { |
| 90 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
| 91 | - echo ' |
|
| 93 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
| 94 | + echo ' |
|
| 92 | 95 | <tr class="windowbg table_caption">'; |
| 93 | - else |
|
| 94 | - echo ' |
|
| 96 | + } else { |
|
| 97 | + echo ' |
|
| 95 | 98 | <tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">'; |
| 99 | + } |
|
| 96 | 100 | |
| 97 | 101 | // Now do each column. |
| 98 | 102 | $column_number = 0; |
@@ -110,16 +114,17 @@ discard block |
||
| 110 | 114 | } |
| 111 | 115 | |
| 112 | 116 | // Shaded? |
| 113 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
| 114 | - echo ' |
|
| 117 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
| 118 | + echo ' |
|
| 115 | 119 | <td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
| 116 | 120 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
| 117 | 121 | </td>'; |
| 118 | - else |
|
| 119 | - echo ' |
|
| 122 | + } else { |
|
| 123 | + echo ' |
|
| 120 | 124 | <td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
| 121 | 125 | ', $data['v'], ' |
| 122 | 126 | </td>'; |
| 127 | + } |
|
| 123 | 128 | |
| 124 | 129 | $column_number++; |
| 125 | 130 | } |
@@ -168,24 +173,26 @@ discard block |
||
| 168 | 173 | <div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '"> |
| 169 | 174 | <table class="bordercolor">'; |
| 170 | 175 | |
| 171 | - if (!empty($table['title'])) |
|
| 172 | - echo ' |
|
| 176 | + if (!empty($table['title'])) { |
|
| 177 | + echo ' |
|
| 173 | 178 | <tr class="title_bar"> |
| 174 | 179 | <td colspan="', $table['column_count'], '"> |
| 175 | 180 | ', $table['title'], ' |
| 176 | 181 | </td> |
| 177 | 182 | </tr>'; |
| 183 | + } |
|
| 178 | 184 | |
| 179 | 185 | // Now do each row! |
| 180 | 186 | $row_number = 0; |
| 181 | 187 | foreach ($table['data'] as $row) |
| 182 | 188 | { |
| 183 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
| 184 | - echo ' |
|
| 189 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
| 190 | + echo ' |
|
| 185 | 191 | <tr class="titlebg">'; |
| 186 | - else |
|
| 187 | - echo ' |
|
| 192 | + } else { |
|
| 193 | + echo ' |
|
| 188 | 194 | <tr class="windowbg">'; |
| 195 | + } |
|
| 189 | 196 | |
| 190 | 197 | // Now do each column!! |
| 191 | 198 | $column_number = 0; |
@@ -202,16 +209,17 @@ discard block |
||
| 202 | 209 | } |
| 203 | 210 | |
| 204 | 211 | // Shaded? |
| 205 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
| 206 | - echo ' |
|
| 212 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
| 213 | + echo ' |
|
| 207 | 214 | <td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
| 208 | 215 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
| 209 | 216 | </td>'; |
| 210 | - else |
|
| 211 | - echo ' |
|
| 217 | + } else { |
|
| 218 | + echo ' |
|
| 212 | 219 | <td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
| 213 | 220 | ', $data['v'], ' |
| 214 | 221 | </td>'; |
| 222 | + } |
|
| 215 | 223 | |
| 216 | 224 | $column_number++; |
| 217 | 225 | } |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | <div class="windowbg2 noup"> |
| 128 | 128 | <dl class="settings">'; |
| 129 | 129 | |
| 130 | - if (!empty($context['table_info'])) |
|
| 131 | - echo ' |
|
| 130 | + if (!empty($context['table_info'])) { |
|
| 131 | + echo ' |
|
| 132 | 132 | <dt> |
| 133 | 133 | <strong>', $txt['search_method_messages_table_space'], ':</strong> |
| 134 | 134 | </dt> |
@@ -141,6 +141,7 @@ discard block |
||
| 141 | 141 | <dd> |
| 142 | 142 | ', $context['table_info']['index_length'], ' |
| 143 | 143 | </dd>'; |
| 144 | + } |
|
| 144 | 145 | echo ' |
| 145 | 146 | </dl> |
| 146 | 147 | ', $context['double_index'] ? '<div class="noticebox"> |
@@ -163,17 +164,17 @@ discard block |
||
| 163 | 164 | <dd> |
| 164 | 165 | <span class="smalltext">'; |
| 165 | 166 | |
| 166 | - if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) |
|
| 167 | - echo ' |
|
| 167 | + if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) { |
|
| 168 | + echo ' |
|
| 168 | 169 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]'; |
| 169 | - |
|
| 170 | - elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) |
|
| 171 | - echo ' |
|
| 170 | + } elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) { |
|
| 171 | + echo ' |
|
| 172 | 172 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create']; |
| 173 | - else |
|
| 174 | - echo ' |
|
| 173 | + } else { |
|
| 174 | + echo ' |
|
| 175 | 175 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br> |
| 176 | 176 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length']; |
| 177 | + } |
|
| 177 | 178 | echo ' |
| 178 | 179 | </span> |
| 179 | 180 | </dd>'; |
@@ -187,26 +188,27 @@ discard block |
||
| 187 | 188 | <dd> |
| 188 | 189 | <span class="smalltext">'; |
| 189 | 190 | |
| 190 | - if ($context['custom_index']) |
|
| 191 | - echo ' |
|
| 191 | + if ($context['custom_index']) { |
|
| 192 | + echo ' |
|
| 192 | 193 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br> |
| 193 | 194 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
| 194 | - |
|
| 195 | - elseif ($context['partial_custom_index']) |
|
| 196 | - echo ' |
|
| 195 | + } elseif ($context['partial_custom_index']) { |
|
| 196 | + echo ' |
|
| 197 | 197 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br> |
| 198 | 198 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
| 199 | - else |
|
| 200 | - echo ' |
|
| 199 | + } else { |
|
| 200 | + echo ' |
|
| 201 | 201 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]'; |
| 202 | + } |
|
| 202 | 203 | echo ' |
| 203 | 204 | </span> |
| 204 | 205 | </dd>'; |
| 205 | 206 | |
| 206 | 207 | foreach ($context['search_apis'] as $api) |
| 207 | 208 | { |
| 208 | - if (empty($api['label']) || $api['has_template']) |
|
| 209 | - continue; |
|
| 209 | + if (empty($api['label']) || $api['has_template']) { |
|
| 210 | + continue; |
|
| 211 | + } |
|
| 210 | 212 | |
| 211 | 213 | echo ' |
| 212 | 214 | <dt> |
@@ -214,11 +216,12 @@ discard block |
||
| 214 | 216 | ', $api['label'], ' |
| 215 | 217 | </dt>'; |
| 216 | 218 | |
| 217 | - if ($api['desc']) |
|
| 218 | - echo ' |
|
| 219 | + if ($api['desc']) { |
|
| 220 | + echo ' |
|
| 219 | 221 | <dd> |
| 220 | 222 | <span class="smalltext">', $api['desc'], '</span> |
| 221 | 223 | </dd>'; |
| 224 | + } |
|
| 222 | 225 | } |
| 223 | 226 | |
| 224 | 227 | echo ' |
@@ -19,26 +19,28 @@ discard block |
||
| 19 | 19 | global $context, $settings, $scripturl, $txt, $modSettings; |
| 20 | 20 | |
| 21 | 21 | // Not allowed to edit? |
| 22 | - if (!$context['can_modify']) |
|
| 23 | - echo ' |
|
| 22 | + if (!$context['can_modify']) { |
|
| 23 | + echo ' |
|
| 24 | 24 | <div class="errorbox"> |
| 25 | 25 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
| 26 | 26 | </div>'; |
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | echo ' |
| 29 | 30 | <div id="admin_form_wrapper"> |
| 30 | 31 | <form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">'; |
| 31 | 32 | |
| 32 | - if (!empty($context['profile'])) |
|
| 33 | - echo ' |
|
| 33 | + if (!empty($context['profile'])) { |
|
| 34 | + echo ' |
|
| 34 | 35 | <div class="cat_bar"> |
| 35 | 36 | <h3 class="catbg">', $txt['permissions_for_profile'], ': "', $context['profile']['name'], '"</h3> |
| 36 | 37 | </div>'; |
| 37 | - else |
|
| 38 | - echo ' |
|
| 38 | + } else { |
|
| 39 | + echo ' |
|
| 39 | 40 | <div class="cat_bar"> |
| 40 | 41 | <h3 class="catbg">', $txt['permissions_title'], '</h3> |
| 41 | 42 | </div>'; |
| 43 | + } |
|
| 42 | 44 | |
| 43 | 45 | echo ' |
| 44 | 46 | <table class="table_grid"> |
@@ -47,13 +49,14 @@ discard block |
||
| 47 | 49 | <th>', $txt['membergroups_name'], '</th> |
| 48 | 50 | <th class="small_table">', $txt['membergroups_members_top'], '</th>'; |
| 49 | 51 | |
| 50 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 51 | - echo ' |
|
| 52 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 53 | + echo ' |
|
| 52 | 54 | <th class="small_table">', $txt['membergroups_permissions'], '</th>'; |
| 53 | - else |
|
| 54 | - echo ' |
|
| 55 | + } else { |
|
| 56 | + echo ' |
|
| 55 | 57 | <th class="small_table">', $txt['permissions_allowed'], '</th> |
| 56 | 58 | <th class="small_table">', $txt['permissions_denied'], '</th>'; |
| 59 | + } |
|
| 57 | 60 | |
| 58 | 61 | echo ' |
| 59 | 62 | <th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th> |
@@ -71,26 +74,28 @@ discard block |
||
| 71 | 74 | <td> |
| 72 | 75 | ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a> ' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', '<span>', $group['name'], '</span>'; |
| 73 | 76 | |
| 74 | - if (!empty($group['children'])) |
|
| 75 | - echo ' |
|
| 77 | + if (!empty($group['children'])) { |
|
| 78 | + echo ' |
|
| 76 | 79 | <br> |
| 77 | 80 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
| 81 | + } |
|
| 78 | 82 | |
| 79 | 83 | echo ' |
| 80 | 84 | </td> |
| 81 | 85 | <td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>'; |
| 82 | 86 | |
| 83 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 84 | - echo ' |
|
| 87 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 88 | + echo ' |
|
| 85 | 89 | <td>', $group['num_permissions']['allowed'], '</td>'; |
| 86 | - else |
|
| 87 | - echo ' |
|
| 90 | + } else { |
|
| 91 | + echo ' |
|
| 88 | 92 | <td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '> |
| 89 | 93 | ', $group['num_permissions']['allowed'], ' |
| 90 | 94 | </td> |
| 91 | 95 | <td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '> |
| 92 | 96 | ', $group['num_permissions']['denied'], ' |
| 93 | 97 | </td>'; |
| 98 | + } |
|
| 94 | 99 | |
| 95 | 100 | echo ' |
| 96 | 101 | <td> |
@@ -141,10 +146,11 @@ discard block |
||
| 141 | 146 | <select name="copy_from"> |
| 142 | 147 | <option value="empty">(', $txt['permissions_select_membergroup'], ')</option>'; |
| 143 | 148 | |
| 144 | - foreach ($context['groups'] as $group) |
|
| 145 | - if ($group['id'] != 1) |
|
| 149 | + foreach ($context['groups'] as $group) { |
|
| 150 | + if ($group['id'] != 1) |
|
| 146 | 151 | echo ' |
| 147 | 152 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
| 153 | + } |
|
| 148 | 154 | |
| 149 | 155 | echo ' |
| 150 | 156 | </select> |
@@ -154,9 +160,10 @@ discard block |
||
| 154 | 160 | <option value="add">', $txt['permissions_add'], '...</option> |
| 155 | 161 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
| 156 | 162 | |
| 157 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 158 | - echo ' |
|
| 163 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 164 | + echo ' |
|
| 159 | 165 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
| 166 | + } |
|
| 160 | 167 | |
| 161 | 168 | echo ' |
| 162 | 169 | </select> |
@@ -167,31 +174,35 @@ discard block |
||
| 167 | 174 | |
| 168 | 175 | foreach ($context['permissions'] as $permissionType) |
| 169 | 176 | { |
| 170 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
| 171 | - continue; |
|
| 177 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
| 178 | + continue; |
|
| 179 | + } |
|
| 172 | 180 | |
| 173 | 181 | foreach ($permissionType['columns'] as $column) |
| 174 | 182 | { |
| 175 | 183 | foreach ($column as $permissionGroup) |
| 176 | 184 | { |
| 177 | - if ($permissionGroup['hidden']) |
|
| 178 | - continue; |
|
| 185 | + if ($permissionGroup['hidden']) { |
|
| 186 | + continue; |
|
| 187 | + } |
|
| 179 | 188 | |
| 180 | 189 | echo ' |
| 181 | 190 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
| 182 | 191 | |
| 183 | 192 | foreach ($permissionGroup['permissions'] as $perm) |
| 184 | 193 | { |
| 185 | - if ($perm['hidden']) |
|
| 186 | - continue; |
|
| 194 | + if ($perm['hidden']) { |
|
| 195 | + continue; |
|
| 196 | + } |
|
| 187 | 197 | |
| 188 | - if ($perm['has_own_any']) |
|
| 189 | - echo ' |
|
| 198 | + if ($perm['has_own_any']) { |
|
| 199 | + echo ' |
|
| 190 | 200 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
| 191 | 201 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
| 192 | - else |
|
| 193 | - echo ' |
|
| 202 | + } else { |
|
| 203 | + echo ' |
|
| 194 | 204 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
| 205 | + } |
|
| 195 | 206 | } |
| 196 | 207 | } |
| 197 | 208 | } |
@@ -256,9 +267,10 @@ discard block |
||
| 256 | 267 | } |
| 257 | 268 | </script>'; |
| 258 | 269 | |
| 259 | - if (!empty($context['profile'])) |
|
| 260 | - echo ' |
|
| 270 | + if (!empty($context['profile'])) { |
|
| 271 | + echo ' |
|
| 261 | 272 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
| 273 | + } |
|
| 262 | 274 | |
| 263 | 275 | echo ' |
| 264 | 276 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -303,9 +315,10 @@ discard block |
||
| 303 | 315 | <h3 class="subbg">', $category['name'], '</h3> |
| 304 | 316 | </div>'; |
| 305 | 317 | |
| 306 | - if (!empty($category['boards'])) |
|
| 307 | - echo ' |
|
| 318 | + if (!empty($category['boards'])) { |
|
| 319 | + echo ' |
|
| 308 | 320 | <ul class="perm_boards flow_hidden">'; |
| 321 | + } |
|
| 309 | 322 | |
| 310 | 323 | foreach ($category['boards'] as $board) |
| 311 | 324 | { |
@@ -321,33 +334,36 @@ discard block |
||
| 321 | 334 | echo ' |
| 322 | 335 | <select name="boardprofile[', $board['id'], ']">'; |
| 323 | 336 | |
| 324 | - foreach ($context['profiles'] as $id => $profile) |
|
| 325 | - echo ' |
|
| 337 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 338 | + echo ' |
|
| 326 | 339 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 340 | + } |
|
| 327 | 341 | |
| 328 | 342 | echo ' |
| 329 | 343 | </select>'; |
| 330 | - } |
|
| 331 | - else |
|
| 332 | - echo ' |
|
| 344 | + } else { |
|
| 345 | + echo ' |
|
| 333 | 346 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
| 347 | + } |
|
| 334 | 348 | |
| 335 | 349 | echo ' |
| 336 | 350 | </span> |
| 337 | 351 | </li>'; |
| 338 | 352 | } |
| 339 | 353 | |
| 340 | - if (!empty($category['boards'])) |
|
| 341 | - echo ' |
|
| 354 | + if (!empty($category['boards'])) { |
|
| 355 | + echo ' |
|
| 342 | 356 | </ul>'; |
| 357 | + } |
|
| 343 | 358 | } |
| 344 | 359 | |
| 345 | - if ($context['edit_all']) |
|
| 346 | - echo ' |
|
| 360 | + if ($context['edit_all']) { |
|
| 361 | + echo ' |
|
| 347 | 362 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button">'; |
| 348 | - else |
|
| 349 | - echo ' |
|
| 363 | + } else { |
|
| 364 | + echo ' |
|
| 350 | 365 | <a class="button" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
| 366 | + } |
|
| 351 | 367 | |
| 352 | 368 | echo ' |
| 353 | 369 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -387,12 +403,13 @@ discard block |
||
| 387 | 403 | <tr class="windowbg"> |
| 388 | 404 | <td>'; |
| 389 | 405 | |
| 390 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
| 391 | - echo ' |
|
| 406 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
| 407 | + echo ' |
|
| 392 | 408 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '">'; |
| 393 | - else |
|
| 394 | - echo ' |
|
| 409 | + } else { |
|
| 410 | + echo ' |
|
| 395 | 411 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
| 412 | + } |
|
| 396 | 413 | |
| 397 | 414 | echo ' |
| 398 | 415 | </td> |
@@ -412,9 +429,10 @@ discard block |
||
| 412 | 429 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 413 | 430 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
| 414 | 431 | |
| 415 | - if ($context['can_edit_something']) |
|
| 416 | - echo ' |
|
| 432 | + if ($context['can_edit_something']) { |
|
| 433 | + echo ' |
|
| 417 | 434 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button">'; |
| 435 | + } |
|
| 418 | 436 | |
| 419 | 437 | echo ' |
| 420 | 438 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '> |
@@ -439,9 +457,10 @@ discard block |
||
| 439 | 457 | <dd> |
| 440 | 458 | <select name="copy_from">'; |
| 441 | 459 | |
| 442 | - foreach ($context['profiles'] as $id => $profile) |
|
| 443 | - echo ' |
|
| 460 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 461 | + echo ' |
|
| 444 | 462 | <option value="', $id, '">', $profile['name'], '</option>'; |
| 463 | + } |
|
| 445 | 464 | |
| 446 | 465 | echo ' |
| 447 | 466 | </select> |
@@ -463,13 +482,13 @@ discard block |
||
| 463 | 482 | global $context, $scripturl, $txt, $modSettings; |
| 464 | 483 | |
| 465 | 484 | // Cannot be edited? |
| 466 | - if (!$context['profile']['can_modify']) |
|
| 467 | - echo ' |
|
| 485 | + if (!$context['profile']['can_modify']) { |
|
| 486 | + echo ' |
|
| 468 | 487 | <div class="errorbox"> |
| 469 | 488 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
| 470 | 489 | </div>'; |
| 471 | - else |
|
| 472 | - echo ' |
|
| 490 | + } else { |
|
| 491 | + echo ' |
|
| 473 | 492 | <script> |
| 474 | 493 | window.smf_usedDeny = false; |
| 475 | 494 | |
@@ -481,27 +500,30 @@ discard block |
||
| 481 | 500 | return true; |
| 482 | 501 | } |
| 483 | 502 | </script>'; |
| 503 | + } |
|
| 484 | 504 | |
| 485 | 505 | echo ' |
| 486 | 506 | <div id="admincenter"> |
| 487 | 507 | <form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">'; |
| 488 | 508 | |
| 489 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
| 490 | - echo ' |
|
| 509 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
| 510 | + echo ' |
|
| 491 | 511 | <div class="information"> |
| 492 | 512 | ', $txt['permissions_option_desc'], ' |
| 493 | 513 | </div>'; |
| 514 | + } |
|
| 494 | 515 | |
| 495 | 516 | echo ' |
| 496 | 517 | <div class="cat_bar"> |
| 497 | 518 | <h3 class="catbg">'; |
| 498 | 519 | |
| 499 | - if ($context['permission_type'] == 'board') |
|
| 500 | - echo ' |
|
| 520 | + if ($context['permission_type'] == 'board') { |
|
| 521 | + echo ' |
|
| 501 | 522 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
| 502 | - else |
|
| 503 | - echo ' |
|
| 523 | + } else { |
|
| 524 | + echo ' |
|
| 504 | 525 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
| 526 | + } |
|
| 505 | 527 | echo ' |
| 506 | 528 | </h3> |
| 507 | 529 | </div>'; |
@@ -524,15 +546,17 @@ discard block |
||
| 524 | 546 | template_modify_group_display('board'); |
| 525 | 547 | } |
| 526 | 548 | |
| 527 | - if ($context['profile']['can_modify']) |
|
| 528 | - echo ' |
|
| 549 | + if ($context['profile']['can_modify']) { |
|
| 550 | + echo ' |
|
| 529 | 551 | <div class="padding"> |
| 530 | 552 | <input type="submit" value="', $txt['permissions_commit'], '" class="button"> |
| 531 | 553 | </div>'; |
| 554 | + } |
|
| 532 | 555 | |
| 533 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
| 534 | - echo ' |
|
| 556 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
| 557 | + echo ' |
|
| 535 | 558 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
| 559 | + } |
|
| 536 | 560 | |
| 537 | 561 | echo ' |
| 538 | 562 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -560,17 +584,19 @@ discard block |
||
| 560 | 584 | |
| 561 | 585 | foreach ($column as $permissionGroup) |
| 562 | 586 | { |
| 563 | - if (empty($permissionGroup['permissions'])) |
|
| 564 | - continue; |
|
| 587 | + if (empty($permissionGroup['permissions'])) { |
|
| 588 | + continue; |
|
| 589 | + } |
|
| 565 | 590 | |
| 566 | 591 | // Are we likely to have something in this group to display or is it all hidden? |
| 567 | 592 | $has_display_content = false; |
| 568 | 593 | if (!$permissionGroup['hidden']) |
| 569 | 594 | { |
| 570 | 595 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
| 571 | - foreach ($permissionGroup['permissions'] as $permission) |
|
| 572 | - if (!$permission['hidden']) |
|
| 596 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
| 597 | + if (!$permission['hidden']) |
|
| 573 | 598 | $has_display_content = true; |
| 599 | + } |
|
| 574 | 600 | |
| 575 | 601 | if ($has_display_content) |
| 576 | 602 | { |
@@ -579,10 +605,11 @@ discard block |
||
| 579 | 605 | <th></th> |
| 580 | 606 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
| 581 | 607 | |
| 582 | - if ($context['group']['id'] != -1) |
|
| 583 | - echo ' |
|
| 608 | + if ($context['group']['id'] != -1) { |
|
| 609 | + echo ' |
|
| 584 | 610 | <th>', $txt['permissions_option_own'], '</th> |
| 585 | 611 | <th>', $txt['permissions_option_any'], '</th>'; |
| 612 | + } |
|
| 586 | 613 | |
| 587 | 614 | echo ' |
| 588 | 615 | </tr>'; |
@@ -605,17 +632,18 @@ discard block |
||
| 605 | 632 | // Guests can't do their own thing. |
| 606 | 633 | if ($context['group']['id'] != -1) |
| 607 | 634 | { |
| 608 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 609 | - echo ' |
|
| 635 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 636 | + echo ' |
|
| 610 | 637 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" ', $disable_field, '>'; |
| 611 | - else |
|
| 638 | + } else |
|
| 612 | 639 | { |
| 613 | 640 | echo ' |
| 614 | 641 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
| 615 | 642 | |
| 616 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 617 | - echo ' |
|
| 643 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 644 | + echo ' |
|
| 618 | 645 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 646 | + } |
|
| 619 | 647 | echo ' |
| 620 | 648 | </select>'; |
| 621 | 649 | } |
@@ -625,39 +653,41 @@ discard block |
||
| 625 | 653 | <td>'; |
| 626 | 654 | } |
| 627 | 655 | |
| 628 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
| 629 | - echo ' |
|
| 656 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
| 657 | + echo ' |
|
| 630 | 658 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>'; |
| 631 | - else |
|
| 659 | + } else |
|
| 632 | 660 | { |
| 633 | 661 | echo ' |
| 634 | 662 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
| 635 | 663 | |
| 636 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 637 | - echo ' |
|
| 664 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 665 | + echo ' |
|
| 638 | 666 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 667 | + } |
|
| 639 | 668 | echo ' |
| 640 | 669 | </select>'; |
| 641 | 670 | } |
| 642 | - } |
|
| 643 | - else |
|
| 671 | + } else |
|
| 644 | 672 | { |
| 645 | - if ($context['group']['id'] != -1) |
|
| 646 | - echo ' |
|
| 673 | + if ($context['group']['id'] != -1) { |
|
| 674 | + echo ' |
|
| 647 | 675 | </td> |
| 648 | 676 | <td>'; |
| 677 | + } |
|
| 649 | 678 | |
| 650 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
| 651 | - echo ' |
|
| 679 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
| 680 | + echo ' |
|
| 652 | 681 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>'; |
| 653 | - else |
|
| 682 | + } else |
|
| 654 | 683 | { |
| 655 | 684 | echo ' |
| 656 | 685 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
| 657 | 686 | |
| 658 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 659 | - echo ' |
|
| 687 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 688 | + echo ' |
|
| 660 | 689 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 690 | + } |
|
| 661 | 691 | echo ' |
| 662 | 692 | </select>'; |
| 663 | 693 | } |
@@ -689,11 +719,11 @@ discard block |
||
| 689 | 719 | <fieldset id="', $context['current_permission'], '"> |
| 690 | 720 | <legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>'; |
| 691 | 721 | |
| 692 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 693 | - echo ' |
|
| 722 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 723 | + echo ' |
|
| 694 | 724 | <ul>'; |
| 695 | - else |
|
| 696 | - echo ' |
|
| 725 | + } else { |
|
| 726 | + echo ' |
|
| 697 | 727 | <div class="information">', $txt['permissions_option_desc'], '</div> |
| 698 | 728 | <dl class="settings"> |
| 699 | 729 | <dt> |
@@ -703,47 +733,52 @@ discard block |
||
| 703 | 733 | </dt> |
| 704 | 734 | <dd> |
| 705 | 735 | </dd>'; |
| 736 | + } |
|
| 706 | 737 | |
| 707 | 738 | foreach ($context['member_groups'] as $group) |
| 708 | 739 | { |
| 709 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 710 | - echo ' |
|
| 740 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 741 | + echo ' |
|
| 711 | 742 | <dt>'; |
| 712 | - else |
|
| 713 | - echo ' |
|
| 743 | + } else { |
|
| 744 | + echo ' |
|
| 714 | 745 | <li>'; |
| 746 | + } |
|
| 715 | 747 | |
| 716 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 717 | - echo ' |
|
| 748 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 749 | + echo ' |
|
| 718 | 750 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '>'; |
| 719 | - else |
|
| 720 | - echo ' |
|
| 751 | + } else { |
|
| 752 | + echo ' |
|
| 721 | 753 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '></span> |
| 722 | 754 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', '></span> |
| 723 | 755 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', '></span>'; |
| 756 | + } |
|
| 724 | 757 | |
| 725 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 726 | - echo ' |
|
| 758 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 759 | + echo ' |
|
| 727 | 760 | </dt> |
| 728 | 761 | <dd> |
| 729 | 762 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
| 730 | 763 | </dd>'; |
| 731 | - else |
|
| 732 | - echo ' |
|
| 764 | + } else { |
|
| 765 | + echo ' |
|
| 733 | 766 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
| 734 | 767 | </li>'; |
| 768 | + } |
|
| 735 | 769 | } |
| 736 | 770 | |
| 737 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 738 | - echo ' |
|
| 771 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 772 | + echo ' |
|
| 739 | 773 | <li> |
| 740 | 774 | <input type="checkbox" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');"> |
| 741 | 775 | <span>', $txt['check_all'], '</span> |
| 742 | 776 | </li> |
| 743 | 777 | </ul>'; |
| 744 | - else |
|
| 745 | - echo ' |
|
| 778 | + } else { |
|
| 779 | + echo ' |
|
| 746 | 780 | </dl>'; |
| 781 | + } |
|
| 747 | 782 | |
| 748 | 783 | echo ' |
| 749 | 784 | </fieldset> |
@@ -783,9 +818,10 @@ discard block |
||
| 783 | 818 | if (!empty($modSettings['postmod_active'])) |
| 784 | 819 | { |
| 785 | 820 | // Got advanced permissions - if so warn! |
| 786 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 787 | - echo ' |
|
| 821 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 822 | + echo ' |
|
| 788 | 823 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
| 824 | + } |
|
| 789 | 825 | |
| 790 | 826 | echo ' |
| 791 | 827 | <div class="padding"> |
@@ -800,10 +836,11 @@ discard block |
||
| 800 | 836 | ', $txt['permissions_post_moderation_select'], ': |
| 801 | 837 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
| 802 | 838 | |
| 803 | - foreach ($context['profiles'] as $profile) |
|
| 804 | - if ($profile['can_modify']) |
|
| 839 | + foreach ($context['profiles'] as $profile) { |
|
| 840 | + if ($profile['can_modify']) |
|
| 805 | 841 | echo ' |
| 806 | 842 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 843 | + } |
|
| 807 | 844 | |
| 808 | 845 | echo ' |
| 809 | 846 | </select> |
@@ -824,11 +861,12 @@ discard block |
||
| 824 | 861 | ', $txt['permissions_post_moderation_replies_any'], ' |
| 825 | 862 | </th>'; |
| 826 | 863 | |
| 827 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 828 | - echo ' |
|
| 864 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 865 | + echo ' |
|
| 829 | 866 | <th class="centercol" colspan="3"> |
| 830 | 867 | ', $txt['permissions_post_moderation_attachments'], ' |
| 831 | 868 | </th>'; |
| 869 | + } |
|
| 832 | 870 | |
| 833 | 871 | echo ' |
| 834 | 872 | </tr> |
@@ -846,11 +884,12 @@ discard block |
||
| 846 | 884 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
| 847 | 885 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
| 848 | 886 | |
| 849 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 850 | - echo ' |
|
| 887 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 888 | + echo ' |
|
| 851 | 889 | <th><span class="generic_icons post_moderation_allow"></span></th> |
| 852 | 890 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
| 853 | 891 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
| 892 | + } |
|
| 854 | 893 | |
| 855 | 894 | echo ' |
| 856 | 895 | </tr> |
@@ -864,10 +903,11 @@ discard block |
||
| 864 | 903 | <td class="half_table"> |
| 865 | 904 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
| 866 | 905 | |
| 867 | - if (!empty($group['children'])) |
|
| 868 | - echo ' |
|
| 906 | + if (!empty($group['children'])) { |
|
| 907 | + echo ' |
|
| 869 | 908 | <br> |
| 870 | 909 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
| 910 | + } |
|
| 871 | 911 | |
| 872 | 912 | echo ' |
| 873 | 913 | </td> |
@@ -882,11 +922,11 @@ discard block |
||
| 882 | 922 | </td>'; |
| 883 | 923 | |
| 884 | 924 | // Guests can't have "own" permissions |
| 885 | - if ($group['id'] == '-1') |
|
| 886 | - echo ' |
|
| 925 | + if ($group['id'] == '-1') { |
|
| 926 | + echo ' |
|
| 887 | 927 | <td colspan="3"></td>'; |
| 888 | - else |
|
| 889 | - echo ' |
|
| 928 | + } else { |
|
| 929 | + echo ' |
|
| 890 | 930 | <td class="centercol"> |
| 891 | 931 | <input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', '> |
| 892 | 932 | </td> |
@@ -896,6 +936,7 @@ discard block |
||
| 896 | 936 | <td class="centercol"> |
| 897 | 937 | <input type="radio" name="replies_own[', $group['id'], ']" value="disallow"', $group['replies_own'] == 'disallow' ? ' checked' : '', '> |
| 898 | 938 | </td>'; |
| 939 | + } |
|
| 899 | 940 | |
| 900 | 941 | echo ' |
| 901 | 942 | <td class="centercol"> |
@@ -908,8 +949,8 @@ discard block |
||
| 908 | 949 | <input type="radio" name="replies_any[', $group['id'], ']" value="disallow"', $group['replies_any'] == 'disallow' ? ' checked' : '', '> |
| 909 | 950 | </td>'; |
| 910 | 951 | |
| 911 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 912 | - echo ' |
|
| 952 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 953 | + echo ' |
|
| 913 | 954 | <td class="centercol"> |
| 914 | 955 | <input type="radio" name="attachment[', $group['id'], ']" value="allow"', $group['attachment'] == 'allow' ? ' checked' : '', '> |
| 915 | 956 | </td> |
@@ -919,6 +960,7 @@ discard block |
||
| 919 | 960 | <td class="centercol"> |
| 920 | 961 | <input type="radio" name="attachment[', $group['id'], ']" value="disallow"', $group['attachment'] == 'disallow' ? ' checked' : '', '> |
| 921 | 962 | </td>'; |
| 963 | + } |
|
| 922 | 964 | |
| 923 | 965 | echo ' |
| 924 | 966 | </tr>'; |
@@ -40,9 +40,10 @@ discard block |
||
| 40 | 40 | <option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>'; |
| 41 | 41 | |
| 42 | 42 | // Show a list of all the years we allow... |
| 43 | - for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) |
|
| 44 | - echo ' |
|
| 43 | + for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { |
|
| 44 | + echo ' |
|
| 45 | 45 | <option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 46 | + } |
|
| 46 | 47 | |
| 47 | 48 | echo ' |
| 48 | 49 | </select> |
@@ -50,9 +51,10 @@ discard block |
||
| 50 | 51 | <select name="month" id="month" onchange="generateDays();">'; |
| 51 | 52 | |
| 52 | 53 | // There are 12 months per year - ensure that they all get listed. |
| 53 | - for ($month = 1; $month <= 12; $month++) |
|
| 54 | - echo ' |
|
| 54 | + for ($month = 1; $month <= 12; $month++) { |
|
| 55 | + echo ' |
|
| 55 | 56 | <option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 57 | + } |
|
| 56 | 58 | |
| 57 | 59 | echo ' |
| 58 | 60 | </select> |
@@ -60,23 +62,25 @@ discard block |
||
| 60 | 62 | <select name="day" id="day" onchange="generateDays();">'; |
| 61 | 63 | |
| 62 | 64 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 63 | - for ($day = 1; $day <= $context['holiday']['last_day']; $day++) |
|
| 64 | - echo ' |
|
| 65 | + for ($day = 1; $day <= $context['holiday']['last_day']; $day++) { |
|
| 66 | + echo ' |
|
| 65 | 67 | <option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 68 | + } |
|
| 66 | 69 | |
| 67 | 70 | echo ' |
| 68 | 71 | </select> |
| 69 | 72 | </dd> |
| 70 | 73 | </dl>'; |
| 71 | 74 | |
| 72 | - if ($context['is_new']) |
|
| 73 | - echo ' |
|
| 75 | + if ($context['is_new']) { |
|
| 76 | + echo ' |
|
| 74 | 77 | <input type="submit" value="', $txt['holidays_button_add'], '" class="button">'; |
| 75 | - else |
|
| 76 | - echo ' |
|
| 78 | + } else { |
|
| 79 | + echo ' |
|
| 77 | 80 | <input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button"> |
| 78 | 81 | <input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button"> |
| 79 | 82 | <input type="hidden" name="holiday" value="', $context['holiday']['id'], '">'; |
| 83 | + } |
|
| 80 | 84 | echo ' |
| 81 | 85 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 82 | 86 | </div><!-- .windowbg2 --> |
@@ -23,15 +23,15 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | global $context, $txt; |
| 25 | 25 | |
| 26 | - if (!empty($context['simple_action'])) |
|
| 27 | - echo ' |
|
| 26 | + if (!empty($context['simple_action'])) { |
|
| 27 | + echo ' |
|
| 28 | 28 | <strong> |
| 29 | 29 | ', $context['error_title'], ' |
| 30 | 30 | </strong><br> |
| 31 | 31 | <div ', $context['error_code'], 'class="padding"> |
| 32 | 32 | ', $context['error_message'], ' |
| 33 | 33 | </div>'; |
| 34 | - else |
|
| 34 | + } else |
|
| 35 | 35 | { |
| 36 | 36 | echo ' |
| 37 | 37 | <div id="fatal_error"> |
@@ -85,21 +85,23 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $error_types = array(); |
| 87 | 87 | |
| 88 | - foreach ($context['error_types'] as $type => $details) |
|
| 89 | - $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
| 88 | + foreach ($context['error_types'] as $type => $details) { |
|
| 89 | + $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
| 90 | + } |
|
| 90 | 91 | |
| 91 | 92 | echo ' |
| 92 | 93 | ', implode(' | ', $error_types), ' |
| 93 | 94 | </td> |
| 94 | 95 | </tr>'; |
| 95 | 96 | |
| 96 | - if ($context['has_filter']) |
|
| 97 | - echo ' |
|
| 97 | + if ($context['has_filter']) { |
|
| 98 | + echo ' |
|
| 98 | 99 | <tr> |
| 99 | 100 | <td colspan="3" class="windowbg"> |
| 100 | 101 | <strong>', $txt['applying_filter'], ':</strong> ', $context['filter']['entity'], ' ', $context['filter']['value']['html'], ' [<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', '">', $txt['clear_filter'], '</a>] |
| 101 | 102 | </td> |
| 102 | 103 | </tr>'; |
| 104 | + } |
|
| 103 | 105 | |
| 104 | 106 | echo ' |
| 105 | 107 | <tr> |
@@ -110,11 +112,12 @@ discard block |
||
| 110 | 112 | </tr>'; |
| 111 | 113 | |
| 112 | 114 | // No errors, then show a message |
| 113 | - if (count($context['errors']) == 0) |
|
| 114 | - echo ' |
|
| 115 | + if (count($context['errors']) == 0) { |
|
| 116 | + echo ' |
|
| 115 | 117 | <tr class="windowbg"> |
| 116 | 118 | <td class="centertext" colspan="2">', $txt['errlog_no_entries'], '</td> |
| 117 | 119 | </tr>'; |
| 120 | + } |
|
| 118 | 121 | |
| 119 | 122 | // We have some errors, must be some mods installed :P |
| 120 | 123 | foreach ($context['errors'] as $error) |
@@ -128,19 +131,21 @@ discard block |
||
| 128 | 131 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? '' : ';desc', $context['has_filter'] ? $context['filter']['href'] : '', '" title="', $txt['reverse_direction'], '"><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></a> |
| 129 | 132 | ', $error['time'], '<br>'; |
| 130 | 133 | |
| 131 | - if (!empty($error['member']['ip'])) |
|
| 132 | - echo ' |
|
| 134 | + if (!empty($error['member']['ip'])) { |
|
| 135 | + echo ' |
|
| 133 | 136 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=ip;value=', $error['member']['ip'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_ip'], '"><span class="generic_icons filter centericon"></span></a> |
| 134 | 137 | <strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong>'; |
| 138 | + } |
|
| 135 | 139 | |
| 136 | 140 | echo ' |
| 137 | 141 | </div> |
| 138 | 142 | <div class="error_info">'; |
| 139 | 143 | |
| 140 | - if ($error['member']['session'] != '') |
|
| 141 | - echo ' |
|
| 144 | + if ($error['member']['session'] != '') { |
|
| 145 | + echo ' |
|
| 142 | 146 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=session;value=', $error['member']['session'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '"><span class="generic_icons filter centericon"></span></a> |
| 143 | 147 | ', $error['member']['session'], '<br>'; |
| 148 | + } |
|
| 144 | 149 | |
| 145 | 150 | echo ' |
| 146 | 151 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=error_type;value=', $error['error_type']['type'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_type'], '"><span class="generic_icons filter centericon"></span></a> |
@@ -154,8 +159,8 @@ discard block |
||
| 154 | 159 | <a href="', $error['url']['html'], '">', $error['url']['html'], '</a> |
| 155 | 160 | </div>'; |
| 156 | 161 | |
| 157 | - if (!empty($error['file'])) |
|
| 158 | - echo ' |
|
| 162 | + if (!empty($error['file'])) { |
|
| 163 | + echo ' |
|
| 159 | 164 | <div class="error_location"> |
| 160 | 165 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=file;value=', $error['file']['search'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_file'], '"><span class="generic_icons filter"></span></a> |
| 161 | 166 | <div> |
@@ -163,6 +168,7 @@ discard block |
||
| 163 | 168 | ', $txt['line'], ': ', $error['file']['line'], ' |
| 164 | 169 | </div> |
| 165 | 170 | </div>'; |
| 171 | + } |
|
| 166 | 172 | |
| 167 | 173 | echo ' |
| 168 | 174 | </td> |
@@ -190,9 +196,10 @@ discard block |
||
| 190 | 196 | </div> |
| 191 | 197 | </div>'; |
| 192 | 198 | |
| 193 | - if ($context['sort_direction'] == 'down') |
|
| 194 | - echo ' |
|
| 199 | + if ($context['sort_direction'] == 'down') { |
|
| 200 | + echo ' |
|
| 195 | 201 | <input type="hidden" name="desc" value="1">'; |
| 202 | + } |
|
| 196 | 203 | |
| 197 | 204 | echo ' |
| 198 | 205 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -24,11 +24,12 @@ discard block |
||
| 24 | 24 | <h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3> |
| 25 | 25 | </div>'; |
| 26 | 26 | |
| 27 | - if (!empty($context['disable_groups'])) |
|
| 28 | - echo ' |
|
| 27 | + if (!empty($context['disable_groups'])) { |
|
| 28 | + echo ' |
|
| 29 | 29 | <div class="information"> |
| 30 | 30 | <span class="alert">', $txt['paid_mod_edit_note'], '</span> |
| 31 | 31 | </div>'; |
| 32 | + } |
|
| 32 | 33 | |
| 33 | 34 | echo ' |
| 34 | 35 | <div class="windowbg2"> |
@@ -69,9 +70,10 @@ discard block |
||
| 69 | 70 | <option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>'; |
| 70 | 71 | |
| 71 | 72 | // Put each group into the box. |
| 72 | - foreach ($context['groups'] as $id => $name) |
|
| 73 | - echo ' |
|
| 73 | + foreach ($context['groups'] as $id => $name) { |
|
| 74 | + echo ' |
|
| 74 | 75 | <option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>'; |
| 76 | + } |
|
| 75 | 77 | |
| 76 | 78 | echo ' |
| 77 | 79 | </select> |
@@ -83,12 +85,13 @@ discard block |
||
| 83 | 85 | <dd>'; |
| 84 | 86 | |
| 85 | 87 | // Put a checkbox in for each group |
| 86 | - foreach ($context['groups'] as $id => $name) |
|
| 87 | - echo ' |
|
| 88 | + foreach ($context['groups'] as $id => $name) { |
|
| 89 | + echo ' |
|
| 88 | 90 | <label for="addgroup_', $id, '"> |
| 89 | 91 | <input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '> |
| 90 | 92 | <span class="smalltext">', $name, '</span> |
| 91 | 93 | </label><br>'; |
| 94 | + } |
|
| 92 | 95 | |
| 93 | 96 | echo ' |
| 94 | 97 | </dd> |
@@ -142,8 +145,8 @@ discard block |
||
| 142 | 145 | <fieldset>'; |
| 143 | 146 | |
| 144 | 147 | //!! Removed until implemented |
| 145 | - if (!empty($sdflsdhglsdjgs)) |
|
| 146 | - echo ' |
|
| 148 | + if (!empty($sdflsdhglsdjgs)) { |
|
| 149 | + echo ' |
|
| 147 | 150 | <dl class="settings"> |
| 148 | 151 | <dt> |
| 149 | 152 | <label for="allow_partial_check">', $txt['paid_mod_allow_partial'], '</label>:<br><span class="smalltext">', $txt['paid_mod_allow_partial_desc'], '</span> |
@@ -152,6 +155,7 @@ discard block |
||
| 152 | 155 | <input type="checkbox" name="allow_partial" id="allow_partial_check"', empty($context['sub']['allow_partial']) ? '' : ' checked', '> |
| 153 | 156 | </dd> |
| 154 | 157 | </dl>'; |
| 158 | + } |
|
| 155 | 159 | |
| 156 | 160 | echo ' |
| 157 | 161 | <div class="information"> |
@@ -250,8 +254,8 @@ discard block |
||
| 250 | 254 | <dl class="settings">'; |
| 251 | 255 | |
| 252 | 256 | // Do we need a username? |
| 253 | - if ($context['action_type'] == 'add') |
|
| 254 | - echo ' |
|
| 257 | + if ($context['action_type'] == 'add') { |
|
| 258 | + echo ' |
|
| 255 | 259 | <dt> |
| 256 | 260 | <strong>', $txt['paid_username'], ':</strong><br> |
| 257 | 261 | <span class="smalltext">', $txt['one_username'], '</span> |
@@ -259,6 +263,7 @@ discard block |
||
| 259 | 263 | <dd> |
| 260 | 264 | <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30"> |
| 261 | 265 | </dd>'; |
| 266 | + } |
|
| 262 | 267 | |
| 263 | 268 | echo ' |
| 264 | 269 | <dt> |
@@ -276,9 +281,10 @@ discard block |
||
| 276 | 281 | <select name="year" id="year" onchange="generateDays();">'; |
| 277 | 282 | |
| 278 | 283 | // Show a list of all the years we allow... |
| 279 | - for ($year = 2005; $year <= 2030; $year++) |
|
| 280 | - echo ' |
|
| 284 | + for ($year = 2005; $year <= 2030; $year++) { |
|
| 285 | + echo ' |
|
| 281 | 286 | <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 287 | + } |
|
| 282 | 288 | |
| 283 | 289 | echo ' |
| 284 | 290 | </select> |
@@ -286,9 +292,10 @@ discard block |
||
| 286 | 292 | <select name="month" id="month" onchange="generateDays();">'; |
| 287 | 293 | |
| 288 | 294 | // There are 12 months per year - ensure that they all get listed. |
| 289 | - for ($month = 1; $month <= 12; $month++) |
|
| 290 | - echo ' |
|
| 295 | + for ($month = 1; $month <= 12; $month++) { |
|
| 296 | + echo ' |
|
| 291 | 297 | <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 298 | + } |
|
| 292 | 299 | |
| 293 | 300 | echo ' |
| 294 | 301 | </select> |
@@ -296,9 +303,10 @@ discard block |
||
| 296 | 303 | <select name="day" id="day">'; |
| 297 | 304 | |
| 298 | 305 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 299 | - for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) |
|
| 300 | - echo ' |
|
| 306 | + for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) { |
|
| 307 | + echo ' |
|
| 301 | 308 | <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 309 | + } |
|
| 302 | 310 | |
| 303 | 311 | echo ' |
| 304 | 312 | </select> |
@@ -310,9 +318,10 @@ discard block |
||
| 310 | 318 | <select name="yearend" id="yearend" onchange="generateDays(\'end\');">'; |
| 311 | 319 | |
| 312 | 320 | // Show a list of all the years we allow... |
| 313 | - for ($year = 2005; $year <= 2030; $year++) |
|
| 314 | - echo ' |
|
| 321 | + for ($year = 2005; $year <= 2030; $year++) { |
|
| 322 | + echo ' |
|
| 315 | 323 | <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 324 | + } |
|
| 316 | 325 | |
| 317 | 326 | echo ' |
| 318 | 327 | </select> |
@@ -320,9 +329,10 @@ discard block |
||
| 320 | 329 | <select name="monthend" id="monthend" onchange="generateDays(\'end\');">'; |
| 321 | 330 | |
| 322 | 331 | // There are 12 months per year - ensure that they all get listed. |
| 323 | - for ($month = 1; $month <= 12; $month++) |
|
| 324 | - echo ' |
|
| 332 | + for ($month = 1; $month <= 12; $month++) { |
|
| 333 | + echo ' |
|
| 325 | 334 | <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 335 | + } |
|
| 326 | 336 | |
| 327 | 337 | echo ' |
| 328 | 338 | </select> |
@@ -330,9 +340,10 @@ discard block |
||
| 330 | 340 | <select name="dayend" id="dayend">'; |
| 331 | 341 | |
| 332 | 342 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 333 | - for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) |
|
| 334 | - echo ' |
|
| 343 | + for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) { |
|
| 344 | + echo ' |
|
| 335 | 345 | <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 346 | + } |
|
| 336 | 347 | |
| 337 | 348 | echo ' |
| 338 | 349 | </select> |
@@ -371,8 +382,8 @@ discard block |
||
| 371 | 382 | <div class="windowbg"> |
| 372 | 383 | <ul>'; |
| 373 | 384 | |
| 374 | - foreach ($context['pending_payments'] as $id => $payment) |
|
| 375 | - echo ' |
|
| 385 | + foreach ($context['pending_payments'] as $id => $payment) { |
|
| 386 | + echo ' |
|
| 376 | 387 | <li> |
| 377 | 388 | ', $payment['desc'], ' |
| 378 | 389 | <span class="floatleft"> |
@@ -382,6 +393,7 @@ discard block |
||
| 382 | 393 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a> |
| 383 | 394 | </span> |
| 384 | 395 | </li>'; |
| 396 | + } |
|
| 385 | 397 | |
| 386 | 398 | echo ' |
| 387 | 399 | </ul> |
@@ -406,12 +418,12 @@ discard block |
||
| 406 | 418 | <h3 class="catbg">', $txt['subscriptions'], '</h3> |
| 407 | 419 | </div>'; |
| 408 | 420 | |
| 409 | - if (empty($context['subscriptions'])) |
|
| 410 | - echo ' |
|
| 421 | + if (empty($context['subscriptions'])) { |
|
| 422 | + echo ' |
|
| 411 | 423 | <div class="information"> |
| 412 | 424 | ', $txt['paid_subs_none'], ' |
| 413 | 425 | </div>'; |
| 414 | - else |
|
| 426 | + } else |
|
| 415 | 427 | { |
| 416 | 428 | echo ' |
| 417 | 429 | <div class="information"> |
@@ -423,8 +435,9 @@ discard block |
||
| 423 | 435 | { |
| 424 | 436 | |
| 425 | 437 | // Ignore the inactive ones... |
| 426 | - if (empty($subscription['active'])) |
|
| 427 | - continue; |
|
| 438 | + if (empty($subscription['active'])) { |
|
| 439 | + continue; |
|
| 440 | + } |
|
| 428 | 441 | |
| 429 | 442 | echo ' |
| 430 | 443 | <div class="cat_bar"> |
@@ -434,9 +447,10 @@ discard block |
||
| 434 | 447 | <p><strong>', $subscription['name'], '</strong></p> |
| 435 | 448 | <p class="smalltext">', $subscription['desc'], '</p>'; |
| 436 | 449 | |
| 437 | - if (!$subscription['flexible']) |
|
| 438 | - echo ' |
|
| 450 | + if (!$subscription['flexible']) { |
|
| 451 | + echo ' |
|
| 439 | 452 | <div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>'; |
| 453 | + } |
|
| 440 | 454 | |
| 441 | 455 | if ($context['user']['is_owner']) |
| 442 | 456 | { |
@@ -449,24 +463,25 @@ discard block |
||
| 449 | 463 | <select name="cur[', $subscription['id'], ']">'; |
| 450 | 464 | |
| 451 | 465 | // Print out the costs for this one. |
| 452 | - foreach ($subscription['costs'] as $duration => $value) |
|
| 453 | - echo ' |
|
| 466 | + foreach ($subscription['costs'] as $duration => $value) { |
|
| 467 | + echo ' |
|
| 454 | 468 | <option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>'; |
| 469 | + } |
|
| 455 | 470 | |
| 456 | 471 | echo ' |
| 457 | 472 | </select>'; |
| 458 | - } |
|
| 459 | - else |
|
| 460 | - echo ' |
|
| 473 | + } else { |
|
| 474 | + echo ' |
|
| 461 | 475 | ', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']); |
| 476 | + } |
|
| 462 | 477 | |
| 463 | 478 | echo ' |
| 464 | 479 | <hr> |
| 465 | 480 | <input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">'; |
| 466 | - } |
|
| 467 | - else |
|
| 468 | - echo ' |
|
| 481 | + } else { |
|
| 482 | + echo ' |
|
| 469 | 483 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>'; |
| 484 | + } |
|
| 470 | 485 | |
| 471 | 486 | echo ' |
| 472 | 487 | </div><!-- .windowbg -->'; |
@@ -493,19 +508,20 @@ discard block |
||
| 493 | 508 | </thead> |
| 494 | 509 | <tbody>'; |
| 495 | 510 | |
| 496 | - if (empty($context['current'])) |
|
| 497 | - echo ' |
|
| 511 | + if (empty($context['current'])) { |
|
| 512 | + echo ' |
|
| 498 | 513 | <tr class="windowbg"> |
| 499 | 514 | <td colspan="4"> |
| 500 | 515 | ', $txt['paid_none_yet'], ' |
| 501 | 516 | </td> |
| 502 | 517 | </tr>'; |
| 518 | + } |
|
| 503 | 519 | |
| 504 | 520 | foreach ($context['current'] as $sub) |
| 505 | 521 | { |
| 506 | 522 | |
| 507 | - if (!$sub['hide']) |
|
| 508 | - echo ' |
|
| 523 | + if (!$sub['hide']) { |
|
| 524 | + echo ' |
|
| 509 | 525 | <tr class="windowbg"> |
| 510 | 526 | <td> |
| 511 | 527 | ', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), ' |
@@ -516,6 +532,7 @@ discard block |
||
| 516 | 532 | <td>', $sub['start'], '</td> |
| 517 | 533 | <td>', $sub['end'], '</td> |
| 518 | 534 | </tr>'; |
| 535 | + } |
|
| 519 | 536 | } |
| 520 | 537 | |
| 521 | 538 | echo ' |
@@ -567,15 +584,17 @@ discard block |
||
| 567 | 584 | ', $gateway['desc'], '<br> |
| 568 | 585 | <form action="', $gateway['form'], '" method="post">'; |
| 569 | 586 | |
| 570 | - if (!empty($gateway['javascript'])) |
|
| 571 | - echo ' |
|
| 587 | + if (!empty($gateway['javascript'])) { |
|
| 588 | + echo ' |
|
| 572 | 589 | <script> |
| 573 | 590 | ', $gateway['javascript'], ' |
| 574 | 591 | </script>'; |
| 592 | + } |
|
| 575 | 593 | |
| 576 | - foreach ($gateway['hidden'] as $name => $value) |
|
| 577 | - echo ' |
|
| 594 | + foreach ($gateway['hidden'] as $name => $value) { |
|
| 595 | + echo ' |
|
| 578 | 596 | <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">'; |
| 597 | + } |
|
| 579 | 598 | |
| 580 | 599 | echo ' |
| 581 | 600 | <br> |
@@ -14,8 +14,9 @@ discard block |
||
| 14 | 14 | * @version 2.1 Beta 4 |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -if (!defined('SMF')) |
|
| 17 | +if (!defined('SMF')) { |
|
| 18 | 18 | die('No direct access...'); |
| 19 | +} |
|
| 19 | 20 | |
| 20 | 21 | /** |
| 21 | 22 | * Fetches a list of boards and (optional) categories including |
@@ -37,11 +38,12 @@ discard block |
||
| 37 | 38 | require_once($sourcedir . '/Subs-Boards.php'); |
| 38 | 39 | |
| 39 | 40 | // For performance, track the latest post while going through the boards. |
| 40 | - if (!empty($boardIndexOptions['set_latest_post'])) |
|
| 41 | - $latest_post = array( |
|
| 41 | + if (!empty($boardIndexOptions['set_latest_post'])) { |
|
| 42 | + $latest_post = array( |
|
| 42 | 43 | 'timestamp' => 0, |
| 43 | 44 | 'ref' => 0, |
| 44 | 45 | ); |
| 46 | + } |
|
| 45 | 47 | |
| 46 | 48 | // Find all boards and categories, as well as related information. This will be sorted by the natural order of boards and categories, which we control. |
| 47 | 49 | $result_boards = $smcFunc['db_query']('', ' |
@@ -74,10 +76,11 @@ discard block |
||
| 74 | 76 | ); |
| 75 | 77 | |
| 76 | 78 | // Start with an empty array. |
| 77 | - if ($boardIndexOptions['include_categories']) |
|
| 78 | - $categories = array(); |
|
| 79 | - else |
|
| 80 | - $this_category = array(); |
|
| 79 | + if ($boardIndexOptions['include_categories']) { |
|
| 80 | + $categories = array(); |
|
| 81 | + } else { |
|
| 82 | + $this_category = array(); |
|
| 83 | + } |
|
| 81 | 84 | $boards = array(); |
| 82 | 85 | |
| 83 | 86 | // Run through the categories and boards (or only boards).... |
@@ -88,8 +91,9 @@ discard block |
||
| 88 | 91 | $row_board['is_read'] = !empty($row_board['is_read']) || $ignoreThisBoard ? '1' : '0'; |
| 89 | 92 | |
| 90 | 93 | // Add parent boards to the $boards list later used to fetch moderators |
| 91 | - if ($row_board['id_parent'] == $boardIndexOptions['parent_id']) |
|
| 92 | - $boards[] = $row_board['id_board']; |
|
| 94 | + if ($row_board['id_parent'] == $boardIndexOptions['parent_id']) { |
|
| 95 | + $boards[] = $row_board['id_board']; |
|
| 96 | + } |
|
| 93 | 97 | |
| 94 | 98 | if ($boardIndexOptions['include_categories']) |
| 95 | 99 | { |
@@ -111,8 +115,9 @@ discard block |
||
| 111 | 115 | } |
| 112 | 116 | |
| 113 | 117 | // If this board has new posts in it (and isn't the recycle bin!) then the category is new. |
| 114 | - if (empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $row_board['id_board']) |
|
| 115 | - $categories[$row_board['id_cat']]['new'] |= empty($row_board['is_read']) && $row_board['poster_name'] != ''; |
|
| 118 | + if (empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $row_board['id_board']) { |
|
| 119 | + $categories[$row_board['id_cat']]['new'] |= empty($row_board['is_read']) && $row_board['poster_name'] != ''; |
|
| 120 | + } |
|
| 116 | 121 | |
| 117 | 122 | // Avoid showing category unread link where it only has redirection boards. |
| 118 | 123 | $categories[$row_board['id_cat']]['show_unread'] = !empty($categories[$row_board['id_cat']]['show_unread']) ? 1 : !$row_board['is_redirect']; |
@@ -161,14 +166,12 @@ discard block |
||
| 161 | 166 | { |
| 162 | 167 | $this_category[$row_board['id_board']]['board_class'] = 'redirect'; |
| 163 | 168 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['redirect_board']; |
| 164 | - } |
|
| 165 | - elseif ($this_category[$row_board['id_board']]['new'] || $context['user']['is_guest']) |
|
| 169 | + } elseif ($this_category[$row_board['id_board']]['new'] || $context['user']['is_guest']) |
|
| 166 | 170 | { |
| 167 | 171 | // If we're showing to guests, we want to give them the idea that something interesting is going on! |
| 168 | 172 | $this_category[$row_board['id_board']]['board_class'] = 'on'; |
| 169 | 173 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['new_posts']; |
| 170 | - } |
|
| 171 | - else |
|
| 174 | + } else |
|
| 172 | 175 | { |
| 173 | 176 | $this_category[$row_board['id_board']]['board_tooltip'] = $txt['old_posts']; |
| 174 | 177 | } |
@@ -219,14 +222,16 @@ discard block |
||
| 219 | 222 | // Child of a child... just add it on... |
| 220 | 223 | elseif (!empty($boardIndexOptions['countChildPosts'])) |
| 221 | 224 | { |
| 222 | - if (!isset($parent_map)) |
|
| 223 | - $parent_map = array(); |
|
| 225 | + if (!isset($parent_map)) { |
|
| 226 | + $parent_map = array(); |
|
| 227 | + } |
|
| 224 | 228 | |
| 225 | - if (!isset($parent_map[$row_board['id_parent']])) |
|
| 226 | - foreach ($this_category as $id => $board) |
|
| 229 | + if (!isset($parent_map[$row_board['id_parent']])) { |
|
| 230 | + foreach ($this_category as $id => $board) |
|
| 227 | 231 | { |
| 228 | 232 | if (!isset($board['children'][$row_board['id_parent']])) |
| 229 | 233 | continue; |
| 234 | + } |
|
| 230 | 235 | |
| 231 | 236 | $parent_map[$row_board['id_parent']] = array(&$this_category[$id], &$this_category[$id]['children'][$row_board['id_parent']]); |
| 232 | 237 | $parent_map[$row_board['id_board']] = array(&$this_category[$id], &$this_category[$id]['children'][$row_board['id_parent']]); |
@@ -247,8 +252,9 @@ discard block |
||
| 247 | 252 | continue; |
| 248 | 253 | } |
| 249 | 254 | // Found a child of a child - skip. |
| 250 | - else |
|
| 251 | - continue; |
|
| 255 | + else { |
|
| 256 | + continue; |
|
| 257 | + } |
|
| 252 | 258 | |
| 253 | 259 | // Prepare the subject, and make sure it's not too long. |
| 254 | 260 | censorText($row_board['subject']); |
@@ -269,12 +275,13 @@ discard block |
||
| 269 | 275 | 'topic' => $row_board['id_topic'] |
| 270 | 276 | ); |
| 271 | 277 | |
| 272 | - if (!empty($settings['avatars_on_boardIndex'])) |
|
| 273 | - $this_last_post['member']['avatar'] = set_avatar_data(array( |
|
| 278 | + if (!empty($settings['avatars_on_boardIndex'])) { |
|
| 279 | + $this_last_post['member']['avatar'] = set_avatar_data(array( |
|
| 274 | 280 | 'avatar' => $row_board['avatar'], |
| 275 | 281 | 'email' => $row_board['email_address'], |
| 276 | 282 | 'filename' => !empty($row_board['member_filename']) ? $row_board['member_filename'] : '', |
| 277 | 283 | )); |
| 284 | + } |
|
| 278 | 285 | |
| 279 | 286 | // Provide the href and link. |
| 280 | 287 | if ($row_board['subject'] != '') |
@@ -286,8 +293,7 @@ discard block |
||
| 286 | 293 | link, href, subject, start (where they should go for the first unread post.), |
| 287 | 294 | and member. (which has id, name, link, href, username in it.) */ |
| 288 | 295 | $this_last_post['last_post_message'] = sprintf($txt['last_post_message'], $this_last_post['member']['link'], $this_last_post['link'], $this_last_post['time']); |
| 289 | - } |
|
| 290 | - else |
|
| 296 | + } else |
|
| 291 | 297 | { |
| 292 | 298 | $this_last_post['href'] = ''; |
| 293 | 299 | $this_last_post['link'] = $txt['not_applicable']; |
@@ -295,8 +301,9 @@ discard block |
||
| 295 | 301 | } |
| 296 | 302 | |
| 297 | 303 | // Set the last post in the parent board. |
| 298 | - if ($row_board['id_parent'] == $boardIndexOptions['parent_id'] || ($isChild && !empty($row_board['poster_time']) && $this_category[$row_board['id_parent']]['last_post']['timestamp'] < forum_time(true, $row_board['poster_time']))) |
|
| 299 | - $this_category[$isChild ? $row_board['id_parent'] : $row_board['id_board']]['last_post'] = $this_last_post; |
|
| 304 | + if ($row_board['id_parent'] == $boardIndexOptions['parent_id'] || ($isChild && !empty($row_board['poster_time']) && $this_category[$row_board['id_parent']]['last_post']['timestamp'] < forum_time(true, $row_board['poster_time']))) { |
|
| 305 | + $this_category[$isChild ? $row_board['id_parent'] : $row_board['id_board']]['last_post'] = $this_last_post; |
|
| 306 | + } |
|
| 300 | 307 | // Just in the child...? |
| 301 | 308 | if ($isChild) |
| 302 | 309 | { |
@@ -306,15 +313,17 @@ discard block |
||
| 306 | 313 | $this_category[$row_board['id_parent']]['children'][$row_board['id_board']]['new'] &= $row_board['poster_name'] != ''; |
| 307 | 314 | } |
| 308 | 315 | // No last post for this board? It's not new then, is it..? |
| 309 | - elseif ($row_board['poster_name'] == '') |
|
| 310 | - $this_category[$row_board['id_board']]['new'] = false; |
|
| 316 | + elseif ($row_board['poster_name'] == '') { |
|
| 317 | + $this_category[$row_board['id_board']]['new'] = false; |
|
| 318 | + } |
|
| 311 | 319 | |
| 312 | 320 | // Determine a global most recent topic. |
| 313 | - if (!empty($boardIndexOptions['set_latest_post']) && !empty($row_board['poster_time']) && $row_board['poster_time'] > $latest_post['timestamp'] && !$ignoreThisBoard) |
|
| 314 | - $latest_post = array( |
|
| 321 | + if (!empty($boardIndexOptions['set_latest_post']) && !empty($row_board['poster_time']) && $row_board['poster_time'] > $latest_post['timestamp'] && !$ignoreThisBoard) { |
|
| 322 | + $latest_post = array( |
|
| 315 | 323 | 'timestamp' => $row_board['poster_time'], |
| 316 | 324 | 'ref' => &$this_category[$isChild ? $row_board['id_parent'] : $row_board['id_board']]['last_post'], |
| 317 | 325 | ); |
| 326 | + } |
|
| 318 | 327 | } |
| 319 | 328 | $smcFunc['db_free_result']($result_boards); |
| 320 | 329 | |
@@ -331,8 +340,9 @@ discard block |
||
| 331 | 340 | if (!empty($moderators[$board['id']])) |
| 332 | 341 | { |
| 333 | 342 | $categories[$k]['boards'][$j]['moderators'] = $moderators[$board['id']]; |
| 334 | - foreach ($moderators[$board['id']] as $moderator) |
|
| 335 | - $categories[$k]['boards'][$j]['link_moderators'][] = $moderator['link']; |
|
| 343 | + foreach ($moderators[$board['id']] as $moderator) { |
|
| 344 | + $categories[$k]['boards'][$j]['link_moderators'][] = $moderator['link']; |
|
| 345 | + } |
|
| 336 | 346 | } |
| 337 | 347 | if (!empty($groups[$board['id']])) |
| 338 | 348 | { |
@@ -345,16 +355,16 @@ discard block |
||
| 345 | 355 | } |
| 346 | 356 | } |
| 347 | 357 | } |
| 348 | - } |
|
| 349 | - else |
|
| 358 | + } else |
|
| 350 | 359 | { |
| 351 | 360 | foreach ($this_category as $k => $board) |
| 352 | 361 | { |
| 353 | 362 | if (!empty($moderators[$board['id']])) |
| 354 | 363 | { |
| 355 | 364 | $this_category[$k]['moderators'] = $moderators[$board['id']]; |
| 356 | - foreach ($moderators[$board['id']] as $moderator) |
|
| 357 | - $this_category[$k]['link_moderators'][] = $moderator['link']; |
|
| 365 | + foreach ($moderators[$board['id']] as $moderator) { |
|
| 366 | + $this_category[$k]['link_moderators'][] = $moderator['link']; |
|
| 367 | + } |
|
| 358 | 368 | } |
| 359 | 369 | if (!empty($groups[$board['id']])) |
| 360 | 370 | { |
@@ -368,20 +378,23 @@ discard block |
||
| 368 | 378 | } |
| 369 | 379 | } |
| 370 | 380 | |
| 371 | - if ($boardIndexOptions['include_categories']) |
|
| 372 | - sortCategories($categories); |
|
| 373 | - else |
|
| 374 | - sortBoards($this_category); |
|
| 381 | + if ($boardIndexOptions['include_categories']) { |
|
| 382 | + sortCategories($categories); |
|
| 383 | + } else { |
|
| 384 | + sortBoards($this_category); |
|
| 385 | + } |
|
| 375 | 386 | |
| 376 | 387 | // By now we should know the most recent post...if we wanna know it that is. |
| 377 | - if (!empty($boardIndexOptions['set_latest_post']) && !empty($latest_post['ref'])) |
|
| 378 | - $context['latest_post'] = $latest_post['ref']; |
|
| 388 | + if (!empty($boardIndexOptions['set_latest_post']) && !empty($latest_post['ref'])) { |
|
| 389 | + $context['latest_post'] = $latest_post['ref']; |
|
| 390 | + } |
|
| 379 | 391 | |
| 380 | 392 | // I can't remember why but trying to make a ternary to get this all in one line is actually a Very Bad Idea. |
| 381 | - if ($boardIndexOptions['include_categories']) |
|
| 382 | - call_integration_hook('integrate_getboardtree', array($boardIndexOptions, &$categories)); |
|
| 383 | - else |
|
| 384 | - call_integration_hook('integrate_getboardtree', array($boardIndexOptions, &$this_category)); |
|
| 393 | + if ($boardIndexOptions['include_categories']) { |
|
| 394 | + call_integration_hook('integrate_getboardtree', array($boardIndexOptions, &$categories)); |
|
| 395 | + } else { |
|
| 396 | + call_integration_hook('integrate_getboardtree', array($boardIndexOptions, &$this_category)); |
|
| 397 | + } |
|
| 385 | 398 | |
| 386 | 399 | return $boardIndexOptions['include_categories'] ? $categories : $this_category; |
| 387 | 400 | } |