@@ -232,7 +232,7 @@ |
||
| 232 | 232 | // In maintenance mode, only login is allowed and don't show OverlayDiv |
| 233 | 233 | echo ' |
| 234 | 234 | <ul class="floatleft welcome"> |
| 235 | - <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li> |
|
| 235 | + <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl . '?action=login', 'return true;'), '</li> |
|
| 236 | 236 | </ul>'; |
| 237 | 237 | |
| 238 | 238 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
@@ -72,9 +72,10 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // Allow css/js files to be disabled for this specific theme. |
| 74 | 74 | // Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference. |
| 75 | - if (!isset($settings['disable_files'])) |
|
| 76 | - $settings['disable_files'] = array(); |
|
| 77 | -} |
|
| 75 | + if (!isset($settings['disable_files'])) { |
|
| 76 | + $settings['disable_files'] = array(); |
|
| 77 | + } |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | /** |
| 80 | 81 | * The main sub template above the content. |
@@ -112,8 +113,9 @@ discard block |
||
| 112 | 113 | echo ' |
| 113 | 114 | <meta'; |
| 114 | 115 | |
| 115 | - foreach ($meta_tag as $meta_key => $meta_value) |
|
| 116 | - echo ' ', $meta_key, '="', $meta_value, '"'; |
|
| 116 | + foreach ($meta_tag as $meta_key => $meta_value) { |
|
| 117 | + echo ' ', $meta_key, '="', $meta_value, '"'; |
|
| 118 | + } |
|
| 117 | 119 | |
| 118 | 120 | echo '>'; |
| 119 | 121 | } |
@@ -124,14 +126,16 @@ discard block |
||
| 124 | 126 | <meta name="theme-color" content="#557EA0">'; |
| 125 | 127 | |
| 126 | 128 | // Please don't index these Mr Robot. |
| 127 | - if (!empty($context['robot_no_index'])) |
|
| 128 | - echo ' |
|
| 129 | + if (!empty($context['robot_no_index'])) { |
|
| 130 | + echo ' |
|
| 129 | 131 | <meta name="robots" content="noindex">'; |
| 132 | + } |
|
| 130 | 133 | |
| 131 | 134 | // Present a canonical url for search engines to prevent duplicate content in their indices. |
| 132 | - if (!empty($context['canonical_url'])) |
|
| 133 | - echo ' |
|
| 135 | + if (!empty($context['canonical_url'])) { |
|
| 136 | + echo ' |
|
| 134 | 137 | <link rel="canonical" href="', $context['canonical_url'], '">'; |
| 138 | + } |
|
| 135 | 139 | |
| 136 | 140 | // Show all the relative links, such as help, search, contents, and the like. |
| 137 | 141 | echo ' |
@@ -140,10 +144,11 @@ discard block |
||
| 140 | 144 | <link rel="search" href="' . $scripturl . '?action=search">' : ''); |
| 141 | 145 | |
| 142 | 146 | // If RSS feeds are enabled, advertise the presence of one. |
| 143 | - if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) |
|
| 144 | - echo ' |
|
| 147 | + if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) { |
|
| 148 | + echo ' |
|
| 145 | 149 | <link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?action=.xml;type=rss2', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '"> |
| 146 | 150 | <link rel="alternate" type="application/atom+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?action=.xml;type=atom', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">'; |
| 151 | + } |
|
| 147 | 152 | |
| 148 | 153 | // If we're viewing a topic, these should be the previous and next topics, respectively. |
| 149 | 154 | if (!empty($context['links']['next'])) |
@@ -159,9 +164,10 @@ discard block |
||
| 159 | 164 | } |
| 160 | 165 | |
| 161 | 166 | // If we're in a board, or a topic for that matter, the index will be the board's index. |
| 162 | - if (!empty($context['current_board'])) |
|
| 163 | - echo ' |
|
| 167 | + if (!empty($context['current_board'])) { |
|
| 168 | + echo ' |
|
| 164 | 169 | <link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">'; |
| 170 | + } |
|
| 165 | 171 | |
| 166 | 172 | // Output any remaining HTML headers. (from mods, maybe?) |
| 167 | 173 | echo $context['html_headers']; |
@@ -193,8 +199,9 @@ discard block |
||
| 193 | 199 | <ul class="floatleft" id="top_info"> |
| 194 | 200 | <li> |
| 195 | 201 | <a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">'; |
| 196 | - if (!empty($context['user']['avatar'])) |
|
| 197 | - echo $context['user']['avatar']['image']; |
|
| 202 | + if (!empty($context['user']['avatar'])) { |
|
| 203 | + echo $context['user']['avatar']['image']; |
|
| 204 | + } |
|
| 198 | 205 | |
| 199 | 206 | echo $context['user']['name'], '</a> |
| 200 | 207 | <div id="profile_menu" class="top_menu"></div> |
@@ -223,17 +230,18 @@ discard block |
||
| 223 | 230 | } |
| 224 | 231 | // Otherwise they're a guest. Ask them to either register or login. |
| 225 | 232 | else |
| 226 | - if (empty($maintenance)) |
|
| 227 | - echo ' |
|
| 233 | + if (empty($maintenance)) { |
|
| 234 | + echo ' |
|
| 228 | 235 | <ul class="floatleft welcome"> |
| 229 | 236 | <li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li> |
| 230 | 237 | </ul>'; |
| 231 | - else |
|
| 232 | - // In maintenance mode, only login is allowed and don't show OverlayDiv |
|
| 238 | + } else { |
|
| 239 | + // In maintenance mode, only login is allowed and don't show OverlayDiv |
|
| 233 | 240 | echo ' |
| 234 | 241 | <ul class="floatleft welcome"> |
| 235 | 242 | <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li> |
| 236 | 243 | </ul>'; |
| 244 | + } |
|
| 237 | 245 | |
| 238 | 246 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
| 239 | 247 | { |
@@ -241,9 +249,10 @@ discard block |
||
| 241 | 249 | <form id="languages_form" method="get" class="floatright"> |
| 242 | 250 | <select id="language_select" name="language" onchange="this.form.submit()">'; |
| 243 | 251 | |
| 244 | - foreach ($context['languages'] as $language) |
|
| 245 | - echo ' |
|
| 252 | + foreach ($context['languages'] as $language) { |
|
| 253 | + echo ' |
|
| 246 | 254 | <option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>'; |
| 255 | + } |
|
| 247 | 256 | |
| 248 | 257 | echo ' |
| 249 | 258 | </select> |
@@ -267,31 +276,36 @@ discard block |
||
| 267 | 276 | <option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>'; |
| 268 | 277 | |
| 269 | 278 | // Can't limit it to a specific topic if we are not in one |
| 270 | - if (!empty($context['current_topic'])) |
|
| 271 | - echo ' |
|
| 279 | + if (!empty($context['current_topic'])) { |
|
| 280 | + echo ' |
|
| 272 | 281 | <option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>'; |
| 282 | + } |
|
| 273 | 283 | |
| 274 | 284 | // Can't limit it to a specific board if we are not in one |
| 275 | - if (!empty($context['current_board'])) |
|
| 276 | - echo ' |
|
| 285 | + if (!empty($context['current_board'])) { |
|
| 286 | + echo ' |
|
| 277 | 287 | <option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>'; |
| 288 | + } |
|
| 278 | 289 | |
| 279 | 290 | // Can't search for members if we can't see the memberlist |
| 280 | - if (!empty($context['allow_memberlist'])) |
|
| 281 | - echo ' |
|
| 291 | + if (!empty($context['allow_memberlist'])) { |
|
| 292 | + echo ' |
|
| 282 | 293 | <option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>'; |
| 294 | + } |
|
| 283 | 295 | |
| 284 | 296 | echo ' |
| 285 | 297 | </select>'; |
| 286 | 298 | |
| 287 | 299 | // Search within current topic? |
| 288 | - if (!empty($context['current_topic'])) |
|
| 289 | - echo ' |
|
| 300 | + if (!empty($context['current_topic'])) { |
|
| 301 | + echo ' |
|
| 290 | 302 | <input type="hidden" name="sd_topic" value="', $context['current_topic'], '">'; |
| 303 | + } |
|
| 291 | 304 | // If we're on a certain board, limit it to this board ;). |
| 292 | - elseif (!empty($context['current_board'])) |
|
| 293 | - echo ' |
|
| 305 | + elseif (!empty($context['current_board'])) { |
|
| 306 | + echo ' |
|
| 294 | 307 | <input type="hidden" name="sd_brd" value="', $context['current_board'], '">'; |
| 308 | + } |
|
| 295 | 309 | |
| 296 | 310 | echo ' |
| 297 | 311 | <input type="submit" name="search2" value="', $txt['search'], '" class="button"> |
@@ -323,12 +337,13 @@ discard block |
||
| 323 | 337 | </div>'; |
| 324 | 338 | |
| 325 | 339 | // Show a random news item? (or you could pick one from news_lines...) |
| 326 | - if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) |
|
| 327 | - echo ' |
|
| 340 | + if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) { |
|
| 341 | + echo ' |
|
| 328 | 342 | <div class="news"> |
| 329 | 343 | <h2>', $txt['news'], ': </h2> |
| 330 | 344 | <p>', $context['random_news_line'], '</p> |
| 331 | 345 | </div>'; |
| 346 | + } |
|
| 332 | 347 | |
| 333 | 348 | echo ' |
| 334 | 349 | <hr class="clear"> |
@@ -389,9 +404,10 @@ discard block |
||
| 389 | 404 | </ul>'; |
| 390 | 405 | |
| 391 | 406 | // Show the load time? |
| 392 | - if ($context['show_load_time']) |
|
| 393 | - echo ' |
|
| 407 | + if ($context['show_load_time']) { |
|
| 408 | + echo ' |
|
| 394 | 409 | <p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>'; |
| 410 | + } |
|
| 395 | 411 | |
| 396 | 412 | echo ' |
| 397 | 413 | </div> |
@@ -422,18 +438,20 @@ discard block |
||
| 422 | 438 | global $context, $shown_linktree, $scripturl, $txt; |
| 423 | 439 | |
| 424 | 440 | // If linktree is empty, just return - also allow an override. |
| 425 | - if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) |
|
| 426 | - return; |
|
| 441 | + if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) { |
|
| 442 | + return; |
|
| 443 | + } |
|
| 427 | 444 | echo ' |
| 428 | 445 | <div class="navigate_section"> |
| 429 | 446 | <ul>'; |
| 430 | 447 | |
| 431 | - if ($context['user']['is_logged']) |
|
| 432 | - echo ' |
|
| 448 | + if ($context['user']['is_logged']) { |
|
| 449 | + echo ' |
|
| 433 | 450 | <li class="unread_links"> |
| 434 | 451 | <a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a> |
| 435 | 452 | <a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a> |
| 436 | 453 | </li>'; |
| 454 | + } |
|
| 437 | 455 | |
| 438 | 456 | // Each tree item has a URL and name. Some may have extra_before and extra_after. |
| 439 | 457 | foreach ($context['linktree'] as $link_num => $tree) |
@@ -444,25 +462,29 @@ discard block |
||
| 444 | 462 | // Don't show a separator for the first one. |
| 445 | 463 | // Better here. Always points to the next level when the linktree breaks to a second line. |
| 446 | 464 | // Picked a better looking HTML entity, and added support for RTL plus a span for styling. |
| 447 | - if ($link_num != 0) |
|
| 448 | - echo ' |
|
| 465 | + if ($link_num != 0) { |
|
| 466 | + echo ' |
|
| 449 | 467 | <span class="dividers">', $context['right_to_left'] ? ' ◄ ' : ' ► ', '</span>'; |
| 468 | + } |
|
| 450 | 469 | |
| 451 | 470 | // Show something before the link? |
| 452 | - if (isset($tree['extra_before'])) |
|
| 453 | - echo $tree['extra_before'], ' '; |
|
| 471 | + if (isset($tree['extra_before'])) { |
|
| 472 | + echo $tree['extra_before'], ' '; |
|
| 473 | + } |
|
| 454 | 474 | |
| 455 | 475 | // Show the link, including a URL if it should have one. |
| 456 | - if (isset($tree['url'])) |
|
| 457 | - echo ' |
|
| 476 | + if (isset($tree['url'])) { |
|
| 477 | + echo ' |
|
| 458 | 478 | <a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>'; |
| 459 | - else |
|
| 460 | - echo ' |
|
| 479 | + } else { |
|
| 480 | + echo ' |
|
| 461 | 481 | <span>' . $tree['name'] . '</span>'; |
| 482 | + } |
|
| 462 | 483 | |
| 463 | 484 | // Show something after the link...? |
| 464 | - if (isset($tree['extra_after'])) |
|
| 465 | - echo ' ', $tree['extra_after']; |
|
| 485 | + if (isset($tree['extra_after'])) { |
|
| 486 | + echo ' ', $tree['extra_after']; |
|
| 487 | + } |
|
| 466 | 488 | |
| 467 | 489 | echo ' |
| 468 | 490 | </li>'; |
@@ -513,13 +535,14 @@ discard block |
||
| 513 | 535 | echo ' |
| 514 | 536 | <ul>'; |
| 515 | 537 | |
| 516 | - foreach ($childbutton['sub_buttons'] as $grandchildbutton) |
|
| 517 | - echo ' |
|
| 538 | + foreach ($childbutton['sub_buttons'] as $grandchildbutton) { |
|
| 539 | + echo ' |
|
| 518 | 540 | <li> |
| 519 | 541 | <a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '> |
| 520 | 542 | ', $grandchildbutton['title'], ' |
| 521 | 543 | </a> |
| 522 | 544 | </li>'; |
| 545 | + } |
|
| 523 | 546 | |
| 524 | 547 | echo ' |
| 525 | 548 | </ul>'; |
@@ -550,8 +573,9 @@ discard block |
||
| 550 | 573 | { |
| 551 | 574 | global $context, $txt; |
| 552 | 575 | |
| 553 | - if (!is_array($strip_options)) |
|
| 554 | - $strip_options = array(); |
|
| 576 | + if (!is_array($strip_options)) { |
|
| 577 | + $strip_options = array(); |
|
| 578 | + } |
|
| 555 | 579 | |
| 556 | 580 | // Create the buttons... |
| 557 | 581 | $buttons = array(); |
@@ -560,8 +584,9 @@ discard block |
||
| 560 | 584 | // As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!) |
| 561 | 585 | if (!isset($value['test']) || !empty($context[$value['test']])) |
| 562 | 586 | { |
| 563 | - if (!isset($value['id'])) |
|
| 564 | - $value['id'] = $key; |
|
| 587 | + if (!isset($value['id'])) { |
|
| 588 | + $value['id'] = $key; |
|
| 589 | + } |
|
| 565 | 590 | |
| 566 | 591 | $button = ' |
| 567 | 592 | <a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>'; |
@@ -574,13 +599,15 @@ discard block |
||
| 574 | 599 | <div class="overview">'; |
| 575 | 600 | foreach ($value['sub_buttons'] as $element) |
| 576 | 601 | { |
| 577 | - if (isset($element['test']) && empty($context[$element['test']])) |
|
| 578 | - continue; |
|
| 602 | + if (isset($element['test']) && empty($context[$element['test']])) { |
|
| 603 | + continue; |
|
| 604 | + } |
|
| 579 | 605 | |
| 580 | 606 | $button .= ' |
| 581 | 607 | <a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>'; |
| 582 | - if (isset($txt[$element['text'] . '_desc'])) |
|
| 583 | - $button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
| 608 | + if (isset($txt[$element['text'] . '_desc'])) { |
|
| 609 | + $button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
| 610 | + } |
|
| 584 | 611 | $button .= '</a>'; |
| 585 | 612 | } |
| 586 | 613 | $button .= ' |
@@ -594,8 +621,9 @@ discard block |
||
| 594 | 621 | } |
| 595 | 622 | |
| 596 | 623 | // No buttons? No button strip either. |
| 597 | - if (empty($buttons)) |
|
| 598 | - return; |
|
| 624 | + if (empty($buttons)) { |
|
| 625 | + return; |
|
| 626 | + } |
|
| 599 | 627 | |
| 600 | 628 | echo ' |
| 601 | 629 | <div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"' : ''), '> |
@@ -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> |
@@ -65,9 +66,10 @@ discard block |
||
| 65 | 66 | <span class="floatright">', $txt['package_available_readme_language'], ' |
| 66 | 67 | <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\'));">'; |
| 67 | 68 | |
| 68 | - foreach ($context['readmes'] as $a => $b) |
|
| 69 | - echo ' |
|
| 69 | + foreach ($context['readmes'] as $a => $b) { |
|
| 70 | + echo ' |
|
| 70 | 71 | <option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), '</option>'; |
| 72 | + } |
|
| 71 | 73 | |
| 72 | 74 | echo ' |
| 73 | 75 | </select> |
@@ -88,9 +90,10 @@ discard block |
||
| 88 | 90 | <span class="floatright">', $txt['package_available_license_language'], ' |
| 89 | 91 | <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\'));">'; |
| 90 | 92 | |
| 91 | - foreach ($context['licenses'] as $a => $b) |
|
| 92 | - echo ' |
|
| 93 | + foreach ($context['licenses'] as $a => $b) { |
|
| 94 | + echo ' |
|
| 93 | 95 | <option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_license_default'] : ucfirst($b), '</option>'; |
| 96 | + } |
|
| 94 | 97 | echo ' |
| 95 | 98 | </select> |
| 96 | 99 | </span> |
@@ -117,9 +120,10 @@ discard block |
||
| 117 | 120 | ', $txt['package_db_uninstall_actions'], ': |
| 118 | 121 | <ul>'; |
| 119 | 122 | |
| 120 | - foreach ($context['database_changes'] as $change) |
|
| 121 | - echo ' |
|
| 123 | + foreach ($context['database_changes'] as $change) { |
|
| 124 | + echo ' |
|
| 122 | 125 | <li>', $change, '</li>'; |
| 126 | + } |
|
| 123 | 127 | echo ' |
| 124 | 128 | </ul> |
| 125 | 129 | </div> |
@@ -129,14 +133,14 @@ discard block |
||
| 129 | 133 | echo ' |
| 130 | 134 | <div class="information">'; |
| 131 | 135 | |
| 132 | - if (empty($context['actions']) && empty($context['database_changes'])) |
|
| 133 | - echo ' |
|
| 136 | + if (empty($context['actions']) && empty($context['database_changes'])) { |
|
| 137 | + echo ' |
|
| 134 | 138 | <br> |
| 135 | 139 | <div class="errorbox"> |
| 136 | 140 | ', $txt['corrupt_compatible'], ' |
| 137 | 141 | </div> |
| 138 | 142 | </div><!-- .information -->'; |
| 139 | - else |
|
| 143 | + } else |
|
| 140 | 144 | { |
| 141 | 145 | echo ' |
| 142 | 146 | ', $txt['perform_actions'], ' |
@@ -241,9 +245,10 @@ discard block |
||
| 241 | 245 | <td></td> |
| 242 | 246 | <td>'; |
| 243 | 247 | |
| 244 | - if (!empty($context['themes_locked'])) |
|
| 245 | - echo ' |
|
| 248 | + if (!empty($context['themes_locked'])) { |
|
| 249 | + echo ' |
|
| 246 | 250 | <input type="hidden" name="custom_theme[]" value="', $id, '">'; |
| 251 | + } |
|
| 247 | 252 | echo ' |
| 248 | 253 | <input type="checkbox" name="custom_theme[]" id="custom_theme_', $id, '" value="', $id, '" 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' : '', '> |
| 249 | 254 | </td> |
@@ -385,14 +390,15 @@ discard block |
||
| 385 | 390 | </script>'; |
| 386 | 391 | |
| 387 | 392 | // And a bit more for database changes. |
| 388 | - if (!empty($context['database_changes'])) |
|
| 389 | - echo ' |
|
| 393 | + if (!empty($context['database_changes'])) { |
|
| 394 | + echo ' |
|
| 390 | 395 | <script> |
| 391 | 396 | var database_changes_area = document.getElementById(\'db_changes_div\'); |
| 392 | 397 | var db_vis = false; |
| 393 | 398 | database_changes_area.style.display = "none"; |
| 394 | 399 | </script>'; |
| 395 | -} |
|
| 400 | + } |
|
| 401 | + } |
|
| 396 | 402 | |
| 397 | 403 | /** |
| 398 | 404 | * Extract package contents |
@@ -424,12 +430,12 @@ discard block |
||
| 424 | 430 | <h3 class="catbg">', $context['uninstalling'] ? $txt['uninstall'] : $txt['extracting'], '</h3> |
| 425 | 431 | </div> |
| 426 | 432 | <div class="information">', $txt['package_installed_extract'], '</div>'; |
| 427 | - } |
|
| 428 | - else |
|
| 429 | - echo ' |
|
| 433 | + } else { |
|
| 434 | + echo ' |
|
| 430 | 435 | <div class="cat_bar"> |
| 431 | 436 | <h3 class="catbg">', $txt['package_installed_redirecting'], '</h3> |
| 432 | 437 | </div>'; |
| 438 | + } |
|
| 433 | 439 | |
| 434 | 440 | echo ' |
| 435 | 441 | <div class="windowbg">'; |
@@ -440,28 +446,25 @@ discard block |
||
| 440 | 446 | echo ' |
| 441 | 447 | ', $context['redirect_text'], '<br><br> |
| 442 | 448 | <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>'; |
| 443 | - } |
|
| 444 | - elseif ($context['uninstalling']) |
|
| 445 | - echo ' |
|
| 449 | + } elseif ($context['uninstalling']) { |
|
| 450 | + echo ' |
|
| 446 | 451 | ', $txt['package_uninstall_done']; |
| 447 | - |
|
| 448 | - elseif ($context['install_finished']) |
|
| 452 | + } elseif ($context['install_finished']) |
|
| 449 | 453 | { |
| 450 | - if ($context['extract_type'] == 'avatar') |
|
| 451 | - echo ' |
|
| 454 | + if ($context['extract_type'] == 'avatar') { |
|
| 455 | + echo ' |
|
| 452 | 456 | ', $txt['avatars_extracted']; |
| 453 | - |
|
| 454 | - elseif ($context['extract_type'] == 'language') |
|
| 455 | - echo ' |
|
| 457 | + } elseif ($context['extract_type'] == 'language') { |
|
| 458 | + echo ' |
|
| 456 | 459 | ', $txt['language_extracted']; |
| 457 | - |
|
| 458 | - else |
|
| 459 | - echo ' |
|
| 460 | + } else { |
|
| 461 | + echo ' |
|
| 460 | 462 | ', $txt['package_installed_done']; |
| 461 | - } |
|
| 462 | - else |
|
| 463 | - echo ' |
|
| 463 | + } |
|
| 464 | + } else { |
|
| 465 | + echo ' |
|
| 464 | 466 | ', $txt['corrupt_compatible']; |
| 467 | + } |
|
| 465 | 468 | |
| 466 | 469 | echo ' |
| 467 | 470 | </div><!-- .windowbg -->'; |
@@ -495,9 +498,10 @@ discard block |
||
| 495 | 498 | <div class="windowbg"> |
| 496 | 499 | <ol>'; |
| 497 | 500 | |
| 498 | - foreach ($context['files'] as $fileinfo) |
|
| 499 | - echo ' |
|
| 501 | + foreach ($context['files'] as $fileinfo) { |
|
| 502 | + echo ' |
|
| 500 | 503 | <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>'; |
| 504 | + } |
|
| 501 | 505 | |
| 502 | 506 | echo ' |
| 503 | 507 | </ol> |
@@ -561,9 +565,10 @@ discard block |
||
| 561 | 565 | </script> |
| 562 | 566 | <div id="yourVersion" style="display:none">', $context['forum_version'], '</div>'; |
| 563 | 567 | |
| 564 | - if (empty($modSettings['disable_smf_js'])) |
|
| 565 | - echo ' |
|
| 568 | + if (empty($modSettings['disable_smf_js'])) { |
|
| 569 | + echo ' |
|
| 566 | 570 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
| 571 | + } |
|
| 567 | 572 | |
| 568 | 573 | // This sets the announcements and current versions themselves ;). |
| 569 | 574 | echo ' |
@@ -602,12 +607,13 @@ discard block |
||
| 602 | 607 | } |
| 603 | 608 | } |
| 604 | 609 | |
| 605 | - if (!$mods_available) |
|
| 606 | - echo ' |
|
| 610 | + if (!$mods_available) { |
|
| 611 | + echo ' |
|
| 607 | 612 | <div class="noticebox">', $txt['no_packages'], '</div>'; |
| 608 | - else |
|
| 609 | - echo ' |
|
| 613 | + } else { |
|
| 614 | + echo ' |
|
| 610 | 615 | <br>'; |
| 616 | + } |
|
| 611 | 617 | |
| 612 | 618 | // the advanced (emulation) box, collapsed by default |
| 613 | 619 | echo ' |
@@ -694,11 +700,12 @@ discard block |
||
| 694 | 700 | { |
| 695 | 701 | global $context, $txt, $scripturl; |
| 696 | 702 | |
| 697 | - if (!empty($context['package_ftp']['error'])) |
|
| 698 | - echo ' |
|
| 703 | + if (!empty($context['package_ftp']['error'])) { |
|
| 704 | + echo ' |
|
| 699 | 705 | <div class="errorbox"> |
| 700 | 706 | <pre>', $context['package_ftp']['error'], '</pre> |
| 701 | 707 | </div>'; |
| 708 | + } |
|
| 702 | 709 | |
| 703 | 710 | echo ' |
| 704 | 711 | <div id="admin_form_wrapper"> |
@@ -780,13 +787,14 @@ discard block |
||
| 780 | 787 | <legend>' . $txt['package_servers'] . '</legend> |
| 781 | 788 | <ul class="package_servers">'; |
| 782 | 789 | |
| 783 | - foreach ($context['servers'] as $server) |
|
| 784 | - echo ' |
|
| 790 | + foreach ($context['servers'] as $server) { |
|
| 791 | + echo ' |
|
| 785 | 792 | <li class="flow_auto"> |
| 786 | 793 | <span class="floatleft">' . $server['name'] . '</span> |
| 787 | 794 | <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> |
| 788 | 795 | <span class="package_server floatright"><a href="' . $scripturl . '?action=admin;area=packages;get;sa=browse;server=' . $server['id'] . '">[ ' . $txt['package_browse'] . ' ]</a></span> |
| 789 | 796 | </li>'; |
| 797 | + } |
|
| 790 | 798 | echo ' |
| 791 | 799 | </ul> |
| 792 | 800 | </fieldset> |
@@ -873,11 +881,12 @@ discard block |
||
| 873 | 881 | <div class="windowbg2">'; |
| 874 | 882 | |
| 875 | 883 | // No packages, as yet. |
| 876 | - if (empty($context['package_list'])) |
|
| 877 | - echo ' |
|
| 884 | + if (empty($context['package_list'])) { |
|
| 885 | + echo ' |
|
| 878 | 886 | <ul> |
| 879 | 887 | <li>', $txt['no_packages'], '</li> |
| 880 | 888 | </ul>'; |
| 889 | + } |
|
| 881 | 890 | |
| 882 | 891 | // List out the packages... |
| 883 | 892 | else |
@@ -890,11 +899,12 @@ discard block |
||
| 890 | 899 | <li> |
| 891 | 900 | <strong><span id="ps_img_', $i, '" class="toggle_up" alt="*" style="display: none;"></span> ', $packageSection['title'], '</strong>'; |
| 892 | 901 | |
| 893 | - if (!empty($packageSection['text'])) |
|
| 894 | - echo ' |
|
| 902 | + if (!empty($packageSection['text'])) { |
|
| 903 | + echo ' |
|
| 895 | 904 | <div class="sub_bar"> |
| 896 | 905 | <h3 class="subbg">', $packageSection['text'], '</h3> |
| 897 | 906 | </div>'; |
| 907 | + } |
|
| 898 | 908 | |
| 899 | 909 | echo ' |
| 900 | 910 | <', $context['list_type'], ' id="package_section_', $i, '" class="packages">'; |
@@ -904,13 +914,15 @@ discard block |
||
| 904 | 914 | echo ' |
| 905 | 915 | <li>'; |
| 906 | 916 | // Textual message. Could be empty just for a blank line... |
| 907 | - if ($package['is_text']) |
|
| 908 | - echo ' |
|
| 917 | + if ($package['is_text']) { |
|
| 918 | + echo ' |
|
| 909 | 919 | ', empty($package['name']) ? ' ' : $package['name']; |
| 920 | + } |
|
| 910 | 921 | // This is supposed to be a rule.. |
| 911 | - elseif ($package['is_line']) |
|
| 912 | - echo ' |
|
| 922 | + elseif ($package['is_line']) { |
|
| 923 | + echo ' |
|
| 913 | 924 | <hr>'; |
| 925 | + } |
|
| 914 | 926 | // A remote link. |
| 915 | 927 | elseif ($package['is_remote']) |
| 916 | 928 | { |
@@ -932,24 +944,28 @@ discard block |
||
| 932 | 944 | <ul id="package_section_', $i, '_pkg_', $id, '" class="package_section">'; |
| 933 | 945 | |
| 934 | 946 | // Show the mod type? |
| 935 | - if ($package['type'] != '') |
|
| 936 | - echo ' |
|
| 947 | + if ($package['type'] != '') { |
|
| 948 | + echo ' |
|
| 937 | 949 | <li class="package_section">', $txt['package_type'], ': ', $smcFunc['ucwords']($smcFunc['strtolower']($package['type'])), '</li>'; |
| 950 | + } |
|
| 938 | 951 | |
| 939 | 952 | // Show the version number? |
| 940 | - if ($package['version'] != '') |
|
| 941 | - echo ' |
|
| 953 | + if ($package['version'] != '') { |
|
| 954 | + echo ' |
|
| 942 | 955 | <li class="package_section">', $txt['mod_version'], ': ', $package['version'], '</li>'; |
| 956 | + } |
|
| 943 | 957 | |
| 944 | 958 | // How 'bout the author? |
| 945 | - if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) |
|
| 946 | - echo ' |
|
| 959 | + if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) { |
|
| 960 | + echo ' |
|
| 947 | 961 | <li class="package_section">', $txt['mod_author'], ': ', $package['author']['link'], '</li>'; |
| 962 | + } |
|
| 948 | 963 | |
| 949 | 964 | // The homepage.... |
| 950 | - if ($package['author']['website']['link'] != '') |
|
| 951 | - echo ' |
|
| 965 | + if ($package['author']['website']['link'] != '') { |
|
| 966 | + echo ' |
|
| 952 | 967 | <li class="package_section">', $txt['author_website'], ': ', $package['author']['website']['link'], '</li>'; |
| 968 | + } |
|
| 953 | 969 | |
| 954 | 970 | // Description: bleh bleh! |
| 955 | 971 | // Location of file: http://someplace/. |
@@ -1003,8 +1019,8 @@ discard block |
||
| 1003 | 1019 | |
| 1004 | 1020 | foreach ($ps['items'] as $id => $package) |
| 1005 | 1021 | { |
| 1006 | - if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) |
|
| 1007 | - echo ' |
|
| 1022 | + if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) { |
|
| 1023 | + echo ' |
|
| 1008 | 1024 | var oPackageToggle_', $section, '_pkg_', $id, ' = new smc_Toggle({ |
| 1009 | 1025 | bToggleEnabled: true, |
| 1010 | 1026 | bCurrentlyCollapsed: true, |
@@ -1019,6 +1035,7 @@ discard block |
||
| 1019 | 1035 | } |
| 1020 | 1036 | ] |
| 1021 | 1037 | });'; |
| 1038 | + } |
|
| 1022 | 1039 | } |
| 1023 | 1040 | } |
| 1024 | 1041 | |
@@ -1064,9 +1081,10 @@ discard block |
||
| 1064 | 1081 | { |
| 1065 | 1082 | global $context, $txt, $scripturl; |
| 1066 | 1083 | |
| 1067 | - if (!empty($context['saved_successful'])) |
|
| 1068 | - echo ' |
|
| 1084 | + if (!empty($context['saved_successful'])) { |
|
| 1085 | + echo ' |
|
| 1069 | 1086 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 1087 | + } |
|
| 1070 | 1088 | |
| 1071 | 1089 | echo ' |
| 1072 | 1090 | <div id="admincenter"> |
@@ -1128,8 +1146,9 @@ discard block |
||
| 1128 | 1146 | global $context, $txt; |
| 1129 | 1147 | |
| 1130 | 1148 | // Nothing to do? Brilliant! |
| 1131 | - if (empty($context['package_ftp'])) |
|
| 1132 | - return false; |
|
| 1149 | + if (empty($context['package_ftp'])) { |
|
| 1150 | + return false; |
|
| 1151 | + } |
|
| 1133 | 1152 | |
| 1134 | 1153 | if (empty($context['package_ftp']['form_elements_only'])) |
| 1135 | 1154 | { |
@@ -1139,19 +1158,21 @@ discard block |
||
| 1139 | 1158 | ', $txt['package_ftp_why_file_list'], ' |
| 1140 | 1159 | <ul style="display: inline;">'; |
| 1141 | 1160 | |
| 1142 | - if (!empty($context['notwritable_files'])) |
|
| 1143 | - foreach ($context['notwritable_files'] as $file) |
|
| 1161 | + if (!empty($context['notwritable_files'])) { |
|
| 1162 | + foreach ($context['notwritable_files'] as $file) |
|
| 1144 | 1163 | echo ' |
| 1145 | 1164 | <li>', $file, '</li>'; |
| 1165 | + } |
|
| 1146 | 1166 | |
| 1147 | 1167 | echo ' |
| 1148 | 1168 | </ul>'; |
| 1149 | 1169 | |
| 1150 | - if (!$context['server']['is_windows']) |
|
| 1151 | - echo ' |
|
| 1170 | + if (!$context['server']['is_windows']) { |
|
| 1171 | + echo ' |
|
| 1152 | 1172 | <hr> |
| 1153 | 1173 | ', $txt['package_chmod_linux'], '<br> |
| 1154 | 1174 | <tt># chmod a+w ', implode(' ', $context['notwritable_files']), '</tt>'; |
| 1175 | + } |
|
| 1155 | 1176 | |
| 1156 | 1177 | echo ' |
| 1157 | 1178 | </div><!-- #need_writable_list -->'; |
@@ -1164,9 +1185,10 @@ discard block |
||
| 1164 | 1185 | </div> |
| 1165 | 1186 | </div>'; |
| 1166 | 1187 | |
| 1167 | - if (!empty($context['package_ftp']['destination'])) |
|
| 1168 | - echo ' |
|
| 1188 | + if (!empty($context['package_ftp']['destination'])) { |
|
| 1189 | + echo ' |
|
| 1169 | 1190 | <form action="', $context['package_ftp']['destination'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">'; |
| 1191 | + } |
|
| 1170 | 1192 | |
| 1171 | 1193 | echo ' |
| 1172 | 1194 | <fieldset> |
@@ -1199,24 +1221,27 @@ discard block |
||
| 1199 | 1221 | </dl> |
| 1200 | 1222 | </fieldset>'; |
| 1201 | 1223 | |
| 1202 | - if (empty($context['package_ftp']['form_elements_only'])) |
|
| 1203 | - echo ' |
|
| 1224 | + if (empty($context['package_ftp']['form_elements_only'])) { |
|
| 1225 | + echo ' |
|
| 1204 | 1226 | <div class="righttext" style="margin: 1ex;"> |
| 1205 | 1227 | <span id="test_ftp_placeholder_full"></span> |
| 1206 | 1228 | <input type="submit" value="', $txt['package_proceed'], '" class="button"> |
| 1207 | 1229 | </div>'; |
| 1230 | + } |
|
| 1208 | 1231 | |
| 1209 | - if (!empty($context['package_ftp']['destination'])) |
|
| 1210 | - echo ' |
|
| 1232 | + if (!empty($context['package_ftp']['destination'])) { |
|
| 1233 | + echo ' |
|
| 1211 | 1234 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1212 | 1235 | </form>'; |
| 1236 | + } |
|
| 1213 | 1237 | |
| 1214 | 1238 | // Hide the details of the list. |
| 1215 | - if (empty($context['package_ftp']['form_elements_only'])) |
|
| 1216 | - echo ' |
|
| 1239 | + if (empty($context['package_ftp']['form_elements_only'])) { |
|
| 1240 | + echo ' |
|
| 1217 | 1241 | <script> |
| 1218 | 1242 | document.getElementById(\'need_writable_list\').style.display = \'none\'; |
| 1219 | 1243 | </script>'; |
| 1244 | + } |
|
| 1220 | 1245 | |
| 1221 | 1246 | // Quick generate the test button. |
| 1222 | 1247 | echo ' |
@@ -1572,9 +1597,10 @@ discard block |
||
| 1572 | 1597 | <tr class="windowbg"> |
| 1573 | 1598 | <td width="30%"><strong>'; |
| 1574 | 1599 | |
| 1575 | - if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) |
|
| 1576 | - echo ' |
|
| 1600 | + if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) { |
|
| 1601 | + echo ' |
|
| 1577 | 1602 | <span class="generic_icons folder"></span>'; |
| 1603 | + } |
|
| 1578 | 1604 | |
| 1579 | 1605 | echo ' |
| 1580 | 1606 | ', $name, ' |
@@ -1590,8 +1616,9 @@ discard block |
||
| 1590 | 1616 | <td class="centertext perm_no_change"><input type="radio" name="permStatus[', $name, ']" value="no_change" checked class="centertext"></td> |
| 1591 | 1617 | </tr>'; |
| 1592 | 1618 | |
| 1593 | - if (!empty($dir['contents'])) |
|
| 1594 | - template_permission_show_contents($name, $dir['contents'], 1); |
|
| 1619 | + if (!empty($dir['contents'])) { |
|
| 1620 | + template_permission_show_contents($name, $dir['contents'], 1); |
|
| 1621 | + } |
|
| 1595 | 1622 | } |
| 1596 | 1623 | |
| 1597 | 1624 | echo ' |
@@ -1627,13 +1654,14 @@ discard block |
||
| 1627 | 1654 | </fieldset>'; |
| 1628 | 1655 | |
| 1629 | 1656 | // Likely to need FTP? |
| 1630 | - if (empty($context['ftp_connected'])) |
|
| 1631 | - echo ' |
|
| 1657 | + if (empty($context['ftp_connected'])) { |
|
| 1658 | + echo ' |
|
| 1632 | 1659 | <p> |
| 1633 | 1660 | ', $txt['package_file_perms_ftp_details'], ': |
| 1634 | 1661 | </p> |
| 1635 | 1662 | ', template_control_chmod(), ' |
| 1636 | 1663 | <div class="noticebox">', $txt['package_file_perms_ftp_retain'], '</div>'; |
| 1664 | + } |
|
| 1637 | 1665 | |
| 1638 | 1666 | echo ' |
| 1639 | 1667 | <span id="test_ftp_placeholder_full"></span> |
@@ -1642,9 +1670,10 @@ discard block |
||
| 1642 | 1670 | </div><!-- .windowbg2 -->'; |
| 1643 | 1671 | |
| 1644 | 1672 | // Any looks fors we've already done? |
| 1645 | - foreach ($context['look_for'] as $path) |
|
| 1646 | - echo ' |
|
| 1673 | + foreach ($context['look_for'] as $path) { |
|
| 1674 | + echo ' |
|
| 1647 | 1675 | <input type="hidden" name="back_look[]" value="', $path, '">'; |
| 1676 | + } |
|
| 1648 | 1677 | |
| 1649 | 1678 | echo ' |
| 1650 | 1679 | </form> |
@@ -1686,9 +1715,10 @@ discard block |
||
| 1686 | 1715 | <td class="smalltext" width="30%">' . str_repeat(' ', $level * 5), ' |
| 1687 | 1716 | ', (!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, "'\\") . '\');">' : ''; |
| 1688 | 1717 | |
| 1689 | - if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) |
|
| 1690 | - echo ' |
|
| 1718 | + if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) { |
|
| 1719 | + echo ' |
|
| 1691 | 1720 | <span class="generic_icons folder"></span>'; |
| 1721 | + } |
|
| 1692 | 1722 | |
| 1693 | 1723 | echo ' |
| 1694 | 1724 | ', $name, ' |
@@ -1714,14 +1744,15 @@ discard block |
||
| 1714 | 1744 | } |
| 1715 | 1745 | |
| 1716 | 1746 | // We have more files to show? |
| 1717 | - if ($has_more) |
|
| 1718 | - echo ' |
|
| 1747 | + if ($has_more) { |
|
| 1748 | + echo ' |
|
| 1719 | 1749 | <tr class="windowbg" id="content_', $js_ident, '_more"> |
| 1720 | 1750 | <td class="smalltext" width="40%">' . str_repeat(' ', $level * 5), ' |
| 1721 | 1751 | « <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> » |
| 1722 | 1752 | </td> |
| 1723 | 1753 | <td colspan="6"></td> |
| 1724 | 1754 | </tr>'; |
| 1755 | + } |
|
| 1725 | 1756 | |
| 1726 | 1757 | if ($drawn_div) |
| 1727 | 1758 | { |
@@ -1729,15 +1760,17 @@ discard block |
||
| 1729 | 1760 | $isFound = false; |
| 1730 | 1761 | foreach ($context['look_for'] as $tree) |
| 1731 | 1762 | { |
| 1732 | - if (substr($tree, 0, strlen($ident)) == $ident) |
|
| 1733 | - $isFound = true; |
|
| 1763 | + if (substr($tree, 0, strlen($ident)) == $ident) { |
|
| 1764 | + $isFound = true; |
|
| 1765 | + } |
|
| 1734 | 1766 | } |
| 1735 | 1767 | |
| 1736 | - if ($level > 1 && !$isFound) |
|
| 1737 | - echo ' |
|
| 1768 | + if ($level > 1 && !$isFound) { |
|
| 1769 | + echo ' |
|
| 1738 | 1770 | <script> |
| 1739 | 1771 | expandFolder(\'', $js_ident, '\', \'\'); |
| 1740 | 1772 | </script>'; |
| 1773 | + } |
|
| 1741 | 1774 | } |
| 1742 | 1775 | } |
| 1743 | 1776 | |
@@ -1757,11 +1790,12 @@ discard block |
||
| 1757 | 1790 | <h3 class="catbg">', $txt['package_file_perms_applying'], '</h3> |
| 1758 | 1791 | </div>'; |
| 1759 | 1792 | |
| 1760 | - if (!empty($context['skip_ftp'])) |
|
| 1761 | - echo ' |
|
| 1793 | + if (!empty($context['skip_ftp'])) { |
|
| 1794 | + echo ' |
|
| 1762 | 1795 | <div class="errorbox"> |
| 1763 | 1796 | ', $txt['package_file_perms_skipping_ftp'], ' |
| 1764 | 1797 | </div>'; |
| 1798 | + } |
|
| 1765 | 1799 | |
| 1766 | 1800 | // How many have we done? |
| 1767 | 1801 | $remaining_items = count($context['method'] == 'individual' ? $context['to_process'] : $context['directory_list']); |
@@ -1800,28 +1834,31 @@ discard block |
||
| 1800 | 1834 | <br>'; |
| 1801 | 1835 | |
| 1802 | 1836 | // Put out the right hidden data. |
| 1803 | - if ($context['method'] == 'individual') |
|
| 1804 | - echo ' |
|
| 1837 | + if ($context['method'] == 'individual') { |
|
| 1838 | + echo ' |
|
| 1805 | 1839 | <input type="hidden" name="custom_value" value="', $context['custom_value'], '"> |
| 1806 | 1840 | <input type="hidden" name="totalItems" value="', $context['total_items'], '"> |
| 1807 | 1841 | <input type="hidden" name="toProcess" value="', $context['to_process_encode'], '">'; |
| 1808 | - else |
|
| 1809 | - echo ' |
|
| 1842 | + } else { |
|
| 1843 | + echo ' |
|
| 1810 | 1844 | <input type="hidden" name="predefined" value="', $context['predefined_type'], '"> |
| 1811 | 1845 | <input type="hidden" name="fileOffset" value="', $context['file_offset'], '"> |
| 1812 | 1846 | <input type="hidden" name="totalItems" value="', $context['total_items'], '"> |
| 1813 | 1847 | <input type="hidden" name="dirList" value="', $context['directory_list_encode'], '"> |
| 1814 | 1848 | <input type="hidden" name="specialFiles" value="', $context['special_files_encode'], '">'; |
| 1849 | + } |
|
| 1815 | 1850 | |
| 1816 | 1851 | // Are we not using FTP for whatever reason. |
| 1817 | - if (!empty($context['skip_ftp'])) |
|
| 1818 | - echo ' |
|
| 1852 | + if (!empty($context['skip_ftp'])) { |
|
| 1853 | + echo ' |
|
| 1819 | 1854 | <input type="hidden" name="skip_ftp" value="1">'; |
| 1855 | + } |
|
| 1820 | 1856 | |
| 1821 | 1857 | // Retain state. |
| 1822 | - foreach ($context['back_look_data'] as $path) |
|
| 1823 | - echo ' |
|
| 1858 | + foreach ($context['back_look_data'] as $path) { |
|
| 1859 | + echo ' |
|
| 1824 | 1860 | <input type="hidden" name="back_look[]" value="', $path, '">'; |
| 1861 | + } |
|
| 1825 | 1862 | |
| 1826 | 1863 | echo ' |
| 1827 | 1864 | <input type="hidden" name="method" value="', $context['method'], '"> |
@@ -64,20 +64,20 @@ discard block |
||
| 64 | 64 | <dd> |
| 65 | 65 | ', $modSettings['smileys_url'], '/'; |
| 66 | 66 | |
| 67 | - if ($context['current_set']['id'] == 'default') |
|
| 68 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
| 69 | - |
|
| 70 | - elseif (empty($context['smiley_set_dirs'])) |
|
| 71 | - echo ' |
|
| 67 | + if ($context['current_set']['id'] == 'default') { |
|
| 68 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
| 69 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
| 70 | + echo ' |
|
| 72 | 71 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> '; |
| 73 | - else |
|
| 72 | + } else |
|
| 74 | 73 | { |
| 75 | 74 | echo ' |
| 76 | 75 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
| 77 | 76 | |
| 78 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
| 79 | - echo ' |
|
| 77 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
| 78 | + echo ' |
|
| 80 | 79 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
| 80 | + } |
|
| 81 | 81 | echo ' |
| 82 | 82 | </select> '; |
| 83 | 83 | } |
@@ -92,14 +92,15 @@ discard block |
||
| 92 | 92 | </dd>'; |
| 93 | 93 | |
| 94 | 94 | // If this is a new smiley set they have the option to import smileys already in the directory. |
| 95 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
| 96 | - echo ' |
|
| 95 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
| 96 | + echo ' |
|
| 97 | 97 | <dt> |
| 98 | 98 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
| 99 | 99 | </dt> |
| 100 | 100 | <dd> |
| 101 | 101 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1"> |
| 102 | 102 | </dd>'; |
| 103 | + } |
|
| 103 | 104 | |
| 104 | 105 | echo ' |
| 105 | 106 | </dl> |
@@ -133,9 +134,10 @@ discard block |
||
| 133 | 134 | <dd> |
| 134 | 135 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">'; |
| 135 | 136 | |
| 136 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 137 | - echo ' |
|
| 137 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 138 | + echo ' |
|
| 138 | 139 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
| 140 | + } |
|
| 139 | 141 | |
| 140 | 142 | echo ' |
| 141 | 143 | </select>) |
@@ -151,17 +153,18 @@ discard block |
||
| 151 | 153 | </dt> |
| 152 | 154 | <dd>'; |
| 153 | 155 | |
| 154 | - if (empty($context['filenames'])) |
|
| 155 | - echo ' |
|
| 156 | + if (empty($context['filenames'])) { |
|
| 157 | + echo ' |
|
| 156 | 158 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">'; |
| 157 | - else |
|
| 159 | + } else |
|
| 158 | 160 | { |
| 159 | 161 | echo ' |
| 160 | 162 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
| 161 | 163 | |
| 162 | - foreach ($context['filenames'] as $filename) |
|
| 163 | - echo ' |
|
| 164 | + foreach ($context['filenames'] as $filename) { |
|
| 165 | + echo ' |
|
| 164 | 166 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
| 167 | + } |
|
| 165 | 168 | echo ' |
| 166 | 169 | </select>'; |
| 167 | 170 | } |
@@ -230,9 +233,10 @@ discard block |
||
| 230 | 233 | <dd> |
| 231 | 234 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
| 232 | 235 | |
| 233 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 234 | - echo ' |
|
| 236 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 237 | + echo ' |
|
| 235 | 238 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
| 239 | + } |
|
| 236 | 240 | |
| 237 | 241 | echo ' |
| 238 | 242 | </select> |
@@ -242,17 +246,18 @@ discard block |
||
| 242 | 246 | </dt> |
| 243 | 247 | <dd>'; |
| 244 | 248 | |
| 245 | - if (empty($context['filenames'])) |
|
| 246 | - echo ' |
|
| 249 | + if (empty($context['filenames'])) { |
|
| 250 | + echo ' |
|
| 247 | 251 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">'; |
| 248 | - else |
|
| 252 | + } else |
|
| 249 | 253 | { |
| 250 | 254 | echo ' |
| 251 | 255 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
| 252 | 256 | |
| 253 | - foreach ($context['filenames'] as $filename) |
|
| 254 | - echo ' |
|
| 257 | + foreach ($context['filenames'] as $filename) { |
|
| 258 | + echo ' |
|
| 255 | 259 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
| 260 | + } |
|
| 256 | 261 | echo ' |
| 257 | 262 | </select>'; |
| 258 | 263 | } |
@@ -281,14 +286,15 @@ discard block |
||
| 281 | 286 | |
| 282 | 287 | <dl id="uploadMore" style="display: none;" class="settings">'; |
| 283 | 288 | |
| 284 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 285 | - echo ' |
|
| 289 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 290 | + echo ' |
|
| 286 | 291 | <dt> |
| 287 | 292 | ', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ': |
| 288 | 293 | </dt> |
| 289 | 294 | <dd> |
| 290 | 295 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');"> |
| 291 | 296 | </dd>'; |
| 297 | + } |
|
| 292 | 298 | echo ' |
| 293 | 299 | </dl> |
| 294 | 300 | </div><!-- .windowbg2 --> |
@@ -358,27 +364,30 @@ discard block |
||
| 358 | 364 | |
| 359 | 365 | foreach ($location['rows'] as $row) |
| 360 | 366 | { |
| 361 | - if (!empty($context['move_smiley'])) |
|
| 362 | - echo ' |
|
| 367 | + if (!empty($context['move_smiley'])) { |
|
| 368 | + echo ' |
|
| 363 | 369 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 370 | + } |
|
| 364 | 371 | |
| 365 | 372 | foreach ($row as $smiley) |
| 366 | 373 | { |
| 367 | - if (empty($context['move_smiley'])) |
|
| 368 | - echo ' |
|
| 374 | + if (empty($context['move_smiley'])) { |
|
| 375 | + echo ' |
|
| 369 | 376 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>'; |
| 370 | - else |
|
| 371 | - echo ' |
|
| 377 | + } else { |
|
| 378 | + echo ' |
|
| 372 | 379 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"> |
| 373 | 380 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 381 | + } |
|
| 374 | 382 | } |
| 375 | 383 | |
| 376 | 384 | echo ' |
| 377 | 385 | <br>'; |
| 378 | 386 | } |
| 379 | - if (!empty($context['move_smiley'])) |
|
| 380 | - echo ' |
|
| 387 | + if (!empty($context['move_smiley'])) { |
|
| 388 | + echo ' |
|
| 381 | 389 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 390 | + } |
|
| 382 | 391 | echo ' |
| 383 | 392 | </div><!-- .windowbg2 --> |
| 384 | 393 | <input type="hidden" name="reorder" value="1"> |
@@ -415,14 +424,15 @@ discard block |
||
| 415 | 424 | <div class="windowbg2"> |
| 416 | 425 | <dl class="settings">'; |
| 417 | 426 | |
| 418 | - if (!$context['new_icon']) |
|
| 419 | - echo ' |
|
| 427 | + if (!$context['new_icon']) { |
|
| 428 | + echo ' |
|
| 420 | 429 | <dt> |
| 421 | 430 | <strong>', $txt['smiley_preview'], ': </strong> |
| 422 | 431 | </dt> |
| 423 | 432 | <dd> |
| 424 | 433 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
| 425 | 434 | </dd>'; |
| 435 | + } |
|
| 426 | 436 | |
| 427 | 437 | echo ' |
| 428 | 438 | <dt> |
@@ -449,9 +459,10 @@ discard block |
||
| 449 | 459 | echo ' |
| 450 | 460 | <optgroup label="', $category['name'], '">'; |
| 451 | 461 | |
| 452 | - foreach ($category['boards'] as $board) |
|
| 453 | - echo ' |
|
| 462 | + foreach ($category['boards'] as $board) { |
|
| 463 | + echo ' |
|
| 454 | 464 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 465 | + } |
|
| 455 | 466 | echo ' |
| 456 | 467 | </optgroup>'; |
| 457 | 468 | } |
@@ -466,19 +477,21 @@ discard block |
||
| 466 | 477 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
| 467 | 478 | |
| 468 | 479 | // Print the list of all the icons it can be put after... |
| 469 | - foreach ($context['icons'] as $id => $data) |
|
| 470 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
| 480 | + foreach ($context['icons'] as $id => $data) { |
|
| 481 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
| 471 | 482 | echo ' |
| 472 | 483 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
| 484 | + } |
|
| 473 | 485 | |
| 474 | 486 | echo ' |
| 475 | 487 | </select> |
| 476 | 488 | </dd> |
| 477 | 489 | </dl>'; |
| 478 | 490 | |
| 479 | - if (!$context['new_icon']) |
|
| 480 | - echo ' |
|
| 491 | + if (!$context['new_icon']) { |
|
| 492 | + echo ' |
|
| 481 | 493 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
| 494 | + } |
|
| 482 | 495 | |
| 483 | 496 | echo ' |
| 484 | 497 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button"> |
@@ -67,8 +67,9 @@ discard block |
||
| 67 | 67 | foreach ($context['categories'] as $category) |
| 68 | 68 | { |
| 69 | 69 | // If theres no parent boards we can see, avoid showing an empty category (unless its collapsed) |
| 70 | - if (empty($category['boards']) && !$category['is_collapsed']) |
|
| 71 | - continue; |
|
| 70 | + if (empty($category['boards']) && !$category['is_collapsed']) { |
|
| 71 | + continue; |
|
| 72 | + } |
|
| 72 | 73 | |
| 73 | 74 | echo ' |
| 74 | 75 | <div class="main_container"> |
@@ -76,9 +77,10 @@ discard block |
||
| 76 | 77 | <h3 class="catbg">'; |
| 77 | 78 | |
| 78 | 79 | // If this category even can collapse, show a link to collapse it. |
| 79 | - if ($category['can_collapse']) |
|
| 80 | - echo ' |
|
| 80 | + if ($category['can_collapse']) { |
|
| 81 | + echo ' |
|
| 81 | 82 | <span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' floatright" data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'], '" style="display: none;"></span>'; |
| 83 | + } |
|
| 82 | 84 | |
| 83 | 85 | echo ' |
| 84 | 86 | ', $category['link'], ' |
@@ -108,10 +110,11 @@ discard block |
||
| 108 | 110 | </div>'; |
| 109 | 111 | |
| 110 | 112 | // Won't somebody think of the children! |
| 111 | - if (function_exists('template_bi_' . $board['type'] . '_children')) |
|
| 112 | - call_user_func('template_bi_' . $board['type'] . '_children', $board); |
|
| 113 | - else |
|
| 114 | - template_bi_board_children($board); |
|
| 113 | + if (function_exists('template_bi_' . $board['type'] . '_children')) { |
|
| 114 | + call_user_func('template_bi_' . $board['type'] . '_children', $board); |
|
| 115 | + } else { |
|
| 116 | + template_bi_board_children($board); |
|
| 117 | + } |
|
| 115 | 118 | |
| 116 | 119 | echo ' |
| 117 | 120 | </div><!-- #board_[id] -->'; |
@@ -126,12 +129,13 @@ discard block |
||
| 126 | 129 | </div><!-- #boardindex_table -->'; |
| 127 | 130 | |
| 128 | 131 | // Show the mark all as read button? |
| 129 | - if ($context['user']['is_logged'] && !empty($context['categories'])) |
|
| 130 | - echo ' |
|
| 132 | + if ($context['user']['is_logged'] && !empty($context['categories'])) { |
|
| 133 | + echo ' |
|
| 131 | 134 | <div class="mark_read"> |
| 132 | 135 | ', template_button_strip($context['mark_read_button'], 'right'), ' |
| 133 | 136 | </div>'; |
| 134 | -} |
|
| 137 | + } |
|
| 138 | + } |
|
| 135 | 139 | |
| 136 | 140 | /** |
| 137 | 141 | * Outputs the board icon for a standard board. |
@@ -175,18 +179,20 @@ discard block |
||
| 175 | 179 | </a>'; |
| 176 | 180 | |
| 177 | 181 | // Has it outstanding posts for approval? |
| 178 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
| 179 | - echo ' |
|
| 182 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
| 183 | + echo ' |
|
| 180 | 184 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>'; |
| 185 | + } |
|
| 181 | 186 | |
| 182 | 187 | echo ' |
| 183 | 188 | <p class="board_description">', $board['description'], '</p>'; |
| 184 | 189 | |
| 185 | 190 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
| 186 | - if (!empty($board['link_moderators'])) |
|
| 187 | - echo ' |
|
| 191 | + if (!empty($board['link_moderators'])) { |
|
| 192 | + echo ' |
|
| 188 | 193 | <p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
| 189 | -} |
|
| 194 | + } |
|
| 195 | + } |
|
| 190 | 196 | |
| 191 | 197 | /** |
| 192 | 198 | * Outputs the board stats for a standard board. |
@@ -227,10 +233,11 @@ discard block |
||
| 227 | 233 | */ |
| 228 | 234 | function template_bi_board_lastpost($board) |
| 229 | 235 | { |
| 230 | - if (!empty($board['last_post']['id'])) |
|
| 231 | - echo ' |
|
| 236 | + if (!empty($board['last_post']['id'])) { |
|
| 237 | + echo ' |
|
| 232 | 238 | <p>', $board['last_post']['last_post_message'], '</p>'; |
| 233 | -} |
|
| 239 | + } |
|
| 240 | + } |
|
| 234 | 241 | |
| 235 | 242 | /** |
| 236 | 243 | * Outputs the board children for a standard board. |
@@ -251,14 +258,16 @@ discard block |
||
| 251 | 258 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
| 252 | 259 | foreach ($board['children'] as $child) |
| 253 | 260 | { |
| 254 | - if (!$child['is_redirect']) |
|
| 255 | - $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
| 256 | - else |
|
| 257 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
| 261 | + if (!$child['is_redirect']) { |
|
| 262 | + $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
| 263 | + } else { |
|
| 264 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
| 265 | + } |
|
| 258 | 266 | |
| 259 | 267 | // Has it posts awaiting approval? |
| 260 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) |
|
| 261 | - $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 268 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) { |
|
| 269 | + $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 270 | + } |
|
| 262 | 271 | |
| 263 | 272 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
| 264 | 273 | } |
@@ -285,8 +294,9 @@ discard block |
||
| 285 | 294 | { |
| 286 | 295 | global $context, $options, $txt; |
| 287 | 296 | |
| 288 | - if (empty($context['info_center'])) |
|
| 289 | - return; |
|
| 297 | + if (empty($context['info_center'])) { |
|
| 298 | + return; |
|
| 299 | + } |
|
| 290 | 300 | |
| 291 | 301 | // Here's where the "Info Center" starts... |
| 292 | 302 | echo ' |
@@ -386,14 +396,15 @@ discard block |
||
| 386 | 396 | /* Each post in latest_posts has: |
| 387 | 397 | board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.), |
| 388 | 398 | subject, short_subject (shortened with...), time, link, and href. */ |
| 389 | - foreach ($context['latest_posts'] as $post) |
|
| 390 | - echo ' |
|
| 399 | + foreach ($context['latest_posts'] as $post) { |
|
| 400 | + echo ' |
|
| 391 | 401 | <tr class="windowbg"> |
| 392 | 402 | <td class="recentpost"><strong>', $post['link'], '</strong></td> |
| 393 | 403 | <td class="recentposter">', $post['poster']['link'], '</td> |
| 394 | 404 | <td class="recentboard">', $post['board']['link'], '</td> |
| 395 | 405 | <td class="recenttime">', $post['time'], '</td> |
| 396 | 406 | </tr>'; |
| 407 | + } |
|
| 397 | 408 | echo ' |
| 398 | 409 | </table>'; |
| 399 | 410 | } |
@@ -417,11 +428,12 @@ discard block |
||
| 417 | 428 | </div>'; |
| 418 | 429 | |
| 419 | 430 | // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P |
| 420 | - if (!empty($context['calendar_holidays'])) |
|
| 421 | - echo ' |
|
| 431 | + if (!empty($context['calendar_holidays'])) { |
|
| 432 | + echo ' |
|
| 422 | 433 | <p class="inline holiday"> |
| 423 | 434 | <span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), ' |
| 424 | 435 | </p>'; |
| 436 | + } |
|
| 425 | 437 | |
| 426 | 438 | // People's birthdays. Like mine. And yours, I guess. Kidding. |
| 427 | 439 | if (!empty($context['calendar_birthdays'])) |
@@ -431,9 +443,10 @@ discard block |
||
| 431 | 443 | <span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>'; |
| 432 | 444 | |
| 433 | 445 | // Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) |
| 434 | - foreach ($context['calendar_birthdays'] as $member) |
|
| 435 | - echo ' |
|
| 446 | + foreach ($context['calendar_birthdays'] as $member) { |
|
| 447 | + echo ' |
|
| 436 | 448 | <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', '; |
| 449 | + } |
|
| 437 | 450 | |
| 438 | 451 | echo ' |
| 439 | 452 | </p>'; |
@@ -448,9 +461,10 @@ discard block |
||
| 448 | 461 | |
| 449 | 462 | // Each event in calendar_events should have: |
| 450 | 463 | // title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. |
| 451 | - foreach ($context['calendar_events'] as $event) |
|
| 452 | - echo ' |
|
| 464 | + foreach ($context['calendar_events'] as $event) { |
|
| 465 | + echo ' |
|
| 453 | 466 | ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><span class="generic_icons calendar_modify"></span></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br>' : ', '; |
| 467 | + } |
|
| 454 | 468 | echo ' |
| 455 | 469 | </p>'; |
| 456 | 470 | } |
@@ -496,15 +510,19 @@ discard block |
||
| 496 | 510 | // Handle hidden users and buddies. |
| 497 | 511 | $bracketList = array(); |
| 498 | 512 | |
| 499 | - if ($context['show_buddies']) |
|
| 500 | - $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
| 501 | - if (!empty($context['num_spiders'])) |
|
| 502 | - $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
| 503 | - if (!empty($context['num_users_hidden'])) |
|
| 504 | - $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
| 513 | + if ($context['show_buddies']) { |
|
| 514 | + $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
| 515 | + } |
|
| 516 | + if (!empty($context['num_spiders'])) { |
|
| 517 | + $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
| 518 | + } |
|
| 519 | + if (!empty($context['num_users_hidden'])) { |
|
| 520 | + $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
| 521 | + } |
|
| 505 | 522 | |
| 506 | - if (!empty($bracketList)) |
|
| 507 | - echo ' (' . implode(', ', $bracketList) . ')'; |
|
| 523 | + if (!empty($bracketList)) { |
|
| 524 | + echo ' (' . implode(', ', $bracketList) . ')'; |
|
| 525 | + } |
|
| 508 | 526 | |
| 509 | 527 | echo $context['show_who'] ? '</a>' : '', ' |
| 510 | 528 | |
@@ -518,9 +536,10 @@ discard block |
||
| 518 | 536 | ', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']); |
| 519 | 537 | |
| 520 | 538 | // Showing membergroups? |
| 521 | - if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) |
|
| 522 | - echo ' |
|
| 539 | + if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) { |
|
| 540 | + echo ' |
|
| 523 | 541 | <span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>'; |
| 542 | + } |
|
| 524 | 543 | } |
| 525 | 544 | |
| 526 | 545 | echo ' |
@@ -945,7 +945,7 @@ |
||
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | echo isset($config_var['postinput']) ? ' |
| 948 | - ' . $config_var['postinput'] : '',' |
|
| 948 | + ' . $config_var['postinput'] : '', ' |
|
| 949 | 949 | </dd>'; |
| 950 | 950 | } |
| 951 | 951 | } |
@@ -64,9 +64,10 @@ discard block |
||
| 64 | 64 | <strong>', $txt['administrators'], ':</strong> |
| 65 | 65 | ', implode(', ', $context['administrators']); |
| 66 | 66 | // If we have lots of admins... don't show them all. |
| 67 | - if (!empty($context['more_admins_link'])) |
|
| 68 | - echo ' |
|
| 67 | + if (!empty($context['more_admins_link'])) { |
|
| 68 | + echo ' |
|
| 69 | 69 | (', $context['more_admins_link'], ')'; |
| 70 | + } |
|
| 70 | 71 | |
| 71 | 72 | echo ' |
| 72 | 73 | </div><!-- #version_details --> |
@@ -83,17 +84,19 @@ discard block |
||
| 83 | 84 | foreach ($area['areas'] as $item_id => $item) |
| 84 | 85 | { |
| 85 | 86 | // No point showing the 'home' page here, we're already on it! |
| 86 | - if ($area_id == 'forum' && $item_id == 'index') |
|
| 87 | - continue; |
|
| 87 | + if ($area_id == 'forum' && $item_id == 'index') { |
|
| 88 | + continue; |
|
| 89 | + } |
|
| 88 | 90 | |
| 89 | 91 | $url = isset($item['url']) ? $item['url'] : $scripturl . '?action=admin;area=' . $item_id . (!empty($context[$context['admin_menu_name']]['extra_parameters']) ? $context[$context['admin_menu_name']]['extra_parameters'] : ''); |
| 90 | 92 | |
| 91 | - if (!empty($item['icon_file'])) |
|
| 92 | - echo ' |
|
| 93 | + if (!empty($item['icon_file'])) { |
|
| 94 | + echo ' |
|
| 93 | 95 | <a href="', $url, '" class="admin_group', !empty($item['inactive']) ? ' inactive' : '', '"><img class="large_admin_menu_icon_file" src="', $item['icon_file'], '" alt="">', $item['label'], '</a>'; |
| 94 | - else |
|
| 95 | - echo ' |
|
| 96 | + } else { |
|
| 97 | + echo ' |
|
| 96 | 98 | <a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>'; |
| 99 | + } |
|
| 97 | 100 | } |
| 98 | 101 | |
| 99 | 102 | echo ' |
@@ -104,10 +107,11 @@ discard block |
||
| 104 | 107 | </div><!-- #admincenter -->'; |
| 105 | 108 | |
| 106 | 109 | // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization. |
| 107 | - if (empty($modSettings['disable_smf_js'])) |
|
| 108 | - echo ' |
|
| 110 | + if (empty($modSettings['disable_smf_js'])) { |
|
| 111 | + echo ' |
|
| 109 | 112 | <script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script> |
| 110 | 113 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
| 114 | + } |
|
| 111 | 115 | |
| 112 | 116 | // This sets the announcements and current versions themselves ;). |
| 113 | 117 | echo ' |
@@ -186,9 +190,10 @@ discard block |
||
| 186 | 190 | <em>', $version['version'], '</em>'; |
| 187 | 191 | |
| 188 | 192 | // more details for this item, show them a link |
| 189 | - if ($context['can_admin'] && isset($version['more'])) |
|
| 190 | - echo |
|
| 193 | + if ($context['can_admin'] && isset($version['more'])) { |
|
| 194 | + echo |
|
| 191 | 195 | ' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>'; |
| 196 | + } |
|
| 192 | 197 | echo ' |
| 193 | 198 | <br>'; |
| 194 | 199 | } |
@@ -219,21 +224,23 @@ discard block |
||
| 219 | 224 | |
| 220 | 225 | foreach ($context['credits'] as $section) |
| 221 | 226 | { |
| 222 | - if (isset($section['pretext'])) |
|
| 223 | - echo ' |
|
| 227 | + if (isset($section['pretext'])) { |
|
| 228 | + echo ' |
|
| 224 | 229 | <p>', $section['pretext'], '</p> |
| 225 | 230 | <hr>'; |
| 231 | + } |
|
| 226 | 232 | |
| 227 | 233 | echo ' |
| 228 | 234 | <dl>'; |
| 229 | 235 | |
| 230 | 236 | foreach ($section['groups'] as $group) |
| 231 | 237 | { |
| 232 | - if (isset($group['title'])) |
|
| 233 | - echo ' |
|
| 238 | + if (isset($group['title'])) { |
|
| 239 | + echo ' |
|
| 234 | 240 | <dt> |
| 235 | 241 | <strong>', $group['title'], ':</strong> |
| 236 | 242 | </dt>'; |
| 243 | + } |
|
| 237 | 244 | |
| 238 | 245 | echo ' |
| 239 | 246 | <dd>', implode(', ', $group['members']), '</dd>'; |
@@ -242,10 +249,11 @@ discard block |
||
| 242 | 249 | echo ' |
| 243 | 250 | </dl>'; |
| 244 | 251 | |
| 245 | - if (isset($section['posttext'])) |
|
| 246 | - echo ' |
|
| 252 | + if (isset($section['posttext'])) { |
|
| 253 | + echo ' |
|
| 247 | 254 | <hr> |
| 248 | 255 | <p>', $section['posttext'], '</p>'; |
| 256 | + } |
|
| 249 | 257 | } |
| 250 | 258 | |
| 251 | 259 | echo ' |
@@ -261,9 +269,10 @@ discard block |
||
| 261 | 269 | smfSupportVersions.forum = "', $context['forum_version'], '";'; |
| 262 | 270 | |
| 263 | 271 | // Don't worry, none of this is logged, it's just used to give information that might be of use. |
| 264 | - foreach ($context['current_versions'] as $variable => $version) |
|
| 265 | - echo ' |
|
| 272 | + foreach ($context['current_versions'] as $variable => $version) { |
|
| 273 | + echo ' |
|
| 266 | 274 | smfSupportVersions.', $variable, ' = "', $version['version'], '";'; |
| 275 | + } |
|
| 267 | 276 | |
| 268 | 277 | // Now we just have to include the script and wait ;). |
| 269 | 278 | echo ' |
@@ -360,8 +369,8 @@ discard block |
||
| 360 | 369 | <tbody>'; |
| 361 | 370 | |
| 362 | 371 | // Loop through every source file displaying its version - using javascript. |
| 363 | - foreach ($context['file_versions'] as $filename => $version) |
|
| 364 | - echo ' |
|
| 372 | + foreach ($context['file_versions'] as $filename => $version) { |
|
| 373 | + echo ' |
|
| 365 | 374 | <tr class="windowbg"> |
| 366 | 375 | <td class="half_table"> |
| 367 | 376 | ', $filename, ' |
@@ -373,6 +382,7 @@ discard block |
||
| 373 | 382 | <em id="currentSources', $filename, '">??</em> |
| 374 | 383 | </td> |
| 375 | 384 | </tr>'; |
| 385 | + } |
|
| 376 | 386 | |
| 377 | 387 | // Default template files. |
| 378 | 388 | echo ' |
@@ -398,8 +408,8 @@ discard block |
||
| 398 | 408 | <table id="Default" class="table_grid"> |
| 399 | 409 | <tbody>'; |
| 400 | 410 | |
| 401 | - foreach ($context['default_template_versions'] as $filename => $version) |
|
| 402 | - echo ' |
|
| 411 | + foreach ($context['default_template_versions'] as $filename => $version) { |
|
| 412 | + echo ' |
|
| 403 | 413 | <tr class="windowbg"> |
| 404 | 414 | <td class="half_table"> |
| 405 | 415 | ', $filename, ' |
@@ -411,6 +421,7 @@ discard block |
||
| 411 | 421 | <em id="currentDefault', $filename, '">??</em> |
| 412 | 422 | </td> |
| 413 | 423 | </tr>'; |
| 424 | + } |
|
| 414 | 425 | |
| 415 | 426 | // Now the language files... |
| 416 | 427 | echo ' |
@@ -438,8 +449,8 @@ discard block |
||
| 438 | 449 | |
| 439 | 450 | foreach ($context['default_language_versions'] as $language => $files) |
| 440 | 451 | { |
| 441 | - foreach ($files as $filename => $version) |
|
| 442 | - echo ' |
|
| 452 | + foreach ($files as $filename => $version) { |
|
| 453 | + echo ' |
|
| 443 | 454 | <tr class="windowbg"> |
| 444 | 455 | <td class="half_table"> |
| 445 | 456 | ', $filename, '.<em>', $language, '</em>.php |
@@ -451,6 +462,7 @@ discard block |
||
| 451 | 462 | <em id="current', $filename, '.', $language, '">??</em> |
| 452 | 463 | </td> |
| 453 | 464 | </tr>'; |
| 465 | + } |
|
| 454 | 466 | } |
| 455 | 467 | |
| 456 | 468 | echo ' |
@@ -480,8 +492,8 @@ discard block |
||
| 480 | 492 | <table id="Templates" class="table_grid"> |
| 481 | 493 | <tbody>'; |
| 482 | 494 | |
| 483 | - foreach ($context['template_versions'] as $filename => $version) |
|
| 484 | - echo ' |
|
| 495 | + foreach ($context['template_versions'] as $filename => $version) { |
|
| 496 | + echo ' |
|
| 485 | 497 | <tr class="windowbg"> |
| 486 | 498 | <td class="half_table"> |
| 487 | 499 | ', $filename, ' |
@@ -493,6 +505,7 @@ discard block |
||
| 493 | 505 | <em id="currentTemplates', $filename, '">??</em> |
| 494 | 506 | </td> |
| 495 | 507 | </tr>'; |
| 508 | + } |
|
| 496 | 509 | |
| 497 | 510 | echo ' |
| 498 | 511 | </tbody> |
@@ -522,8 +535,8 @@ discard block |
||
| 522 | 535 | <table id="Tasks" class="table_grid"> |
| 523 | 536 | <tbody>'; |
| 524 | 537 | |
| 525 | - foreach ($context['tasks_versions'] as $filename => $version) |
|
| 526 | - echo ' |
|
| 538 | + foreach ($context['tasks_versions'] as $filename => $version) { |
|
| 539 | + echo ' |
|
| 527 | 540 | <tr class="windowbg"> |
| 528 | 541 | <td class="half_table"> |
| 529 | 542 | ', $filename, ' |
@@ -535,6 +548,7 @@ discard block |
||
| 535 | 548 | <em id="currentTasks', $filename, '">??</em> |
| 536 | 549 | </td> |
| 537 | 550 | </tr>'; |
| 551 | + } |
|
| 538 | 552 | |
| 539 | 553 | echo ' |
| 540 | 554 | </tbody> |
@@ -576,9 +590,10 @@ discard block |
||
| 576 | 590 | { |
| 577 | 591 | global $context, $scripturl, $txt, $modSettings; |
| 578 | 592 | |
| 579 | - if (!empty($context['saved_successful'])) |
|
| 580 | - echo ' |
|
| 593 | + if (!empty($context['saved_successful'])) { |
|
| 594 | + echo ' |
|
| 581 | 595 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 596 | + } |
|
| 582 | 597 | |
| 583 | 598 | // First section is for adding/removing words from the censored list. |
| 584 | 599 | echo ' |
@@ -593,11 +608,12 @@ discard block |
||
| 593 | 608 | <p>', $txt['admin_censored_where'], '</p>'; |
| 594 | 609 | |
| 595 | 610 | // Show text boxes for censoring [bad ] => [good ]. |
| 596 | - foreach ($context['censored_words'] as $vulgar => $proper) |
|
| 597 | - echo ' |
|
| 611 | + foreach ($context['censored_words'] as $vulgar => $proper) { |
|
| 612 | + echo ' |
|
| 598 | 613 | <div class="block"> |
| 599 | 614 | <input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> => <input type="text" name="censor_proper[]" value="', $proper, '" size="30"> |
| 600 | 615 | </div>'; |
| 616 | + } |
|
| 601 | 617 | |
| 602 | 618 | // Now provide a way to censor more words. |
| 603 | 619 | echo ' |
@@ -672,19 +688,21 @@ discard block |
||
| 672 | 688 | <div class="windowbg2 noup"> |
| 673 | 689 | ', $txt['not_done_reason']; |
| 674 | 690 | |
| 675 | - if (!empty($context['continue_percent'])) |
|
| 676 | - echo ' |
|
| 691 | + if (!empty($context['continue_percent'])) { |
|
| 692 | + echo ' |
|
| 677 | 693 | <div class="progress_bar"> |
| 678 | 694 | <div class="full_bar">', $context['continue_percent'], '%</div> |
| 679 | 695 | <div class="green_percent" style="width: ', $context['continue_percent'], '%;"> </div> |
| 680 | 696 | </div>'; |
| 697 | + } |
|
| 681 | 698 | |
| 682 | - if (!empty($context['substep_enabled'])) |
|
| 683 | - echo ' |
|
| 699 | + if (!empty($context['substep_enabled'])) { |
|
| 700 | + echo ' |
|
| 684 | 701 | <div class="progress_bar"> |
| 685 | 702 | <div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div> |
| 686 | 703 | <div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;"> </div> |
| 687 | 704 | </div>'; |
| 705 | + } |
|
| 688 | 706 | |
| 689 | 707 | echo ' |
| 690 | 708 | <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit"> |
@@ -719,35 +737,40 @@ discard block |
||
| 719 | 737 | { |
| 720 | 738 | global $context, $txt, $scripturl; |
| 721 | 739 | |
| 722 | - if (!empty($context['saved_successful'])) |
|
| 723 | - echo ' |
|
| 740 | + if (!empty($context['saved_successful'])) { |
|
| 741 | + echo ' |
|
| 724 | 742 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 725 | - elseif (!empty($context['saved_failed'])) |
|
| 726 | - echo ' |
|
| 743 | + } elseif (!empty($context['saved_failed'])) { |
|
| 744 | + echo ' |
|
| 727 | 745 | <div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>'; |
| 746 | + } |
|
| 728 | 747 | |
| 729 | - if (!empty($context['settings_pre_javascript'])) |
|
| 730 | - echo ' |
|
| 748 | + if (!empty($context['settings_pre_javascript'])) { |
|
| 749 | + echo ' |
|
| 731 | 750 | <script>', $context['settings_pre_javascript'], '</script>'; |
| 751 | + } |
|
| 732 | 752 | |
| 733 | - if (!empty($context['settings_insert_above'])) |
|
| 734 | - echo $context['settings_insert_above']; |
|
| 753 | + if (!empty($context['settings_insert_above'])) { |
|
| 754 | + echo $context['settings_insert_above']; |
|
| 755 | + } |
|
| 735 | 756 | |
| 736 | 757 | echo ' |
| 737 | 758 | <div id="admincenter"> |
| 738 | 759 | <form id="admin_form_wrapper" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>'; |
| 739 | 760 | |
| 740 | 761 | // Is there a custom title? |
| 741 | - if (isset($context['settings_title'])) |
|
| 742 | - echo ' |
|
| 762 | + if (isset($context['settings_title'])) { |
|
| 763 | + echo ' |
|
| 743 | 764 | <div class="cat_bar"> |
| 744 | 765 | <h3 class="catbg">', $context['settings_title'], '</h3> |
| 745 | 766 | </div>'; |
| 767 | + } |
|
| 746 | 768 | |
| 747 | 769 | // Have we got a message to display? |
| 748 | - if (!empty($context['settings_message'])) |
|
| 749 | - echo ' |
|
| 770 | + if (!empty($context['settings_message'])) { |
|
| 771 | + echo ' |
|
| 750 | 772 | <div class="information">', $context['settings_message'], '</div>'; |
| 773 | + } |
|
| 751 | 774 | |
| 752 | 775 | // Now actually loop through all the variables. |
| 753 | 776 | $is_open = false; |
@@ -800,8 +823,9 @@ discard block |
||
| 800 | 823 | // Hang about? Are you pulling my leg - a callback?! |
| 801 | 824 | if (is_array($config_var) && $config_var['type'] == 'callback') |
| 802 | 825 | { |
| 803 | - if (function_exists('template_callback_' . $config_var['name'])) |
|
| 804 | - call_user_func('template_callback_' . $config_var['name']); |
|
| 826 | + if (function_exists('template_callback_' . $config_var['name'])) { |
|
| 827 | + call_user_func('template_callback_' . $config_var['name']); |
|
| 828 | + } |
|
| 805 | 829 | |
| 806 | 830 | continue; |
| 807 | 831 | } |
@@ -831,9 +855,10 @@ discard block |
||
| 831 | 855 | $text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time'); |
| 832 | 856 | |
| 833 | 857 | // Show the [?] button. |
| 834 | - if ($config_var['help']) |
|
| 835 | - echo ' |
|
| 858 | + if ($config_var['help']) { |
|
| 859 | + echo ' |
|
| 836 | 860 | <a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a> '; |
| 861 | + } |
|
| 837 | 862 | |
| 838 | 863 | echo ' |
| 839 | 864 | <a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span> |
@@ -842,22 +867,25 @@ discard block |
||
| 842 | 867 | $config_var['preinput']; |
| 843 | 868 | |
| 844 | 869 | // Show a check box. |
| 845 | - if ($config_var['type'] == 'check') |
|
| 846 | - echo ' |
|
| 870 | + if ($config_var['type'] == 'check') { |
|
| 871 | + echo ' |
|
| 847 | 872 | <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">'; |
| 873 | + } |
|
| 848 | 874 | // Escape (via htmlspecialchars.) the text box. |
| 849 | - elseif ($config_var['type'] == 'password') |
|
| 850 | - echo ' |
|
| 875 | + elseif ($config_var['type'] == 'password') { |
|
| 876 | + echo ' |
|
| 851 | 877 | <input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;"><br> |
| 852 | 878 | <input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
| 879 | + } |
|
| 853 | 880 | // Show a selection box. |
| 854 | 881 | elseif ($config_var['type'] == 'select') |
| 855 | 882 | { |
| 856 | 883 | echo ' |
| 857 | 884 | <select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), (!empty($config_var['multiple']) && !empty($config_var['size']) ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
| 858 | - foreach ($config_var['data'] as $option) |
|
| 859 | - echo ' |
|
| 885 | + foreach ($config_var['data'] as $option) { |
|
| 886 | + echo ' |
|
| 860 | 887 | <option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected' : ''), '>', $option[1], '</option>'; |
| 888 | + } |
|
| 861 | 889 | echo ' |
| 862 | 890 | </select>'; |
| 863 | 891 | } |
@@ -874,16 +902,18 @@ discard block |
||
| 874 | 902 | |
| 875 | 903 | foreach ($context['board_list'] as $id_cat => $cat) |
| 876 | 904 | { |
| 877 | - if (!$first) |
|
| 878 | - echo ' |
|
| 905 | + if (!$first) { |
|
| 906 | + echo ' |
|
| 879 | 907 | <hr>'; |
| 908 | + } |
|
| 880 | 909 | echo ' |
| 881 | 910 | <strong>', $cat['name'], '</strong> |
| 882 | 911 | <ul>'; |
| 883 | 912 | |
| 884 | - foreach ($cat['boards'] as $id_board => $brd) |
|
| 885 | - echo ' |
|
| 913 | + foreach ($cat['boards'] as $id_board => $brd) { |
|
| 914 | + echo ' |
|
| 886 | 915 | <li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat(' ', $brd['child_level']) : '', $brd['name'], '</label></li>'; |
| 916 | + } |
|
| 887 | 917 | |
| 888 | 918 | echo ' |
| 889 | 919 | </ul>'; |
@@ -893,12 +923,14 @@ discard block |
||
| 893 | 923 | </fieldset>'; |
| 894 | 924 | } |
| 895 | 925 | // Text area? |
| 896 | - elseif ($config_var['type'] == 'large_text') |
|
| 897 | - echo ' |
|
| 926 | + elseif ($config_var['type'] == 'large_text') { |
|
| 927 | + echo ' |
|
| 898 | 928 | <textarea rows="', (!empty($config_var['size']) ? $config_var['size'] : (!empty($config_var['rows']) ? $config_var['rows'] : 4)), '" cols="', (!empty($config_var['cols']) ? $config_var['cols'] : 30), '" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>'; |
| 929 | + } |
|
| 899 | 930 | // Permission group? |
| 900 | - elseif ($config_var['type'] == 'permissions') |
|
| 901 | - theme_inline_permissions($config_var['name']); |
|
| 931 | + elseif ($config_var['type'] == 'permissions') { |
|
| 932 | + theme_inline_permissions($config_var['name']); |
|
| 933 | + } |
|
| 902 | 934 | |
| 903 | 935 | // BBC selection? |
| 904 | 936 | elseif ($config_var['type'] == 'bbc') |
@@ -910,20 +942,22 @@ discard block |
||
| 910 | 942 | |
| 911 | 943 | foreach ($context['bbc_columns'] as $bbcColumn) |
| 912 | 944 | { |
| 913 | - foreach ($bbcColumn as $bbcTag) |
|
| 914 | - echo ' |
|
| 945 | + foreach ($bbcColumn as $bbcTag) { |
|
| 946 | + echo ' |
|
| 915 | 947 | <li class="list_bbc floatleft"> |
| 916 | 948 | <input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked' : '', '> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', ' |
| 917 | 949 | </li>'; |
| 950 | + } |
|
| 918 | 951 | } |
| 919 | 952 | echo ' </ul> |
| 920 | 953 | <input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked' : '', '> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label> |
| 921 | 954 | </fieldset>'; |
| 922 | 955 | } |
| 923 | 956 | // A simple message? |
| 924 | - elseif ($config_var['type'] == 'var_message') |
|
| 925 | - echo ' |
|
| 957 | + elseif ($config_var['type'] == 'var_message') { |
|
| 958 | + echo ' |
|
| 926 | 959 | <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>'; |
| 960 | + } |
|
| 927 | 961 | // Assume it must be a text box |
| 928 | 962 | else |
| 929 | 963 | { |
@@ -948,63 +982,70 @@ discard block |
||
| 948 | 982 | ' . $config_var['postinput'] : '',' |
| 949 | 983 | </dd>'; |
| 950 | 984 | } |
| 951 | - } |
|
| 952 | - |
|
| 953 | - else |
|
| 985 | + } else |
|
| 954 | 986 | { |
| 955 | 987 | // Just show a separator. |
| 956 | - if ($config_var == '') |
|
| 957 | - echo ' |
|
| 988 | + if ($config_var == '') { |
|
| 989 | + echo ' |
|
| 958 | 990 | </dl> |
| 959 | 991 | <hr> |
| 960 | 992 | <dl class="settings">'; |
| 961 | - else |
|
| 962 | - echo ' |
|
| 993 | + } else { |
|
| 994 | + echo ' |
|
| 963 | 995 | <dd> |
| 964 | 996 | <strong>' . $config_var . '</strong> |
| 965 | 997 | </dd>'; |
| 998 | + } |
|
| 966 | 999 | } |
| 967 | 1000 | } |
| 968 | 1001 | |
| 969 | - if ($is_open) |
|
| 970 | - echo ' |
|
| 1002 | + if ($is_open) { |
|
| 1003 | + echo ' |
|
| 971 | 1004 | </dl>'; |
| 1005 | + } |
|
| 972 | 1006 | |
| 973 | - if (empty($context['settings_save_dont_show'])) |
|
| 974 | - echo ' |
|
| 1007 | + if (empty($context['settings_save_dont_show'])) { |
|
| 1008 | + echo ' |
|
| 975 | 1009 | <input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">'; |
| 1010 | + } |
|
| 976 | 1011 | |
| 977 | - if ($is_open) |
|
| 978 | - echo ' |
|
| 1012 | + if ($is_open) { |
|
| 1013 | + echo ' |
|
| 979 | 1014 | </div><!-- .windowbg2 -->'; |
| 1015 | + } |
|
| 980 | 1016 | |
| 981 | 1017 | |
| 982 | 1018 | // At least one token has to be used! |
| 983 | - if (isset($context['admin-ssc_token'])) |
|
| 984 | - echo ' |
|
| 1019 | + if (isset($context['admin-ssc_token'])) { |
|
| 1020 | + echo ' |
|
| 985 | 1021 | <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">'; |
| 1022 | + } |
|
| 986 | 1023 | |
| 987 | - if (isset($context['admin-dbsc_token'])) |
|
| 988 | - echo ' |
|
| 1024 | + if (isset($context['admin-dbsc_token'])) { |
|
| 1025 | + echo ' |
|
| 989 | 1026 | <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">'; |
| 1027 | + } |
|
| 990 | 1028 | |
| 991 | - if (isset($context['admin-mp_token'])) |
|
| 992 | - echo ' |
|
| 1029 | + if (isset($context['admin-mp_token'])) { |
|
| 1030 | + echo ' |
|
| 993 | 1031 | <input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">'; |
| 1032 | + } |
|
| 994 | 1033 | |
| 995 | 1034 | echo ' |
| 996 | 1035 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 997 | 1036 | </form> |
| 998 | 1037 | </div><!-- #admincenter -->'; |
| 999 | 1038 | |
| 1000 | - if (!empty($context['settings_post_javascript'])) |
|
| 1001 | - echo ' |
|
| 1039 | + if (!empty($context['settings_post_javascript'])) { |
|
| 1040 | + echo ' |
|
| 1002 | 1041 | <script> |
| 1003 | 1042 | ', $context['settings_post_javascript'], ' |
| 1004 | 1043 | </script>'; |
| 1044 | + } |
|
| 1005 | 1045 | |
| 1006 | - if (!empty($context['settings_insert_below'])) |
|
| 1007 | - echo $context['settings_insert_below']; |
|
| 1046 | + if (!empty($context['settings_insert_below'])) { |
|
| 1047 | + echo $context['settings_insert_below']; |
|
| 1048 | + } |
|
| 1008 | 1049 | |
| 1009 | 1050 | // We may have added a board listing. If we did, we need to make it work. |
| 1010 | 1051 | addInlineJavascript(' |
@@ -1027,9 +1068,10 @@ discard block |
||
| 1027 | 1068 | { |
| 1028 | 1069 | global $context, $txt; |
| 1029 | 1070 | |
| 1030 | - if (!empty($context['saved_successful'])) |
|
| 1031 | - echo ' |
|
| 1071 | + if (!empty($context['saved_successful'])) { |
|
| 1072 | + echo ' |
|
| 1032 | 1073 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 1074 | + } |
|
| 1033 | 1075 | |
| 1034 | 1076 | // Standard fields. |
| 1035 | 1077 | template_show_list('standard_profile_fields'); |
@@ -1062,11 +1104,12 @@ discard block |
||
| 1062 | 1104 | if (isset($_GET['msg'])) |
| 1063 | 1105 | { |
| 1064 | 1106 | loadLanguage('Errors'); |
| 1065 | - if (isset($txt['custom_option_' . $_GET['msg']])) |
|
| 1066 | - echo ' |
|
| 1107 | + if (isset($txt['custom_option_' . $_GET['msg']])) { |
|
| 1108 | + echo ' |
|
| 1067 | 1109 | <div class="errorbox">', |
| 1068 | 1110 | $txt['custom_option_' . $_GET['msg']], ' |
| 1069 | 1111 | </div>'; |
| 1112 | + } |
|
| 1070 | 1113 | } |
| 1071 | 1114 | |
| 1072 | 1115 | echo ' |
@@ -1133,9 +1176,10 @@ discard block |
||
| 1133 | 1176 | <dd> |
| 1134 | 1177 | <select name="placement" id="placement">'; |
| 1135 | 1178 | |
| 1136 | - foreach ($context['cust_profile_fields_placement'] as $order => $name) |
|
| 1137 | - echo ' |
|
| 1179 | + foreach ($context['cust_profile_fields_placement'] as $order => $name) { |
|
| 1180 | + echo ' |
|
| 1138 | 1181 | <option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>'; |
| 1182 | + } |
|
| 1139 | 1183 | |
| 1140 | 1184 | echo ' |
| 1141 | 1185 | </select> |
@@ -1159,9 +1203,10 @@ discard block |
||
| 1159 | 1203 | <dd> |
| 1160 | 1204 | <select name="field_type" id="field_type" onchange="updateInputBoxes();">'; |
| 1161 | 1205 | |
| 1162 | - foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) |
|
| 1163 | - echo ' |
|
| 1206 | + foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) { |
|
| 1207 | + echo ' |
|
| 1164 | 1208 | <option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>'; |
| 1209 | + } |
|
| 1165 | 1210 | |
| 1166 | 1211 | echo ' |
| 1167 | 1212 | </select> |
@@ -1262,9 +1307,10 @@ discard block |
||
| 1262 | 1307 | </fieldset> |
| 1263 | 1308 | <input type="submit" name="save" value="', $txt['save'], '" class="button">'; |
| 1264 | 1309 | |
| 1265 | - if ($context['fid']) |
|
| 1266 | - echo ' |
|
| 1310 | + if ($context['fid']) { |
|
| 1311 | + echo ' |
|
| 1267 | 1312 | <input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">'; |
| 1313 | + } |
|
| 1268 | 1314 | |
| 1269 | 1315 | echo ' |
| 1270 | 1316 | </div><!-- .windowbg2 --> |
@@ -1307,8 +1353,7 @@ discard block |
||
| 1307 | 1353 | { |
| 1308 | 1354 | echo ' |
| 1309 | 1355 | <p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>'; |
| 1310 | - } |
|
| 1311 | - else |
|
| 1356 | + } else |
|
| 1312 | 1357 | { |
| 1313 | 1358 | echo ' |
| 1314 | 1359 | <ol class="search_results">'; |
@@ -1335,9 +1380,10 @@ discard block |
||
| 1335 | 1380 | <li> |
| 1336 | 1381 | <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']'; |
| 1337 | 1382 | |
| 1338 | - if ($result['help']) |
|
| 1339 | - echo ' |
|
| 1383 | + if ($result['help']) { |
|
| 1384 | + echo ' |
|
| 1340 | 1385 | <p class="double_height">', $result['help'], '</p>'; |
| 1386 | + } |
|
| 1341 | 1387 | |
| 1342 | 1388 | echo ' |
| 1343 | 1389 | </li>'; |
@@ -1377,10 +1423,11 @@ discard block |
||
| 1377 | 1423 | <strong>', $txt['setup_verification_answer'], '</strong> |
| 1378 | 1424 | </dd>'; |
| 1379 | 1425 | |
| 1380 | - if (!empty($context['qa_by_lang'][$lang_id])) |
|
| 1381 | - foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1426 | + if (!empty($context['qa_by_lang'][$lang_id])) { |
|
| 1427 | + foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1382 | 1428 | { |
| 1383 | 1429 | $question = $context['question_answers'][$q_id]; |
| 1430 | + } |
|
| 1384 | 1431 | |
| 1385 | 1432 | echo ' |
| 1386 | 1433 | <dt> |
@@ -1388,9 +1435,10 @@ discard block |
||
| 1388 | 1435 | </dt> |
| 1389 | 1436 | <dd>'; |
| 1390 | 1437 | |
| 1391 | - foreach ($question['answers'] as $answer) |
|
| 1392 | - echo ' |
|
| 1438 | + foreach ($question['answers'] as $answer) { |
|
| 1439 | + echo ' |
|
| 1393 | 1440 | <input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">'; |
| 1441 | + } |
|
| 1394 | 1442 | |
| 1395 | 1443 | echo ' |
| 1396 | 1444 | <div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div> |
@@ -1429,11 +1477,12 @@ discard block |
||
| 1429 | 1477 | ', $txt['errors_found'], ': |
| 1430 | 1478 | <ul>'; |
| 1431 | 1479 | |
| 1432 | - foreach ($context['repair_errors'] as $error) |
|
| 1433 | - echo ' |
|
| 1480 | + foreach ($context['repair_errors'] as $error) { |
|
| 1481 | + echo ' |
|
| 1434 | 1482 | <li> |
| 1435 | 1483 | ', $error, ' |
| 1436 | 1484 | </li>'; |
| 1485 | + } |
|
| 1437 | 1486 | |
| 1438 | 1487 | echo ' |
| 1439 | 1488 | </ul> |
@@ -1443,16 +1492,15 @@ discard block |
||
| 1443 | 1492 | <p class="padding"> |
| 1444 | 1493 | <strong><a href="', $scripturl, '?action=admin;area=repairboards;fixErrors;', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=admin;area=maintain">', $txt['no'], '</a></strong> |
| 1445 | 1494 | </p>'; |
| 1446 | - } |
|
| 1447 | - else |
|
| 1448 | - echo ' |
|
| 1495 | + } else { |
|
| 1496 | + echo ' |
|
| 1449 | 1497 | <p>', $txt['maintain_no_errors'], '</p> |
| 1450 | 1498 | <p class="padding"> |
| 1451 | 1499 | <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a> |
| 1452 | 1500 | </p>'; |
| 1501 | + } |
|
| 1453 | 1502 | |
| 1454 | - } |
|
| 1455 | - else |
|
| 1503 | + } else |
|
| 1456 | 1504 | { |
| 1457 | 1505 | if (!empty($context['redirect_to_recount'])) |
| 1458 | 1506 | { |
@@ -1464,8 +1512,7 @@ discard block |
||
| 1464 | 1512 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1465 | 1513 | <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '"> |
| 1466 | 1514 | </form>'; |
| 1467 | - } |
|
| 1468 | - else |
|
| 1515 | + } else |
|
| 1469 | 1516 | { |
| 1470 | 1517 | echo ' |
| 1471 | 1518 | <p>', $txt['errors_fixed'], '</p> |
@@ -1619,8 +1666,8 @@ discard block |
||
| 1619 | 1666 | { |
| 1620 | 1667 | global $context, $txt; |
| 1621 | 1668 | |
| 1622 | - if ($context['user']['is_admin']) |
|
| 1623 | - echo ' |
|
| 1669 | + if ($context['user']['is_admin']) { |
|
| 1670 | + echo ' |
|
| 1624 | 1671 | <span class="floatright admin_search"> |
| 1625 | 1672 | <span class="generic_icons filter centericon"></span> |
| 1626 | 1673 | <input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';"> |
@@ -1631,6 +1678,7 @@ discard block |
||
| 1631 | 1678 | </select> |
| 1632 | 1679 | <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button"> |
| 1633 | 1680 | </span>'; |
| 1634 | -} |
|
| 1681 | + } |
|
| 1682 | + } |
|
| 1635 | 1683 | |
| 1636 | 1684 | ?> |
| 1637 | 1685 | \ No newline at end of file |
@@ -27,9 +27,10 @@ discard block |
||
| 27 | 27 | <h3 class="catbg"> |
| 28 | 28 | <span class="floatleft">', $txt['members_list'], '</span>'; |
| 29 | 29 | |
| 30 | - if (!isset($context['old_search'])) |
|
| 31 | - echo ' |
|
| 30 | + if (!isset($context['old_search'])) { |
|
| 31 | + echo ' |
|
| 32 | 32 | <span class="floatright">', $context['letter_links'], '</span>'; |
| 33 | + } |
|
| 33 | 34 | echo ' |
| 34 | 35 | </h3> |
| 35 | 36 | </div>'; |
@@ -44,19 +45,22 @@ discard block |
||
| 44 | 45 | foreach ($context['columns'] as $key => $column) |
| 45 | 46 | { |
| 46 | 47 | // @TODO maybe find something nicer? |
| 47 | - if ($key == 'email_address' && !$context['can_send_email']) |
|
| 48 | - continue; |
|
| 48 | + if ($key == 'email_address' && !$context['can_send_email']) { |
|
| 49 | + continue; |
|
| 50 | + } |
|
| 49 | 51 | |
| 50 | 52 | // This is a selected column, so underline it or some such. |
| 51 | - if ($column['selected']) |
|
| 52 | - echo ' |
|
| 53 | + if ($column['selected']) { |
|
| 54 | + echo ' |
|
| 53 | 55 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '> |
| 54 | 56 | <a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></th>'; |
| 57 | + } |
|
| 55 | 58 | // This is just some column... show the link and be done with it. |
| 56 | - else |
|
| 57 | - echo ' |
|
| 59 | + else { |
|
| 60 | + echo ' |
|
| 58 | 61 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '> |
| 59 | 62 | ', $column['link'], '</th>'; |
| 63 | + } |
|
| 60 | 64 | } |
| 61 | 65 | echo ' |
| 62 | 66 | </tr> |
@@ -75,9 +79,10 @@ discard block |
||
| 75 | 79 | </td> |
| 76 | 80 | <td class="lefttext">', $member['link'], '</td>'; |
| 77 | 81 | |
| 78 | - if (!isset($context['disabled_fields']['website'])) |
|
| 79 | - echo ' |
|
| 82 | + if (!isset($context['disabled_fields']['website'])) { |
|
| 83 | + echo ' |
|
| 80 | 84 | <td class="centertext website_url">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><span class="generic_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>'; |
| 85 | + } |
|
| 81 | 86 | |
| 82 | 87 | // Group and date. |
| 83 | 88 | echo ' |
@@ -90,11 +95,12 @@ discard block |
||
| 90 | 95 | <td class="centertext" style="white-space: nowrap; width: 15px">', $member['posts'], '</td> |
| 91 | 96 | <td class="centertext statsbar" style="width: 120px">'; |
| 92 | 97 | |
| 93 | - if (!empty($member['post_percent'])) |
|
| 94 | - echo ' |
|
| 98 | + if (!empty($member['post_percent'])) { |
|
| 99 | + echo ' |
|
| 95 | 100 | <div class="bar" style="width: ', $member['post_percent'] + 4, 'px;"> |
| 96 | 101 | <div style="width: ', $member['post_percent'], 'px;"></div> |
| 97 | 102 | </div>'; |
| 103 | + } |
|
| 98 | 104 | |
| 99 | 105 | echo ' |
| 100 | 106 | </td>'; |
@@ -103,9 +109,10 @@ discard block |
||
| 103 | 109 | // Show custom fields marked to be shown here |
| 104 | 110 | if (!empty($context['custom_profile_fields']['columns'])) |
| 105 | 111 | { |
| 106 | - foreach ($context['custom_profile_fields']['columns'] as $key => $column) |
|
| 107 | - echo ' |
|
| 112 | + foreach ($context['custom_profile_fields']['columns'] as $key => $column) { |
|
| 113 | + echo ' |
|
| 108 | 114 | <td class="righttext">', $member['options'][$key], '</td>'; |
| 115 | + } |
|
| 109 | 116 | } |
| 110 | 117 | |
| 111 | 118 | echo ' |
@@ -113,11 +120,12 @@ discard block |
||
| 113 | 120 | } |
| 114 | 121 | } |
| 115 | 122 | // No members? |
| 116 | - else |
|
| 117 | - echo ' |
|
| 123 | + else { |
|
| 124 | + echo ' |
|
| 118 | 125 | <tr> |
| 119 | 126 | <td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td> |
| 120 | 127 | </tr>'; |
| 128 | + } |
|
| 121 | 129 | |
| 122 | 130 | echo ' |
| 123 | 131 | </tbody> |
@@ -130,9 +138,10 @@ discard block |
||
| 130 | 138 | <div class="pagelinks floatleft">', $context['page_index'], '</div>'; |
| 131 | 139 | |
| 132 | 140 | // If it is displaying the result of a search show a "search again" link to edit their criteria. |
| 133 | - if (isset($context['old_search'])) |
|
| 134 | - echo ' |
|
| 141 | + if (isset($context['old_search'])) { |
|
| 142 | + echo ' |
|
| 135 | 143 | <a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>'; |
| 144 | + } |
|
| 136 | 145 | echo ' |
| 137 | 146 | </div> |
| 138 | 147 | </div><!-- #memberlist -->'; |
@@ -23,15 +23,15 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | global $context, $txt; |
| 25 | 25 | |
| 26 | - if (!empty($context['simple_action'])) |
|
| 27 | - echo ' |
|
| 26 | + if (!empty($context['simple_action'])) { |
|
| 27 | + echo ' |
|
| 28 | 28 | <strong> |
| 29 | 29 | ', $context['error_title'], ' |
| 30 | 30 | </strong><br> |
| 31 | 31 | <div ', $context['error_code'], 'class="padding"> |
| 32 | 32 | ', $context['error_message'], ' |
| 33 | 33 | </div>'; |
| 34 | - else |
|
| 34 | + } else |
|
| 35 | 35 | { |
| 36 | 36 | echo ' |
| 37 | 37 | <div id="fatal_error"> |
@@ -87,21 +87,23 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $error_types = array(); |
| 89 | 89 | |
| 90 | - foreach ($context['error_types'] as $type => $details) |
|
| 91 | - $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
| 90 | + foreach ($context['error_types'] as $type => $details) { |
|
| 91 | + $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>'; |
|
| 92 | + } |
|
| 92 | 93 | |
| 93 | 94 | echo ' |
| 94 | 95 | ', implode(' | ', $error_types), ' |
| 95 | 96 | </td> |
| 96 | 97 | </tr>'; |
| 97 | 98 | |
| 98 | - if ($context['has_filter']) |
|
| 99 | - echo ' |
|
| 99 | + if ($context['has_filter']) { |
|
| 100 | + echo ' |
|
| 100 | 101 | <tr> |
| 101 | 102 | <td colspan="3" class="windowbg"> |
| 102 | 103 | <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>] |
| 103 | 104 | </td> |
| 104 | 105 | </tr>'; |
| 106 | + } |
|
| 105 | 107 | |
| 106 | 108 | echo ' |
| 107 | 109 | <tr> |
@@ -112,11 +114,12 @@ discard block |
||
| 112 | 114 | </tr>'; |
| 113 | 115 | |
| 114 | 116 | // No errors, then show a message |
| 115 | - if (count($context['errors']) == 0) |
|
| 116 | - echo ' |
|
| 117 | + if (count($context['errors']) == 0) { |
|
| 118 | + echo ' |
|
| 117 | 119 | <tr class="windowbg"> |
| 118 | 120 | <td class="centertext" colspan="2">', $txt['errlog_no_entries'], '</td> |
| 119 | 121 | </tr>'; |
| 122 | + } |
|
| 120 | 123 | |
| 121 | 124 | // we have some errors, must be some mods installed :P |
| 122 | 125 | foreach ($context['errors'] as $error) |
@@ -130,19 +133,21 @@ discard block |
||
| 130 | 133 | <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> |
| 131 | 134 | ', $error['time'], '<br>'; |
| 132 | 135 | |
| 133 | - if (!empty($error['member']['ip'])) |
|
| 134 | - echo ' |
|
| 136 | + if (!empty($error['member']['ip'])) { |
|
| 137 | + echo ' |
|
| 135 | 138 | <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> |
| 136 | 139 | <strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong> <br>'; |
| 140 | + } |
|
| 137 | 141 | |
| 138 | 142 | echo ' |
| 139 | 143 | </div> |
| 140 | 144 | <div style="float: left; width: 50%; line-height: 1.8em; padding: 0 4px;">'; |
| 141 | 145 | |
| 142 | - if ($error['member']['session'] != '') |
|
| 143 | - echo ' |
|
| 146 | + if ($error['member']['session'] != '') { |
|
| 147 | + echo ' |
|
| 144 | 148 | <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> |
| 145 | 149 | ', $error['member']['session'], '<br>'; |
| 150 | + } |
|
| 146 | 151 | |
| 147 | 152 | echo ' |
| 148 | 153 | <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> |
@@ -156,8 +161,8 @@ discard block |
||
| 156 | 161 | <a style="display: table-cell;" href="', $error['url']['html'], '">', $error['url']['html'], '</a> |
| 157 | 162 | </div>'; |
| 158 | 163 | |
| 159 | - if (!empty($error['file'])) |
|
| 160 | - echo ' |
|
| 164 | + if (!empty($error['file'])) { |
|
| 165 | + echo ' |
|
| 161 | 166 | <div style="float: left; width: 100%; padding: 4px 0; line-height: 1.6em; border-top: 1px solid #e3e3e3;"> |
| 162 | 167 | <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> |
| 163 | 168 | <div> |
@@ -165,6 +170,7 @@ discard block |
||
| 165 | 170 | ', $txt['line'], ': ', $error['file']['line'], ' |
| 166 | 171 | </div> |
| 167 | 172 | </div>'; |
| 173 | + } |
|
| 168 | 174 | |
| 169 | 175 | echo ' |
| 170 | 176 | </td> |
@@ -192,9 +198,10 @@ discard block |
||
| 192 | 198 | </div> |
| 193 | 199 | </div>'; |
| 194 | 200 | |
| 195 | - if ($context['sort_direction'] == 'down') |
|
| 196 | - echo ' |
|
| 201 | + if ($context['sort_direction'] == 'down') { |
|
| 202 | + echo ' |
|
| 197 | 203 | <input type="hidden" name="desc" value="1">'; |
| 204 | + } |
|
| 198 | 205 | |
| 199 | 206 | echo ' |
| 200 | 207 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | foreach ($message['custom_fields']['above_member'] as $custom) |
| 234 | 234 | echo ' |
| 235 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 235 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 236 | 236 | |
| 237 | 237 | echo ' |
| 238 | 238 | </ul> |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | if (!empty($message['custom_fields']['below_avatar'])) |
| 270 | 270 | foreach ($message['custom_fields']['below_avatar'] as $custom) |
| 271 | 271 | echo ' |
| 272 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 272 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 273 | 273 | |
| 274 | 274 | if (!$message['member']['is_guest']) |
| 275 | 275 | echo ' |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | foreach ($message['custom_fields']['icons'] as $custom) |
| 313 | 313 | echo ' |
| 314 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 314 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 315 | 315 | |
| 316 | 316 | echo ' |
| 317 | 317 | </ol> |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | if (!empty($message['custom_fields']['standard'])) |
| 370 | 370 | foreach ($message['custom_fields']['standard'] as $custom) |
| 371 | 371 | echo ' |
| 372 | - <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
| 372 | + <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
| 373 | 373 | |
| 374 | 374 | // Are we showing the warning status? |
| 375 | 375 | if ($message['member']['can_see_warning']) |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | if (!empty($message['custom_fields']['bottom_poster'])) |
| 381 | 381 | foreach ($message['custom_fields']['bottom_poster'] as $custom) |
| 382 | 382 | echo ' |
| 383 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 383 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | // Done with the information about the poster... on to the post itself. |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | |
| 482 | 482 | foreach ($message['custom_fields']['above_signature'] as $custom) |
| 483 | 483 | echo ' |
| 484 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 484 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 485 | 485 | |
| 486 | 486 | echo ' |
| 487 | 487 | </ul> |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | foreach ($message['custom_fields']['below_signature'] as $custom) |
| 504 | 504 | echo ' |
| 505 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
| 505 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
| 506 | 506 | |
| 507 | 507 | echo ' |
| 508 | 508 | </ul> |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | while ($message = $context['get_pmessage']('subject')) |
| 642 | 642 | { |
| 643 | 643 | echo ' |
| 644 | - <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','"> |
|
| 644 | + <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '"> |
|
| 645 | 645 | <td class="table_icon"> |
| 646 | 646 | <script> |
| 647 | 647 | currentLabels[', $message['id'], '] = {'; |
@@ -926,13 +926,13 @@ discard block |
||
| 926 | 926 | // You can only reply if they are not a guest... |
| 927 | 927 | if (!$message['member']['is_guest']) |
| 928 | 928 | echo ' |
| 929 | - <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'], ' |
|
| 930 | - <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']; |
|
| 929 | + <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'], ' |
|
| 930 | + <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']; |
|
| 931 | 931 | |
| 932 | 932 | // This is for "forwarding" - even if the member is gone. |
| 933 | 933 | else |
| 934 | 934 | echo ' |
| 935 | - <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']; |
|
| 935 | + <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']; |
|
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | echo ' |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> |
| 1038 | 1038 | <dl> |
| 1039 | 1039 | <dt> |
| 1040 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
| 1040 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
| 1041 | 1041 | </dt> |
| 1042 | 1042 | <dd class="error" id="error_list"> |
| 1043 | 1043 | ', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), ' |
@@ -1093,7 +1093,7 @@ discard block |
||
| 1093 | 1093 | <span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span> |
| 1094 | 1094 | </dt> |
| 1095 | 1095 | <dd id="pm_subject"> |
| 1096 | - <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/> |
|
| 1096 | + <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/> |
|
| 1097 | 1097 | </dd> |
| 1098 | 1098 | </dl> |
| 1099 | 1099 | <hr>'; |
@@ -1462,7 +1462,7 @@ discard block |
||
| 1462 | 1462 | echo ' |
| 1463 | 1463 | <div class="padding"> |
| 1464 | 1464 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
| 1465 | - <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
|
| 1465 | + <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure"> |
|
| 1466 | 1466 | </div>'; |
| 1467 | 1467 | |
| 1468 | 1468 | echo ' |
@@ -1627,7 +1627,7 @@ discard block |
||
| 1627 | 1627 | if (!empty($context['rules'])) |
| 1628 | 1628 | echo ' |
| 1629 | 1629 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1630 | - <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
|
| 1630 | + <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">'; |
|
| 1631 | 1631 | |
| 1632 | 1632 | echo ' |
| 1633 | 1633 | </div> |
@@ -1871,9 +1871,9 @@ discard block |
||
| 1871 | 1871 | |
| 1872 | 1872 | echo ' |
| 1873 | 1873 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
| 1874 | - <option value="">', $txt['pm_rule_sel_action'] , ':</option> |
|
| 1875 | - <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option> |
|
| 1876 | - <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option> |
|
| 1874 | + <option value="">', $txt['pm_rule_sel_action'], ':</option> |
|
| 1875 | + <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option> |
|
| 1876 | + <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option> |
|
| 1877 | 1877 | </select> |
| 1878 | 1878 | <span id="labdiv', $k, '"> |
| 1879 | 1879 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
@@ -1987,7 +1987,7 @@ discard block |
||
| 1987 | 1987 | </div> |
| 1988 | 1988 | <ul class="quickbuttons"> |
| 1989 | 1989 | <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> |
| 1990 | - <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> |
|
| 1990 | + <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> |
|
| 1991 | 1991 | </ul> |
| 1992 | 1992 | </div><!-- .windowbg -->'; |
| 1993 | 1993 | } |
@@ -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 | { |
@@ -194,14 +195,15 @@ discard block |
||
| 194 | 195 | if ($context['get_pmessage']('message', true)) |
| 195 | 196 | { |
| 196 | 197 | // Show the helpful titlebar - generally. |
| 197 | - if ($context['display_mode'] != 1) |
|
| 198 | - echo ' |
|
| 198 | + if ($context['display_mode'] != 1) { |
|
| 199 | + echo ' |
|
| 199 | 200 | <div class="cat_bar"> |
| 200 | 201 | <h3 class="catbg"> |
| 201 | 202 | <span id="author">', $txt['author'], '</span> |
| 202 | 203 | <span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span> |
| 203 | 204 | </h3> |
| 204 | 205 | </div>'; |
| 206 | + } |
|
| 205 | 207 | |
| 206 | 208 | // Show a few buttons if we are in conversation mode and outputting the first message. |
| 207 | 209 | if ($context['display_mode'] == 2) |
@@ -230,9 +232,10 @@ discard block |
||
| 230 | 232 | <div class="custom_fields_above_member"> |
| 231 | 233 | <ul class="nolist">'; |
| 232 | 234 | |
| 233 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
| 234 | - echo ' |
|
| 235 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
| 236 | + echo ' |
|
| 235 | 237 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 238 | + } |
|
| 236 | 239 | |
| 237 | 240 | echo ' |
| 238 | 241 | </ul> |
@@ -244,9 +247,10 @@ discard block |
||
| 244 | 247 | <a id="msg', $message['id'], '"></a>'; |
| 245 | 248 | |
| 246 | 249 | // Show online and offline buttons? |
| 247 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
| 248 | - echo ' |
|
| 250 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
| 251 | + echo ' |
|
| 249 | 252 | <span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>'; |
| 253 | + } |
|
| 250 | 254 | |
| 251 | 255 | // Show a link to the member's profile (but only if the sender isn't a guest). |
| 252 | 256 | echo ' |
@@ -259,48 +263,56 @@ discard block |
||
| 259 | 263 | <ul class="user_info">'; |
| 260 | 264 | |
| 261 | 265 | // Show the user's avatar. |
| 262 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
| 263 | - echo ' |
|
| 266 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
| 267 | + echo ' |
|
| 264 | 268 | <li class="avatar"> |
| 265 | 269 | <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a> |
| 266 | 270 | </li>'; |
| 271 | + } |
|
| 267 | 272 | |
| 268 | 273 | // Are there any custom fields below the avatar? |
| 269 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
| 270 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 274 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
| 275 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
| 271 | 276 | echo ' |
| 272 | 277 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 278 | + } |
|
| 273 | 279 | |
| 274 | - if (!$message['member']['is_guest']) |
|
| 275 | - echo ' |
|
| 280 | + if (!$message['member']['is_guest']) { |
|
| 281 | + echo ' |
|
| 276 | 282 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
| 283 | + } |
|
| 277 | 284 | // Show the member's primary group (like 'Administrator') if they have one. |
| 278 | - if (isset($message['member']['group']) && $message['member']['group'] != '') |
|
| 279 | - echo ' |
|
| 285 | + if (isset($message['member']['group']) && $message['member']['group'] != '') { |
|
| 286 | + echo ' |
|
| 280 | 287 | <li class="membergroup">', $message['member']['group'], '</li>'; |
| 288 | + } |
|
| 281 | 289 | |
| 282 | 290 | // Show the member's custom title, if they have one. |
| 283 | - if (isset($message['member']['title']) && $message['member']['title'] != '') |
|
| 284 | - echo ' |
|
| 291 | + if (isset($message['member']['title']) && $message['member']['title'] != '') { |
|
| 292 | + echo ' |
|
| 285 | 293 | <li class="title">', $message['member']['title'], '</li>'; |
| 294 | + } |
|
| 286 | 295 | |
| 287 | 296 | // Don't show these things for guests. |
| 288 | 297 | if (!$message['member']['is_guest']) |
| 289 | 298 | { |
| 290 | 299 | // 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. |
| 291 | - if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') |
|
| 292 | - echo ' |
|
| 300 | + if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') { |
|
| 301 | + echo ' |
|
| 293 | 302 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
| 303 | + } |
|
| 294 | 304 | |
| 295 | 305 | // Show how many posts they have made. |
| 296 | - if (!isset($context['disabled_fields']['posts'])) |
|
| 297 | - echo ' |
|
| 306 | + if (!isset($context['disabled_fields']['posts'])) { |
|
| 307 | + echo ' |
|
| 298 | 308 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
| 309 | + } |
|
| 299 | 310 | |
| 300 | 311 | // Show their personal text? |
| 301 | - if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') |
|
| 302 | - echo ' |
|
| 312 | + if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') { |
|
| 313 | + echo ' |
|
| 303 | 314 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
| 315 | + } |
|
| 304 | 316 | |
| 305 | 317 | // Any custom fields to show as icons? |
| 306 | 318 | if (!empty($message['custom_fields']['icons'])) |
@@ -309,9 +321,10 @@ discard block |
||
| 309 | 321 | <li class="im_icons"> |
| 310 | 322 | <ol>'; |
| 311 | 323 | |
| 312 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
| 313 | - echo ' |
|
| 324 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
| 325 | + echo ' |
|
| 314 | 326 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 327 | + } |
|
| 315 | 328 | |
| 316 | 329 | echo ' |
| 317 | 330 | </ol> |
@@ -319,19 +332,22 @@ discard block |
||
| 319 | 332 | } |
| 320 | 333 | |
| 321 | 334 | // Show the IP to this user for this post - because you can moderate? |
| 322 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
| 323 | - echo ' |
|
| 335 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
| 336 | + echo ' |
|
| 324 | 337 | <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>'; |
| 338 | + } |
|
| 325 | 339 | |
| 326 | 340 | // Or, should we show it because this is you? |
| 327 | - elseif ($message['can_see_ip']) |
|
| 328 | - echo ' |
|
| 341 | + elseif ($message['can_see_ip']) { |
|
| 342 | + echo ' |
|
| 329 | 343 | <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>'; |
| 344 | + } |
|
| 330 | 345 | |
| 331 | 346 | // Okay, you are logged in, then we can show something about why IPs are logged... |
| 332 | - else |
|
| 333 | - echo ' |
|
| 347 | + else { |
|
| 348 | + echo ' |
|
| 334 | 349 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
| 350 | + } |
|
| 335 | 351 | |
| 336 | 352 | // Show the profile, website, email address, and personal message buttons. |
| 337 | 353 | if ($message['member']['show_profile_buttons']) |
@@ -341,24 +357,28 @@ discard block |
||
| 341 | 357 | <ol class="profile_icons">'; |
| 342 | 358 | |
| 343 | 359 | // Show the profile button |
| 344 | - if ($message['member']['can_view_profile']) |
|
| 345 | - echo ' |
|
| 360 | + if ($message['member']['can_view_profile']) { |
|
| 361 | + echo ' |
|
| 346 | 362 | <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>'; |
| 363 | + } |
|
| 347 | 364 | |
| 348 | 365 | // Don't show an icon if they haven't specified a website. |
| 349 | - if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) |
|
| 350 | - echo ' |
|
| 366 | + if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) { |
|
| 367 | + echo ' |
|
| 351 | 368 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
| 369 | + } |
|
| 352 | 370 | |
| 353 | 371 | // Don't show the email address if they want it hidden. |
| 354 | - if ($message['member']['show_email']) |
|
| 355 | - echo ' |
|
| 372 | + if ($message['member']['show_email']) { |
|
| 373 | + echo ' |
|
| 356 | 374 | <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>'; |
| 375 | + } |
|
| 357 | 376 | |
| 358 | 377 | // Since we know this person isn't a guest, you *can* message them. |
| 359 | - if ($context['can_send_pm']) |
|
| 360 | - echo ' |
|
| 378 | + if ($context['can_send_pm']) { |
|
| 379 | + echo ' |
|
| 361 | 380 | <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>'; |
| 381 | + } |
|
| 362 | 382 | |
| 363 | 383 | echo ' |
| 364 | 384 | </ol> |
@@ -366,21 +386,24 @@ discard block |
||
| 366 | 386 | } |
| 367 | 387 | |
| 368 | 388 | // Any custom fields for standard placement? |
| 369 | - if (!empty($message['custom_fields']['standard'])) |
|
| 370 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
| 389 | + if (!empty($message['custom_fields']['standard'])) { |
|
| 390 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
| 371 | 391 | echo ' |
| 372 | 392 | <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
| 393 | + } |
|
| 373 | 394 | |
| 374 | 395 | // Are we showing the warning status? |
| 375 | - if ($message['member']['can_see_warning']) |
|
| 376 | - echo ' |
|
| 396 | + if ($message['member']['can_see_warning']) { |
|
| 397 | + echo ' |
|
| 377 | 398 | <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>'; |
| 399 | + } |
|
| 378 | 400 | |
| 379 | 401 | // Are there any custom fields to show at the bottom of the poster info? |
| 380 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
| 381 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 402 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
| 403 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
| 382 | 404 | echo ' |
| 383 | 405 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 406 | + } |
|
| 384 | 407 | } |
| 385 | 408 | |
| 386 | 409 | // Done with the information about the poster... on to the post itself. |
@@ -399,25 +422,29 @@ discard block |
||
| 399 | 422 | <span class="smalltext">« <strong> ', $txt['sent_to'], ':</strong> '; |
| 400 | 423 | |
| 401 | 424 | // People it was sent directly to.... |
| 402 | - if (!empty($message['recipients']['to'])) |
|
| 403 | - echo implode(', ', $message['recipients']['to']); |
|
| 425 | + if (!empty($message['recipients']['to'])) { |
|
| 426 | + echo implode(', ', $message['recipients']['to']); |
|
| 427 | + } |
|
| 404 | 428 | |
| 405 | 429 | // Otherwise, we're just going to say "some people"... |
| 406 | - elseif ($context['folder'] != 'sent') |
|
| 407 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 430 | + elseif ($context['folder'] != 'sent') { |
|
| 431 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 432 | + } |
|
| 408 | 433 | |
| 409 | 434 | echo ' |
| 410 | 435 | <strong> ', $txt['on'], ':</strong> ', $message['time'], ' » |
| 411 | 436 | </span>'; |
| 412 | 437 | |
| 413 | 438 | // If we're in the sent items, show who it was sent to besides the "To:" people. |
| 414 | - if (!empty($message['recipients']['bcc'])) |
|
| 415 | - echo ' |
|
| 439 | + if (!empty($message['recipients']['bcc'])) { |
|
| 440 | + echo ' |
|
| 416 | 441 | <br><span class="smalltext">« <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' »</span>'; |
| 442 | + } |
|
| 417 | 443 | |
| 418 | - if (!empty($message['is_replied_to'])) |
|
| 419 | - echo ' |
|
| 444 | + if (!empty($message['is_replied_to'])) { |
|
| 445 | + echo ' |
|
| 420 | 446 | <br><span class="smalltext">« ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' »</span>'; |
| 447 | + } |
|
| 421 | 448 | |
| 422 | 449 | echo ' |
| 423 | 450 | </div><!-- .keyinfo --> |
@@ -425,13 +452,15 @@ discard block |
||
| 425 | 452 | <div class="post"> |
| 426 | 453 | <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>'; |
| 427 | 454 | |
| 428 | - if ($message['can_report'] || $context['can_send_pm']) |
|
| 429 | - echo ' |
|
| 455 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
| 456 | + echo ' |
|
| 430 | 457 | <div class="under_message">'; |
| 458 | + } |
|
| 431 | 459 | |
| 432 | - if ($message['can_report']) |
|
| 433 | - echo ' |
|
| 460 | + if ($message['can_report']) { |
|
| 461 | + echo ' |
|
| 434 | 462 | <a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>'; |
| 463 | + } |
|
| 435 | 464 | |
| 436 | 465 | echo ' |
| 437 | 466 | <ul class="quickbuttons">'; |
@@ -443,32 +472,36 @@ discard block |
||
| 443 | 472 | if (!$message['member']['is_guest']) |
| 444 | 473 | { |
| 445 | 474 | // Is there than more than one recipient you can reply to? |
| 446 | - if ($message['number_recipients'] > 1) |
|
| 447 | - echo ' |
|
| 475 | + if ($message['number_recipients'] > 1) { |
|
| 476 | + echo ' |
|
| 448 | 477 | <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>'; |
| 478 | + } |
|
| 449 | 479 | |
| 450 | 480 | echo ' |
| 451 | 481 | <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> |
| 452 | 482 | <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>'; |
| 453 | 483 | } |
| 454 | 484 | // This is for "forwarding" - even if the member is gone. |
| 455 | - else |
|
| 456 | - echo ' |
|
| 485 | + else { |
|
| 486 | + echo ' |
|
| 457 | 487 | <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>'; |
| 488 | + } |
|
| 458 | 489 | } |
| 459 | 490 | echo ' |
| 460 | 491 | <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>'; |
| 461 | 492 | |
| 462 | - if (empty($context['display_mode'])) |
|
| 463 | - echo ' |
|
| 493 | + if (empty($context['display_mode'])) { |
|
| 494 | + echo ' |
|
| 464 | 495 | <li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;"></li>'; |
| 496 | + } |
|
| 465 | 497 | |
| 466 | 498 | echo ' |
| 467 | 499 | </ul>'; |
| 468 | 500 | |
| 469 | - if ($message['can_report'] || $context['can_send_pm']) |
|
| 470 | - echo ' |
|
| 501 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
| 502 | + echo ' |
|
| 471 | 503 | </div><!-- .under_message -->'; |
| 504 | + } |
|
| 472 | 505 | |
| 473 | 506 | // Are there any custom profile fields for above the signature? |
| 474 | 507 | if (!empty($message['custom_fields']['above_signature'])) |
@@ -477,9 +510,10 @@ discard block |
||
| 477 | 510 | <div class="custom_fields_above_signature"> |
| 478 | 511 | <ul class="nolist">'; |
| 479 | 512 | |
| 480 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
| 481 | - echo ' |
|
| 513 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
| 514 | + echo ' |
|
| 482 | 515 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 516 | + } |
|
| 483 | 517 | |
| 484 | 518 | echo ' |
| 485 | 519 | </ul> |
@@ -487,9 +521,10 @@ discard block |
||
| 487 | 521 | } |
| 488 | 522 | |
| 489 | 523 | // Show the member's signature? |
| 490 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
| 491 | - echo ' |
|
| 524 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
| 525 | + echo ' |
|
| 492 | 526 | <div class="signature">', $message['member']['signature'], '</div>'; |
| 527 | + } |
|
| 493 | 528 | |
| 494 | 529 | // Are there any custom profile fields for below the signature? |
| 495 | 530 | if (!empty($message['custom_fields']['below_signature'])) |
@@ -498,9 +533,10 @@ discard block |
||
| 498 | 533 | <div class="custom_fields_below_signature"> |
| 499 | 534 | <ul class="nolist">'; |
| 500 | 535 | |
| 501 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
| 502 | - echo ' |
|
| 536 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
| 537 | + echo ' |
|
| 503 | 538 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
| 539 | + } |
|
| 504 | 540 | |
| 505 | 541 | echo ' |
| 506 | 542 | </ul> |
@@ -527,10 +563,11 @@ discard block |
||
| 527 | 563 | echo ' |
| 528 | 564 | <option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>'; |
| 529 | 565 | |
| 530 | - foreach ($context['labels'] as $label) |
|
| 531 | - if (!isset($message['labels'][$label['id']])) |
|
| 566 | + foreach ($context['labels'] as $label) { |
|
| 567 | + if (!isset($message['labels'][$label['id']])) |
|
| 532 | 568 | echo ' |
| 533 | 569 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
| 570 | + } |
|
| 534 | 571 | } |
| 535 | 572 | |
| 536 | 573 | // ... and are there any that can be removed? |
@@ -539,9 +576,10 @@ discard block |
||
| 539 | 576 | echo ' |
| 540 | 577 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
| 541 | 578 | |
| 542 | - foreach ($message['labels'] as $label) |
|
| 543 | - echo ' |
|
| 579 | + foreach ($message['labels'] as $label) { |
|
| 580 | + echo ' |
|
| 544 | 581 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
| 582 | + } |
|
| 545 | 583 | } |
| 546 | 584 | echo ' |
| 547 | 585 | </select> |
@@ -560,8 +598,8 @@ discard block |
||
| 560 | 598 | </div><!-- .windowbg -->'; |
| 561 | 599 | } |
| 562 | 600 | |
| 563 | - if (empty($context['display_mode'])) |
|
| 564 | - echo ' |
|
| 601 | + if (empty($context['display_mode'])) { |
|
| 602 | + echo ' |
|
| 565 | 603 | |
| 566 | 604 | <div class="pagesection"> |
| 567 | 605 | <div class="floatleft">', $context['page_index'], '</div> |
@@ -569,6 +607,7 @@ discard block |
||
| 569 | 607 | <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"> |
| 570 | 608 | </div> |
| 571 | 609 | </div>'; |
| 610 | + } |
|
| 572 | 611 | |
| 573 | 612 | // Show a few buttons if we are in conversation mode and outputting the first message. |
| 574 | 613 | elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons'])) |
@@ -629,11 +668,12 @@ discard block |
||
| 629 | 668 | </thead> |
| 630 | 669 | <tbody>'; |
| 631 | 670 | |
| 632 | - if (!$context['show_delete']) |
|
| 633 | - echo ' |
|
| 671 | + if (!$context['show_delete']) { |
|
| 672 | + echo ' |
|
| 634 | 673 | <tr class="windowbg"> |
| 635 | 674 | <td colspan="5">', $txt['pm_alert_none'], '</td> |
| 636 | 675 | </tr>'; |
| 676 | + } |
|
| 637 | 677 | |
| 638 | 678 | while ($message = $context['get_pmessage']('subject')) |
| 639 | 679 | { |
@@ -693,9 +733,10 @@ discard block |
||
| 693 | 733 | |
| 694 | 734 | foreach ($context['labels'] as $label) |
| 695 | 735 | { |
| 696 | - if ($label['id'] != $context['current_label_id']) |
|
| 697 | - echo ' |
|
| 736 | + if ($label['id'] != $context['current_label_id']) { |
|
| 737 | + echo ' |
|
| 698 | 738 | <option value="add_', $label['id'], '"> ', $label['name'], '</option>'; |
| 739 | + } |
|
| 699 | 740 | } |
| 700 | 741 | |
| 701 | 742 | echo ' |
@@ -781,9 +822,10 @@ discard block |
||
| 781 | 822 | <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" 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" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd> |
| 782 | 823 | </dl>'; |
| 783 | 824 | |
| 784 | - if (!$context['currently_using_labels']) |
|
| 785 | - echo ' |
|
| 825 | + if (!$context['currently_using_labels']) { |
|
| 826 | + echo ' |
|
| 786 | 827 | <input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button">'; |
| 828 | + } |
|
| 787 | 829 | |
| 788 | 830 | echo ' |
| 789 | 831 | <br class="clear_right"> |
@@ -804,12 +846,13 @@ discard block |
||
| 804 | 846 | <div id="advanced_panel_div"> |
| 805 | 847 | <ul id="searchLabelsExpand">'; |
| 806 | 848 | |
| 807 | - foreach ($context['search_labels'] as $label) |
|
| 808 | - echo ' |
|
| 849 | + foreach ($context['search_labels'] as $label) { |
|
| 850 | + echo ' |
|
| 809 | 851 | <li> |
| 810 | 852 | <label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', '> |
| 811 | 853 | ', $label['name'], '</label> |
| 812 | 854 | </li>'; |
| 855 | + } |
|
| 813 | 856 | |
| 814 | 857 | echo ' |
| 815 | 858 | </ul> |
@@ -871,8 +914,8 @@ discard block |
||
| 871 | 914 | </div>'; |
| 872 | 915 | |
| 873 | 916 | // complete results ? |
| 874 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
| 875 | - echo ' |
|
| 917 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
| 918 | + echo ' |
|
| 876 | 919 | <table class="table_grid"> |
| 877 | 920 | <thead> |
| 878 | 921 | <tr class="title_bar"> |
@@ -882,6 +925,7 @@ discard block |
||
| 882 | 925 | </tr> |
| 883 | 926 | </thead> |
| 884 | 927 | <tbody>'; |
| 928 | + } |
|
| 885 | 929 | |
| 886 | 930 | // Print each message out... |
| 887 | 931 | foreach ($context['personal_messages'] as $message) |
@@ -901,12 +945,14 @@ discard block |
||
| 901 | 945 | |
| 902 | 946 | // Show the recipients. |
| 903 | 947 | // @todo This doesn't deal with the sent item searching quite right for bcc. |
| 904 | - if (!empty($message['recipients']['to'])) |
|
| 905 | - echo implode(', ', $message['recipients']['to']); |
|
| 948 | + if (!empty($message['recipients']['to'])) { |
|
| 949 | + echo implode(', ', $message['recipients']['to']); |
|
| 950 | + } |
|
| 906 | 951 | |
| 907 | 952 | // Otherwise, we're just going to say "some people"... |
| 908 | - elseif ($context['folder'] != 'sent') |
|
| 909 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 953 | + elseif ($context['folder'] != 'sent') { |
|
| 954 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
| 955 | + } |
|
| 910 | 956 | |
| 911 | 957 | echo ' |
| 912 | 958 | </h3> |
@@ -921,15 +967,17 @@ discard block |
||
| 921 | 967 | $reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"'); |
| 922 | 968 | |
| 923 | 969 | // You can only reply if they are not a guest... |
| 924 | - if (!$message['member']['is_guest']) |
|
| 925 | - echo ' |
|
| 970 | + if (!$message['member']['is_guest']) { |
|
| 971 | + echo ' |
|
| 926 | 972 | <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'], ' |
| 927 | 973 | <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']; |
| 974 | + } |
|
| 928 | 975 | |
| 929 | 976 | // This is for "forwarding" - even if the member is gone. |
| 930 | - else |
|
| 931 | - echo ' |
|
| 977 | + else { |
|
| 978 | + echo ' |
|
| 932 | 979 | <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']; |
| 980 | + } |
|
| 933 | 981 | } |
| 934 | 982 | |
| 935 | 983 | echo ' |
@@ -950,17 +998,19 @@ discard block |
||
| 950 | 998 | } |
| 951 | 999 | |
| 952 | 1000 | // Finish off the page... |
| 953 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
| 954 | - echo ' |
|
| 1001 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
| 1002 | + echo ' |
|
| 955 | 1003 | </tbody> |
| 956 | 1004 | </table>'; |
| 1005 | + } |
|
| 957 | 1006 | |
| 958 | 1007 | // No results? |
| 959 | - if (empty($context['personal_messages'])) |
|
| 960 | - echo ' |
|
| 1008 | + if (empty($context['personal_messages'])) { |
|
| 1009 | + echo ' |
|
| 961 | 1010 | <div class="windowbg"> |
| 962 | 1011 | <p class="centertext">', $txt['pm_search_none_found'], '</p> |
| 963 | 1012 | </div>'; |
| 1013 | + } |
|
| 964 | 1014 | |
| 965 | 1015 | echo ' |
| 966 | 1016 | <div class="pagesection"> |
@@ -985,15 +1035,17 @@ discard block |
||
| 985 | 1035 | </div> |
| 986 | 1036 | <div class="windowbg">'; |
| 987 | 1037 | |
| 988 | - if (!empty($context['send_log']['sent'])) |
|
| 989 | - foreach ($context['send_log']['sent'] as $log_entry) |
|
| 1038 | + if (!empty($context['send_log']['sent'])) { |
|
| 1039 | + foreach ($context['send_log']['sent'] as $log_entry) |
|
| 990 | 1040 | echo ' |
| 991 | 1041 | <span class="error">', $log_entry, '</span><br>'; |
| 1042 | + } |
|
| 992 | 1043 | |
| 993 | - if (!empty($context['send_log']['failed'])) |
|
| 994 | - foreach ($context['send_log']['failed'] as $log_entry) |
|
| 1044 | + if (!empty($context['send_log']['failed'])) { |
|
| 1045 | + foreach ($context['send_log']['failed'] as $log_entry) |
|
| 995 | 1046 | echo ' |
| 996 | 1047 | <span class="error">', $log_entry, '</span><br>'; |
| 1048 | + } |
|
| 997 | 1049 | |
| 998 | 1050 | echo ' |
| 999 | 1051 | </div> |
@@ -1042,12 +1094,13 @@ discard block |
||
| 1042 | 1094 | </dl> |
| 1043 | 1095 | </div>'; |
| 1044 | 1096 | |
| 1045 | - if (!empty($modSettings['drafts_pm_enabled'])) |
|
| 1046 | - echo ' |
|
| 1097 | + if (!empty($modSettings['drafts_pm_enabled'])) { |
|
| 1098 | + echo ' |
|
| 1047 | 1099 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
| 1048 | 1100 | sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), ' |
| 1049 | 1101 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
| 1050 | 1102 | </div>'; |
| 1103 | + } |
|
| 1051 | 1104 | |
| 1052 | 1105 | echo ' |
| 1053 | 1106 | <dl id="post_header">'; |
@@ -1103,9 +1156,10 @@ discard block |
||
| 1103 | 1156 | } |
| 1104 | 1157 | |
| 1105 | 1158 | // What about smileys? |
| 1106 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
| 1107 | - echo ' |
|
| 1159 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
| 1160 | + echo ' |
|
| 1108 | 1161 | <div id="smileyBox_message"></div>'; |
| 1162 | + } |
|
| 1109 | 1163 | |
| 1110 | 1164 | // Show BBC buttons, smileys and textbox. |
| 1111 | 1165 | echo ' |
@@ -1152,10 +1206,11 @@ discard block |
||
| 1152 | 1206 | <dt><strong>', $txt['subject'], '</strong></dt> |
| 1153 | 1207 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
| 1154 | 1208 | |
| 1155 | - foreach ($context['drafts'] as $draft) |
|
| 1156 | - echo ' |
|
| 1209 | + foreach ($context['drafts'] as $draft) { |
|
| 1210 | + echo ' |
|
| 1157 | 1211 | <dt>', $draft['link'], '</dt> |
| 1158 | 1212 | <dd>', $draft['poster_time'], '</dd>'; |
| 1213 | + } |
|
| 1159 | 1214 | echo ' |
| 1160 | 1215 | </dl> |
| 1161 | 1216 | </div>'; |
@@ -1262,8 +1317,8 @@ discard block |
||
| 1262 | 1317 | }'; |
| 1263 | 1318 | |
| 1264 | 1319 | // Code for showing and hiding drafts |
| 1265 | - if (!empty($context['drafts'])) |
|
| 1266 | - echo ' |
|
| 1320 | + if (!empty($context['drafts'])) { |
|
| 1321 | + echo ' |
|
| 1267 | 1322 | var oSwapDraftOptions = new smc_Toggle({ |
| 1268 | 1323 | bToggleEnabled: true, |
| 1269 | 1324 | bCurrentlyCollapsed: true, |
@@ -1285,13 +1340,14 @@ discard block |
||
| 1285 | 1340 | } |
| 1286 | 1341 | ] |
| 1287 | 1342 | });'; |
| 1343 | + } |
|
| 1288 | 1344 | |
| 1289 | 1345 | echo ' |
| 1290 | 1346 | </script>'; |
| 1291 | 1347 | |
| 1292 | 1348 | // Show the message you're replying to. |
| 1293 | - if ($context['reply']) |
|
| 1294 | - echo ' |
|
| 1349 | + if ($context['reply']) { |
|
| 1350 | + echo ' |
|
| 1295 | 1351 | <br><br> |
| 1296 | 1352 | <div class="cat_bar"> |
| 1297 | 1353 | <h3 class="catbg">', $txt['subject'], ': ', $context['quoted_message']['subject'], '</h3> |
@@ -1305,6 +1361,7 @@ discard block |
||
| 1305 | 1361 | ', $context['quoted_message']['body'], ' |
| 1306 | 1362 | </div> |
| 1307 | 1363 | <br class="clear">'; |
| 1364 | + } |
|
| 1308 | 1365 | |
| 1309 | 1366 | echo ' |
| 1310 | 1367 | <script> |
@@ -1316,23 +1373,25 @@ discard block |
||
| 1316 | 1373 | sToControlId: \'to_control\', |
| 1317 | 1374 | aToRecipients: ['; |
| 1318 | 1375 | |
| 1319 | - foreach ($context['recipients']['to'] as $i => $member) |
|
| 1320 | - echo ' |
|
| 1376 | + foreach ($context['recipients']['to'] as $i => $member) { |
|
| 1377 | + echo ' |
|
| 1321 | 1378 | { |
| 1322 | 1379 | sItemId: ', JavaScriptEscape($member['id']), ', |
| 1323 | 1380 | sItemName: ', JavaScriptEscape($member['name']), ' |
| 1324 | 1381 | }', $i == count($context['recipients']['to']) - 1 ? '' : ','; |
| 1382 | + } |
|
| 1325 | 1383 | |
| 1326 | 1384 | echo ' |
| 1327 | 1385 | ], |
| 1328 | 1386 | aBccRecipients: ['; |
| 1329 | 1387 | |
| 1330 | - foreach ($context['recipients']['bcc'] as $i => $member) |
|
| 1331 | - echo ' |
|
| 1388 | + foreach ($context['recipients']['bcc'] as $i => $member) { |
|
| 1389 | + echo ' |
|
| 1332 | 1390 | { |
| 1333 | 1391 | sItemId: ', JavaScriptEscape($member['id']), ', |
| 1334 | 1392 | sItemName: ', JavaScriptEscape($member['name']), ' |
| 1335 | 1393 | }', $i == count($context['recipients']['bcc']) - 1 ? '' : ','; |
| 1394 | + } |
|
| 1336 | 1395 | |
| 1337 | 1396 | echo ' |
| 1338 | 1397 | ], |
@@ -1421,26 +1480,28 @@ discard block |
||
| 1421 | 1480 | </th> |
| 1422 | 1481 | <th class="centertext table_icon">'; |
| 1423 | 1482 | |
| 1424 | - if (count($context['labels']) > 2) |
|
| 1425 | - echo ' |
|
| 1483 | + if (count($context['labels']) > 2) { |
|
| 1484 | + echo ' |
|
| 1426 | 1485 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
| 1486 | + } |
|
| 1427 | 1487 | |
| 1428 | 1488 | echo ' |
| 1429 | 1489 | </th> |
| 1430 | 1490 | </tr> |
| 1431 | 1491 | </thead> |
| 1432 | 1492 | <tbody>'; |
| 1433 | - if (count($context['labels']) < 2) |
|
| 1434 | - echo ' |
|
| 1493 | + if (count($context['labels']) < 2) { |
|
| 1494 | + echo ' |
|
| 1435 | 1495 | <tr class="windowbg"> |
| 1436 | 1496 | <td colspan="2">', $txt['pm_labels_no_exist'], '</td> |
| 1437 | 1497 | </tr>'; |
| 1438 | - else |
|
| 1498 | + } else |
|
| 1439 | 1499 | { |
| 1440 | 1500 | foreach ($context['labels'] as $label) |
| 1441 | 1501 | { |
| 1442 | - if ($label['id'] == -1) |
|
| 1443 | - continue; |
|
| 1502 | + if ($label['id'] == -1) { |
|
| 1503 | + continue; |
|
| 1504 | + } |
|
| 1444 | 1505 | |
| 1445 | 1506 | echo ' |
| 1446 | 1507 | <tr class="windowbg"> |
@@ -1455,12 +1516,13 @@ discard block |
||
| 1455 | 1516 | </tbody> |
| 1456 | 1517 | </table>'; |
| 1457 | 1518 | |
| 1458 | - if (!count($context['labels']) < 2) |
|
| 1459 | - echo ' |
|
| 1519 | + if (!count($context['labels']) < 2) { |
|
| 1520 | + echo ' |
|
| 1460 | 1521 | <div class="padding"> |
| 1461 | 1522 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
| 1462 | 1523 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
| 1463 | 1524 | </div>'; |
| 1525 | + } |
|
| 1464 | 1526 | |
| 1465 | 1527 | echo ' |
| 1466 | 1528 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1516,9 +1578,10 @@ discard block |
||
| 1516 | 1578 | <dd> |
| 1517 | 1579 | <select name="id_admin"> |
| 1518 | 1580 | <option value="0">', $txt['pm_report_all_admins'], '</option>'; |
| 1519 | - foreach ($context['admins'] as $id => $name) |
|
| 1520 | - echo ' |
|
| 1581 | + foreach ($context['admins'] as $id => $name) { |
|
| 1582 | + echo ' |
|
| 1521 | 1583 | <option value="', $id, '">', $name, '</option>'; |
| 1584 | + } |
|
| 1522 | 1585 | echo ' |
| 1523 | 1586 | </select> |
| 1524 | 1587 | </dd>'; |
@@ -1580,9 +1643,10 @@ discard block |
||
| 1580 | 1643 | </th> |
| 1581 | 1644 | <th class="centertext table_icon">'; |
| 1582 | 1645 | |
| 1583 | - if (!empty($context['rules'])) |
|
| 1584 | - echo ' |
|
| 1646 | + if (!empty($context['rules'])) { |
|
| 1647 | + echo ' |
|
| 1585 | 1648 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
| 1649 | + } |
|
| 1586 | 1650 | |
| 1587 | 1651 | echo ' |
| 1588 | 1652 | </th> |
@@ -1590,13 +1654,14 @@ discard block |
||
| 1590 | 1654 | </thead> |
| 1591 | 1655 | <tbody>'; |
| 1592 | 1656 | |
| 1593 | - if (empty($context['rules'])) |
|
| 1594 | - echo ' |
|
| 1657 | + if (empty($context['rules'])) { |
|
| 1658 | + echo ' |
|
| 1595 | 1659 | <tr class="windowbg"> |
| 1596 | 1660 | <td colspan="2"> |
| 1597 | 1661 | ', $txt['pm_rules_none'], ' |
| 1598 | 1662 | </td> |
| 1599 | 1663 | </tr>'; |
| 1664 | + } |
|
| 1600 | 1665 | |
| 1601 | 1666 | foreach ($context['rules'] as $rule) |
| 1602 | 1667 | { |
@@ -1617,14 +1682,16 @@ discard block |
||
| 1617 | 1682 | <div class="righttext"> |
| 1618 | 1683 | <a class="button" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>'; |
| 1619 | 1684 | |
| 1620 | - if (!empty($context['rules'])) |
|
| 1621 | - echo ' |
|
| 1685 | + if (!empty($context['rules'])) { |
|
| 1686 | + echo ' |
|
| 1622 | 1687 | [<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>]'; |
| 1688 | + } |
|
| 1623 | 1689 | |
| 1624 | - if (!empty($context['rules'])) |
|
| 1625 | - echo ' |
|
| 1690 | + if (!empty($context['rules'])) { |
|
| 1691 | + echo ' |
|
| 1626 | 1692 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1627 | 1693 | <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
| 1694 | + } |
|
| 1628 | 1695 | |
| 1629 | 1696 | echo ' |
| 1630 | 1697 | </div> |
@@ -1646,14 +1713,16 @@ discard block |
||
| 1646 | 1713 | var groups = new Array() |
| 1647 | 1714 | var labels = new Array()'; |
| 1648 | 1715 | |
| 1649 | - foreach ($context['groups'] as $id => $title) |
|
| 1650 | - echo ' |
|
| 1716 | + foreach ($context['groups'] as $id => $title) { |
|
| 1717 | + echo ' |
|
| 1651 | 1718 | groups[', $id, '] = "', addslashes($title), '";'; |
| 1719 | + } |
|
| 1652 | 1720 | |
| 1653 | - foreach ($context['labels'] as $label) |
|
| 1654 | - if ($label['id'] != -1) |
|
| 1721 | + foreach ($context['labels'] as $label) { |
|
| 1722 | + if ($label['id'] != -1) |
|
| 1655 | 1723 | echo ' |
| 1656 | 1724 | labels[', ($label['id']), '] = "', addslashes($label['name']), '";'; |
| 1725 | + } |
|
| 1657 | 1726 | |
| 1658 | 1727 | echo ' |
| 1659 | 1728 | function addCriteriaOption() |
@@ -1668,8 +1737,9 @@ discard block |
||
| 1668 | 1737 | |
| 1669 | 1738 | 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=""><\' + \'/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>'; |
| 1670 | 1739 | |
| 1671 | - foreach ($context['groups'] as $id => $group) |
|
| 1672 | - echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
| 1740 | + foreach ($context['groups'] as $id => $group) { |
|
| 1741 | + echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
| 1742 | + } |
|
| 1673 | 1743 | |
| 1674 | 1744 | echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\'); |
| 1675 | 1745 | } |
@@ -1686,9 +1756,10 @@ discard block |
||
| 1686 | 1756 | |
| 1687 | 1757 | 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>'; |
| 1688 | 1758 | |
| 1689 | - foreach ($context['labels'] as $label) |
|
| 1690 | - if ($label['id'] != -1) |
|
| 1759 | + foreach ($context['labels'] as $label) { |
|
| 1760 | + if ($label['id'] != -1) |
|
| 1691 | 1761 | echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>'; |
| 1762 | + } |
|
| 1692 | 1763 | |
| 1693 | 1764 | echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\'); |
| 1694 | 1765 | } |
@@ -1802,19 +1873,20 @@ discard block |
||
| 1802 | 1873 | $isFirst = true; |
| 1803 | 1874 | foreach ($context['rule']['criteria'] as $k => $criteria) |
| 1804 | 1875 | { |
| 1805 | - if (!$isFirst && $criteria['t'] == '') |
|
| 1806 | - echo '<div id="removeonjs1">'; |
|
| 1807 | - |
|
| 1808 | - elseif (!$isFirst) |
|
| 1809 | - echo '<br>'; |
|
| 1876 | + if (!$isFirst && $criteria['t'] == '') { |
|
| 1877 | + echo '<div id="removeonjs1">'; |
|
| 1878 | + } elseif (!$isFirst) { |
|
| 1879 | + echo '<br>'; |
|
| 1880 | + } |
|
| 1810 | 1881 | |
| 1811 | 1882 | echo ' |
| 1812 | 1883 | <select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();"> |
| 1813 | 1884 | <option value="">', $txt['pm_rule_criteria_pick'], ':</option>'; |
| 1814 | 1885 | |
| 1815 | - foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) |
|
| 1816 | - echo ' |
|
| 1886 | + foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) { |
|
| 1887 | + echo ' |
|
| 1817 | 1888 | <option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>'; |
| 1889 | + } |
|
| 1818 | 1890 | |
| 1819 | 1891 | echo ' |
| 1820 | 1892 | </select> |
@@ -1825,19 +1897,20 @@ discard block |
||
| 1825 | 1897 | <select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();"> |
| 1826 | 1898 | <option value="">', $txt['pm_rule_sel_group'], '</option>'; |
| 1827 | 1899 | |
| 1828 | - foreach ($context['groups'] as $id => $group) |
|
| 1829 | - echo ' |
|
| 1900 | + foreach ($context['groups'] as $id => $group) { |
|
| 1901 | + echo ' |
|
| 1830 | 1902 | <option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>'; |
| 1903 | + } |
|
| 1831 | 1904 | echo ' |
| 1832 | 1905 | </select> |
| 1833 | 1906 | </span>'; |
| 1834 | 1907 | |
| 1835 | 1908 | // If this is the dummy we add a means to hide for non js users. |
| 1836 | - if ($isFirst) |
|
| 1837 | - $isFirst = false; |
|
| 1838 | - |
|
| 1839 | - elseif ($criteria['t'] == '') |
|
| 1840 | - echo '</div><!-- .removeonjs1 -->'; |
|
| 1909 | + if ($isFirst) { |
|
| 1910 | + $isFirst = false; |
|
| 1911 | + } elseif ($criteria['t'] == '') { |
|
| 1912 | + echo '</div><!-- .removeonjs1 -->'; |
|
| 1913 | + } |
|
| 1841 | 1914 | } |
| 1842 | 1915 | |
| 1843 | 1916 | echo ' |
@@ -1860,10 +1933,11 @@ discard block |
||
| 1860 | 1933 | $isFirst = true; |
| 1861 | 1934 | foreach ($context['rule']['actions'] as $k => $action) |
| 1862 | 1935 | { |
| 1863 | - if (!$isFirst && $action['t'] == '') |
|
| 1864 | - echo '<div id="removeonjs2">'; |
|
| 1865 | - elseif (!$isFirst) |
|
| 1866 | - echo '<br>'; |
|
| 1936 | + if (!$isFirst && $action['t'] == '') { |
|
| 1937 | + echo '<div id="removeonjs2">'; |
|
| 1938 | + } elseif (!$isFirst) { |
|
| 1939 | + echo '<br>'; |
|
| 1940 | + } |
|
| 1867 | 1941 | |
| 1868 | 1942 | echo ' |
| 1869 | 1943 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
@@ -1875,19 +1949,21 @@ discard block |
||
| 1875 | 1949 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
| 1876 | 1950 | <option value="">', $txt['pm_rule_sel_label'], '</option>'; |
| 1877 | 1951 | |
| 1878 | - foreach ($context['labels'] as $label) |
|
| 1879 | - if ($label['id'] != -1) |
|
| 1952 | + foreach ($context['labels'] as $label) { |
|
| 1953 | + if ($label['id'] != -1) |
|
| 1880 | 1954 | echo ' |
| 1881 | 1955 | <option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>'; |
| 1956 | + } |
|
| 1882 | 1957 | |
| 1883 | 1958 | echo ' |
| 1884 | 1959 | </select> |
| 1885 | 1960 | </span>'; |
| 1886 | 1961 | |
| 1887 | - if ($isFirst) |
|
| 1888 | - $isFirst = false; |
|
| 1889 | - elseif ($action['t'] == '') |
|
| 1890 | - echo '</div><!-- .removeonjs2 -->'; |
|
| 1962 | + if ($isFirst) { |
|
| 1963 | + $isFirst = false; |
|
| 1964 | + } elseif ($action['t'] == '') { |
|
| 1965 | + echo '</div><!-- .removeonjs2 -->'; |
|
| 1966 | + } |
|
| 1891 | 1967 | } |
| 1892 | 1968 | |
| 1893 | 1969 | echo ' |
@@ -1911,22 +1987,25 @@ discard block |
||
| 1911 | 1987 | echo ' |
| 1912 | 1988 | <script>'; |
| 1913 | 1989 | |
| 1914 | - foreach ($context['rule']['criteria'] as $k => $c) |
|
| 1915 | - echo ' |
|
| 1990 | + foreach ($context['rule']['criteria'] as $k => $c) { |
|
| 1991 | + echo ' |
|
| 1916 | 1992 | updateRuleDef(', $k, ');'; |
| 1993 | + } |
|
| 1917 | 1994 | |
| 1918 | - foreach ($context['rule']['actions'] as $k => $c) |
|
| 1919 | - echo ' |
|
| 1995 | + foreach ($context['rule']['actions'] as $k => $c) { |
|
| 1996 | + echo ' |
|
| 1920 | 1997 | updateActionDef(', $k, ');'; |
| 1998 | + } |
|
| 1921 | 1999 | |
| 1922 | 2000 | echo ' |
| 1923 | 2001 | rebuildRuleDesc();'; |
| 1924 | 2002 | |
| 1925 | 2003 | // If this isn't a new rule and we have JS enabled remove the JS compatibility stuff. |
| 1926 | - if ($context['rid']) |
|
| 1927 | - echo ' |
|
| 2004 | + if ($context['rid']) { |
|
| 2005 | + echo ' |
|
| 1928 | 2006 | document.getElementById("removeonjs1").style.display = "none"; |
| 1929 | 2007 | document.getElementById("removeonjs2").style.display = "none";'; |
| 2008 | + } |
|
| 1930 | 2009 | |
| 1931 | 2010 | echo ' |
| 1932 | 2011 | document.getElementById("addonjs1").style.display = ""; |
@@ -1954,12 +2033,12 @@ discard block |
||
| 1954 | 2033 | </div>'; |
| 1955 | 2034 | |
| 1956 | 2035 | // No drafts? Just show an informative message. |
| 1957 | - if (empty($context['drafts'])) |
|
| 1958 | - echo ' |
|
| 2036 | + if (empty($context['drafts'])) { |
|
| 2037 | + echo ' |
|
| 1959 | 2038 | <div class="windowbg2 centertext"> |
| 1960 | 2039 | ', $txt['draft_none'], ' |
| 1961 | 2040 | </div>'; |
| 1962 | - else |
|
| 2041 | + } else |
|
| 1963 | 2042 | { |
| 1964 | 2043 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
| 1965 | 2044 | foreach ($context['drafts'] as $draft) |
@@ -53,14 +53,15 @@ discard block |
||
| 53 | 53 | foreach ($context['smileys'] as $location => $smileyRows) |
| 54 | 54 | { |
| 55 | 55 | $countLocations--; |
| 56 | - if ($location == 'postform') |
|
| 57 | - echo ' |
|
| 56 | + if ($location == 'postform') { |
|
| 57 | + echo ' |
|
| 58 | 58 | dropdown: |
| 59 | 59 | {'; |
| 60 | - elseif ($location == 'popup') |
|
| 61 | - echo ' |
|
| 60 | + } elseif ($location == 'popup') { |
|
| 61 | + echo ' |
|
| 62 | 62 | popup: |
| 63 | 63 | {'; |
| 64 | + } |
|
| 64 | 65 | |
| 65 | 66 | $numRows = count($smileyRows); |
| 66 | 67 | |
@@ -74,21 +75,22 @@ discard block |
||
| 74 | 75 | echo ' |
| 75 | 76 | ', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), empty($smiley['isLast']) ? ',' : ''; |
| 76 | 77 | } |
| 77 | - if (empty($smileyRow['isLast']) && $numRows != 1) |
|
| 78 | - echo ', |
|
| 78 | + if (empty($smileyRow['isLast']) && $numRows != 1) { |
|
| 79 | + echo ', |
|
| 79 | 80 | \'-', $emptyPlaceholder++, '\': \'\','; |
| 81 | + } |
|
| 80 | 82 | } |
| 81 | 83 | echo ' |
| 82 | 84 | }', $countLocations != 0 ? ',' : ''; |
| 83 | 85 | } |
| 84 | 86 | echo ' |
| 85 | 87 | }'; |
| 86 | - } |
|
| 87 | - else |
|
| 88 | - echo ', |
|
| 88 | + } else { |
|
| 89 | + echo ', |
|
| 89 | 90 | emoticons: |
| 90 | 91 | {}, |
| 91 | 92 | emoticonsEnabled:false'; |
| 93 | + } |
|
| 92 | 94 | |
| 93 | 95 | if ($context['show_bbc'] && $bbcContainer !== null) |
| 94 | 96 | { |
@@ -101,15 +103,16 @@ discard block |
||
| 101 | 103 | |
| 102 | 104 | $count_tags--; |
| 103 | 105 | |
| 104 | - if (!empty($count_tags)) |
|
| 105 | - echo '||'; |
|
| 106 | + if (!empty($count_tags)) { |
|
| 107 | + echo '||'; |
|
| 108 | + } |
|
| 106 | 109 | } |
| 107 | 110 | |
| 108 | 111 | echo '",'; |
| 109 | - } |
|
| 110 | - else |
|
| 111 | - echo ', |
|
| 112 | + } else { |
|
| 113 | + echo ', |
|
| 112 | 114 | toolbar: "",'; |
| 115 | + } |
|
| 113 | 116 | |
| 114 | 117 | echo ' |
| 115 | 118 | }); |
@@ -151,43 +154,48 @@ discard block |
||
| 151 | 154 | |
| 152 | 155 | $tempTab = $context['tabindex']; |
| 153 | 156 | |
| 154 | - if (!empty($context['drafts_pm_save'])) |
|
| 155 | - $tempTab++; |
|
| 156 | - elseif (!empty($context['drafts_save'])) |
|
| 157 | - $tempTab++; |
|
| 158 | - elseif ($editor_context['preview_type']) |
|
| 159 | - $tempTab++; |
|
| 160 | - elseif ($context['show_spellchecking']) |
|
| 161 | - $tempTab++; |
|
| 157 | + if (!empty($context['drafts_pm_save'])) { |
|
| 158 | + $tempTab++; |
|
| 159 | + } elseif (!empty($context['drafts_save'])) { |
|
| 160 | + $tempTab++; |
|
| 161 | + } elseif ($editor_context['preview_type']) { |
|
| 162 | + $tempTab++; |
|
| 163 | + } elseif ($context['show_spellchecking']) { |
|
| 164 | + $tempTab++; |
|
| 165 | + } |
|
| 162 | 166 | |
| 163 | 167 | $tempTab++; |
| 164 | 168 | $context['tabindex'] = $tempTab; |
| 165 | 169 | |
| 166 | - if (!empty($context['drafts_pm_save'])) |
|
| 167 | - echo ' |
|
| 170 | + if (!empty($context['drafts_pm_save'])) { |
|
| 171 | + echo ' |
|
| 168 | 172 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button"> |
| 169 | 173 | <input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">'; |
| 174 | + } |
|
| 170 | 175 | |
| 171 | - if (!empty($context['drafts_save'])) |
|
| 172 | - echo ' |
|
| 176 | + if (!empty($context['drafts_save'])) { |
|
| 177 | + echo ' |
|
| 173 | 178 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" class="button"> |
| 174 | 179 | <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">'; |
| 180 | + } |
|
| 175 | 181 | |
| 176 | - if ($context['show_spellchecking']) |
|
| 177 | - echo ' |
|
| 182 | + if ($context['show_spellchecking']) { |
|
| 183 | + echo ' |
|
| 178 | 184 | <input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button">'; |
| 185 | + } |
|
| 179 | 186 | |
| 180 | - if ($editor_context['preview_type']) |
|
| 181 | - echo ' |
|
| 187 | + if ($editor_context['preview_type']) { |
|
| 188 | + echo ' |
|
| 182 | 189 | <input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', --$tempTab, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button">'; |
| 190 | + } |
|
| 183 | 191 | |
| 184 | 192 | |
| 185 | 193 | echo ' |
| 186 | 194 | <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button">'; |
| 187 | 195 | |
| 188 | 196 | // Load in the PM autosaver if it's enabled |
| 189 | - if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) |
|
| 190 | - echo ' |
|
| 197 | + if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) { |
|
| 198 | + echo ' |
|
| 191 | 199 | <span class="righttext padding" style="display: block"> |
| 192 | 200 | <span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"> </span> |
| 193 | 201 | <span id="draft_lastautosave" ></span> |
@@ -205,10 +213,11 @@ discard block |
||
| 205 | 213 | iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), ' |
| 206 | 214 | }); |
| 207 | 215 | </script>'; |
| 216 | + } |
|
| 208 | 217 | |
| 209 | 218 | // Start an instance of the auto saver if its enabled |
| 210 | - if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) |
|
| 211 | - echo ' |
|
| 219 | + if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) { |
|
| 220 | + echo ' |
|
| 212 | 221 | <span class="righttext padding" style="display: block"> |
| 213 | 222 | <span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"> </span> |
| 214 | 223 | <span id="draft_lastautosave" ></span> |
@@ -225,7 +234,8 @@ discard block |
||
| 225 | 234 | iFreq: ', $context['drafts_autosave_frequency'], ' |
| 226 | 235 | }); |
| 227 | 236 | </script>'; |
| 228 | -} |
|
| 237 | + } |
|
| 238 | + } |
|
| 229 | 239 | |
| 230 | 240 | /** |
| 231 | 241 | * This template displays a verification form |
@@ -242,51 +252,57 @@ discard block |
||
| 242 | 252 | $verify_context = &$context['controls']['verification'][$verify_id]; |
| 243 | 253 | |
| 244 | 254 | // Keep track of where we are. |
| 245 | - if (empty($verify_context['tracking']) || $reset) |
|
| 246 | - $verify_context['tracking'] = 0; |
|
| 255 | + if (empty($verify_context['tracking']) || $reset) { |
|
| 256 | + $verify_context['tracking'] = 0; |
|
| 257 | + } |
|
| 247 | 258 | |
| 248 | 259 | // How many items are there to display in total. |
| 249 | 260 | $total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0); |
| 250 | 261 | |
| 251 | 262 | // If we've gone too far, stop. |
| 252 | - if ($verify_context['tracking'] > $total_items) |
|
| 253 | - return false; |
|
| 263 | + if ($verify_context['tracking'] > $total_items) { |
|
| 264 | + return false; |
|
| 265 | + } |
|
| 254 | 266 | |
| 255 | 267 | // Loop through each item to show them. |
| 256 | 268 | for ($i = 0; $i < $total_items; $i++) |
| 257 | 269 | { |
| 258 | 270 | // If we're after a single item only show it if we're in the right place. |
| 259 | - if ($display_type == 'single' && $verify_context['tracking'] != $i) |
|
| 260 | - continue; |
|
| 271 | + if ($display_type == 'single' && $verify_context['tracking'] != $i) { |
|
| 272 | + continue; |
|
| 273 | + } |
|
| 261 | 274 | |
| 262 | - if ($display_type != 'single') |
|
| 263 | - echo ' |
|
| 275 | + if ($display_type != 'single') { |
|
| 276 | + echo ' |
|
| 264 | 277 | <div id="verification_control_', $i, '" class="verification_control">'; |
| 278 | + } |
|
| 265 | 279 | |
| 266 | 280 | // Display empty field, but only if we have one, and it's the first time. |
| 267 | - if ($verify_context['empty_field'] && empty($i)) |
|
| 268 | - echo ' |
|
| 281 | + if ($verify_context['empty_field'] && empty($i)) { |
|
| 282 | + echo ' |
|
| 269 | 283 | <div class="smalltext vv_special"> |
| 270 | 284 | ', $txt['visual_verification_hidden'], ': |
| 271 | 285 | <input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value=""> |
| 272 | 286 | </div>'; |
| 287 | + } |
|
| 273 | 288 | |
| 274 | 289 | // Do the actual stuff |
| 275 | 290 | if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha'])) |
| 276 | 291 | { |
| 277 | 292 | if ($verify_context['show_visual']) |
| 278 | 293 | { |
| 279 | - if ($context['use_graphic_library']) |
|
| 280 | - echo ' |
|
| 294 | + if ($context['use_graphic_library']) { |
|
| 295 | + echo ' |
|
| 281 | 296 | <img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">'; |
| 282 | - else |
|
| 283 | - echo ' |
|
| 297 | + } else { |
|
| 298 | + echo ' |
|
| 284 | 299 | <img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1"> |
| 285 | 300 | <img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2"> |
| 286 | 301 | <img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3"> |
| 287 | 302 | <img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4"> |
| 288 | 303 | <img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5"> |
| 289 | 304 | <img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">'; |
| 305 | + } |
|
| 290 | 306 | |
| 291 | 307 | echo ' |
| 292 | 308 | <div class="smalltext" style="margin: 4px 0 8px 0;"> |
@@ -303,8 +319,7 @@ discard block |
||
| 303 | 319 | <br> |
| 304 | 320 | <script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>'; |
| 305 | 321 | } |
| 306 | - } |
|
| 307 | - else |
|
| 322 | + } else |
|
| 308 | 323 | { |
| 309 | 324 | // Where in the question array is this question? |
| 310 | 325 | $qIndex = $verify_context['show_visual'] ? $i - 1 : $i; |
@@ -316,21 +331,24 @@ discard block |
||
| 316 | 331 | </div>'; |
| 317 | 332 | } |
| 318 | 333 | |
| 319 | - if ($display_type != 'single') |
|
| 320 | - echo ' |
|
| 334 | + if ($display_type != 'single') { |
|
| 335 | + echo ' |
|
| 321 | 336 | </div><!-- #verification_control_[i] -->'; |
| 337 | + } |
|
| 322 | 338 | |
| 323 | 339 | // If we were displaying just one and we did it, break. |
| 324 | - if ($display_type == 'single' && $verify_context['tracking'] == $i) |
|
| 325 | - break; |
|
| 340 | + if ($display_type == 'single' && $verify_context['tracking'] == $i) { |
|
| 341 | + break; |
|
| 342 | + } |
|
| 326 | 343 | } |
| 327 | 344 | |
| 328 | 345 | // Assume we found something, always, |
| 329 | 346 | $verify_context['tracking']++; |
| 330 | 347 | |
| 331 | 348 | // Tell something displaying piecemeal to keep going. |
| 332 | - if ($display_type == 'single') |
|
| 333 | - return true; |
|
| 334 | -} |
|
| 349 | + if ($display_type == 'single') { |
|
| 350 | + return true; |
|
| 351 | + } |
|
| 352 | + } |
|
| 335 | 353 | |
| 336 | 354 | ?> |
| 337 | 355 | \ No newline at end of file |