@@ -83,6 +83,7 @@ |
||
83 | 83 | * Redirection topic options |
84 | 84 | * |
85 | 85 | * @var string $type What type of topic this is for - currently 'merge' or 'move'. Used to display appropriate text strings... |
86 | + * @param string $type |
|
86 | 87 | */ |
87 | 88 | function template_redirect_options($type) |
88 | 89 | { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | // Stick our "create a redirection topic" template in here... |
64 | 64 | template_redirect_options('move'); |
65 | 65 | |
66 | - echo ' |
|
66 | + echo ' |
|
67 | 67 | <input type="submit" value="', $txt['move_topic'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit"> |
68 | 68 | </div> |
69 | 69 | </div>'; |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | */ |
87 | 87 | function template_redirect_options($type) |
88 | 88 | { |
89 | - global $txt, $context, $modSettings; |
|
89 | + global $txt, $context, $modSettings; |
|
90 | 90 | |
91 | - echo ' |
|
91 | + echo ' |
|
92 | 92 | <label for="postRedirect"><input type="checkbox" name="postRedirect" id="postRedirect"', $context['is_approved'] ? ' checked' : '', ' onclick="', $context['is_approved'] ? '' : 'if (this.checked && !confirm(\'' . $txt[$type . '_topic_unapproved_js'] . '\')) return false; ', 'document.getElementById(\'reasonArea\').style.display = this.checked ? \'block\' : \'none\';" class="input_check"> ', $txt['post_redirection'], '.</label> |
93 | 93 | <fieldset id="reasonArea" style="margin-top: 1ex;', $context['is_approved'] ? '' : 'display: none;', '"> |
94 | 94 | <dl class="settings"> |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | foreach ($category['boards'] as $board) |
41 | 41 | echo ' |
42 | - <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', $board['id'] == $context['current_board'] ? ' disabled' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level']-1) . '=> ' : '', $board['name'], '</option>'; |
|
42 | + <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', $board['id'] == $context['current_board'] ? ' disabled' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=> ' : '', $board['name'], '</option>'; |
|
43 | 43 | echo ' |
44 | 44 | </optgroup>'; |
45 | 45 | } |
@@ -37,9 +37,10 @@ discard block |
||
37 | 37 | echo ' |
38 | 38 | <optgroup label="', $category['name'], '">'; |
39 | 39 | |
40 | - foreach ($category['boards'] as $board) |
|
41 | - echo ' |
|
40 | + foreach ($category['boards'] as $board) { |
|
41 | + echo ' |
|
42 | 42 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', $board['id'] == $context['current_board'] ? ' disabled' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level']-1) . '=> ' : '', $board['name'], '</option>'; |
43 | + } |
|
43 | 44 | echo ' |
44 | 45 | </optgroup>'; |
45 | 46 | } |
@@ -68,9 +69,10 @@ discard block |
||
68 | 69 | </div> |
69 | 70 | </div>'; |
70 | 71 | |
71 | - if ($context['back_to_topic']) |
|
72 | - echo ' |
|
72 | + if ($context['back_to_topic']) { |
|
73 | + echo ' |
|
73 | 74 | <input type="hidden" name="goback" value="1">'; |
75 | + } |
|
74 | 76 | |
75 | 77 | echo ' |
76 | 78 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -120,8 +122,7 @@ discard block |
||
120 | 122 | <option value="86400">', $txt['two_months'], '</option> |
121 | 123 | </select> |
122 | 124 | </dd>'; |
123 | - } |
|
124 | - else |
|
125 | + } else |
|
125 | 126 | { |
126 | 127 | echo ' |
127 | 128 | <input type="hidden" name="redirect_expires" value="0">'; |
@@ -217,9 +218,9 @@ discard block |
||
217 | 218 | <input type="submit" value="', $txt['go'], '" class="button_submit"> |
218 | 219 | </form>'; |
219 | 220 | |
221 | + } else { |
|
222 | + echo $txt['target_below']; |
|
220 | 223 | } |
221 | - else |
|
222 | - echo $txt['target_below']; |
|
223 | 224 | |
224 | 225 | echo ' </h4> |
225 | 226 | </div>'; |
@@ -237,12 +238,13 @@ discard block |
||
237 | 238 | |
238 | 239 | $merge_button = create_button('merge', 'merge', ''); |
239 | 240 | |
240 | - foreach ($context['topics'] as $topic) |
|
241 | - echo ' |
|
241 | + foreach ($context['topics'] as $topic) { |
|
242 | + echo ' |
|
242 | 243 | <li> |
243 | 244 | <a href="', $scripturl, '?action=mergetopics;sa=options;board=', $context['current_board'], '.0;from=', $context['origin_topic'], ';to=', $topic['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $merge_button, '</a> |
244 | 245 | <a href="', $scripturl, '?topic=', $topic['id'], '.0" target="_blank" class="new_win">', $topic['subject'], '</a> ', $txt['started_by'], ' ', $topic['poster']['link'], ' |
245 | 246 | </li>'; |
247 | + } |
|
246 | 248 | |
247 | 249 | echo ' |
248 | 250 | </ul> |
@@ -251,8 +253,7 @@ discard block |
||
251 | 253 | <div class="pagesection"> |
252 | 254 | ', $context['page_index'], ' |
253 | 255 | </div>'; |
254 | - } |
|
255 | - else |
|
256 | + } else |
|
256 | 257 | { |
257 | 258 | // Just a nice "There aren't any topics" message |
258 | 259 | echo ' |
@@ -306,8 +307,8 @@ discard block |
||
306 | 307 | </tr> |
307 | 308 | </thead> |
308 | 309 | <tbody>'; |
309 | - foreach ($context['topics'] as $topic) |
|
310 | - echo ' |
|
310 | + foreach ($context['topics'] as $topic) { |
|
311 | + echo ' |
|
311 | 312 | <tr class="windowbg"> |
312 | 313 | <td> |
313 | 314 | <input type="checkbox" class="input_check" name="topics[]" value="' . $topic['id'] . '" checked> |
@@ -327,6 +328,7 @@ discard block |
||
327 | 328 | <input type="checkbox" class="input_check" name="notifications[]" value="' . $topic['id'] . '" checked> |
328 | 329 | </td> |
329 | 330 | </tr>'; |
331 | + } |
|
330 | 332 | echo ' |
331 | 333 | </tbody> |
332 | 334 | </table> |
@@ -337,9 +339,10 @@ discard block |
||
337 | 339 | <fieldset id="merge_subject" class="merge_options"> |
338 | 340 | <legend>', $txt['merge_select_subject'], '</legend> |
339 | 341 | <select name="subject" onchange="this.form.custom_subject.style.display = (this.options[this.selectedIndex].value != 0) ? \'none\': \'\' ;">'; |
340 | - foreach ($context['topics'] as $topic) |
|
341 | - echo ' |
|
342 | + foreach ($context['topics'] as $topic) { |
|
343 | + echo ' |
|
342 | 344 | <option value="', $topic['id'], '"' . ($topic['selected'] ? ' selected' : '') . '>', $topic['subject'], '</option>'; |
345 | + } |
|
343 | 346 | echo ' |
344 | 347 | <option value="0">', $txt['merge_custom_subject'], ':</option> |
345 | 348 | </select> |
@@ -357,11 +360,12 @@ discard block |
||
357 | 360 | <fieldset id="merge_board" class="merge_options"> |
358 | 361 | <legend>', $txt['merge_select_target_board'], '</legend> |
359 | 362 | <ul>'; |
360 | - foreach ($context['boards'] as $board) |
|
361 | - echo ' |
|
363 | + foreach ($context['boards'] as $board) { |
|
364 | + echo ' |
|
362 | 365 | <li> |
363 | 366 | <input type="radio" name="board" value="' . $board['id'] . '"' . ($board['selected'] ? ' checked' : '') . ' class="input_radio"> ' . $board['name'] . ' |
364 | 367 | </li>'; |
368 | + } |
|
365 | 369 | echo ' |
366 | 370 | </ul> |
367 | 371 | </fieldset>'; |
@@ -372,11 +376,12 @@ discard block |
||
372 | 376 | <fieldset id="merge_poll" class="merge_options"> |
373 | 377 | <legend>' . $txt['merge_select_poll'] . '</legend> |
374 | 378 | <ul>'; |
375 | - foreach ($context['polls'] as $poll) |
|
376 | - echo ' |
|
379 | + foreach ($context['polls'] as $poll) { |
|
380 | + echo ' |
|
377 | 381 | <li> |
378 | 382 | <input type="radio" name="poll" value="' . $poll['id'] . '"' . ($poll['selected'] ? ' checked' : '') . ' class="input_radio"> ' . $poll['question'] . ' (' . $txt['topic'] . ': <a href="' . $scripturl . '?topic=' . $poll['topic']['id'] . '.0" target="_blank" class="new_win">' . $poll['topic']['subject'] . '</a>) |
379 | 383 | </li>'; |
384 | + } |
|
380 | 385 | echo ' |
381 | 386 | <li> |
382 | 387 | <input type="radio" name="poll" value="-1" class="input_radio"> (' . $txt['merge_no_poll'] . ') |
@@ -1096,7 +1096,7 @@ |
||
1096 | 1096 | /** |
1097 | 1097 | * CHMOD control form |
1098 | 1098 | * |
1099 | - * @return bool False if nothing to do. |
|
1099 | + * @return false|null False if nothing to do. |
|
1100 | 1100 | */ |
1101 | 1101 | function template_control_chmod() |
1102 | 1102 | { |
@@ -31,12 +31,13 @@ discard block |
||
31 | 31 | </div> |
32 | 32 | <div class="information">'; |
33 | 33 | |
34 | - if ($context['is_installed']) |
|
35 | - echo ' |
|
34 | + if ($context['is_installed']) { |
|
35 | + echo ' |
|
36 | 36 | <strong>', $txt['package_installed_warning1'], '</strong><br> |
37 | 37 | <br> |
38 | 38 | ', $txt['package_installed_warning2'], '<br> |
39 | 39 | <br>'; |
40 | + } |
|
40 | 41 | |
41 | 42 | echo $txt['package_installed_warning3'], ' |
42 | 43 | </div><br>'; |
@@ -63,8 +64,9 @@ discard block |
||
63 | 64 | ', $context['package_readme'], ' |
64 | 65 | <span class="floatright">', $txt['package_available_readme_language'], ' |
65 | 66 | <select name="readme_language" id="readme_language" onchange="if (this.options[this.selectedIndex].value) window.location.href = smf_prepareScriptUrl(smf_scripturl + \'', '?action=admin;area=packages;sa=', $context['uninstalling'] ? 'uninstall' : 'install', ';package=', $context['filename'], ';readme=\' + this.options[this.selectedIndex].value + \';license=\' + get_selected(\'license_language\'));">'; |
66 | - foreach ($context['readmes'] as $a => $b) |
|
67 | - echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), '</option>'; |
|
67 | + foreach ($context['readmes'] as $a => $b) { |
|
68 | + echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), '</option>'; |
|
69 | + } |
|
68 | 70 | echo ' |
69 | 71 | </select> |
70 | 72 | </span> |
@@ -83,8 +85,9 @@ discard block |
||
83 | 85 | ', $context['package_license'], ' |
84 | 86 | <span class="floatright">', $txt['package_available_license_language'], ' |
85 | 87 | <select name="license_language" id="license_language" onchange="if (this.options[this.selectedIndex].value) window.location.href = smf_prepareScriptUrl(smf_scripturl + \'', '?action=admin;area=packages;sa=install', ';package=', $context['filename'], ';license=\' + this.options[this.selectedIndex].value + \';readme=\' + get_selected(\'readme_language\'));">'; |
86 | - foreach ($context['licenses'] as $a => $b) |
|
87 | - echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_license_default'] : ucfirst($b), '</option>'; |
|
88 | + foreach ($context['licenses'] as $a => $b) { |
|
89 | + echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_license_default'] : ucfirst($b), '</option>'; |
|
90 | + } |
|
88 | 91 | echo ' |
89 | 92 | </select> |
90 | 93 | </span> |
@@ -110,9 +113,10 @@ discard block |
||
110 | 113 | ', $txt['package_db_uninstall_actions'], ': |
111 | 114 | <ul>'; |
112 | 115 | |
113 | - foreach ($context['database_changes'] as $change) |
|
114 | - echo ' |
|
116 | + foreach ($context['database_changes'] as $change) { |
|
117 | + echo ' |
|
115 | 118 | <li>', $change, '</li>'; |
119 | + } |
|
116 | 120 | echo ' |
117 | 121 | </ul> |
118 | 122 | </div> |
@@ -122,14 +126,14 @@ discard block |
||
122 | 126 | echo ' |
123 | 127 | <div class="information">'; |
124 | 128 | |
125 | - if (empty($context['actions']) && empty($context['database_changes'])) |
|
126 | - echo ' |
|
129 | + if (empty($context['actions']) && empty($context['database_changes'])) { |
|
130 | + echo ' |
|
127 | 131 | <br> |
128 | 132 | <div class="errorbox"> |
129 | 133 | ', $txt['corrupt_compatible'], ' |
130 | 134 | </div> |
131 | 135 | </div>'; |
132 | - else |
|
136 | + } else |
|
133 | 137 | { |
134 | 138 | echo ' |
135 | 139 | ', $txt['perform_actions'], ' |
@@ -229,9 +233,10 @@ discard block |
||
229 | 233 | <tr class="title_bar"> |
230 | 234 | <td></td> |
231 | 235 | <td>'; |
232 | - if (!empty($context['themes_locked'])) |
|
233 | - echo ' |
|
236 | + if (!empty($context['themes_locked'])) { |
|
237 | + echo ' |
|
234 | 238 | <input type="hidden" name="custom_theme[]" value="', $id, '">'; |
239 | + } |
|
235 | 240 | echo ' |
236 | 241 | <input type="checkbox" name="custom_theme[]" id="custom_theme_', $id, '" value="', $id, '" class="input_check" onclick="', (!empty($theme['has_failure']) ? 'if (this.form.custom_theme_' . $id . '.checked && !confirm(\'' . $txt['package_theme_failure_warning'] . '\')) return false;' : ''), 'invertAll(this, this.form, \'dummy_theme_', $id, '\', true);"', !empty($context['themes_locked']) ? ' disabled checked' : '', '> |
237 | 242 | </td> |
@@ -372,14 +377,15 @@ discard block |
||
372 | 377 | </script>'; |
373 | 378 | |
374 | 379 | // And a bit more for database changes. |
375 | - if (!empty($context['database_changes'])) |
|
376 | - echo ' |
|
380 | + if (!empty($context['database_changes'])) { |
|
381 | + echo ' |
|
377 | 382 | <script> |
378 | 383 | var database_changes_area = document.getElementById(\'db_changes_div\'); |
379 | 384 | var db_vis = false; |
380 | 385 | database_changes_area.style.display = "none"; |
381 | 386 | </script>'; |
382 | -} |
|
387 | + } |
|
388 | + } |
|
383 | 389 | |
384 | 390 | /** |
385 | 391 | * Extract package contents |
@@ -411,12 +417,12 @@ discard block |
||
411 | 417 | <h3 class="catbg">', $context['uninstalling'] ? $txt['uninstall'] : $txt['extracting'], '</h3> |
412 | 418 | </div> |
413 | 419 | <div class="information">', $txt['package_installed_extract'], '</div>'; |
414 | - } |
|
415 | - else |
|
416 | - echo ' |
|
420 | + } else { |
|
421 | + echo ' |
|
417 | 422 | <div class="cat_bar"> |
418 | 423 | <h3 class="catbg">', $txt['package_installed_redirecting'], '</h3> |
419 | 424 | </div>'; |
425 | + } |
|
420 | 426 | |
421 | 427 | echo ' |
422 | 428 | <div class="windowbg">'; |
@@ -427,25 +433,25 @@ discard block |
||
427 | 433 | echo ' |
428 | 434 | ', $context['redirect_text'], '<br><br> |
429 | 435 | <a href="', $context['redirect_url'], '">', $txt['package_installed_redirect_go_now'], '</a> | <a href="', $scripturl, '?action=admin;area=packages;sa=browse">', $txt['package_installed_redirect_cancel'], '</a>'; |
430 | - } |
|
431 | - elseif ($context['uninstalling']) |
|
432 | - echo ' |
|
436 | + } elseif ($context['uninstalling']) { |
|
437 | + echo ' |
|
433 | 438 | ', $txt['package_uninstall_done']; |
434 | - elseif ($context['install_finished']) |
|
439 | + } elseif ($context['install_finished']) |
|
435 | 440 | { |
436 | - if ($context['extract_type'] == 'avatar') |
|
437 | - echo ' |
|
441 | + if ($context['extract_type'] == 'avatar') { |
|
442 | + echo ' |
|
438 | 443 | ', $txt['avatars_extracted']; |
439 | - elseif ($context['extract_type'] == 'language') |
|
440 | - echo ' |
|
444 | + } elseif ($context['extract_type'] == 'language') { |
|
445 | + echo ' |
|
441 | 446 | ', $txt['language_extracted']; |
442 | - else |
|
443 | - echo ' |
|
447 | + } else { |
|
448 | + echo ' |
|
444 | 449 | ', $txt['package_installed_done']; |
445 | - } |
|
446 | - else |
|
447 | - echo ' |
|
450 | + } |
|
451 | + } else { |
|
452 | + echo ' |
|
448 | 453 | ', $txt['corrupt_compatible']; |
454 | + } |
|
449 | 455 | |
450 | 456 | echo ' |
451 | 457 | </div>'; |
@@ -479,9 +485,10 @@ discard block |
||
479 | 485 | <div class="windowbg"> |
480 | 486 | <ol>'; |
481 | 487 | |
482 | - foreach ($context['files'] as $fileinfo) |
|
483 | - echo ' |
|
488 | + foreach ($context['files'] as $fileinfo) { |
|
489 | + echo ' |
|
484 | 490 | <li><a href="', $scripturl, '?action=admin;area=packages;sa=examine;package=', $context['filename'], ';file=', $fileinfo['filename'], '" title="', $txt['view'], '">', $fileinfo['filename'], '</a> (', $fileinfo['size'], ' ', $txt['package_bytes'], ')</li>'; |
491 | + } |
|
485 | 492 | |
486 | 493 | echo ' |
487 | 494 | </ol> |
@@ -545,9 +552,10 @@ discard block |
||
545 | 552 | </script> |
546 | 553 | <div id="yourVersion" style="display:none">', $context['forum_version'], '</div>'; |
547 | 554 | |
548 | - if (empty($modSettings['disable_smf_js'])) |
|
549 | - echo ' |
|
555 | + if (empty($modSettings['disable_smf_js'])) { |
|
556 | + echo ' |
|
550 | 557 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
558 | + } |
|
551 | 559 | |
552 | 560 | // This sets the announcements and current versions themselves ;). |
553 | 561 | echo ' |
@@ -586,12 +594,13 @@ discard block |
||
586 | 594 | } |
587 | 595 | } |
588 | 596 | |
589 | - if (!$mods_available) |
|
590 | - echo ' |
|
597 | + if (!$mods_available) { |
|
598 | + echo ' |
|
591 | 599 | <div class="noticebox">', $txt['no_packages'], '</div>'; |
592 | - else |
|
593 | - echo ' |
|
600 | + } else { |
|
601 | + echo ' |
|
594 | 602 | <br>'; |
603 | + } |
|
595 | 604 | |
596 | 605 | // the advanced (emulation) box, collapsed by default |
597 | 606 | echo ' |
@@ -680,11 +689,12 @@ discard block |
||
680 | 689 | { |
681 | 690 | global $context, $txt, $scripturl; |
682 | 691 | |
683 | - if (!empty($context['package_ftp']['error'])) |
|
684 | - echo ' |
|
692 | + if (!empty($context['package_ftp']['error'])) { |
|
693 | + echo ' |
|
685 | 694 | <div class="errorbox"> |
686 | 695 | <pre>', $context['package_ftp']['error'], '</pre> |
687 | 696 | </div>'; |
697 | + } |
|
688 | 698 | |
689 | 699 | echo ' |
690 | 700 | <div id="admin_form_wrapper"> |
@@ -765,13 +775,14 @@ discard block |
||
765 | 775 | <fieldset> |
766 | 776 | <legend>' . $txt['package_servers'] . '</legend> |
767 | 777 | <ul class="package_servers">'; |
768 | - foreach ($context['servers'] as $server) |
|
769 | - echo ' |
|
778 | + foreach ($context['servers'] as $server) { |
|
779 | + echo ' |
|
770 | 780 | <li class="flow_auto"> |
771 | 781 | <span class="floatleft">' . $server['name'] . '</span> |
772 | 782 | <span class="package_server floatright"><a href="' . $scripturl . '?action=admin;area=packages;get;sa=remove;server=' . $server['id'] . ';', $context['session_var'], '=', $context['session_id'], '">[ ' . $txt['delete'] . ' ]</a></span> |
773 | 783 | <span class="package_server floatright"><a href="' . $scripturl . '?action=admin;area=packages;get;sa=browse;server=' . $server['id'] . '">[ ' . $txt['package_browse'] . ' ]</a></span> |
774 | 784 | </li>'; |
785 | + } |
|
775 | 786 | echo ' |
776 | 787 | </ul> |
777 | 788 | </fieldset> |
@@ -858,11 +869,12 @@ discard block |
||
858 | 869 | <div class="windowbg2">'; |
859 | 870 | |
860 | 871 | // No packages, as yet. |
861 | - if (empty($context['package_list'])) |
|
862 | - echo ' |
|
872 | + if (empty($context['package_list'])) { |
|
873 | + echo ' |
|
863 | 874 | <ul> |
864 | 875 | <li>', $txt['no_packages'], '</li> |
865 | 876 | </ul>'; |
877 | + } |
|
866 | 878 | // List out the packages... |
867 | 879 | else |
868 | 880 | { |
@@ -874,11 +886,12 @@ discard block |
||
874 | 886 | <li> |
875 | 887 | <strong><span id="ps_img_', $i, '" class="toggle_up" alt="*" style="display: none;"></span> ', $packageSection['title'], '</strong>'; |
876 | 888 | |
877 | - if (!empty($packageSection['text'])) |
|
878 | - echo ' |
|
889 | + if (!empty($packageSection['text'])) { |
|
890 | + echo ' |
|
879 | 891 | <div class="sub_bar"> |
880 | 892 | <h3 class="subbg">', $packageSection['text'], '</h3> |
881 | 893 | </div>'; |
894 | + } |
|
882 | 895 | |
883 | 896 | echo ' |
884 | 897 | <', $context['list_type'], ' id="package_section_', $i, '" class="packages">'; |
@@ -888,13 +901,15 @@ discard block |
||
888 | 901 | echo ' |
889 | 902 | <li>'; |
890 | 903 | // Textual message. Could be empty just for a blank line... |
891 | - if ($package['is_text']) |
|
892 | - echo ' |
|
904 | + if ($package['is_text']) { |
|
905 | + echo ' |
|
893 | 906 | ', empty($package['name']) ? ' ' : $package['name']; |
907 | + } |
|
894 | 908 | // This is supposed to be a rule.. |
895 | - elseif ($package['is_line']) |
|
896 | - echo ' |
|
909 | + elseif ($package['is_line']) { |
|
910 | + echo ' |
|
897 | 911 | <hr>'; |
912 | + } |
|
898 | 913 | // A remote link. |
899 | 914 | elseif ($package['is_remote']) |
900 | 915 | { |
@@ -916,21 +931,25 @@ discard block |
||
916 | 931 | <ul id="package_section_', $i, '_pkg_', $id, '" class="package_section">'; |
917 | 932 | |
918 | 933 | // Show the mod type? |
919 | - if ($package['type'] != '') |
|
920 | - echo ' |
|
934 | + if ($package['type'] != '') { |
|
935 | + echo ' |
|
921 | 936 | <li class="package_section">', $txt['package_type'], ': ', $smcFunc['ucwords']($smcFunc['strtolower']($package['type'])), '</li>'; |
937 | + } |
|
922 | 938 | // Show the version number? |
923 | - if ($package['version'] != '') |
|
924 | - echo ' |
|
939 | + if ($package['version'] != '') { |
|
940 | + echo ' |
|
925 | 941 | <li class="package_section">', $txt['mod_version'], ': ', $package['version'], '</li>'; |
942 | + } |
|
926 | 943 | // How 'bout the author? |
927 | - if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) |
|
928 | - echo ' |
|
944 | + if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) { |
|
945 | + echo ' |
|
929 | 946 | <li class="package_section">', $txt['mod_author'], ': ', $package['author']['link'], '</li>'; |
947 | + } |
|
930 | 948 | // The homepage.... |
931 | - if ($package['author']['website']['link'] != '') |
|
932 | - echo ' |
|
949 | + if ($package['author']['website']['link'] != '') { |
|
950 | + echo ' |
|
933 | 951 | <li class="package_section">', $txt['author_website'], ': ', $package['author']['website']['link'], '</li>'; |
952 | + } |
|
934 | 953 | |
935 | 954 | // Desciption: bleh bleh! |
936 | 955 | // Location of file: http://someplace/. |
@@ -983,8 +1002,8 @@ discard block |
||
983 | 1002 | |
984 | 1003 | foreach ($ps['items'] as $id => $package) |
985 | 1004 | { |
986 | - if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) |
|
987 | - echo ' |
|
1005 | + if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) { |
|
1006 | + echo ' |
|
988 | 1007 | var oPackageToggle_', $section, '_pkg_', $id, ' = new smc_Toggle({ |
989 | 1008 | bToggleEnabled: true, |
990 | 1009 | bCurrentlyCollapsed: true, |
@@ -999,6 +1018,7 @@ discard block |
||
999 | 1018 | } |
1000 | 1019 | ] |
1001 | 1020 | });'; |
1021 | + } |
|
1002 | 1022 | } |
1003 | 1023 | } |
1004 | 1024 | echo ' |
@@ -1039,9 +1059,10 @@ discard block |
||
1039 | 1059 | { |
1040 | 1060 | global $context, $txt, $scripturl; |
1041 | 1061 | |
1042 | - if (!empty($context['saved_successful'])) |
|
1043 | - echo ' |
|
1062 | + if (!empty($context['saved_successful'])) { |
|
1063 | + echo ' |
|
1044 | 1064 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
1065 | + } |
|
1045 | 1066 | |
1046 | 1067 | echo ' |
1047 | 1068 | <div id="admincenter"> |
@@ -1103,8 +1124,9 @@ discard block |
||
1103 | 1124 | global $context, $txt; |
1104 | 1125 | |
1105 | 1126 | // Nothing to do? Brilliant! |
1106 | - if (empty($context['package_ftp'])) |
|
1107 | - return false; |
|
1127 | + if (empty($context['package_ftp'])) { |
|
1128 | + return false; |
|
1129 | + } |
|
1108 | 1130 | |
1109 | 1131 | if (empty($context['package_ftp']['form_elements_only'])) |
1110 | 1132 | { |
@@ -1113,19 +1135,21 @@ discard block |
||
1113 | 1135 | <div id="need_writable_list" class="smalltext"> |
1114 | 1136 | ', $txt['package_ftp_why_file_list'], ' |
1115 | 1137 | <ul style="display: inline;">'; |
1116 | - if (!empty($context['notwritable_files'])) |
|
1117 | - foreach ($context['notwritable_files'] as $file) |
|
1138 | + if (!empty($context['notwritable_files'])) { |
|
1139 | + foreach ($context['notwritable_files'] as $file) |
|
1118 | 1140 | echo ' |
1119 | 1141 | <li>', $file, '</li>'; |
1142 | + } |
|
1120 | 1143 | |
1121 | 1144 | echo ' |
1122 | 1145 | </ul>'; |
1123 | 1146 | |
1124 | - if (!$context['server']['is_windows']) |
|
1125 | - echo ' |
|
1147 | + if (!$context['server']['is_windows']) { |
|
1148 | + echo ' |
|
1126 | 1149 | <hr> |
1127 | 1150 | ', $txt['package_chmod_linux'], '<br /> |
1128 | 1151 | <tt># chmod a+w ', implode(' ', $context['notwritable_files']), '</tt>'; |
1152 | + } |
|
1129 | 1153 | |
1130 | 1154 | echo ' |
1131 | 1155 | </div>'; |
@@ -1136,9 +1160,10 @@ discard block |
||
1136 | 1160 | <tt id="ftp_error_message">', !empty($context['package_ftp']['error']) ? $context['package_ftp']['error'] : '', '</tt> |
1137 | 1161 | </div></div>'; |
1138 | 1162 | |
1139 | - if (!empty($context['package_ftp']['destination'])) |
|
1140 | - echo ' |
|
1163 | + if (!empty($context['package_ftp']['destination'])) { |
|
1164 | + echo ' |
|
1141 | 1165 | <form action="', $context['package_ftp']['destination'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">'; |
1166 | + } |
|
1142 | 1167 | |
1143 | 1168 | echo ' |
1144 | 1169 | <fieldset> |
@@ -1171,25 +1196,28 @@ discard block |
||
1171 | 1196 | </dl> |
1172 | 1197 | </fieldset>'; |
1173 | 1198 | |
1174 | - if (empty($context['package_ftp']['form_elements_only'])) |
|
1175 | - echo ' |
|
1199 | + if (empty($context['package_ftp']['form_elements_only'])) { |
|
1200 | + echo ' |
|
1176 | 1201 | |
1177 | 1202 | <div class="righttext" style="margin: 1ex;"> |
1178 | 1203 | <span id="test_ftp_placeholder_full"></span> |
1179 | 1204 | <input type="submit" value="', $txt['package_proceed'], '" class="button_submit"> |
1180 | 1205 | </div>'; |
1206 | + } |
|
1181 | 1207 | |
1182 | - if (!empty($context['package_ftp']['destination'])) |
|
1183 | - echo ' |
|
1208 | + if (!empty($context['package_ftp']['destination'])) { |
|
1209 | + echo ' |
|
1184 | 1210 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1185 | 1211 | </form>'; |
1212 | + } |
|
1186 | 1213 | |
1187 | 1214 | // Hide the details of the list. |
1188 | - if (empty($context['package_ftp']['form_elements_only'])) |
|
1189 | - echo ' |
|
1215 | + if (empty($context['package_ftp']['form_elements_only'])) { |
|
1216 | + echo ' |
|
1190 | 1217 | <script> |
1191 | 1218 | document.getElementById(\'need_writable_list\').style.display = \'none\'; |
1192 | 1219 | </script>'; |
1220 | + } |
|
1193 | 1221 | |
1194 | 1222 | // Quick generate the test button. |
1195 | 1223 | echo ' |
@@ -1545,9 +1573,10 @@ discard block |
||
1545 | 1573 | <tr class="windowbg"> |
1546 | 1574 | <td width="30%"><strong>'; |
1547 | 1575 | |
1548 | - if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) |
|
1549 | - echo ' |
|
1576 | + if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) { |
|
1577 | + echo ' |
|
1550 | 1578 | <span class="generic_icons folder"></span>'; |
1579 | + } |
|
1551 | 1580 | |
1552 | 1581 | echo ' |
1553 | 1582 | ', $name, ' |
@@ -1564,8 +1593,9 @@ discard block |
||
1564 | 1593 | </tr> |
1565 | 1594 | '; |
1566 | 1595 | |
1567 | - if (!empty($dir['contents'])) |
|
1568 | - template_permission_show_contents($name, $dir['contents'], 1); |
|
1596 | + if (!empty($dir['contents'])) { |
|
1597 | + template_permission_show_contents($name, $dir['contents'], 1); |
|
1598 | + } |
|
1569 | 1599 | } |
1570 | 1600 | |
1571 | 1601 | echo ' |
@@ -1601,13 +1631,14 @@ discard block |
||
1601 | 1631 | </fieldset>'; |
1602 | 1632 | |
1603 | 1633 | // Likely to need FTP? |
1604 | - if (empty($context['ftp_connected'])) |
|
1605 | - echo ' |
|
1634 | + if (empty($context['ftp_connected'])) { |
|
1635 | + echo ' |
|
1606 | 1636 | <p> |
1607 | 1637 | ', $txt['package_file_perms_ftp_details'], ': |
1608 | 1638 | </p> |
1609 | 1639 | ', template_control_chmod(), ' |
1610 | 1640 | <div class="noticebox">', $txt['package_file_perms_ftp_retain'], '</div>'; |
1641 | + } |
|
1611 | 1642 | |
1612 | 1643 | echo ' |
1613 | 1644 | <span id="test_ftp_placeholder_full"></span> |
@@ -1616,9 +1647,10 @@ discard block |
||
1616 | 1647 | </div>'; |
1617 | 1648 | |
1618 | 1649 | // Any looks fors we've already done? |
1619 | - foreach ($context['look_for'] as $path) |
|
1620 | - echo ' |
|
1650 | + foreach ($context['look_for'] as $path) { |
|
1651 | + echo ' |
|
1621 | 1652 | <input type="hidden" name="back_look[]" value="', $path, '">'; |
1653 | + } |
|
1622 | 1654 | echo ' |
1623 | 1655 | </form><br>'; |
1624 | 1656 | } |
@@ -1657,9 +1689,10 @@ discard block |
||
1657 | 1689 | <td class="smalltext" width="30%">' . str_repeat(' ', $level * 5), ' |
1658 | 1690 | ', (!empty($dir['type']) && $dir['type'] == 'dir_recursive') || !empty($dir['list_contents']) ? '<a id="link_' . $cur_ident . '" href="' . $scripturl . '?action=admin;area=packages;sa=perms;find=' . base64_encode($ident . '/' . $name) . ';back_look=' . $context['back_look_data'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '#fol_' . $cur_ident . '" onclick="return expandFolder(\'' . $cur_ident . '\', \'' . addcslashes($ident . '/' . $name, "'\\") . '\');">' : ''; |
1659 | 1691 | |
1660 | - if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) |
|
1661 | - echo ' |
|
1692 | + if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) { |
|
1693 | + echo ' |
|
1662 | 1694 | <span class="generic_icons folder"></span>'; |
1695 | + } |
|
1663 | 1696 | |
1664 | 1697 | echo ' |
1665 | 1698 | ', $name, ' |
@@ -1685,14 +1718,15 @@ discard block |
||
1685 | 1718 | } |
1686 | 1719 | |
1687 | 1720 | // We have more files to show? |
1688 | - if ($has_more) |
|
1689 | - echo ' |
|
1721 | + if ($has_more) { |
|
1722 | + echo ' |
|
1690 | 1723 | <tr class="windowbg" id="content_', $js_ident, '_more"> |
1691 | 1724 | <td class="smalltext" width="40%">' . str_repeat(' ', $level * 5), ' |
1692 | 1725 | « <a href="' . $scripturl . '?action=admin;area=packages;sa=perms;find=' . base64_encode($ident) . ';fileoffset=', ($context['file_offset'] + $context['file_limit']), ';' . $context['session_var'] . '=' . $context['session_id'] . '#fol_' . preg_replace('~[^A-Za-z0-9_\-=:]~', ':-:', $ident) . '">', $txt['package_file_perms_more_files'], '</a> » |
1693 | 1726 | </td> |
1694 | 1727 | <td colspan="6"></td> |
1695 | 1728 | </tr>'; |
1729 | + } |
|
1696 | 1730 | |
1697 | 1731 | if ($drawn_div) |
1698 | 1732 | { |
@@ -1700,15 +1734,17 @@ discard block |
||
1700 | 1734 | $isFound = false; |
1701 | 1735 | foreach ($context['look_for'] as $tree) |
1702 | 1736 | { |
1703 | - if (substr($tree, 0, strlen($ident)) == $ident) |
|
1704 | - $isFound = true; |
|
1737 | + if (substr($tree, 0, strlen($ident)) == $ident) { |
|
1738 | + $isFound = true; |
|
1739 | + } |
|
1705 | 1740 | } |
1706 | 1741 | |
1707 | - if ($level > 1 && !$isFound) |
|
1708 | - echo ' |
|
1742 | + if ($level > 1 && !$isFound) { |
|
1743 | + echo ' |
|
1709 | 1744 | <script> |
1710 | 1745 | expandFolder(\'', $js_ident, '\', \'\'); |
1711 | 1746 | </script>'; |
1747 | + } |
|
1712 | 1748 | } |
1713 | 1749 | } |
1714 | 1750 | |
@@ -1728,11 +1764,12 @@ discard block |
||
1728 | 1764 | <h3 class="catbg">', $txt['package_file_perms_applying'], '</h3> |
1729 | 1765 | </div>'; |
1730 | 1766 | |
1731 | - if (!empty($context['skip_ftp'])) |
|
1732 | - echo ' |
|
1767 | + if (!empty($context['skip_ftp'])) { |
|
1768 | + echo ' |
|
1733 | 1769 | <div class="errorbox"> |
1734 | 1770 | ', $txt['package_file_perms_skipping_ftp'], ' |
1735 | 1771 | </div>'; |
1772 | + } |
|
1736 | 1773 | |
1737 | 1774 | // How many have we done? |
1738 | 1775 | $remaining_items = count($context['method'] == 'individual' ? $context['to_process'] : $context['directory_list']); |
@@ -1770,28 +1807,31 @@ discard block |
||
1770 | 1807 | <br>'; |
1771 | 1808 | |
1772 | 1809 | // Put out the right hidden data. |
1773 | - if ($context['method'] == 'individual') |
|
1774 | - echo ' |
|
1810 | + if ($context['method'] == 'individual') { |
|
1811 | + echo ' |
|
1775 | 1812 | <input type="hidden" name="custom_value" value="', $context['custom_value'], '"> |
1776 | 1813 | <input type="hidden" name="totalItems" value="', $context['total_items'], '"> |
1777 | 1814 | <input type="hidden" name="toProcess" value="', base64_encode(json_encode($context['to_process'])), '">'; |
1778 | - else |
|
1779 | - echo ' |
|
1815 | + } else { |
|
1816 | + echo ' |
|
1780 | 1817 | <input type="hidden" name="predefined" value="', $context['predefined_type'], '"> |
1781 | 1818 | <input type="hidden" name="fileOffset" value="', $context['file_offset'], '"> |
1782 | 1819 | <input type="hidden" name="totalItems" value="', $context['total_items'], '"> |
1783 | 1820 | <input type="hidden" name="dirList" value="', base64_encode(json_encode($context['directory_list'])), '"> |
1784 | 1821 | <input type="hidden" name="specialFiles" value="', base64_encode(json_encode($context['special_files'])), '">'; |
1822 | + } |
|
1785 | 1823 | |
1786 | 1824 | // Are we not using FTP for whatever reason. |
1787 | - if (!empty($context['skip_ftp'])) |
|
1788 | - echo ' |
|
1825 | + if (!empty($context['skip_ftp'])) { |
|
1826 | + echo ' |
|
1789 | 1827 | <input type="hidden" name="skip_ftp" value="1">'; |
1828 | + } |
|
1790 | 1829 | |
1791 | 1830 | // Retain state. |
1792 | - foreach ($context['back_look_data'] as $path) |
|
1793 | - echo ' |
|
1831 | + foreach ($context['back_look_data'] as $path) { |
|
1832 | + echo ' |
|
1794 | 1833 | <input type="hidden" name="back_look[]" value="', $path, '">'; |
1834 | + } |
|
1795 | 1835 | |
1796 | 1836 | echo ' |
1797 | 1837 | <input type="hidden" name="method" value="', $context['method'], '"> |
@@ -12,7 +12,8 @@ |
||
12 | 12 | header('Location: ' . $boardurl); |
13 | 13 | } |
14 | 14 | // Can't find it... just forget it. |
15 | -else |
|
15 | +else { |
|
16 | 16 | exit; |
17 | +} |
|
17 | 18 | |
18 | 19 | ?> |
19 | 20 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -583,8 +583,7 @@ discard block |
||
583 | 583 | { |
584 | 584 | $header = '<?php require("' . ($user_info['is_admin'] ? addslashes(realpath($boarddir . '/SSI.php')) : 'SSI.php') . '"); ?>' . "\n" . $header; |
585 | 585 | return $header . template_homepage_sample1_html() . $footer; |
586 | - } |
|
587 | - else |
|
586 | + } else |
|
588 | 587 | { |
589 | 588 | echo $header; |
590 | 589 | template_homepage_sample1_php(); |
@@ -599,9 +598,10 @@ discard block |
||
599 | 598 | |
600 | 599 | $topics = ssi_recentTopics(8, null, null, 'array'); |
601 | 600 | |
602 | - foreach ($topics as $topic) |
|
603 | - echo ' |
|
601 | + foreach ($topics as $topic) { |
|
602 | + echo ' |
|
604 | 603 | <li><a href="', $topic['href'], '">', $topic['subject'], '</a> ', $txt['by'], ' ', $topic['poster']['link'], '</li>'; |
604 | + } |
|
605 | 605 | |
606 | 606 | unset($topics); |
607 | 607 |
@@ -186,8 +186,9 @@ discard block |
||
186 | 186 | |
187 | 187 | ########## Error-Catching ########## |
188 | 188 | # Note: You shouldn't touch these settings. |
189 | -if (file_exists(dirname(__FILE__) . '/db_last_error.php')) |
|
189 | +if (file_exists(dirname(__FILE__) . '/db_last_error.php')) { |
|
190 | 190 | include(dirname(__FILE__) . '/db_last_error.php'); |
191 | +} |
|
191 | 192 | |
192 | 193 | if (!isset($db_last_error)) |
193 | 194 | { |
@@ -202,11 +203,14 @@ discard block |
||
202 | 203 | } |
203 | 204 | |
204 | 205 | # Make sure the paths are correct... at least try to fix them. |
205 | -if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt')) |
|
206 | +if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt')) { |
|
206 | 207 | $boarddir = dirname(__FILE__); |
207 | -if (!file_exists($sourcedir) && file_exists($boarddir . '/Sources')) |
|
208 | +} |
|
209 | +if (!file_exists($sourcedir) && file_exists($boarddir . '/Sources')) { |
|
208 | 210 | $sourcedir = $boarddir . '/Sources'; |
209 | -if (!file_exists($cachedir) && file_exists($boarddir . '/cache')) |
|
211 | +} |
|
212 | +if (!file_exists($cachedir) && file_exists($boarddir . '/cache')) { |
|
210 | 213 | $cachedir = $boarddir . '/cache'; |
214 | +} |
|
211 | 215 | |
212 | 216 | ?> |
213 | 217 | \ No newline at end of file |
@@ -23,13 +23,13 @@ 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">', $context['error_message'], '</div>'; |
32 | - else |
|
32 | + } else |
|
33 | 33 | { |
34 | 34 | echo ' |
35 | 35 | <div id="fatal_error"> |
@@ -82,21 +82,23 @@ discard block |
||
82 | 82 | ', $txt['apply_filter_of_type'], ':'; |
83 | 83 | |
84 | 84 | $error_types = array(); |
85 | - foreach ($context['error_types'] as $type => $details) |
|
86 | - $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>'; |
|
85 | + foreach ($context['error_types'] as $type => $details) { |
|
86 | + $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>'; |
|
87 | + } |
|
87 | 88 | |
88 | 89 | echo ' |
89 | 90 | ', implode(' | ', $error_types), ' |
90 | 91 | </td> |
91 | 92 | </tr>'; |
92 | 93 | |
93 | - if ($context['has_filter']) |
|
94 | - echo ' |
|
94 | + if ($context['has_filter']) { |
|
95 | + echo ' |
|
95 | 96 | <tr> |
96 | 97 | <td colspan="3" class="windowbg"> |
97 | 98 | <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>] |
98 | 99 | </td> |
99 | 100 | </tr>'; |
101 | + } |
|
100 | 102 | |
101 | 103 | echo ' |
102 | 104 | <tr> |
@@ -107,11 +109,12 @@ discard block |
||
107 | 109 | </tr>'; |
108 | 110 | |
109 | 111 | // No errors, then show a message |
110 | - if (count($context['errors']) == 0) |
|
111 | - echo ' |
|
112 | + if (count($context['errors']) == 0) { |
|
113 | + echo ' |
|
112 | 114 | <tr class="windowbg"> |
113 | 115 | <td class="centertext" colspan="2">', $txt['errlog_no_entries'], '</td> |
114 | 116 | </tr>'; |
117 | + } |
|
115 | 118 | |
116 | 119 | // we have some errors, must be some mods installed :P |
117 | 120 | foreach ($context['errors'] as $error) |
@@ -126,20 +129,22 @@ discard block |
||
126 | 129 | <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> |
127 | 130 | ', $error['time'], '<br>'; |
128 | 131 | |
129 | - if (!empty($error['member']['ip'])) |
|
130 | - echo ' |
|
132 | + if (!empty($error['member']['ip'])) { |
|
133 | + echo ' |
|
131 | 134 | <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> |
132 | 135 | <strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong> <br>'; |
136 | + } |
|
133 | 137 | |
134 | 138 | echo ' |
135 | 139 | </div> |
136 | 140 | |
137 | 141 | <div style="float: left; width: 50%; line-height: 1.8em; padding: 0 4px;">'; |
138 | 142 | |
139 | - if ($error['member']['session'] != '') |
|
140 | - echo ' |
|
143 | + if ($error['member']['session'] != '') { |
|
144 | + echo ' |
|
141 | 145 | <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> |
142 | 146 | ', $error['member']['session'], '<br>'; |
147 | + } |
|
143 | 148 | |
144 | 149 | echo ' |
145 | 150 | <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> |
@@ -153,8 +158,8 @@ discard block |
||
153 | 158 | <a style="display: table-cell;" href="', $error['url']['html'], '">', $error['url']['html'], '</a> |
154 | 159 | </div>'; |
155 | 160 | |
156 | - if (!empty($error['file'])) |
|
157 | - echo ' |
|
161 | + if (!empty($error['file'])) { |
|
162 | + echo ' |
|
158 | 163 | <div style="float: left; width: 100%; padding: 4px 0; line-height: 1.6em; border-top: 1px solid #e3e3e3;"> |
159 | 164 | <a style="display: table-cell; padding: 4px; width: 20px; vertical-align: top;" 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> |
160 | 165 | <div> |
@@ -162,6 +167,7 @@ discard block |
||
162 | 167 | ', $txt['line'], ': ', $error['file']['line'], ' |
163 | 168 | </div> |
164 | 169 | </div>'; |
170 | + } |
|
165 | 171 | |
166 | 172 | echo ' |
167 | 173 | </td> |
@@ -190,9 +196,10 @@ discard block |
||
190 | 196 | </div> |
191 | 197 | <br>'; |
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'], '">'; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | foreach ($message['custom_fields']['above_member'] as $custom) |
233 | 233 | echo ' |
234 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
234 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
235 | 235 | |
236 | 236 | echo ' |
237 | 237 | </ul> |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | if (!empty($message['custom_fields']['below_avatar'])) |
269 | 269 | foreach ($message['custom_fields']['below_avatar'] as $custom) |
270 | 270 | echo ' |
271 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
271 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
272 | 272 | |
273 | 273 | if (!$message['member']['is_guest']) |
274 | 274 | echo ' |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | foreach ($message['custom_fields']['icons'] as $custom) |
312 | 312 | echo ' |
313 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
313 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
314 | 314 | |
315 | 315 | echo ' |
316 | 316 | </ol> |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (!empty($message['custom_fields']['standard'])) |
369 | 369 | foreach ($message['custom_fields']['standard'] as $custom) |
370 | 370 | echo ' |
371 | - <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
371 | + <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
372 | 372 | |
373 | 373 | // Are we showing the warning status? |
374 | 374 | if ($message['member']['can_see_warning']) |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | if (!empty($message['custom_fields']['bottom_poster'])) |
380 | 380 | foreach ($message['custom_fields']['bottom_poster'] as $custom) |
381 | 381 | echo ' |
382 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
382 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | // Done with the information about the poster... on to the post itself. |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | |
479 | 479 | foreach ($message['custom_fields']['above_signature'] as $custom) |
480 | 480 | echo ' |
481 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
481 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
482 | 482 | |
483 | 483 | echo ' |
484 | 484 | </ul> |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | |
500 | 500 | foreach ($message['custom_fields']['below_signature'] as $custom) |
501 | 501 | echo ' |
502 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
502 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
503 | 503 | |
504 | 504 | echo ' |
505 | 505 | </ul> |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | while ($message = $context['get_pmessage']('subject')) |
632 | 632 | { |
633 | 633 | echo ' |
634 | - <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','"> |
|
634 | + <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '"> |
|
635 | 635 | <td class="table_icon"> |
636 | 636 | <script> |
637 | 637 | currentLabels[', $message['id'], '] = {'; |
@@ -903,12 +903,12 @@ discard block |
||
903 | 903 | // You can only reply if they are not a guest... |
904 | 904 | if (!$message['member']['is_guest']) |
905 | 905 | echo ' |
906 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
|
907 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
|
906 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], ' |
|
907 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator']; |
|
908 | 908 | // This is for "forwarding" - even if the member is gone. |
909 | 909 | else |
910 | 910 | echo ' |
911 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
|
911 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator']; |
|
912 | 912 | } |
913 | 913 | |
914 | 914 | echo ' |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> |
1009 | 1009 | <dl> |
1010 | 1010 | <dt> |
1011 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
1011 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
1012 | 1012 | </dt> |
1013 | 1013 | <dd class="error" id="error_list"> |
1014 | 1014 | ', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), ' |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | <span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span> |
1065 | 1065 | </dt> |
1066 | 1066 | <dd id="pm_subject"> |
1067 | - <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/> |
|
1067 | + <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/> |
|
1068 | 1068 | </dd> |
1069 | 1069 | </dl><hr>'; |
1070 | 1070 | |
@@ -1427,7 +1427,7 @@ discard block |
||
1427 | 1427 | echo ' |
1428 | 1428 | <div class="padding"> |
1429 | 1429 | <input type="submit" name="save" value="', $txt['save'], '" class="button_submit"> |
1430 | - <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button_submit you_sure"> |
|
1430 | + <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button_submit you_sure"> |
|
1431 | 1431 | </div>'; |
1432 | 1432 | |
1433 | 1433 | echo ' |
@@ -1591,7 +1591,7 @@ discard block |
||
1591 | 1591 | if (!empty($context['rules'])) |
1592 | 1592 | echo ' |
1593 | 1593 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1594 | - <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button_submit smalltext you_sure">'; |
|
1594 | + <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button_submit smalltext you_sure">'; |
|
1595 | 1595 | |
1596 | 1596 | echo ' |
1597 | 1597 | </div> |
@@ -1832,9 +1832,9 @@ discard block |
||
1832 | 1832 | |
1833 | 1833 | echo ' |
1834 | 1834 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
1835 | - <option value="">', $txt['pm_rule_sel_action'] , ':</option> |
|
1836 | - <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option> |
|
1837 | - <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option> |
|
1835 | + <option value="">', $txt['pm_rule_sel_action'], ':</option> |
|
1836 | + <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option> |
|
1837 | + <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option> |
|
1838 | 1838 | </select> |
1839 | 1839 | <span id="labdiv', $k, '"> |
1840 | 1840 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
@@ -1951,7 +1951,7 @@ discard block |
||
1951 | 1951 | </div> |
1952 | 1952 | <ul class="quickbuttons"> |
1953 | 1953 | <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li> |
1954 | - <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
1954 | + <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
1955 | 1955 | </ul> |
1956 | 1956 | </div>'; |
1957 | 1957 | } |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | <div id="personal_messages">'; |
22 | 22 | |
23 | 23 | // Show the capacity bar, if available. |
24 | - if (!empty($context['limit_bar'])) |
|
25 | - echo ' |
|
24 | + if (!empty($context['limit_bar'])) { |
|
25 | + echo ' |
|
26 | 26 | <div class="cat_bar"> |
27 | 27 | <h3 class="catbg"> |
28 | 28 | <span class="floatleft">', $txt['pm_capacity'], ':</span> |
@@ -32,14 +32,16 @@ discard block |
||
32 | 32 | <span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span> |
33 | 33 | </h3> |
34 | 34 | </div>'; |
35 | + } |
|
35 | 36 | |
36 | 37 | // Message sent? Show a small indication. |
37 | - if (isset($context['pm_sent'])) |
|
38 | - echo ' |
|
38 | + if (isset($context['pm_sent'])) { |
|
39 | + echo ' |
|
39 | 40 | <div class="infobox"> |
40 | 41 | ', $txt['pm_sent'], ' |
41 | 42 | </div>'; |
42 | -} |
|
43 | + } |
|
44 | + } |
|
43 | 45 | |
44 | 46 | /** |
45 | 47 | * Just the end of the index bar, nothing special. |
@@ -72,8 +74,7 @@ discard block |
||
72 | 74 | { |
73 | 75 | echo ' |
74 | 76 | <div class="no_unread">', $txt['pm_no_unread'], '</div>'; |
75 | - } |
|
76 | - else |
|
77 | + } else |
|
77 | 78 | { |
78 | 79 | foreach ($context['unread_pms'] as $id_pm => $pm_details) |
79 | 80 | { |
@@ -193,14 +194,15 @@ discard block |
||
193 | 194 | if ($context['get_pmessage']('message', true)) |
194 | 195 | { |
195 | 196 | // Show the helpful titlebar - generally. |
196 | - if ($context['display_mode'] != 1) |
|
197 | - echo ' |
|
197 | + if ($context['display_mode'] != 1) { |
|
198 | + echo ' |
|
198 | 199 | <div class="cat_bar"> |
199 | 200 | <h3 class="catbg"> |
200 | 201 | <span id="author">', $txt['author'], '</span> |
201 | 202 | <span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span> |
202 | 203 | </h3> |
203 | 204 | </div>'; |
205 | + } |
|
204 | 206 | |
205 | 207 | // Show a few buttons if we are in conversation mode and outputting the first message. |
206 | 208 | if ($context['display_mode'] == 2) |
@@ -229,9 +231,10 @@ discard block |
||
229 | 231 | <div class="custom_fields_above_member"> |
230 | 232 | <ul class="nolist">'; |
231 | 233 | |
232 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
233 | - echo ' |
|
234 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
235 | + echo ' |
|
234 | 236 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
237 | + } |
|
235 | 238 | |
236 | 239 | echo ' |
237 | 240 | </ul> |
@@ -243,9 +246,10 @@ discard block |
||
243 | 246 | <a id="msg', $message['id'], '"></a>'; |
244 | 247 | |
245 | 248 | // Show online and offline buttons? |
246 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
247 | - echo ' |
|
249 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
250 | + echo ' |
|
248 | 251 | <span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>'; |
252 | + } |
|
249 | 253 | |
250 | 254 | // Show a link to the member's profile (but only if the sender isn't a guest). |
251 | 255 | echo ' |
@@ -258,48 +262,56 @@ discard block |
||
258 | 262 | <ul class="user_info">'; |
259 | 263 | |
260 | 264 | // Show the user's avatar. |
261 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
262 | - echo ' |
|
265 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
266 | + echo ' |
|
263 | 267 | <li class="avatar"> |
264 | 268 | <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a> |
265 | 269 | </li>'; |
270 | + } |
|
266 | 271 | |
267 | 272 | // Are there any custom fields below the avatar? |
268 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
269 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
273 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
274 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
270 | 275 | echo ' |
271 | 276 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
277 | + } |
|
272 | 278 | |
273 | - if (!$message['member']['is_guest']) |
|
274 | - echo ' |
|
279 | + if (!$message['member']['is_guest']) { |
|
280 | + echo ' |
|
275 | 281 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
282 | + } |
|
276 | 283 | // Show the member's primary group (like 'Administrator') if they have one. |
277 | - if (isset($message['member']['group']) && $message['member']['group'] != '') |
|
278 | - echo ' |
|
284 | + if (isset($message['member']['group']) && $message['member']['group'] != '') { |
|
285 | + echo ' |
|
279 | 286 | <li class="membergroup">', $message['member']['group'], '</li>'; |
287 | + } |
|
280 | 288 | |
281 | 289 | // Show the member's custom title, if they have one. |
282 | - if (isset($message['member']['title']) && $message['member']['title'] != '') |
|
283 | - echo ' |
|
290 | + if (isset($message['member']['title']) && $message['member']['title'] != '') { |
|
291 | + echo ' |
|
284 | 292 | <li class="title">', $message['member']['title'], '</li>'; |
293 | + } |
|
285 | 294 | |
286 | 295 | // Don't show these things for guests. |
287 | 296 | if (!$message['member']['is_guest']) |
288 | 297 | { |
289 | 298 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
290 | - if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') |
|
291 | - echo ' |
|
299 | + if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') { |
|
300 | + echo ' |
|
292 | 301 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
302 | + } |
|
293 | 303 | |
294 | 304 | // Show how many posts they have made. |
295 | - if (!isset($context['disabled_fields']['posts'])) |
|
296 | - echo ' |
|
305 | + if (!isset($context['disabled_fields']['posts'])) { |
|
306 | + echo ' |
|
297 | 307 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
308 | + } |
|
298 | 309 | |
299 | 310 | // Show their personal text? |
300 | - if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') |
|
301 | - echo ' |
|
311 | + if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') { |
|
312 | + echo ' |
|
302 | 313 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
314 | + } |
|
303 | 315 | |
304 | 316 | // Any custom fields to show as icons? |
305 | 317 | if (!empty($message['custom_fields']['icons'])) |
@@ -308,9 +320,10 @@ discard block |
||
308 | 320 | <li class="im_icons"> |
309 | 321 | <ol>'; |
310 | 322 | |
311 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
312 | - echo ' |
|
323 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
324 | + echo ' |
|
313 | 325 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
326 | + } |
|
314 | 327 | |
315 | 328 | echo ' |
316 | 329 | </ol> |
@@ -318,19 +331,22 @@ discard block |
||
318 | 331 | } |
319 | 332 | |
320 | 333 | // Show the IP to this user for this post - because you can moderate? |
321 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
322 | - echo ' |
|
334 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
335 | + echo ' |
|
323 | 336 | <li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>'; |
337 | + } |
|
324 | 338 | |
325 | 339 | // Or, should we show it because this is you? |
326 | - elseif ($message['can_see_ip']) |
|
327 | - echo ' |
|
340 | + elseif ($message['can_see_ip']) { |
|
341 | + echo ' |
|
328 | 342 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
343 | + } |
|
329 | 344 | |
330 | 345 | // Okay, you are logged in, then we can show something about why IPs are logged... |
331 | - else |
|
332 | - echo ' |
|
346 | + else { |
|
347 | + echo ' |
|
333 | 348 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
349 | + } |
|
334 | 350 | |
335 | 351 | // Show the profile, website, email address, and personal message buttons. |
336 | 352 | if ($message['member']['show_profile_buttons']) |
@@ -340,24 +356,28 @@ discard block |
||
340 | 356 | <ol class="profile_icons">'; |
341 | 357 | |
342 | 358 | // Show the profile button |
343 | - if ($message['member']['can_view_profile']) |
|
344 | - echo ' |
|
359 | + if ($message['member']['can_view_profile']) { |
|
360 | + echo ' |
|
345 | 361 | <li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>'; |
362 | + } |
|
346 | 363 | |
347 | 364 | // Don't show an icon if they haven't specified a website. |
348 | - if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) |
|
349 | - echo ' |
|
365 | + if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) { |
|
366 | + echo ' |
|
350 | 367 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
368 | + } |
|
351 | 369 | |
352 | 370 | // Don't show the email address if they want it hidden. |
353 | - if ($message['member']['show_email']) |
|
354 | - echo ' |
|
371 | + if ($message['member']['show_email']) { |
|
372 | + echo ' |
|
355 | 373 | <li><a href="mailto:', $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
374 | + } |
|
356 | 375 | |
357 | 376 | // Since we know this person isn't a guest, you *can* message them. |
358 | - if ($context['can_send_pm']) |
|
359 | - echo ' |
|
377 | + if ($context['can_send_pm']) { |
|
378 | + echo ' |
|
360 | 379 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
380 | + } |
|
361 | 381 | |
362 | 382 | echo ' |
363 | 383 | </ol> |
@@ -365,21 +385,24 @@ discard block |
||
365 | 385 | } |
366 | 386 | |
367 | 387 | // Any custom fields for standard placement? |
368 | - if (!empty($message['custom_fields']['standard'])) |
|
369 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
388 | + if (!empty($message['custom_fields']['standard'])) { |
|
389 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
370 | 390 | echo ' |
371 | 391 | <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
392 | + } |
|
372 | 393 | |
373 | 394 | // Are we showing the warning status? |
374 | - if ($message['member']['can_see_warning']) |
|
375 | - echo ' |
|
395 | + if ($message['member']['can_see_warning']) { |
|
396 | + echo ' |
|
376 | 397 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span>', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
398 | + } |
|
377 | 399 | |
378 | 400 | // Are there any custom fields to show at the bottom of the poster info? |
379 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
380 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
401 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
402 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
381 | 403 | echo ' |
382 | 404 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
405 | + } |
|
383 | 406 | } |
384 | 407 | |
385 | 408 | // Done with the information about the poster... on to the post itself. |
@@ -398,24 +421,28 @@ discard block |
||
398 | 421 | <span class="smalltext">« <strong> ', $txt['sent_to'], ':</strong> '; |
399 | 422 | |
400 | 423 | // People it was sent directly to.... |
401 | - if (!empty($message['recipients']['to'])) |
|
402 | - echo implode(', ', $message['recipients']['to']); |
|
424 | + if (!empty($message['recipients']['to'])) { |
|
425 | + echo implode(', ', $message['recipients']['to']); |
|
426 | + } |
|
403 | 427 | // Otherwise, we're just going to say "some people"... |
404 | - elseif ($context['folder'] != 'sent') |
|
405 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
428 | + elseif ($context['folder'] != 'sent') { |
|
429 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
430 | + } |
|
406 | 431 | |
407 | 432 | echo ' |
408 | 433 | <strong> ', $txt['on'], ':</strong> ', $message['time'], ' » |
409 | 434 | </span>'; |
410 | 435 | |
411 | 436 | // If we're in the sent items, show who it was sent to besides the "To:" people. |
412 | - if (!empty($message['recipients']['bcc'])) |
|
413 | - echo ' |
|
437 | + if (!empty($message['recipients']['bcc'])) { |
|
438 | + echo ' |
|
414 | 439 | <br><span class="smalltext">« <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' »</span>'; |
440 | + } |
|
415 | 441 | |
416 | - if (!empty($message['is_replied_to'])) |
|
417 | - echo ' |
|
442 | + if (!empty($message['is_replied_to'])) { |
|
443 | + echo ' |
|
418 | 444 | <br><span class="smalltext">« ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' »</span>'; |
445 | + } |
|
419 | 446 | |
420 | 447 | echo ' |
421 | 448 | </div> |
@@ -423,13 +450,15 @@ discard block |
||
423 | 450 | <div class="post"> |
424 | 451 | <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>'; |
425 | 452 | |
426 | - if ($message['can_report'] || $context['can_send_pm']) |
|
427 | - echo ' |
|
453 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
454 | + echo ' |
|
428 | 455 | <div class="under_message">'; |
456 | + } |
|
429 | 457 | |
430 | - if ($message['can_report']) |
|
431 | - echo ' |
|
458 | + if ($message['can_report']) { |
|
459 | + echo ' |
|
432 | 460 | <a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>'; |
461 | + } |
|
433 | 462 | |
434 | 463 | echo ' |
435 | 464 | <ul class="quickbuttons">'; |
@@ -441,32 +470,36 @@ discard block |
||
441 | 470 | if (!$message['member']['is_guest']) |
442 | 471 | { |
443 | 472 | // Is there than more than one recipient you can reply to? |
444 | - if ($message['number_recipients'] > 1) |
|
445 | - echo ' |
|
473 | + if ($message['number_recipients'] > 1) { |
|
474 | + echo ' |
|
446 | 475 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>'; |
476 | + } |
|
447 | 477 | |
448 | 478 | echo ' |
449 | 479 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li> |
450 | 480 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
451 | 481 | } |
452 | 482 | // This is for "forwarding" - even if the member is gone. |
453 | - else |
|
454 | - echo ' |
|
483 | + else { |
|
484 | + echo ' |
|
455 | 485 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>'; |
486 | + } |
|
456 | 487 | } |
457 | 488 | echo ' |
458 | 489 | <li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>'; |
459 | 490 | |
460 | - if (empty($context['display_mode'])) |
|
461 | - echo ' |
|
491 | + if (empty($context['display_mode'])) { |
|
492 | + echo ' |
|
462 | 493 | <li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;" class="input_check"></li>'; |
494 | + } |
|
463 | 495 | |
464 | 496 | echo ' |
465 | 497 | </ul>'; |
466 | 498 | |
467 | - if ($message['can_report'] || $context['can_send_pm']) |
|
468 | - echo ' |
|
499 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
500 | + echo ' |
|
469 | 501 | </div>'; |
502 | + } |
|
470 | 503 | |
471 | 504 | // Are there any custom profile fields for above the signature? |
472 | 505 | if (!empty($message['custom_fields']['above_signature'])) |
@@ -475,9 +508,10 @@ discard block |
||
475 | 508 | <div class="custom_fields_above_signature"> |
476 | 509 | <ul class="nolist">'; |
477 | 510 | |
478 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
479 | - echo ' |
|
511 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
512 | + echo ' |
|
480 | 513 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
514 | + } |
|
481 | 515 | |
482 | 516 | echo ' |
483 | 517 | </ul> |
@@ -485,9 +519,10 @@ discard block |
||
485 | 519 | } |
486 | 520 | |
487 | 521 | // Show the member's signature? |
488 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
489 | - echo ' |
|
522 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
523 | + echo ' |
|
490 | 524 | <div class="signature">', $message['member']['signature'], '</div>'; |
525 | + } |
|
491 | 526 | |
492 | 527 | // Are there any custom profile fields for below the signature? |
493 | 528 | if (!empty($message['custom_fields']['below_signature'])) |
@@ -496,9 +531,10 @@ discard block |
||
496 | 531 | <div class="custom_fields_below_signature"> |
497 | 532 | <ul class="nolist">'; |
498 | 533 | |
499 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
500 | - echo ' |
|
534 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
535 | + echo ' |
|
501 | 536 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
537 | + } |
|
502 | 538 | |
503 | 539 | echo ' |
504 | 540 | </ul> |
@@ -523,19 +559,21 @@ discard block |
||
523 | 559 | { |
524 | 560 | echo ' |
525 | 561 | <option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>'; |
526 | - foreach ($context['labels'] as $label) |
|
527 | - if (!isset($message['labels'][$label['id']])) |
|
562 | + foreach ($context['labels'] as $label) { |
|
563 | + if (!isset($message['labels'][$label['id']])) |
|
528 | 564 | echo ' |
529 | 565 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
566 | + } |
|
530 | 567 | } |
531 | 568 | // ... and are there any that can be removed? |
532 | 569 | if (!empty($message['labels']) && (count($message['labels']) > 1 || !isset($message['labels'][-1]))) |
533 | 570 | { |
534 | 571 | echo ' |
535 | 572 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
536 | - foreach ($message['labels'] as $label) |
|
537 | - echo ' |
|
573 | + foreach ($message['labels'] as $label) { |
|
574 | + echo ' |
|
538 | 575 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
576 | + } |
|
539 | 577 | } |
540 | 578 | echo ' |
541 | 579 | </select> |
@@ -555,13 +593,14 @@ discard block |
||
555 | 593 | </div>'; |
556 | 594 | } |
557 | 595 | |
558 | - if (empty($context['display_mode'])) |
|
559 | - echo ' |
|
596 | + if (empty($context['display_mode'])) { |
|
597 | + echo ' |
|
560 | 598 | |
561 | 599 | <div class="pagesection"> |
562 | 600 | <div class="floatleft">', $context['page_index'], '</div> |
563 | 601 | <div class="floatright"><input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button_submit"></div> |
564 | 602 | </div>'; |
603 | + } |
|
565 | 604 | |
566 | 605 | // Show a few buttons if we are in conversation mode and outputting the first message. |
567 | 606 | elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons'])) |
@@ -621,11 +660,12 @@ discard block |
||
621 | 660 | </tr> |
622 | 661 | </thead> |
623 | 662 | <tbody>'; |
624 | - if (!$context['show_delete']) |
|
625 | - echo ' |
|
663 | + if (!$context['show_delete']) { |
|
664 | + echo ' |
|
626 | 665 | <tr class="windowbg"> |
627 | 666 | <td colspan="5">', $txt['pm_alert_none'], '</td> |
628 | 667 | </tr>'; |
668 | + } |
|
629 | 669 | |
630 | 670 | while ($message = $context['get_pmessage']('subject')) |
631 | 671 | { |
@@ -678,9 +718,10 @@ discard block |
||
678 | 718 | |
679 | 719 | foreach ($context['labels'] as $label) |
680 | 720 | { |
681 | - if ($label['id'] != $context['current_label_id']) |
|
682 | - echo ' |
|
721 | + if ($label['id'] != $context['current_label_id']) { |
|
722 | + echo ' |
|
683 | 723 | <option value="add_', $label['id'], '"> ', $label['name'], '</option>'; |
724 | + } |
|
684 | 725 | } |
685 | 726 | |
686 | 727 | echo ' |
@@ -765,9 +806,10 @@ discard block |
||
765 | 806 | <dt class="between">', $txt['pm_search_post_age'], ':</dt> |
766 | 807 | <dd>', $txt['pm_search_between'], ' <input type="number" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999"> ', $txt['pm_search_between_and'], ' <input type="number" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd> |
767 | 808 | </dl>'; |
768 | - if (!$context['currently_using_labels']) |
|
769 | - echo ' |
|
809 | + if (!$context['currently_using_labels']) { |
|
810 | + echo ' |
|
770 | 811 | <input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button_submit">'; |
812 | + } |
|
771 | 813 | echo ' |
772 | 814 | <br class="clear_right"> |
773 | 815 | </div> |
@@ -787,12 +829,13 @@ discard block |
||
787 | 829 | <div id="advanced_panel_div"> |
788 | 830 | <ul id="searchLabelsExpand">'; |
789 | 831 | |
790 | - foreach ($context['search_labels'] as $label) |
|
791 | - echo ' |
|
832 | + foreach ($context['search_labels'] as $label) { |
|
833 | + echo ' |
|
792 | 834 | <li> |
793 | 835 | <label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', ' class="input_check"> |
794 | 836 | ', $label['name'], '</label> |
795 | 837 | </li>'; |
838 | + } |
|
796 | 839 | |
797 | 840 | echo ' |
798 | 841 | </ul> |
@@ -852,8 +895,8 @@ discard block |
||
852 | 895 | </div>'; |
853 | 896 | |
854 | 897 | // complete results ? |
855 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
856 | - echo ' |
|
898 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
899 | + echo ' |
|
857 | 900 | <table class="table_grid"> |
858 | 901 | <thead> |
859 | 902 | <tr class="title_bar"> |
@@ -863,6 +906,7 @@ discard block |
||
863 | 906 | </tr> |
864 | 907 | </thead> |
865 | 908 | <tbody>'; |
909 | + } |
|
866 | 910 | |
867 | 911 | // Print each message out... |
868 | 912 | foreach ($context['personal_messages'] as $message) |
@@ -882,11 +926,13 @@ discard block |
||
882 | 926 | |
883 | 927 | // Show the recipients. |
884 | 928 | // @todo This doesn't deal with the sent item searching quite right for bcc. |
885 | - if (!empty($message['recipients']['to'])) |
|
886 | - echo implode(', ', $message['recipients']['to']); |
|
929 | + if (!empty($message['recipients']['to'])) { |
|
930 | + echo implode(', ', $message['recipients']['to']); |
|
931 | + } |
|
887 | 932 | // Otherwise, we're just going to say "some people"... |
888 | - elseif ($context['folder'] != 'sent') |
|
889 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
933 | + elseif ($context['folder'] != 'sent') { |
|
934 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
935 | + } |
|
890 | 936 | |
891 | 937 | echo ' |
892 | 938 | </h3> |
@@ -900,14 +946,16 @@ discard block |
||
900 | 946 | $quote_button = create_button('quote.png', 'reply_quote', 'reply_quote', 'class="centericon"'); |
901 | 947 | $reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"'); |
902 | 948 | // You can only reply if they are not a guest... |
903 | - if (!$message['member']['is_guest']) |
|
904 | - echo ' |
|
949 | + if (!$message['member']['is_guest']) { |
|
950 | + echo ' |
|
905 | 951 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
906 | 952 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
953 | + } |
|
907 | 954 | // This is for "forwarding" - even if the member is gone. |
908 | - else |
|
909 | - echo ' |
|
955 | + else { |
|
956 | + echo ' |
|
910 | 957 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
958 | + } |
|
911 | 959 | } |
912 | 960 | |
913 | 961 | echo ' |
@@ -928,17 +976,19 @@ discard block |
||
928 | 976 | } |
929 | 977 | |
930 | 978 | // Finish off the page... |
931 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
932 | - echo ' |
|
979 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
980 | + echo ' |
|
933 | 981 | </tbody> |
934 | 982 | </table>'; |
983 | + } |
|
935 | 984 | |
936 | 985 | // No results? |
937 | - if (empty($context['personal_messages'])) |
|
938 | - echo ' |
|
986 | + if (empty($context['personal_messages'])) { |
|
987 | + echo ' |
|
939 | 988 | <div class="windowbg"> |
940 | 989 | <p class="centertext">', $txt['pm_search_none_found'], '</p> |
941 | 990 | </div>'; |
991 | + } |
|
942 | 992 | |
943 | 993 | echo ' |
944 | 994 | <div class="pagesection"> |
@@ -962,12 +1012,14 @@ discard block |
||
962 | 1012 | <h3 class="catbg">', $txt['pm_send_report'], '</h3> |
963 | 1013 | </div> |
964 | 1014 | <div class="windowbg">'; |
965 | - if (!empty($context['send_log']['sent'])) |
|
966 | - foreach ($context['send_log']['sent'] as $log_entry) |
|
1015 | + if (!empty($context['send_log']['sent'])) { |
|
1016 | + foreach ($context['send_log']['sent'] as $log_entry) |
|
967 | 1017 | echo '<span class="error">', $log_entry, '</span><br>'; |
968 | - if (!empty($context['send_log']['failed'])) |
|
969 | - foreach ($context['send_log']['failed'] as $log_entry) |
|
1018 | + } |
|
1019 | + if (!empty($context['send_log']['failed'])) { |
|
1020 | + foreach ($context['send_log']['failed'] as $log_entry) |
|
970 | 1021 | echo '<span class="error">', $log_entry, '</span><br>'; |
1022 | + } |
|
971 | 1023 | echo ' |
972 | 1024 | </div> |
973 | 1025 | <br>'; |
@@ -1015,12 +1067,13 @@ discard block |
||
1015 | 1067 | </dl> |
1016 | 1068 | </div>'; |
1017 | 1069 | |
1018 | - if (!empty($modSettings['drafts_pm_enabled'])) |
|
1019 | - echo ' |
|
1070 | + if (!empty($modSettings['drafts_pm_enabled'])) { |
|
1071 | + echo ' |
|
1020 | 1072 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
1021 | 1073 | sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), ' |
1022 | 1074 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
1023 | 1075 | </div>'; |
1076 | + } |
|
1024 | 1077 | |
1025 | 1078 | echo ' |
1026 | 1079 | <dl id="post_header">'; |
@@ -1075,9 +1128,10 @@ discard block |
||
1075 | 1128 | } |
1076 | 1129 | |
1077 | 1130 | // What about smileys? |
1078 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
1079 | - echo ' |
|
1131 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
1132 | + echo ' |
|
1080 | 1133 | <div id="smileyBox_message"></div>'; |
1134 | + } |
|
1081 | 1135 | |
1082 | 1136 | // Show BBC buttons, smileys and textbox. |
1083 | 1137 | echo ' |
@@ -1124,10 +1178,11 @@ discard block |
||
1124 | 1178 | <dt><strong>', $txt['subject'], '</strong></dt> |
1125 | 1179 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
1126 | 1180 | |
1127 | - foreach ($context['drafts'] as $draft) |
|
1128 | - echo ' |
|
1181 | + foreach ($context['drafts'] as $draft) { |
|
1182 | + echo ' |
|
1129 | 1183 | <dt>', $draft['link'], '</dt> |
1130 | 1184 | <dd>', $draft['poster_time'], '</dd>'; |
1185 | + } |
|
1131 | 1186 | echo ' |
1132 | 1187 | </dl> |
1133 | 1188 | </div>'; |
@@ -1233,8 +1288,8 @@ discard block |
||
1233 | 1288 | }'; |
1234 | 1289 | |
1235 | 1290 | // Code for showing and hiding drafts |
1236 | - if (!empty($context['drafts'])) |
|
1237 | - echo ' |
|
1291 | + if (!empty($context['drafts'])) { |
|
1292 | + echo ' |
|
1238 | 1293 | var oSwapDraftOptions = new smc_Toggle({ |
1239 | 1294 | bToggleEnabled: true, |
1240 | 1295 | bCurrentlyCollapsed: true, |
@@ -1256,13 +1311,14 @@ discard block |
||
1256 | 1311 | } |
1257 | 1312 | ] |
1258 | 1313 | });'; |
1314 | + } |
|
1259 | 1315 | |
1260 | 1316 | echo ' |
1261 | 1317 | </script>'; |
1262 | 1318 | |
1263 | 1319 | // Show the message you're replying to. |
1264 | - if ($context['reply']) |
|
1265 | - echo ' |
|
1320 | + if ($context['reply']) { |
|
1321 | + echo ' |
|
1266 | 1322 | <br> |
1267 | 1323 | <br> |
1268 | 1324 | <div class="cat_bar"> |
@@ -1276,6 +1332,7 @@ discard block |
||
1276 | 1332 | <hr> |
1277 | 1333 | ', $context['quoted_message']['body'], ' |
1278 | 1334 | </div><br class="clear">'; |
1335 | + } |
|
1279 | 1336 | |
1280 | 1337 | echo ' |
1281 | 1338 | <script> |
@@ -1286,22 +1343,24 @@ discard block |
||
1286 | 1343 | sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', |
1287 | 1344 | sToControlId: \'to_control\', |
1288 | 1345 | aToRecipients: ['; |
1289 | - foreach ($context['recipients']['to'] as $i => $member) |
|
1290 | - echo ' |
|
1346 | + foreach ($context['recipients']['to'] as $i => $member) { |
|
1347 | + echo ' |
|
1291 | 1348 | { |
1292 | 1349 | sItemId: ', JavaScriptEscape($member['id']), ', |
1293 | 1350 | sItemName: ', JavaScriptEscape($member['name']), ' |
1294 | 1351 | }', $i == count($context['recipients']['to']) - 1 ? '' : ','; |
1352 | + } |
|
1295 | 1353 | |
1296 | 1354 | echo ' |
1297 | 1355 | ], |
1298 | 1356 | aBccRecipients: ['; |
1299 | - foreach ($context['recipients']['bcc'] as $i => $member) |
|
1300 | - echo ' |
|
1357 | + foreach ($context['recipients']['bcc'] as $i => $member) { |
|
1358 | + echo ' |
|
1301 | 1359 | { |
1302 | 1360 | sItemId: ', JavaScriptEscape($member['id']), ', |
1303 | 1361 | sItemName: ', JavaScriptEscape($member['name']), ' |
1304 | 1362 | }', $i == count($context['recipients']['bcc']) - 1 ? '' : ','; |
1363 | + } |
|
1305 | 1364 | |
1306 | 1365 | echo ' |
1307 | 1366 | ], |
@@ -1388,26 +1447,28 @@ discard block |
||
1388 | 1447 | </th> |
1389 | 1448 | <th class="centertext table_icon">'; |
1390 | 1449 | |
1391 | - if (count($context['labels']) > 2) |
|
1392 | - echo ' |
|
1450 | + if (count($context['labels']) > 2) { |
|
1451 | + echo ' |
|
1393 | 1452 | <input type="checkbox" class="input_check" onclick="invertAll(this, this.form);">'; |
1453 | + } |
|
1394 | 1454 | |
1395 | 1455 | echo ' |
1396 | 1456 | </th> |
1397 | 1457 | </tr> |
1398 | 1458 | </thead> |
1399 | 1459 | <tbody>'; |
1400 | - if (count($context['labels']) < 2) |
|
1401 | - echo ' |
|
1460 | + if (count($context['labels']) < 2) { |
|
1461 | + echo ' |
|
1402 | 1462 | <tr class="windowbg"> |
1403 | 1463 | <td colspan="2">', $txt['pm_labels_no_exist'], '</td> |
1404 | 1464 | </tr>'; |
1405 | - else |
|
1465 | + } else |
|
1406 | 1466 | { |
1407 | 1467 | foreach ($context['labels'] as $label) |
1408 | 1468 | { |
1409 | - if ($label['id'] == -1) |
|
1410 | - continue; |
|
1469 | + if ($label['id'] == -1) { |
|
1470 | + continue; |
|
1471 | + } |
|
1411 | 1472 | |
1412 | 1473 | echo ' |
1413 | 1474 | <tr class="windowbg"> |
@@ -1422,12 +1483,13 @@ discard block |
||
1422 | 1483 | </tbody> |
1423 | 1484 | </table>'; |
1424 | 1485 | |
1425 | - if (!count($context['labels']) < 2) |
|
1426 | - echo ' |
|
1486 | + if (!count($context['labels']) < 2) { |
|
1487 | + echo ' |
|
1427 | 1488 | <div class="padding"> |
1428 | 1489 | <input type="submit" name="save" value="', $txt['save'], '" class="button_submit"> |
1429 | 1490 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button_submit you_sure"> |
1430 | 1491 | </div>'; |
1492 | + } |
|
1431 | 1493 | |
1432 | 1494 | echo ' |
1433 | 1495 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1482,9 +1544,10 @@ discard block |
||
1482 | 1544 | <dd> |
1483 | 1545 | <select name="id_admin"> |
1484 | 1546 | <option value="0">', $txt['pm_report_all_admins'], '</option>'; |
1485 | - foreach ($context['admins'] as $id => $name) |
|
1486 | - echo ' |
|
1547 | + foreach ($context['admins'] as $id => $name) { |
|
1548 | + echo ' |
|
1487 | 1549 | <option value="', $id, '">', $name, '</option>'; |
1550 | + } |
|
1488 | 1551 | echo ' |
1489 | 1552 | </select> |
1490 | 1553 | </dd>'; |
@@ -1546,9 +1609,10 @@ discard block |
||
1546 | 1609 | </th> |
1547 | 1610 | <th class="centertext table_icon">'; |
1548 | 1611 | |
1549 | - if (!empty($context['rules'])) |
|
1550 | - echo ' |
|
1612 | + if (!empty($context['rules'])) { |
|
1613 | + echo ' |
|
1551 | 1614 | <input type="checkbox" onclick="invertAll(this, this.form);" class="input_check">'; |
1615 | + } |
|
1552 | 1616 | |
1553 | 1617 | echo ' |
1554 | 1618 | </th> |
@@ -1556,13 +1620,14 @@ discard block |
||
1556 | 1620 | </thead> |
1557 | 1621 | <tbody>'; |
1558 | 1622 | |
1559 | - if (empty($context['rules'])) |
|
1560 | - echo ' |
|
1623 | + if (empty($context['rules'])) { |
|
1624 | + echo ' |
|
1561 | 1625 | <tr class="windowbg"> |
1562 | 1626 | <td colspan="2"> |
1563 | 1627 | ', $txt['pm_rules_none'], ' |
1564 | 1628 | </td> |
1565 | 1629 | </tr>'; |
1630 | + } |
|
1566 | 1631 | |
1567 | 1632 | foreach ($context['rules'] as $rule) |
1568 | 1633 | { |
@@ -1583,14 +1648,16 @@ discard block |
||
1583 | 1648 | <div class="righttext"> |
1584 | 1649 | <a class="button_link" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>'; |
1585 | 1650 | |
1586 | - if (!empty($context['rules'])) |
|
1587 | - echo ' |
|
1651 | + if (!empty($context['rules'])) { |
|
1652 | + echo ' |
|
1588 | 1653 | [<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]'; |
1654 | + } |
|
1589 | 1655 | |
1590 | - if (!empty($context['rules'])) |
|
1591 | - echo ' |
|
1656 | + if (!empty($context['rules'])) { |
|
1657 | + echo ' |
|
1592 | 1658 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1593 | 1659 | <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button_submit smalltext you_sure">'; |
1660 | + } |
|
1594 | 1661 | |
1595 | 1662 | echo ' |
1596 | 1663 | </div> |
@@ -1612,14 +1679,16 @@ discard block |
||
1612 | 1679 | var groups = new Array() |
1613 | 1680 | var labels = new Array()'; |
1614 | 1681 | |
1615 | - foreach ($context['groups'] as $id => $title) |
|
1616 | - echo ' |
|
1682 | + foreach ($context['groups'] as $id => $title) { |
|
1683 | + echo ' |
|
1617 | 1684 | groups[', $id, '] = "', addslashes($title), '";'; |
1685 | + } |
|
1618 | 1686 | |
1619 | - foreach ($context['labels'] as $label) |
|
1620 | - if ($label['id'] != -1) |
|
1687 | + foreach ($context['labels'] as $label) { |
|
1688 | + if ($label['id'] != -1) |
|
1621 | 1689 | echo ' |
1622 | 1690 | labels[', ($label['id']), '] = "', addslashes($label['name']), '";'; |
1691 | + } |
|
1623 | 1692 | |
1624 | 1693 | echo ' |
1625 | 1694 | function addCriteriaOption() |
@@ -1634,8 +1703,9 @@ discard block |
||
1634 | 1703 | |
1635 | 1704 | setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select> <span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value="" class="input_text"><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>'; |
1636 | 1705 | |
1637 | - foreach ($context['groups'] as $id => $group) |
|
1638 | - echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
1706 | + foreach ($context['groups'] as $id => $group) { |
|
1707 | + echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
1708 | + } |
|
1639 | 1709 | |
1640 | 1710 | echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\'); |
1641 | 1711 | } |
@@ -1652,9 +1722,10 @@ discard block |
||
1652 | 1722 | |
1653 | 1723 | setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select> <span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>'; |
1654 | 1724 | |
1655 | - foreach ($context['labels'] as $label) |
|
1656 | - if ($label['id'] != -1) |
|
1725 | + foreach ($context['labels'] as $label) { |
|
1726 | + if ($label['id'] != -1) |
|
1657 | 1727 | echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>'; |
1728 | + } |
|
1658 | 1729 | |
1659 | 1730 | echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\'); |
1660 | 1731 | } |
@@ -1768,18 +1839,20 @@ discard block |
||
1768 | 1839 | $isFirst = true; |
1769 | 1840 | foreach ($context['rule']['criteria'] as $k => $criteria) |
1770 | 1841 | { |
1771 | - if (!$isFirst && $criteria['t'] == '') |
|
1772 | - echo '<div id="removeonjs1">'; |
|
1773 | - elseif (!$isFirst) |
|
1774 | - echo '<br>'; |
|
1842 | + if (!$isFirst && $criteria['t'] == '') { |
|
1843 | + echo '<div id="removeonjs1">'; |
|
1844 | + } elseif (!$isFirst) { |
|
1845 | + echo '<br>'; |
|
1846 | + } |
|
1775 | 1847 | |
1776 | 1848 | echo ' |
1777 | 1849 | <select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();"> |
1778 | 1850 | <option value="">', $txt['pm_rule_criteria_pick'], ':</option>'; |
1779 | 1851 | |
1780 | - foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) |
|
1781 | - echo ' |
|
1852 | + foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) { |
|
1853 | + echo ' |
|
1782 | 1854 | <option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>'; |
1855 | + } |
|
1783 | 1856 | |
1784 | 1857 | echo ' |
1785 | 1858 | </select> |
@@ -1790,18 +1863,20 @@ discard block |
||
1790 | 1863 | <select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();"> |
1791 | 1864 | <option value="">', $txt['pm_rule_sel_group'], '</option>'; |
1792 | 1865 | |
1793 | - foreach ($context['groups'] as $id => $group) |
|
1794 | - echo ' |
|
1866 | + foreach ($context['groups'] as $id => $group) { |
|
1867 | + echo ' |
|
1795 | 1868 | <option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>'; |
1869 | + } |
|
1796 | 1870 | echo ' |
1797 | 1871 | </select> |
1798 | 1872 | </span>'; |
1799 | 1873 | |
1800 | 1874 | // If this is the dummy we add a means to hide for non js users. |
1801 | - if ($isFirst) |
|
1802 | - $isFirst = false; |
|
1803 | - elseif ($criteria['t'] == '') |
|
1804 | - echo '</div>'; |
|
1875 | + if ($isFirst) { |
|
1876 | + $isFirst = false; |
|
1877 | + } elseif ($criteria['t'] == '') { |
|
1878 | + echo '</div>'; |
|
1879 | + } |
|
1805 | 1880 | } |
1806 | 1881 | |
1807 | 1882 | echo ' |
@@ -1824,10 +1899,11 @@ discard block |
||
1824 | 1899 | $isFirst = true; |
1825 | 1900 | foreach ($context['rule']['actions'] as $k => $action) |
1826 | 1901 | { |
1827 | - if (!$isFirst && $action['t'] == '') |
|
1828 | - echo '<div id="removeonjs2">'; |
|
1829 | - elseif (!$isFirst) |
|
1830 | - echo '<br>'; |
|
1902 | + if (!$isFirst && $action['t'] == '') { |
|
1903 | + echo '<div id="removeonjs2">'; |
|
1904 | + } elseif (!$isFirst) { |
|
1905 | + echo '<br>'; |
|
1906 | + } |
|
1831 | 1907 | |
1832 | 1908 | echo ' |
1833 | 1909 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
@@ -1838,20 +1914,22 @@ discard block |
||
1838 | 1914 | <span id="labdiv', $k, '"> |
1839 | 1915 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
1840 | 1916 | <option value="">', $txt['pm_rule_sel_label'], '</option>'; |
1841 | - foreach ($context['labels'] as $label) |
|
1842 | - if ($label['id'] != -1) |
|
1917 | + foreach ($context['labels'] as $label) { |
|
1918 | + if ($label['id'] != -1) |
|
1843 | 1919 | echo ' |
1844 | 1920 | <option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>'; |
1921 | + } |
|
1845 | 1922 | |
1846 | 1923 | echo ' |
1847 | 1924 | </select> |
1848 | 1925 | </span>'; |
1849 | 1926 | |
1850 | - if ($isFirst) |
|
1851 | - $isFirst = false; |
|
1852 | - elseif ($action['t'] == '') |
|
1853 | - echo ' |
|
1927 | + if ($isFirst) { |
|
1928 | + $isFirst = false; |
|
1929 | + } elseif ($action['t'] == '') { |
|
1930 | + echo ' |
|
1854 | 1931 | </div>'; |
1932 | + } |
|
1855 | 1933 | } |
1856 | 1934 | |
1857 | 1935 | echo ' |
@@ -1875,22 +1953,25 @@ discard block |
||
1875 | 1953 | echo ' |
1876 | 1954 | <script>'; |
1877 | 1955 | |
1878 | - foreach ($context['rule']['criteria'] as $k => $c) |
|
1879 | - echo ' |
|
1956 | + foreach ($context['rule']['criteria'] as $k => $c) { |
|
1957 | + echo ' |
|
1880 | 1958 | updateRuleDef(', $k, ');'; |
1959 | + } |
|
1881 | 1960 | |
1882 | - foreach ($context['rule']['actions'] as $k => $c) |
|
1883 | - echo ' |
|
1961 | + foreach ($context['rule']['actions'] as $k => $c) { |
|
1962 | + echo ' |
|
1884 | 1963 | updateActionDef(', $k, ');'; |
1964 | + } |
|
1885 | 1965 | |
1886 | 1966 | echo ' |
1887 | 1967 | rebuildRuleDesc();'; |
1888 | 1968 | |
1889 | 1969 | // If this isn't a new rule and we have JS enabled remove the JS compatibility stuff. |
1890 | - if ($context['rid']) |
|
1891 | - echo ' |
|
1970 | + if ($context['rid']) { |
|
1971 | + echo ' |
|
1892 | 1972 | document.getElementById("removeonjs1").style.display = "none"; |
1893 | 1973 | document.getElementById("removeonjs2").style.display = "none";'; |
1974 | + } |
|
1894 | 1975 | |
1895 | 1976 | echo ' |
1896 | 1977 | document.getElementById("addonjs1").style.display = ""; |
@@ -1918,12 +1999,12 @@ discard block |
||
1918 | 1999 | </div>'; |
1919 | 2000 | |
1920 | 2001 | // No drafts? Just show an informative message. |
1921 | - if (empty($context['drafts'])) |
|
1922 | - echo ' |
|
2002 | + if (empty($context['drafts'])) { |
|
2003 | + echo ' |
|
1923 | 2004 | <div class="windowbg2 centertext"> |
1924 | 2005 | ', $txt['draft_none'], ' |
1925 | 2006 | </div>'; |
1926 | - else |
|
2007 | + } else |
|
1927 | 2008 | { |
1928 | 2009 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
1929 | 2010 | foreach ($context['drafts'] as $draft) |
@@ -116,9 +116,10 @@ discard block |
||
116 | 116 | <h3 class="catbg">', $txt['attachment_transfer'], '</h3> |
117 | 117 | </div>'; |
118 | 118 | |
119 | - if (!empty($context['results'])) |
|
120 | - echo ' |
|
119 | + if (!empty($context['results'])) { |
|
120 | + echo ' |
|
121 | 121 | <div class="noticebox">', $context['results'], '</div>'; |
122 | + } |
|
122 | 123 | |
123 | 124 | echo ' |
124 | 125 | <div class="windowbg2 noup"> |
@@ -129,9 +130,10 @@ discard block |
||
129 | 130 | <dd><select name="from"> |
130 | 131 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
131 | 132 | |
132 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
133 | - echo ' |
|
133 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
134 | + echo ' |
|
134 | 135 | <option value="', $id, '">', $dir, '</option>'; |
136 | + } |
|
135 | 137 | echo ' |
136 | 138 | </select></dd> |
137 | 139 | <dt>', $txt['attachment_transfer_auto'], '</dt> |
@@ -139,13 +141,14 @@ discard block |
||
139 | 141 | <option value="0">', $txt['attachment_transfer_auto_select'], '</option> |
140 | 142 | <option value="-1">', $txt['attachment_transfer_forum_root'], '</option>'; |
141 | 143 | |
142 | - if (!empty($context['base_dirs'])) |
|
143 | - foreach ($context['base_dirs'] as $id => $dir) |
|
144 | + if (!empty($context['base_dirs'])) { |
|
145 | + foreach ($context['base_dirs'] as $id => $dir) |
|
144 | 146 | echo ' |
145 | 147 | <option value="', $id, '">', $dir, '</option>'; |
146 | - else |
|
147 | - echo ' |
|
148 | + } else { |
|
149 | + echo ' |
|
148 | 150 | <option value="0" disabled>', $txt['attachment_transfer_no_base'], '</option>'; |
151 | + } |
|
149 | 152 | |
150 | 153 | echo ' |
151 | 154 | </select></dd> |
@@ -153,16 +156,18 @@ discard block |
||
153 | 156 | <dd><select name="to"> |
154 | 157 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
155 | 158 | |
156 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
157 | - echo ' |
|
159 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
160 | + echo ' |
|
158 | 161 | <option value="', $id, '">', $dir, '</option>'; |
162 | + } |
|
159 | 163 | echo ' |
160 | 164 | </select></dd>'; |
161 | 165 | |
162 | - if (!empty($modSettings['attachmentDirFileLimit'])) |
|
163 | - echo ' |
|
166 | + if (!empty($modSettings['attachmentDirFileLimit'])) { |
|
167 | + echo ' |
|
164 | 168 | <dt>', $txt['attachment_transfer_empty'], '</dt> |
165 | 169 | <dd><input type="checkbox" name="empty_it"', $context['checked'] ? ' checked' : '', '></dd>'; |
170 | + } |
|
166 | 171 | echo ' |
167 | 172 | </dl> |
168 | 173 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -238,10 +243,11 @@ discard block |
||
238 | 243 | // Loop through each error reporting the status |
239 | 244 | foreach ($context['repair_errors'] as $error => $number) |
240 | 245 | { |
241 | - if (!empty($number)) |
|
242 | - echo ' |
|
246 | + if (!empty($number)) { |
|
247 | + echo ' |
|
243 | 248 | <input type="checkbox" name="to_fix[]" id="', $error, '" value="', $error, '" class="input_check"> |
244 | 249 | <label for="', $error, '">', sprintf($txt['attach_repair_' . $error], $number), '</label><br>'; |
250 | + } |
|
245 | 251 | } |
246 | 252 | |
247 | 253 | echo ' <br> |