@@ -18,11 +18,12 @@ discard block |
||
| 18 | 18 | global $context, $txt, $scripturl; |
| 19 | 19 | |
| 20 | 20 | // Let them know the action was a success. |
| 21 | - if (!empty($context['report_post_action'])) |
|
| 22 | - echo ' |
|
| 21 | + if (!empty($context['report_post_action'])) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="infobox"> |
| 24 | 24 | ', $txt['report_action_' . $context['report_post_action']], ' |
| 25 | 25 | </div>'; |
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | echo ' |
| 28 | 29 | <form id="reported_posts" action="', $scripturl, '?action=moderate;area=reportedposts;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '"> |
@@ -52,8 +53,9 @@ discard block |
||
| 52 | 53 | |
| 53 | 54 | // Prepare the comments... |
| 54 | 55 | $comments = array(); |
| 55 | - foreach ($report['comments'] as $comment) |
|
| 56 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 56 | + foreach ($report['comments'] as $comment) { |
|
| 57 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 58 | + } |
|
| 57 | 59 | |
| 58 | 60 | echo ' |
| 59 | 61 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -69,18 +71,21 @@ discard block |
||
| 69 | 71 | <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
| 70 | 72 | |
| 71 | 73 | // Delete message button. |
| 72 | - if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) |
|
| 73 | - echo ' |
|
| 74 | + if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) { |
|
| 75 | + echo ' |
|
| 74 | 76 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'], '.0;msg=', $report['topic']['id_msg'], ';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'], '" class="you_sure">', $delete_button, '</a></li>'; |
| 77 | + } |
|
| 75 | 78 | |
| 76 | 79 | // Ban this user button. |
| 77 | - if (!$report['closed'] && !empty($context['report_manage_bans'])) |
|
| 78 | - echo ' |
|
| 80 | + if (!$report['closed'] && !empty($context['report_manage_bans'])) { |
|
| 81 | + echo ' |
|
| 79 | 82 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']), ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
| 83 | + } |
|
| 80 | 84 | |
| 81 | - if (!$context['view_closed']) |
|
| 82 | - echo ' |
|
| 85 | + if (!$context['view_closed']) { |
|
| 86 | + echo ' |
|
| 83 | 87 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>'; |
| 88 | + } |
|
| 84 | 89 | |
| 85 | 90 | echo ' |
| 86 | 91 | </ul> |
@@ -88,18 +93,20 @@ discard block |
||
| 88 | 93 | } |
| 89 | 94 | |
| 90 | 95 | // Were none found? |
| 91 | - if (empty($context['reports'])) |
|
| 92 | - echo ' |
|
| 96 | + if (empty($context['reports'])) { |
|
| 97 | + echo ' |
|
| 93 | 98 | <div class="windowbg2"> |
| 94 | 99 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
| 95 | 100 | </div>'; |
| 101 | + } |
|
| 96 | 102 | |
| 97 | 103 | echo ' |
| 98 | 104 | <div class="pagesection">'; |
| 99 | 105 | |
| 100 | - if (!empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many']) |
|
| 101 | - echo ' |
|
| 106 | + if (!empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many']) { |
|
| 107 | + echo ' |
|
| 102 | 108 | <div class="pagelinks floatleft">' . $context['page_index'] . '</div>'; |
| 109 | + } |
|
| 103 | 110 | |
| 104 | 111 | echo ' |
| 105 | 112 | <div class="floatright">', !$context['view_closed'] ? ' |
@@ -130,18 +137,20 @@ discard block |
||
| 130 | 137 | <div class="modbox"> |
| 131 | 138 | <ul>'; |
| 132 | 139 | |
| 133 | - foreach ($context['reported_posts'] as $report) |
|
| 134 | - echo ' |
|
| 140 | + foreach ($context['reported_posts'] as $report) { |
|
| 141 | + echo ' |
|
| 135 | 142 | <li class="smalltext"> |
| 136 | 143 | <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], ' |
| 137 | 144 | </li>'; |
| 145 | + } |
|
| 138 | 146 | |
| 139 | 147 | // Don't have any watched users right now? |
| 140 | - if (empty($context['reported_posts'])) |
|
| 141 | - echo ' |
|
| 148 | + if (empty($context['reported_posts'])) { |
|
| 149 | + echo ' |
|
| 142 | 150 | <li> |
| 143 | 151 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
| 144 | 152 | </li>'; |
| 153 | + } |
|
| 145 | 154 | |
| 146 | 155 | echo ' |
| 147 | 156 | </ul> |
@@ -189,11 +198,12 @@ discard block |
||
| 189 | 198 | global $context, $scripturl, $txt; |
| 190 | 199 | |
| 191 | 200 | // Let them know the action was a success. |
| 192 | - if (!empty($context['report_post_action'])) |
|
| 193 | - echo ' |
|
| 201 | + if (!empty($context['report_post_action'])) { |
|
| 202 | + echo ' |
|
| 194 | 203 | <div class="infobox"> |
| 195 | 204 | ', $txt['report_action_' . $context['report_post_action']], ' |
| 196 | 205 | </div>'; |
| 206 | + } |
|
| 197 | 207 | |
| 198 | 208 | echo ' |
| 199 | 209 | <div id="modcenter"> |
@@ -229,14 +239,15 @@ discard block |
||
| 229 | 239 | <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3> |
| 230 | 240 | </div>'; |
| 231 | 241 | |
| 232 | - foreach ($context['report']['comments'] as $comment) |
|
| 233 | - echo ' |
|
| 242 | + foreach ($context['report']['comments'] as $comment) { |
|
| 243 | + echo ' |
|
| 234 | 244 | <div class="windowbg"> |
| 235 | 245 | <p class="smalltext"> |
| 236 | 246 | ', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), ' |
| 237 | 247 | </p> |
| 238 | 248 | <p>', $comment['message'], '</p> |
| 239 | 249 | </div>'; |
| 250 | + } |
|
| 240 | 251 | |
| 241 | 252 | echo ' |
| 242 | 253 | <br> |
@@ -245,11 +256,12 @@ discard block |
||
| 245 | 256 | </div> |
| 246 | 257 | <div>'; |
| 247 | 258 | |
| 248 | - if (empty($context['report']['mod_comments'])) |
|
| 249 | - echo ' |
|
| 259 | + if (empty($context['report']['mod_comments'])) { |
|
| 260 | + echo ' |
|
| 250 | 261 | <div class="information"> |
| 251 | 262 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
| 252 | 263 | </div>'; |
| 264 | + } |
|
| 253 | 265 | |
| 254 | 266 | foreach ($context['report']['mod_comments'] as $comment) |
| 255 | 267 | { |
@@ -335,18 +347,20 @@ discard block |
||
| 335 | 347 | <div class="modbox"> |
| 336 | 348 | <ul>'; |
| 337 | 349 | |
| 338 | - foreach ($context['reported_members'] as $report) |
|
| 339 | - echo ' |
|
| 350 | + foreach ($context['reported_members'] as $report) { |
|
| 351 | + echo ' |
|
| 340 | 352 | <li class="smalltext"> |
| 341 | 353 | <a href="', $report['report_href'], '">', $report['user_name'], '</a> |
| 342 | 354 | </li>'; |
| 355 | + } |
|
| 343 | 356 | |
| 344 | 357 | // Don't have any reported members right now? |
| 345 | - if (empty($context['reported_members'])) |
|
| 346 | - echo ' |
|
| 358 | + if (empty($context['reported_members'])) { |
|
| 359 | + echo ' |
|
| 347 | 360 | <li> |
| 348 | 361 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
| 349 | 362 | </li>'; |
| 363 | + } |
|
| 350 | 364 | |
| 351 | 365 | echo ' |
| 352 | 366 | </ul> |
@@ -394,11 +408,12 @@ discard block |
||
| 394 | 408 | global $context, $txt, $scripturl; |
| 395 | 409 | |
| 396 | 410 | // Let them know the action was a success. |
| 397 | - if (!empty($context['report_post_action']) && !empty($txt['report_action_' . $context['report_post_action']])) |
|
| 398 | - echo ' |
|
| 411 | + if (!empty($context['report_post_action']) && !empty($txt['report_action_' . $context['report_post_action']])) { |
|
| 412 | + echo ' |
|
| 399 | 413 | <div class="infobox"> |
| 400 | 414 | ', $txt['report_action_' . $context['report_post_action']], ' |
| 401 | 415 | </div>'; |
| 416 | + } |
|
| 402 | 417 | |
| 403 | 418 | echo ' |
| 404 | 419 | <form id="reported_members" action="', $scripturl, '?action=moderate;area=reportedmembers;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '"> |
@@ -430,8 +445,9 @@ discard block |
||
| 430 | 445 | |
| 431 | 446 | // Prepare the comments... |
| 432 | 447 | $comments = array(); |
| 433 | - foreach ($report['comments'] as $comment) |
|
| 434 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 448 | + foreach ($report['comments'] as $comment) { |
|
| 449 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 450 | + } |
|
| 435 | 451 | |
| 436 | 452 | echo ' |
| 437 | 453 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -443,13 +459,15 @@ discard block |
||
| 443 | 459 | <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
| 444 | 460 | |
| 445 | 461 | // Ban this user button. |
| 446 | - if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) |
|
| 447 | - echo ' |
|
| 462 | + if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) { |
|
| 463 | + echo ' |
|
| 448 | 464 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
| 465 | + } |
|
| 449 | 466 | |
| 450 | - if (!$context['view_closed']) |
|
| 451 | - echo ' |
|
| 467 | + if (!$context['view_closed']) { |
|
| 468 | + echo ' |
|
| 452 | 469 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>'; |
| 470 | + } |
|
| 453 | 471 | |
| 454 | 472 | echo ' |
| 455 | 473 | </ul> |
@@ -457,11 +475,12 @@ discard block |
||
| 457 | 475 | } |
| 458 | 476 | |
| 459 | 477 | // Were none found? |
| 460 | - if (empty($context['reports'])) |
|
| 461 | - echo ' |
|
| 478 | + if (empty($context['reports'])) { |
|
| 479 | + echo ' |
|
| 462 | 480 | <div class="windowbg2"> |
| 463 | 481 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
| 464 | 482 | </div>'; |
| 483 | + } |
|
| 465 | 484 | |
| 466 | 485 | echo ' |
| 467 | 486 | <div class="pagesection"> |
@@ -482,11 +501,12 @@ discard block |
||
| 482 | 501 | global $context, $scripturl, $txt; |
| 483 | 502 | |
| 484 | 503 | // Let them know the action was a success. |
| 485 | - if (!empty($context['report_post_action'])) |
|
| 486 | - echo ' |
|
| 504 | + if (!empty($context['report_post_action'])) { |
|
| 505 | + echo ' |
|
| 487 | 506 | <div class="infobox"> |
| 488 | 507 | ', $txt['report_action_' . $context['report_post_action']], ' |
| 489 | 508 | </div>'; |
| 509 | + } |
|
| 490 | 510 | |
| 491 | 511 | echo ' |
| 492 | 512 | <div id="modcenter"> |
@@ -519,14 +539,15 @@ discard block |
||
| 519 | 539 | <h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3> |
| 520 | 540 | </div>'; |
| 521 | 541 | |
| 522 | - foreach ($context['report']['comments'] as $comment) |
|
| 523 | - echo ' |
|
| 542 | + foreach ($context['report']['comments'] as $comment) { |
|
| 543 | + echo ' |
|
| 524 | 544 | <div class="windowbg"> |
| 525 | 545 | <p class="smalltext"> |
| 526 | 546 | ', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), ' |
| 527 | 547 | </p> |
| 528 | 548 | <p>', $comment['message'], '</p> |
| 529 | 549 | </div>'; |
| 550 | + } |
|
| 530 | 551 | |
| 531 | 552 | echo ' |
| 532 | 553 | <br> |
@@ -535,11 +556,12 @@ discard block |
||
| 535 | 556 | </div> |
| 536 | 557 | <div>'; |
| 537 | 558 | |
| 538 | - if (empty($context['report']['mod_comments'])) |
|
| 539 | - echo ' |
|
| 559 | + if (empty($context['report']['mod_comments'])) { |
|
| 560 | + echo ' |
|
| 540 | 561 | <div class="information"> |
| 541 | 562 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
| 542 | 563 | </div>'; |
| 564 | + } |
|
| 543 | 565 | |
| 544 | 566 | foreach ($context['report']['mod_comments'] as $comment) |
| 545 | 567 | { |
@@ -25,18 +25,20 @@ discard block |
||
| 25 | 25 | </div> |
| 26 | 26 | <div class="windowbg2 noup">'; |
| 27 | 27 | |
| 28 | - if (!empty($context['move_board'])) |
|
| 29 | - echo ' |
|
| 28 | + if (!empty($context['move_board'])) { |
|
| 29 | + echo ' |
|
| 30 | 30 | <div class="noticebox"> |
| 31 | 31 | ', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', ' |
| 32 | 32 | </div>'; |
| 33 | + } |
|
| 33 | 34 | |
| 34 | 35 | // No categories so show a label. |
| 35 | - if (empty($context['categories'])) |
|
| 36 | - echo ' |
|
| 36 | + if (empty($context['categories'])) { |
|
| 37 | + echo ' |
|
| 37 | 38 | <div class="windowbg centertext"> |
| 38 | 39 | ', $txt['mboards_no_cats'], ' |
| 39 | 40 | </div>'; |
| 41 | + } |
|
| 40 | 42 | |
| 41 | 43 | // Loop through every category, listing the boards in each as we go. |
| 42 | 44 | foreach ($context['categories'] as $category) |
@@ -54,9 +56,10 @@ discard block |
||
| 54 | 56 | <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> |
| 55 | 57 | <ul id="category_', $category['id'], '" class="nolist">'; |
| 56 | 58 | |
| 57 | - if (!empty($category['move_link'])) |
|
| 58 | - echo ' |
|
| 59 | + if (!empty($category['move_link'])) { |
|
| 60 | + echo ' |
|
| 59 | 61 | <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>'; |
| 62 | + } |
|
| 60 | 63 | |
| 61 | 64 | $recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>'; |
| 62 | 65 | $redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">'; |
@@ -81,9 +84,10 @@ discard block |
||
| 81 | 84 | echo ' |
| 82 | 85 | <li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; |
| 83 | 86 | |
| 84 | - foreach ($board['move_links'] as $link) |
|
| 85 | - echo ' |
|
| 87 | + foreach ($board['move_links'] as $link) { |
|
| 88 | + echo ' |
|
| 86 | 89 | <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>'; |
| 90 | + } |
|
| 87 | 91 | |
| 88 | 92 | echo ' |
| 89 | 93 | </li>'; |
@@ -132,9 +136,10 @@ discard block |
||
| 132 | 136 | <select name="cat_order">'; |
| 133 | 137 | |
| 134 | 138 | // Print every existing category into a select box. |
| 135 | - foreach ($context['category_order'] as $order) |
|
| 136 | - echo ' |
|
| 139 | + foreach ($context['category_order'] as $order) { |
|
| 140 | + echo ' |
|
| 137 | 141 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
| 142 | + } |
|
| 138 | 143 | echo ' |
| 139 | 144 | </select> |
| 140 | 145 | </dd>'; |
@@ -169,14 +174,15 @@ discard block |
||
| 169 | 174 | { |
| 170 | 175 | foreach ($context['custom_category_settings'] as $catset_id => $catset) |
| 171 | 176 | { |
| 172 | - if (!empty($catset['dt']) && !empty($catset['dd'])) |
|
| 173 | - echo ' |
|
| 177 | + if (!empty($catset['dt']) && !empty($catset['dd'])) { |
|
| 178 | + echo ' |
|
| 174 | 179 | <dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '"> |
| 175 | 180 | ', $catset['dt'], ' |
| 176 | 181 | </dt> |
| 177 | 182 | <dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '> |
| 178 | 183 | ', $catset['dd'], ' |
| 179 | 184 | </dd>'; |
| 185 | + } |
|
| 180 | 186 | } |
| 181 | 187 | } |
| 182 | 188 | |
@@ -184,21 +190,23 @@ discard block |
||
| 184 | 190 | echo ' |
| 185 | 191 | </dl>'; |
| 186 | 192 | |
| 187 | - if (isset($context['category']['is_new'])) |
|
| 188 | - echo ' |
|
| 193 | + if (isset($context['category']['is_new'])) { |
|
| 194 | + echo ' |
|
| 189 | 195 | <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">'; |
| 190 | - else |
|
| 191 | - echo ' |
|
| 196 | + } else { |
|
| 197 | + echo ' |
|
| 192 | 198 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button"> |
| 193 | 199 | <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button you_sure">'; |
| 200 | + } |
|
| 194 | 201 | echo ' |
| 195 | 202 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 196 | 203 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
| 197 | 204 | |
| 198 | 205 | // If this category is empty we don't bother with the next confirmation screen. |
| 199 | - if ($context['category']['is_empty']) |
|
| 200 | - echo ' |
|
| 206 | + if ($context['category']['is_empty']) { |
|
| 207 | + echo ' |
|
| 201 | 208 | <input type="hidden" name="empty" value="1">'; |
| 209 | + } |
|
| 202 | 210 | |
| 203 | 211 | echo ' |
| 204 | 212 | </div><!-- .windowbg2 --> |
@@ -225,9 +233,10 @@ discard block |
||
| 225 | 233 | <p>', $txt['mboards_delete_cat_contains'], ':</p> |
| 226 | 234 | <ul>'; |
| 227 | 235 | |
| 228 | - foreach ($context['category']['children'] as $child) |
|
| 229 | - echo ' |
|
| 236 | + foreach ($context['category']['children'] as $child) { |
|
| 237 | + echo ' |
|
| 230 | 238 | <li>', $child, '</li>'; |
| 239 | + } |
|
| 231 | 240 | |
| 232 | 241 | echo ' |
| 233 | 242 | </ul> |
@@ -241,10 +250,11 @@ discard block |
||
| 241 | 250 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>: |
| 242 | 251 | <select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>'; |
| 243 | 252 | |
| 244 | - foreach ($context['category_order'] as $cat) |
|
| 245 | - if ($cat['id'] != 0) |
|
| 253 | + foreach ($context['category_order'] as $cat) { |
|
| 254 | + if ($cat['id'] != 0) |
|
| 246 | 255 | echo ' |
| 247 | 256 | <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; |
| 257 | + } |
|
| 248 | 258 | |
| 249 | 259 | echo ' |
| 250 | 260 | </select> |
@@ -287,9 +297,10 @@ discard block |
||
| 287 | 297 | <dd> |
| 288 | 298 | <select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">'; |
| 289 | 299 | |
| 290 | - foreach ($context['categories'] as $category) |
|
| 291 | - echo ' |
|
| 300 | + foreach ($context['categories'] as $category) { |
|
| 301 | + echo ' |
|
| 292 | 302 | <option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; |
| 303 | + } |
|
| 293 | 304 | echo ' |
| 294 | 305 | </select> |
| 295 | 306 | </dd>'; |
@@ -317,9 +328,10 @@ discard block |
||
| 317 | 328 | <select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '> |
| 318 | 329 | ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; |
| 319 | 330 | |
| 320 | - foreach ($context['board_order'] as $order) |
|
| 321 | - echo ' |
|
| 331 | + foreach ($context['board_order'] as $order) { |
|
| 332 | + echo ' |
|
| 322 | 333 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
| 334 | + } |
|
| 323 | 335 | echo ' |
| 324 | 336 | </select> |
| 325 | 337 | </dd>'; |
@@ -348,13 +360,15 @@ discard block |
||
| 348 | 360 | <dd> |
| 349 | 361 | <select name="profile">'; |
| 350 | 362 | |
| 351 | - if (isset($context['board']['is_new'])) |
|
| 352 | - echo ' |
|
| 363 | + if (isset($context['board']['is_new'])) { |
|
| 364 | + echo ' |
|
| 353 | 365 | <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; |
| 366 | + } |
|
| 354 | 367 | |
| 355 | - foreach ($context['profiles'] as $id => $profile) |
|
| 356 | - echo ' |
|
| 368 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 369 | + echo ' |
|
| 357 | 370 | <option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 371 | + } |
|
| 358 | 372 | |
| 359 | 373 | echo ' |
| 360 | 374 | </select> |
@@ -367,8 +381,8 @@ discard block |
||
| 367 | 381 | </dt> |
| 368 | 382 | <dd>'; |
| 369 | 383 | |
| 370 | - if (!empty($modSettings['deny_boards_access'])) |
|
| 371 | - echo ' |
|
| 384 | + if (!empty($modSettings['deny_boards_access'])) { |
|
| 385 | + echo ' |
|
| 372 | 386 | <table> |
| 373 | 387 | <tr> |
| 374 | 388 | <td></td> |
@@ -376,10 +390,11 @@ discard block |
||
| 376 | 390 | <th>', $txt['permissions_option_off'], '</th> |
| 377 | 391 | <th>', $txt['permissions_option_deny'], '</th> |
| 378 | 392 | </tr>'; |
| 393 | + } |
|
| 379 | 394 | |
| 380 | 395 | // List all the membergroups so the user can choose who may access this board. |
| 381 | - foreach ($context['groups'] as $group) |
|
| 382 | - if (empty($modSettings['deny_boards_access'])) |
|
| 396 | + foreach ($context['groups'] as $group) { |
|
| 397 | + if (empty($modSettings['deny_boards_access'])) |
|
| 383 | 398 | echo ' |
| 384 | 399 | <label for="groups_', $group['id'], '"> |
| 385 | 400 | <input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '> |
@@ -387,8 +402,9 @@ discard block |
||
| 387 | 402 | ', $group['name'], ' |
| 388 | 403 | </span> |
| 389 | 404 | </label><br>'; |
| 390 | - else |
|
| 391 | - echo ' |
|
| 405 | + } |
|
| 406 | + else { |
|
| 407 | + echo ' |
|
| 392 | 408 | <tr> |
| 393 | 409 | <td> |
| 394 | 410 | <label for="groups_', $group['id'], '_a"> |
@@ -408,16 +424,17 @@ discard block |
||
| 408 | 424 | </td> |
| 409 | 425 | <td></td> |
| 410 | 426 | </tr>'; |
| 427 | + } |
|
| 411 | 428 | |
| 412 | - if (empty($modSettings['deny_boards_access'])) |
|
| 413 | - echo ' |
|
| 429 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 430 | + echo ' |
|
| 414 | 431 | <span class="select_all_box"> |
| 415 | 432 | <em>', $txt['check_all'], '</em> <input type="checkbox" onclick="invertAll(this, this.form, \'groups[\');"> |
| 416 | 433 | </span> |
| 417 | 434 | <br><br> |
| 418 | 435 | </dd>'; |
| 419 | - else |
|
| 420 | - echo ' |
|
| 436 | + } else { |
|
| 437 | + echo ' |
|
| 421 | 438 | <tr class="select_all_box"> |
| 422 | 439 | <td> |
| 423 | 440 | </td> |
@@ -436,6 +453,7 @@ discard block |
||
| 436 | 453 | </tr> |
| 437 | 454 | </table> |
| 438 | 455 | </dd>'; |
| 456 | + } |
|
| 439 | 457 | |
| 440 | 458 | // Options to choose moderators, specify as announcement board and choose whether to count posts here. |
| 441 | 459 | echo ' |
@@ -490,8 +508,8 @@ discard block |
||
| 490 | 508 | </dl> |
| 491 | 509 | </div>'; |
| 492 | 510 | |
| 493 | - if ($context['board']['redirect']) |
|
| 494 | - echo ' |
|
| 511 | + if ($context['board']['redirect']) { |
|
| 512 | + echo ' |
|
| 495 | 513 | <div id="reset_redirect_div"> |
| 496 | 514 | <dl class="settings"> |
| 497 | 515 | <dt> |
@@ -504,6 +522,7 @@ discard block |
||
| 504 | 522 | </dd> |
| 505 | 523 | </dl> |
| 506 | 524 | </div>'; |
| 525 | + } |
|
| 507 | 526 | } |
| 508 | 527 | |
| 509 | 528 | echo ' |
@@ -531,9 +550,10 @@ discard block |
||
| 531 | 550 | <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> |
| 532 | 551 | <option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>'; |
| 533 | 552 | |
| 534 | - foreach ($context['themes'] as $theme) |
|
| 535 | - echo ' |
|
| 553 | + foreach ($context['themes'] as $theme) { |
|
| 554 | + echo ' |
|
| 536 | 555 | <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
| 556 | + } |
|
| 537 | 557 | |
| 538 | 558 | echo ' |
| 539 | 559 | </select> |
@@ -562,14 +582,15 @@ discard block |
||
| 562 | 582 | |
| 563 | 583 | foreach ($context['custom_board_settings'] as $cbs_id => $cbs) |
| 564 | 584 | { |
| 565 | - if (!empty($cbs['dt']) && !empty($cbs['dd'])) |
|
| 566 | - echo ' |
|
| 585 | + if (!empty($cbs['dt']) && !empty($cbs['dd'])) { |
|
| 586 | + echo ' |
|
| 567 | 587 | <dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '"> |
| 568 | 588 | ', $cbs['dt'], ' |
| 569 | 589 | </dt> |
| 570 | 590 | <dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '> |
| 571 | 591 | ', $cbs['dd'], ' |
| 572 | 592 | </dd>'; |
| 593 | + } |
|
| 573 | 594 | } |
| 574 | 595 | |
| 575 | 596 | echo ' |
@@ -577,9 +598,10 @@ discard block |
||
| 577 | 598 | </div>'; |
| 578 | 599 | } |
| 579 | 600 | |
| 580 | - if (!empty($context['board']['is_recycle'])) |
|
| 581 | - echo ' |
|
| 601 | + if (!empty($context['board']['is_recycle'])) { |
|
| 602 | + echo ' |
|
| 582 | 603 | <div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>'; |
| 604 | + } |
|
| 583 | 605 | |
| 584 | 606 | echo ' |
| 585 | 607 | <input type="hidden" name="rid" value="', $context['redirect_location'], '"> |
@@ -587,21 +609,24 @@ discard block |
||
| 587 | 609 | <input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">'; |
| 588 | 610 | |
| 589 | 611 | // If this board has no children don't bother with the next confirmation screen. |
| 590 | - if ($context['board']['no_children']) |
|
| 591 | - echo ' |
|
| 612 | + if ($context['board']['no_children']) { |
|
| 613 | + echo ' |
|
| 592 | 614 | <input type="hidden" name="no_children" value="1">'; |
| 615 | + } |
|
| 593 | 616 | |
| 594 | - if (isset($context['board']['is_new'])) |
|
| 595 | - echo ' |
|
| 617 | + if (isset($context['board']['is_new'])) { |
|
| 618 | + echo ' |
|
| 596 | 619 | <input type="hidden" name="cur_cat" value="', $context['board']['category'], '"> |
| 597 | 620 | <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
| 598 | - else |
|
| 599 | - echo ' |
|
| 621 | + } else { |
|
| 622 | + echo ' |
|
| 600 | 623 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">'; |
| 624 | + } |
|
| 601 | 625 | |
| 602 | - if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) |
|
| 603 | - echo ' |
|
| 626 | + if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) { |
|
| 627 | + echo ' |
|
| 604 | 628 | <input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button you_sure">'; |
| 629 | + } |
|
| 605 | 630 | echo ' |
| 606 | 631 | </div><!-- .windowbg2 --> |
| 607 | 632 | </form> |
@@ -622,12 +647,13 @@ discard block |
||
| 622 | 647 | sItemListContainerId: \'moderator_container\', |
| 623 | 648 | aListItems: ['; |
| 624 | 649 | |
| 625 | - foreach ($context['board']['moderators'] as $id_member => $member_name) |
|
| 626 | - echo ' |
|
| 650 | + foreach ($context['board']['moderators'] as $id_member => $member_name) { |
|
| 651 | + echo ' |
|
| 627 | 652 | { |
| 628 | 653 | sItemId: ', JavaScriptEscape($id_member), ', |
| 629 | 654 | sItemName: ', JavaScriptEscape($member_name), ' |
| 630 | 655 | }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; |
| 656 | + } |
|
| 631 | 657 | |
| 632 | 658 | echo ' |
| 633 | 659 | ] |
@@ -647,12 +673,13 @@ discard block |
||
| 647 | 673 | sItemListContainerId: \'moderator_group_container\', |
| 648 | 674 | aListItems: ['; |
| 649 | 675 | |
| 650 | - foreach ($context['board']['moderator_groups'] as $id_group => $group_name) |
|
| 651 | - echo ' |
|
| 676 | + foreach ($context['board']['moderator_groups'] as $id_group => $group_name) { |
|
| 677 | + echo ' |
|
| 652 | 678 | { |
| 653 | 679 | sItemId: ', JavaScriptEscape($id_group), ', |
| 654 | 680 | sItemName: ', JavaScriptEscape($group_name), ' |
| 655 | 681 | }', $id_group == $context['board']['last_moderator_group_id'] ? '' : ','; |
| 682 | + } |
|
| 656 | 683 | |
| 657 | 684 | echo ' |
| 658 | 685 | ] |
@@ -678,17 +705,19 @@ discard block |
||
| 678 | 705 | echo ' |
| 679 | 706 | document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; |
| 680 | 707 | |
| 681 | - if ($context['board']['redirect']) |
|
| 682 | - echo ' |
|
| 708 | + if ($context['board']['redirect']) { |
|
| 709 | + echo ' |
|
| 683 | 710 | document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; |
| 711 | + } |
|
| 684 | 712 | } |
| 685 | 713 | |
| 686 | 714 | // Include any JavaScript added by mods using the 'integrate_edit_board' hook. |
| 687 | 715 | if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions'])) |
| 688 | 716 | { |
| 689 | - foreach ($context['custom_refreshOptions'] as $refreshOption) |
|
| 690 | - echo ' |
|
| 717 | + foreach ($context['custom_refreshOptions'] as $refreshOption) { |
|
| 718 | + echo ' |
|
| 691 | 719 | ', $refreshOption; |
| 720 | + } |
|
| 692 | 721 | } |
| 693 | 722 | |
| 694 | 723 | echo ' |
@@ -717,9 +746,10 @@ discard block |
||
| 717 | 746 | <p>', $txt['mboards_delete_board_contains'], '</p> |
| 718 | 747 | <ul>'; |
| 719 | 748 | |
| 720 | - foreach ($context['children'] as $child) |
|
| 721 | - echo ' |
|
| 749 | + foreach ($context['children'] as $child) { |
|
| 750 | + echo ' |
|
| 722 | 751 | <li>', $child['node']['name'], '</li>'; |
| 752 | + } |
|
| 723 | 753 | |
| 724 | 754 | echo ' |
| 725 | 755 | </ul> |
@@ -733,10 +763,11 @@ discard block |
||
| 733 | 763 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>: |
| 734 | 764 | <select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>'; |
| 735 | 765 | |
| 736 | - foreach ($context['board_order'] as $board) |
|
| 737 | - if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
| 766 | + foreach ($context['board_order'] as $board) { |
|
| 767 | + if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
| 738 | 768 | echo ' |
| 739 | 769 | <option value="', $board['id'], '">', $board['name'], '</option>'; |
| 770 | + } |
|
| 740 | 771 | |
| 741 | 772 | echo ' |
| 742 | 773 | </select> |
@@ -31,25 +31,27 @@ 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> |
| 43 | 44 | <br>'; |
| 44 | 45 | |
| 45 | 46 | // Do errors exist in the install? If so light them up like a christmas tree. |
| 46 | - if ($context['has_failure']) |
|
| 47 | - echo ' |
|
| 47 | + if ($context['has_failure']) { |
|
| 48 | + echo ' |
|
| 48 | 49 | <div class="errorbox"> |
| 49 | 50 | ', sprintf($txt['package_will_fail_title'], $txt['package_' . ($context['uninstalling'] ? 'uninstall' : 'install')]), '<br> |
| 50 | 51 | ', sprintf($txt['package_will_fail_warning'], $txt['package_' . ($context['uninstalling'] ? 'uninstall' : 'install')]), |
| 51 | 52 | !empty($context['failure_details']) ? '<br><br><strong>' . $context['failure_details'] . '</strong>' : '', ' |
| 52 | 53 | </div>'; |
| 54 | + } |
|
| 53 | 55 | |
| 54 | 56 | // Display the package readme if one exists |
| 55 | 57 | if (isset($context['package_readme'])) |
@@ -63,9 +65,10 @@ discard block |
||
| 63 | 65 | <span class="floatright">', $txt['package_available_readme_language'], ' |
| 64 | 66 | <select name="readme_language" id="readme_language" onchange="if (this.options[this.selectedIndex].value) window.location.href = smf_prepareScriptUrl(smf_scripturl + \'', '?action=admin;area=packages;sa=', $context['uninstalling'] ? 'uninstall' : 'install', ';package=', $context['filename'], ';readme=\' + this.options[this.selectedIndex].value + \';license=\' + get_selected(\'license_language\'));">'; |
| 65 | 67 | |
| 66 | - foreach ($context['readmes'] as $a => $b) |
|
| 67 | - echo ' |
|
| 68 | + foreach ($context['readmes'] as $a => $b) { |
|
| 69 | + echo ' |
|
| 68 | 70 | <option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), '</option>'; |
| 71 | + } |
|
| 69 | 72 | |
| 70 | 73 | echo ' |
| 71 | 74 | </select> |
@@ -86,9 +89,10 @@ discard block |
||
| 86 | 89 | <span class="floatright">', $txt['package_available_license_language'], ' |
| 87 | 90 | <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\'));">'; |
| 88 | 91 | |
| 89 | - foreach ($context['licenses'] as $a => $b) |
|
| 90 | - echo ' |
|
| 92 | + foreach ($context['licenses'] as $a => $b) { |
|
| 93 | + echo ' |
|
| 91 | 94 | <option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_license_default'] : ucfirst($b), '</option>'; |
| 95 | + } |
|
| 92 | 96 | echo ' |
| 93 | 97 | </select> |
| 94 | 98 | </span> |
@@ -115,9 +119,10 @@ discard block |
||
| 115 | 119 | ', $txt['package_db_uninstall_actions'], ': |
| 116 | 120 | <ul>'; |
| 117 | 121 | |
| 118 | - foreach ($context['database_changes'] as $change) |
|
| 119 | - echo ' |
|
| 122 | + foreach ($context['database_changes'] as $change) { |
|
| 123 | + echo ' |
|
| 120 | 124 | <li>', $change, '</li>'; |
| 125 | + } |
|
| 121 | 126 | |
| 122 | 127 | echo ' |
| 123 | 128 | </ul> |
@@ -128,14 +133,14 @@ discard block |
||
| 128 | 133 | echo ' |
| 129 | 134 | <div class="information">'; |
| 130 | 135 | |
| 131 | - if (empty($context['actions']) && empty($context['database_changes'])) |
|
| 132 | - echo ' |
|
| 136 | + if (empty($context['actions']) && empty($context['database_changes'])) { |
|
| 137 | + echo ' |
|
| 133 | 138 | <br> |
| 134 | 139 | <div class="errorbox"> |
| 135 | 140 | ', $txt['corrupt_compatible'], ' |
| 136 | 141 | </div> |
| 137 | 142 | </div><!-- .information -->'; |
| 138 | - else |
|
| 143 | + } else |
|
| 139 | 144 | { |
| 140 | 145 | echo ' |
| 141 | 146 | ', $txt['perform_actions'], ' |
@@ -239,9 +244,10 @@ discard block |
||
| 239 | 244 | <td></td> |
| 240 | 245 | <td>'; |
| 241 | 246 | |
| 242 | - if (!empty($context['themes_locked'])) |
|
| 243 | - echo ' |
|
| 247 | + if (!empty($context['themes_locked'])) { |
|
| 248 | + echo ' |
|
| 244 | 249 | <input type="hidden" name="custom_theme[]" value="', $id, '">'; |
| 250 | + } |
|
| 245 | 251 | echo ' |
| 246 | 252 | <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' : '', '> |
| 247 | 253 | </td> |
@@ -307,21 +313,23 @@ discard block |
||
| 307 | 313 | } |
| 308 | 314 | |
| 309 | 315 | // Are we effectively ready to install? |
| 310 | - if (!$context['ftp_needed'] && (!empty($context['actions']) || !empty($context['database_changes']))) |
|
| 311 | - echo ' |
|
| 316 | + if (!$context['ftp_needed'] && (!empty($context['actions']) || !empty($context['database_changes']))) { |
|
| 317 | + echo ' |
|
| 312 | 318 | <div class="righttext padding"> |
| 313 | 319 | <input type="submit" value="', $context['uninstalling'] ? $txt['package_uninstall_now'] : $txt['package_install_now'], '" onclick="return ', !empty($context['has_failure']) ? '(submitThisOnce(this) && confirm(\'' . ($context['uninstalling'] ? $txt['package_will_fail_popup_uninstall'] : $txt['package_will_fail_popup']) . '\'))' : 'submitThisOnce(this)', ';" class="button"> |
| 314 | 320 | </div>'; |
| 321 | + } |
|
| 315 | 322 | |
| 316 | 323 | // If we need ftp information then demand it! |
| 317 | - elseif ($context['ftp_needed']) |
|
| 318 | - echo ' |
|
| 324 | + elseif ($context['ftp_needed']) { |
|
| 325 | + echo ' |
|
| 319 | 326 | <div class="cat_bar"> |
| 320 | 327 | <h3 class="catbg">', $txt['package_ftp_necessary'], '</h3> |
| 321 | 328 | </div> |
| 322 | 329 | <div> |
| 323 | 330 | ', template_control_chmod(), ' |
| 324 | 331 | </div>'; |
| 332 | + } |
|
| 325 | 333 | |
| 326 | 334 | echo ' |
| 327 | 335 | |
@@ -338,8 +346,8 @@ discard block |
||
| 338 | 346 | // Operations. |
| 339 | 347 | if (!empty($js_operations)) |
| 340 | 348 | { |
| 341 | - foreach ($js_operations as $key => $operation) |
|
| 342 | - echo ' |
|
| 349 | + foreach ($js_operations as $key => $operation) { |
|
| 350 | + echo ' |
|
| 343 | 351 | aOperationElements[', $key, '] = new smc_Toggle({ |
| 344 | 352 | bToggleEnabled: true, |
| 345 | 353 | bNoAnimate: true, |
@@ -357,6 +365,7 @@ discard block |
||
| 357 | 365 | } |
| 358 | 366 | ] |
| 359 | 367 | });'; |
| 368 | + } |
|
| 360 | 369 | } |
| 361 | 370 | |
| 362 | 371 | echo ' |
@@ -378,14 +387,15 @@ discard block |
||
| 378 | 387 | </script>'; |
| 379 | 388 | |
| 380 | 389 | // And a bit more for database changes. |
| 381 | - if (!empty($context['database_changes'])) |
|
| 382 | - echo ' |
|
| 390 | + if (!empty($context['database_changes'])) { |
|
| 391 | + echo ' |
|
| 383 | 392 | <script> |
| 384 | 393 | var database_changes_area = document.getElementById(\'db_changes_div\'); |
| 385 | 394 | var db_vis = false; |
| 386 | 395 | database_changes_area.style.display = "none"; |
| 387 | 396 | </script>'; |
| 388 | -} |
|
| 397 | + } |
|
| 398 | + } |
|
| 389 | 399 | |
| 390 | 400 | /** |
| 391 | 401 | * Extract package contents |
@@ -394,8 +404,8 @@ discard block |
||
| 394 | 404 | { |
| 395 | 405 | global $context, $txt, $scripturl; |
| 396 | 406 | |
| 397 | - if (!empty($context['redirect_url'])) |
|
| 398 | - echo ' |
|
| 407 | + if (!empty($context['redirect_url'])) { |
|
| 408 | + echo ' |
|
| 399 | 409 | <script> |
| 400 | 410 | setTimeout("doRedirect();", ', empty($context['redirect_timeout']) ? '5000' : $context['redirect_timeout'], '); |
| 401 | 411 | |
@@ -404,52 +414,51 @@ discard block |
||
| 404 | 414 | window.location = "', $context['redirect_url'], '"; |
| 405 | 415 | } |
| 406 | 416 | </script>'; |
| 417 | + } |
|
| 407 | 418 | |
| 408 | 419 | echo ' |
| 409 | 420 | <div id="admincenter">'; |
| 410 | 421 | |
| 411 | - if (empty($context['redirect_url'])) |
|
| 412 | - echo ' |
|
| 422 | + if (empty($context['redirect_url'])) { |
|
| 423 | + echo ' |
|
| 413 | 424 | <div class="cat_bar"> |
| 414 | 425 | <h3 class="catbg">', $context['uninstalling'] ? $txt['uninstall'] : $txt['extracting'], '</h3> |
| 415 | 426 | </div> |
| 416 | 427 | <div class="information">', $txt['package_installed_extract'], '</div>'; |
| 417 | - else |
|
| 418 | - echo ' |
|
| 428 | + } else { |
|
| 429 | + echo ' |
|
| 419 | 430 | <div class="cat_bar"> |
| 420 | 431 | <h3 class="catbg">', $txt['package_installed_redirecting'], '</h3> |
| 421 | 432 | </div>'; |
| 433 | + } |
|
| 422 | 434 | |
| 423 | 435 | echo ' |
| 424 | 436 | <div class="windowbg">'; |
| 425 | 437 | |
| 426 | 438 | // If we are going to redirect we have a slightly different agenda. |
| 427 | - if (!empty($context['redirect_url'])) |
|
| 428 | - echo ' |
|
| 439 | + if (!empty($context['redirect_url'])) { |
|
| 440 | + echo ' |
|
| 429 | 441 | ', $context['redirect_text'], '<br><br> |
| 430 | 442 | <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>'; |
| 431 | - |
|
| 432 | - elseif ($context['uninstalling']) |
|
| 433 | - echo ' |
|
| 443 | + } elseif ($context['uninstalling']) { |
|
| 444 | + echo ' |
|
| 434 | 445 | ', $txt['package_uninstall_done']; |
| 435 | - |
|
| 436 | - elseif ($context['install_finished']) |
|
| 446 | + } elseif ($context['install_finished']) |
|
| 437 | 447 | { |
| 438 | - if ($context['extract_type'] == 'avatar') |
|
| 439 | - echo ' |
|
| 448 | + if ($context['extract_type'] == 'avatar') { |
|
| 449 | + echo ' |
|
| 440 | 450 | ', $txt['avatars_extracted']; |
| 441 | - |
|
| 442 | - elseif ($context['extract_type'] == 'language') |
|
| 443 | - echo ' |
|
| 451 | + } elseif ($context['extract_type'] == 'language') { |
|
| 452 | + echo ' |
|
| 444 | 453 | ', $txt['language_extracted']; |
| 445 | - |
|
| 446 | - else |
|
| 447 | - echo ' |
|
| 454 | + } else { |
|
| 455 | + echo ' |
|
| 448 | 456 | ', $txt['package_installed_done']; |
| 449 | - } |
|
| 450 | - else |
|
| 451 | - echo ' |
|
| 457 | + } |
|
| 458 | + } else { |
|
| 459 | + echo ' |
|
| 452 | 460 | ', $txt['corrupt_compatible']; |
| 461 | + } |
|
| 453 | 462 | |
| 454 | 463 | echo ' |
| 455 | 464 | </div><!-- .windowbg -->'; |
@@ -483,9 +492,10 @@ discard block |
||
| 483 | 492 | <div class="windowbg"> |
| 484 | 493 | <ol>'; |
| 485 | 494 | |
| 486 | - foreach ($context['files'] as $fileinfo) |
|
| 487 | - echo ' |
|
| 495 | + foreach ($context['files'] as $fileinfo) { |
|
| 496 | + echo ' |
|
| 488 | 497 | <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>'; |
| 498 | + } |
|
| 489 | 499 | |
| 490 | 500 | echo ' |
| 491 | 501 | </ol> |
@@ -549,9 +559,10 @@ discard block |
||
| 549 | 559 | </script> |
| 550 | 560 | <div id="yourVersion" style="display:none">', $context['forum_version'], '</div>'; |
| 551 | 561 | |
| 552 | - if (empty($modSettings['disable_smf_js'])) |
|
| 553 | - echo ' |
|
| 562 | + if (empty($modSettings['disable_smf_js'])) { |
|
| 563 | + echo ' |
|
| 554 | 564 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
| 565 | + } |
|
| 555 | 566 | |
| 556 | 567 | // This sets the announcements and current versions themselves ;). |
| 557 | 568 | echo ' |
@@ -590,12 +601,13 @@ discard block |
||
| 590 | 601 | } |
| 591 | 602 | } |
| 592 | 603 | |
| 593 | - if (!$mods_available) |
|
| 594 | - echo ' |
|
| 604 | + if (!$mods_available) { |
|
| 605 | + echo ' |
|
| 595 | 606 | <div class="noticebox">', $txt['no_packages'], '</div>'; |
| 596 | - else |
|
| 597 | - echo ' |
|
| 607 | + } else { |
|
| 608 | + echo ' |
|
| 598 | 609 | <br>'; |
| 610 | + } |
|
| 599 | 611 | |
| 600 | 612 | // The advanced (emulation) box, collapsed by default |
| 601 | 613 | echo ' |
@@ -622,9 +634,10 @@ discard block |
||
| 622 | 634 | <a id="revert" name="revert"></a> |
| 623 | 635 | <select name="version_emulate" id="ve">'; |
| 624 | 636 | |
| 625 | - foreach ($context['emulation_versions'] as $version) |
|
| 626 | - echo ' |
|
| 637 | + foreach ($context['emulation_versions'] as $version) { |
|
| 638 | + echo ' |
|
| 627 | 639 | <option value="', $version, '"', ($version == $context['selected_version'] ? ' selected="selected"' : ''), '>', $version, '</option>'; |
| 640 | + } |
|
| 628 | 641 | |
| 629 | 642 | echo ' |
| 630 | 643 | </select> |
@@ -680,11 +693,12 @@ discard block |
||
| 680 | 693 | { |
| 681 | 694 | global $context, $txt, $scripturl; |
| 682 | 695 | |
| 683 | - if (!empty($context['package_ftp']['error'])) |
|
| 684 | - echo ' |
|
| 696 | + if (!empty($context['package_ftp']['error'])) { |
|
| 697 | + echo ' |
|
| 685 | 698 | <div class="errorbox"> |
| 686 | 699 | <pre>', $context['package_ftp']['error'], '</pre> |
| 687 | 700 | </div>'; |
| 701 | + } |
|
| 688 | 702 | |
| 689 | 703 | echo ' |
| 690 | 704 | <div id="admin_form_wrapper"> |
@@ -766,13 +780,14 @@ discard block |
||
| 766 | 780 | <legend>' . $txt['package_servers'] . '</legend> |
| 767 | 781 | <ul class="package_servers">'; |
| 768 | 782 | |
| 769 | - foreach ($context['servers'] as $server) |
|
| 770 | - echo ' |
|
| 783 | + foreach ($context['servers'] as $server) { |
|
| 784 | + echo ' |
|
| 771 | 785 | <li class="flow_auto"> |
| 772 | 786 | <span class="floatleft">' . $server['name'] . '</span> |
| 773 | 787 | <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> |
| 774 | 788 | <span class="package_server floatright"><a href="' . $scripturl . '?action=admin;area=packages;get;sa=browse;server=' . $server['id'] . '">[ ' . $txt['package_browse'] . ' ]</a></span> |
| 775 | 789 | </li>'; |
| 790 | + } |
|
| 776 | 791 | echo ' |
| 777 | 792 | </ul> |
| 778 | 793 | </fieldset> |
@@ -859,11 +874,12 @@ discard block |
||
| 859 | 874 | <div class="windowbg2">'; |
| 860 | 875 | |
| 861 | 876 | // No packages, as yet. |
| 862 | - if (empty($context['package_list'])) |
|
| 863 | - echo ' |
|
| 877 | + if (empty($context['package_list'])) { |
|
| 878 | + echo ' |
|
| 864 | 879 | <ul> |
| 865 | 880 | <li>', $txt['no_packages'], '</li> |
| 866 | 881 | </ul>'; |
| 882 | + } |
|
| 867 | 883 | |
| 868 | 884 | // List out the packages... |
| 869 | 885 | else |
@@ -877,11 +893,12 @@ discard block |
||
| 877 | 893 | <li> |
| 878 | 894 | <strong><span id="ps_img_', $i, '" class="toggle_up" alt="*" style="display: none;"></span> ', $packageSection['title'], '</strong>'; |
| 879 | 895 | |
| 880 | - if (!empty($packageSection['text'])) |
|
| 881 | - echo ' |
|
| 896 | + if (!empty($packageSection['text'])) { |
|
| 897 | + echo ' |
|
| 882 | 898 | <div class="sub_bar"> |
| 883 | 899 | <h3 class="subbg">', $packageSection['text'], '</h3> |
| 884 | 900 | </div>'; |
| 901 | + } |
|
| 885 | 902 | |
| 886 | 903 | echo ' |
| 887 | 904 | <', $context['list_type'], ' id="package_section_', $i, '" class="packages">'; |
@@ -892,24 +909,28 @@ discard block |
||
| 892 | 909 | <li>'; |
| 893 | 910 | |
| 894 | 911 | // Textual message. Could be empty just for a blank line... |
| 895 | - if ($package['is_text']) |
|
| 896 | - echo ' |
|
| 912 | + if ($package['is_text']) { |
|
| 913 | + echo ' |
|
| 897 | 914 | ', empty($package['name']) ? ' ' : $package['name']; |
| 915 | + } |
|
| 898 | 916 | |
| 899 | 917 | // This is supposed to be a rule.. |
| 900 | - elseif ($package['is_line']) |
|
| 901 | - echo ' |
|
| 918 | + elseif ($package['is_line']) { |
|
| 919 | + echo ' |
|
| 902 | 920 | <hr>'; |
| 921 | + } |
|
| 903 | 922 | |
| 904 | 923 | // A remote link. |
| 905 | - elseif ($package['is_remote']) |
|
| 906 | - echo ' |
|
| 924 | + elseif ($package['is_remote']) { |
|
| 925 | + echo ' |
|
| 907 | 926 | <strong>', $package['link'], '</strong>'; |
| 927 | + } |
|
| 908 | 928 | |
| 909 | 929 | // A title? |
| 910 | - elseif ($package['is_heading'] || $package['is_title']) |
|
| 911 | - echo ' |
|
| 930 | + elseif ($package['is_heading'] || $package['is_title']) { |
|
| 931 | + echo ' |
|
| 912 | 932 | <strong>', $package['name'], '</strong>'; |
| 933 | + } |
|
| 913 | 934 | |
| 914 | 935 | // Otherwise, it's a package. |
| 915 | 936 | else |
@@ -920,32 +941,36 @@ discard block |
||
| 920 | 941 | <ul id="package_section_', $i, '_pkg_', $id, '" class="package_section">'; |
| 921 | 942 | |
| 922 | 943 | // Show the mod type? |
| 923 | - if ($package['type'] != '') |
|
| 924 | - echo ' |
|
| 944 | + if ($package['type'] != '') { |
|
| 945 | + echo ' |
|
| 925 | 946 | <li class="package_section"> |
| 926 | 947 | ', $txt['package_type'], ': ', $smcFunc['ucwords']($smcFunc['strtolower']($package['type'])), ' |
| 927 | 948 | </li>'; |
| 949 | + } |
|
| 928 | 950 | |
| 929 | 951 | // Show the version number? |
| 930 | - if ($package['version'] != '') |
|
| 931 | - echo ' |
|
| 952 | + if ($package['version'] != '') { |
|
| 953 | + echo ' |
|
| 932 | 954 | <li class="package_section"> |
| 933 | 955 | ', $txt['mod_version'], ': ', $package['version'], ' |
| 934 | 956 | </li>'; |
| 957 | + } |
|
| 935 | 958 | |
| 936 | 959 | // How 'bout the author? |
| 937 | - if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) |
|
| 938 | - echo ' |
|
| 960 | + if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) { |
|
| 961 | + echo ' |
|
| 939 | 962 | <li class="package_section"> |
| 940 | 963 | ', $txt['mod_author'], ': ', $package['author']['link'], ' |
| 941 | 964 | </li>'; |
| 965 | + } |
|
| 942 | 966 | |
| 943 | 967 | // The homepage... |
| 944 | - if ($package['author']['website']['link'] != '') |
|
| 945 | - echo ' |
|
| 968 | + if ($package['author']['website']['link'] != '') { |
|
| 969 | + echo ' |
|
| 946 | 970 | <li class="package_section"> |
| 947 | 971 | ', $txt['author_website'], ': ', $package['author']['website']['link'], ' |
| 948 | 972 | </li>'; |
| 973 | + } |
|
| 949 | 974 | |
| 950 | 975 | // Description: bleh bleh! |
| 951 | 976 | // Location of file: http://someplace/. |
@@ -1004,8 +1029,8 @@ discard block |
||
| 1004 | 1029 | |
| 1005 | 1030 | foreach ($ps['items'] as $id => $package) |
| 1006 | 1031 | { |
| 1007 | - if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) |
|
| 1008 | - echo ' |
|
| 1032 | + if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) { |
|
| 1033 | + echo ' |
|
| 1009 | 1034 | var oPackageToggle_', $section, '_pkg_', $id, ' = new smc_Toggle({ |
| 1010 | 1035 | bToggleEnabled: true, |
| 1011 | 1036 | bCurrentlyCollapsed: true, |
@@ -1020,6 +1045,7 @@ discard block |
||
| 1020 | 1045 | } |
| 1021 | 1046 | ] |
| 1022 | 1047 | });'; |
| 1048 | + } |
|
| 1023 | 1049 | } |
| 1024 | 1050 | } |
| 1025 | 1051 | |
@@ -1064,9 +1090,10 @@ discard block |
||
| 1064 | 1090 | { |
| 1065 | 1091 | global $context, $txt, $scripturl; |
| 1066 | 1092 | |
| 1067 | - if (!empty($context['saved_successful'])) |
|
| 1068 | - echo ' |
|
| 1093 | + if (!empty($context['saved_successful'])) { |
|
| 1094 | + echo ' |
|
| 1069 | 1095 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 1096 | + } |
|
| 1070 | 1097 | |
| 1071 | 1098 | echo ' |
| 1072 | 1099 | <div id="admincenter"> |
@@ -1128,8 +1155,9 @@ discard block |
||
| 1128 | 1155 | global $context, $txt; |
| 1129 | 1156 | |
| 1130 | 1157 | // Nothing to do? Brilliant! |
| 1131 | - if (empty($context['package_ftp'])) |
|
| 1132 | - return false; |
|
| 1158 | + if (empty($context['package_ftp'])) { |
|
| 1159 | + return false; |
|
| 1160 | + } |
|
| 1133 | 1161 | |
| 1134 | 1162 | if (empty($context['package_ftp']['form_elements_only'])) |
| 1135 | 1163 | { |
@@ -1139,19 +1167,21 @@ discard block |
||
| 1139 | 1167 | ', $txt['package_ftp_why_file_list'], ' |
| 1140 | 1168 | <ul style="display: inline;">'; |
| 1141 | 1169 | |
| 1142 | - if (!empty($context['notwritable_files'])) |
|
| 1143 | - foreach ($context['notwritable_files'] as $file) |
|
| 1170 | + if (!empty($context['notwritable_files'])) { |
|
| 1171 | + foreach ($context['notwritable_files'] as $file) |
|
| 1144 | 1172 | echo ' |
| 1145 | 1173 | <li>', $file, '</li>'; |
| 1174 | + } |
|
| 1146 | 1175 | |
| 1147 | 1176 | echo ' |
| 1148 | 1177 | </ul>'; |
| 1149 | 1178 | |
| 1150 | - if (!$context['server']['is_windows']) |
|
| 1151 | - echo ' |
|
| 1179 | + if (!$context['server']['is_windows']) { |
|
| 1180 | + echo ' |
|
| 1152 | 1181 | <hr> |
| 1153 | 1182 | ', $txt['package_chmod_linux'], '<br> |
| 1154 | 1183 | <tt># chmod a+w ', implode(' ', $context['notwritable_files']), '</tt>'; |
| 1184 | + } |
|
| 1155 | 1185 | |
| 1156 | 1186 | echo ' |
| 1157 | 1187 | </div><!-- #need_writable_list -->'; |
@@ -1164,9 +1194,10 @@ discard block |
||
| 1164 | 1194 | </div> |
| 1165 | 1195 | </div>'; |
| 1166 | 1196 | |
| 1167 | - if (!empty($context['package_ftp']['destination'])) |
|
| 1168 | - echo ' |
|
| 1197 | + if (!empty($context['package_ftp']['destination'])) { |
|
| 1198 | + echo ' |
|
| 1169 | 1199 | <form action="', $context['package_ftp']['destination'], '" method="post" accept-charset="', $context['character_set'], '">'; |
| 1200 | + } |
|
| 1170 | 1201 | |
| 1171 | 1202 | echo ' |
| 1172 | 1203 | <fieldset> |
@@ -1199,24 +1230,27 @@ discard block |
||
| 1199 | 1230 | </dl> |
| 1200 | 1231 | </fieldset>'; |
| 1201 | 1232 | |
| 1202 | - if (empty($context['package_ftp']['form_elements_only'])) |
|
| 1203 | - echo ' |
|
| 1233 | + if (empty($context['package_ftp']['form_elements_only'])) { |
|
| 1234 | + echo ' |
|
| 1204 | 1235 | <div class="righttext" style="margin: 1ex;"> |
| 1205 | 1236 | <span id="test_ftp_placeholder_full"></span> |
| 1206 | 1237 | <input type="submit" value="', $txt['package_proceed'], '" class="button"> |
| 1207 | 1238 | </div>'; |
| 1239 | + } |
|
| 1208 | 1240 | |
| 1209 | - if (!empty($context['package_ftp']['destination'])) |
|
| 1210 | - echo ' |
|
| 1241 | + if (!empty($context['package_ftp']['destination'])) { |
|
| 1242 | + echo ' |
|
| 1211 | 1243 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1212 | 1244 | </form>'; |
| 1245 | + } |
|
| 1213 | 1246 | |
| 1214 | 1247 | // Hide the details of the list. |
| 1215 | - if (empty($context['package_ftp']['form_elements_only'])) |
|
| 1216 | - echo ' |
|
| 1248 | + if (empty($context['package_ftp']['form_elements_only'])) { |
|
| 1249 | + echo ' |
|
| 1217 | 1250 | <script> |
| 1218 | 1251 | document.getElementById(\'need_writable_list\').style.display = \'none\'; |
| 1219 | 1252 | </script>'; |
| 1253 | + } |
|
| 1220 | 1254 | |
| 1221 | 1255 | // Quick generate the test button. |
| 1222 | 1256 | echo ' |
@@ -1573,9 +1607,10 @@ discard block |
||
| 1573 | 1607 | <td width="30%"> |
| 1574 | 1608 | <strong>'; |
| 1575 | 1609 | |
| 1576 | - if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) |
|
| 1577 | - echo ' |
|
| 1610 | + if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) { |
|
| 1611 | + echo ' |
|
| 1578 | 1612 | <span class="generic_icons folder"></span>'; |
| 1613 | + } |
|
| 1579 | 1614 | |
| 1580 | 1615 | echo ' |
| 1581 | 1616 | ', $name, ' |
@@ -1602,8 +1637,9 @@ discard block |
||
| 1602 | 1637 | </td> |
| 1603 | 1638 | </tr>'; |
| 1604 | 1639 | |
| 1605 | - if (!empty($dir['contents'])) |
|
| 1606 | - template_permission_show_contents($name, $dir['contents'], 1); |
|
| 1640 | + if (!empty($dir['contents'])) { |
|
| 1641 | + template_permission_show_contents($name, $dir['contents'], 1); |
|
| 1642 | + } |
|
| 1607 | 1643 | } |
| 1608 | 1644 | |
| 1609 | 1645 | echo ' |
@@ -1639,13 +1675,14 @@ discard block |
||
| 1639 | 1675 | </fieldset>'; |
| 1640 | 1676 | |
| 1641 | 1677 | // Likely to need FTP? |
| 1642 | - if (empty($context['ftp_connected'])) |
|
| 1643 | - echo ' |
|
| 1678 | + if (empty($context['ftp_connected'])) { |
|
| 1679 | + echo ' |
|
| 1644 | 1680 | <p> |
| 1645 | 1681 | ', $txt['package_file_perms_ftp_details'], ': |
| 1646 | 1682 | </p> |
| 1647 | 1683 | ', template_control_chmod(), ' |
| 1648 | 1684 | <div class="noticebox">', $txt['package_file_perms_ftp_retain'], '</div>'; |
| 1685 | + } |
|
| 1649 | 1686 | |
| 1650 | 1687 | echo ' |
| 1651 | 1688 | <span id="test_ftp_placeholder_full"></span> |
@@ -1654,9 +1691,10 @@ discard block |
||
| 1654 | 1691 | </div><!-- .windowbg2 -->'; |
| 1655 | 1692 | |
| 1656 | 1693 | // Any looks fors we've already done? |
| 1657 | - foreach ($context['look_for'] as $path) |
|
| 1658 | - echo ' |
|
| 1694 | + foreach ($context['look_for'] as $path) { |
|
| 1695 | + echo ' |
|
| 1659 | 1696 | <input type="hidden" name="back_look[]" value="', $path, '">'; |
| 1697 | + } |
|
| 1660 | 1698 | |
| 1661 | 1699 | echo ' |
| 1662 | 1700 | </form> |
@@ -1698,9 +1736,10 @@ discard block |
||
| 1698 | 1736 | <td class="smalltext" width="30%">' . str_repeat(' ', $level * 5), ' |
| 1699 | 1737 | ', (!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, "'\\") . '\');">' : ''; |
| 1700 | 1738 | |
| 1701 | - if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) |
|
| 1702 | - echo ' |
|
| 1739 | + if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) { |
|
| 1740 | + echo ' |
|
| 1703 | 1741 | <span class="generic_icons folder"></span>'; |
| 1742 | + } |
|
| 1704 | 1743 | |
| 1705 | 1744 | echo ' |
| 1706 | 1745 | ', $name, ' |
@@ -1718,34 +1757,38 @@ discard block |
||
| 1718 | 1757 | </tr> |
| 1719 | 1758 | <tr id="insert_div_loc_' . $cur_ident . '" style="display: none;"><td></td></tr>'; |
| 1720 | 1759 | |
| 1721 | - if (!empty($dir['contents'])) |
|
| 1722 | - template_permission_show_contents($ident . '/' . $name, $dir['contents'], $level + 1, !empty($dir['more_files'])); |
|
| 1760 | + if (!empty($dir['contents'])) { |
|
| 1761 | + template_permission_show_contents($ident . '/' . $name, $dir['contents'], $level + 1, !empty($dir['more_files'])); |
|
| 1762 | + } |
|
| 1723 | 1763 | } |
| 1724 | 1764 | } |
| 1725 | 1765 | |
| 1726 | 1766 | // We have more files to show? |
| 1727 | - if ($has_more) |
|
| 1728 | - echo ' |
|
| 1767 | + if ($has_more) { |
|
| 1768 | + echo ' |
|
| 1729 | 1769 | <tr class="windowbg" id="content_', $js_ident, '_more"> |
| 1730 | 1770 | <td class="smalltext" width="40%">' . str_repeat(' ', $level * 5), ' |
| 1731 | 1771 | « <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> » |
| 1732 | 1772 | </td> |
| 1733 | 1773 | <td colspan="6"></td> |
| 1734 | 1774 | </tr>'; |
| 1775 | + } |
|
| 1735 | 1776 | |
| 1736 | 1777 | if ($drawn_div) |
| 1737 | 1778 | { |
| 1738 | 1779 | // Hide anything too far down the tree. |
| 1739 | 1780 | $isFound = false; |
| 1740 | - foreach ($context['look_for'] as $tree) |
|
| 1741 | - if (substr($tree, 0, strlen($ident)) == $ident) |
|
| 1781 | + foreach ($context['look_for'] as $tree) { |
|
| 1782 | + if (substr($tree, 0, strlen($ident)) == $ident) |
|
| 1742 | 1783 | $isFound = true; |
| 1784 | + } |
|
| 1743 | 1785 | |
| 1744 | - if ($level > 1 && !$isFound) |
|
| 1745 | - echo ' |
|
| 1786 | + if ($level > 1 && !$isFound) { |
|
| 1787 | + echo ' |
|
| 1746 | 1788 | <script> |
| 1747 | 1789 | expandFolder(\'', $js_ident, '\', \'\'); |
| 1748 | 1790 | </script>'; |
| 1791 | + } |
|
| 1749 | 1792 | } |
| 1750 | 1793 | } |
| 1751 | 1794 | |
@@ -1765,11 +1808,12 @@ discard block |
||
| 1765 | 1808 | <h3 class="catbg">', $txt['package_file_perms_applying'], '</h3> |
| 1766 | 1809 | </div>'; |
| 1767 | 1810 | |
| 1768 | - if (!empty($context['skip_ftp'])) |
|
| 1769 | - echo ' |
|
| 1811 | + if (!empty($context['skip_ftp'])) { |
|
| 1812 | + echo ' |
|
| 1770 | 1813 | <div class="errorbox"> |
| 1771 | 1814 | ', $txt['package_file_perms_skipping_ftp'], ' |
| 1772 | 1815 | </div>'; |
| 1816 | + } |
|
| 1773 | 1817 | |
| 1774 | 1818 | // How many have we done? |
| 1775 | 1819 | $remaining_items = count($context['method'] == 'individual' ? $context['to_process'] : $context['directory_list']); |
@@ -1808,28 +1852,31 @@ discard block |
||
| 1808 | 1852 | <br>'; |
| 1809 | 1853 | |
| 1810 | 1854 | // Put out the right hidden data. |
| 1811 | - if ($context['method'] == 'individual') |
|
| 1812 | - echo ' |
|
| 1855 | + if ($context['method'] == 'individual') { |
|
| 1856 | + echo ' |
|
| 1813 | 1857 | <input type="hidden" name="custom_value" value="', $context['custom_value'], '"> |
| 1814 | 1858 | <input type="hidden" name="totalItems" value="', $context['total_items'], '"> |
| 1815 | 1859 | <input type="hidden" name="toProcess" value="', $context['to_process_encode'], '">'; |
| 1816 | - else |
|
| 1817 | - echo ' |
|
| 1860 | + } else { |
|
| 1861 | + echo ' |
|
| 1818 | 1862 | <input type="hidden" name="predefined" value="', $context['predefined_type'], '"> |
| 1819 | 1863 | <input type="hidden" name="fileOffset" value="', $context['file_offset'], '"> |
| 1820 | 1864 | <input type="hidden" name="totalItems" value="', $context['total_items'], '"> |
| 1821 | 1865 | <input type="hidden" name="dirList" value="', $context['directory_list_encode'], '"> |
| 1822 | 1866 | <input type="hidden" name="specialFiles" value="', $context['special_files_encode'], '">'; |
| 1867 | + } |
|
| 1823 | 1868 | |
| 1824 | 1869 | // Are we not using FTP for whatever reason. |
| 1825 | - if (!empty($context['skip_ftp'])) |
|
| 1826 | - echo ' |
|
| 1870 | + if (!empty($context['skip_ftp'])) { |
|
| 1871 | + echo ' |
|
| 1827 | 1872 | <input type="hidden" name="skip_ftp" value="1">'; |
| 1873 | + } |
|
| 1828 | 1874 | |
| 1829 | 1875 | // Retain state. |
| 1830 | - foreach ($context['back_look_data'] as $path) |
|
| 1831 | - echo ' |
|
| 1876 | + foreach ($context['back_look_data'] as $path) { |
|
| 1877 | + echo ' |
|
| 1832 | 1878 | <input type="hidden" name="back_look[]" value="', $path, '">'; |
| 1879 | + } |
|
| 1833 | 1880 | |
| 1834 | 1881 | echo ' |
| 1835 | 1882 | <input type="hidden" name="method" value="', $context['method'], '"> |
@@ -86,11 +86,12 @@ discard block |
||
| 86 | 86 | <span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br>'; |
| 87 | 87 | |
| 88 | 88 | // Only offer to search for buddies if we have some! |
| 89 | - if (!empty($context['show_buddies'])) |
|
| 90 | - echo ' |
|
| 89 | + if (!empty($context['show_buddies'])) { |
|
| 90 | + echo ' |
|
| 91 | 91 | <span class="smalltext"> |
| 92 | 92 | <label for="buddies"><input type="checkbox" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked' : '', '> ', $txt['find_buddies'], '</label> |
| 93 | 93 | </span><br>'; |
| 94 | + } |
|
| 94 | 95 | |
| 95 | 96 | echo ' |
| 96 | 97 | <div class="padding righttext"> |
@@ -105,20 +106,21 @@ discard block |
||
| 105 | 106 | <h3 class="catbg">', $txt['find_results'], '</h3> |
| 106 | 107 | </div>'; |
| 107 | 108 | |
| 108 | - if (empty($context['results'])) |
|
| 109 | - echo ' |
|
| 109 | + if (empty($context['results'])) { |
|
| 110 | + echo ' |
|
| 110 | 111 | <p class="error">', $txt['find_no_results'], '</p>'; |
| 111 | - else |
|
| 112 | + } else |
|
| 112 | 113 | { |
| 113 | 114 | echo ' |
| 114 | 115 | <ul class="padding">'; |
| 115 | 116 | |
| 116 | - foreach ($context['results'] as $result) |
|
| 117 | - echo ' |
|
| 117 | + foreach ($context['results'] as $result) { |
|
| 118 | + echo ' |
|
| 118 | 119 | <li class="windowbg"> |
| 119 | 120 | <a href="', $result['href'], '" target="_blank"> <span class="generic_icons profile_sm"></span> |
| 120 | 121 | <a href="javascript:void(0);" onclick="addMember(this.innerHTML); return false;">', $result['name'], '</a> |
| 121 | 122 | </li>'; |
| 123 | + } |
|
| 122 | 124 | |
| 123 | 125 | echo ' |
| 124 | 126 | </ul> |
@@ -134,11 +136,12 @@ discard block |
||
| 134 | 136 | <input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '"> |
| 135 | 137 | </form>'; |
| 136 | 138 | |
| 137 | - if (empty($context['results'])) |
|
| 138 | - echo ' |
|
| 139 | + if (empty($context['results'])) { |
|
| 140 | + echo ' |
|
| 139 | 141 | <script> |
| 140 | 142 | document.getElementById("search").focus(); |
| 141 | 143 | </script>'; |
| 144 | + } |
|
| 142 | 145 | |
| 143 | 146 | echo ' |
| 144 | 147 | </body> |
@@ -162,9 +165,10 @@ discard block |
||
| 162 | 165 | <p>', $txt['manual_introduction'], '</p> |
| 163 | 166 | <ul>'; |
| 164 | 167 | |
| 165 | - foreach ($context['manual_sections'] as $section_id => $wiki_id) |
|
| 166 | - echo ' |
|
| 168 | + foreach ($context['manual_sections'] as $section_id => $wiki_id) { |
|
| 169 | + echo ' |
|
| 167 | 170 | <li><a href="', $context['wiki_url'], '/', $context['wiki_prefix'], $wiki_id, ($txt['lang_dictionary'] != 'en' ? '/' . $txt['lang_dictionary'] : ''), '" target="_blank">', $txt['manual_section_' . $section_id . '_title'], '</a> - ', $txt['manual_section_' . $section_id . '_desc'], '</li>'; |
| 171 | + } |
|
| 168 | 172 | |
| 169 | 173 | echo ' |
| 170 | 174 | </ul> |
@@ -180,8 +184,8 @@ discard block |
||
| 180 | 184 | { |
| 181 | 185 | global $txt, $context, $modSettings; |
| 182 | 186 | |
| 183 | - if (!empty($modSettings['requireAgreement'])) |
|
| 184 | - echo ' |
|
| 187 | + if (!empty($modSettings['requireAgreement'])) { |
|
| 188 | + echo ' |
|
| 185 | 189 | <div class="cat_bar"> |
| 186 | 190 | <h3 class="catbg"> |
| 187 | 191 | ', $txt['terms_and_rules'], ' - ', $context['forum_name_html_safe'], ' |
@@ -190,11 +194,12 @@ discard block |
||
| 190 | 194 | <div class="roundframe"> |
| 191 | 195 | ', $context['agreement'], ' |
| 192 | 196 | </div>'; |
| 193 | - else |
|
| 194 | - echo ' |
|
| 197 | + } else { |
|
| 198 | + echo ' |
|
| 195 | 199 | <div class="noticebox"> |
| 196 | 200 | ', $txt['agreement_disabled'], ' |
| 197 | 201 | </div>'; |
| 198 | -} |
|
| 202 | + } |
|
| 203 | + } |
|
| 199 | 204 | |
| 200 | 205 | ?> |
| 201 | 206 | \ No newline at end of file |
@@ -54,9 +54,10 @@ discard block |
||
| 54 | 54 | <dd> |
| 55 | 55 | <div id="known_themes_list">'; |
| 56 | 56 | |
| 57 | - foreach ($context['themes'] as $theme) |
|
| 58 | - echo ' |
|
| 57 | + foreach ($context['themes'] as $theme) { |
|
| 58 | + echo ' |
|
| 59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $theme['name'], '</label><br>'; |
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | echo ' |
| 62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
| 73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
| 74 | 75 | |
| 75 | 76 | // Put an option for each theme in the select box. |
| 76 | - foreach ($context['themes'] as $theme) |
|
| 77 | - echo ' |
|
| 77 | + foreach ($context['themes'] as $theme) { |
|
| 78 | + echo ' |
|
| 78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
| 80 | + } |
|
| 79 | 81 | |
| 80 | 82 | echo ' |
| 81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
| 90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
| 91 | 93 | |
| 92 | 94 | // Same thing, this time for changing the theme of everyone. |
| 93 | - foreach ($context['themes'] as $theme) |
|
| 94 | - echo ' |
|
| 95 | + foreach ($context['themes'] as $theme) { |
|
| 96 | + echo ' |
|
| 95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
| 98 | + } |
|
| 96 | 99 | |
| 97 | 100 | echo ' |
| 98 | 101 | </select> |
@@ -187,11 +190,12 @@ discard block |
||
| 187 | 190 | global $context, $scripturl, $txt; |
| 188 | 191 | |
| 189 | 192 | // Show a nice confirmation message. |
| 190 | - if (isset($_GET['done'])) |
|
| 191 | - echo ' |
|
| 193 | + if (isset($_GET['done'])) { |
|
| 194 | + echo ' |
|
| 192 | 195 | <div class="infobox"> |
| 193 | 196 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
| 194 | 197 | </div>'; |
| 198 | + } |
|
| 195 | 199 | |
| 196 | 200 | echo ' |
| 197 | 201 | <div id="admincenter"> |
@@ -354,11 +358,12 @@ discard block |
||
| 354 | 358 | if (empty($setting) || !is_array($setting)) |
| 355 | 359 | { |
| 356 | 360 | // Insert a separator (unless this is the first item in the list) |
| 357 | - if ($i !== $first_option_key) |
|
| 358 | - echo ' |
|
| 361 | + if ($i !== $first_option_key) { |
|
| 362 | + echo ' |
|
| 359 | 363 | </dl> |
| 360 | 364 | <hr> |
| 361 | 365 | <dl class="settings">'; |
| 366 | + } |
|
| 362 | 367 | |
| 363 | 368 | // Should we give a name to this section? |
| 364 | 369 | if (is_string($setting) && !empty($setting)) |
@@ -367,9 +372,9 @@ discard block |
||
| 367 | 372 | echo ' |
| 368 | 373 | <dt><strong>' . $setting . '</strong></dt> |
| 369 | 374 | <dd></dd>'; |
| 375 | + } else { |
|
| 376 | + $titled_section = false; |
|
| 370 | 377 | } |
| 371 | - else |
|
| 372 | - $titled_section = false; |
|
| 373 | 378 | |
| 374 | 379 | continue; |
| 375 | 380 | } |
@@ -378,8 +383,8 @@ discard block |
||
| 378 | 383 | <dt>'; |
| 379 | 384 | |
| 380 | 385 | // Show the change option box? |
| 381 | - if ($context['theme_options_reset']) |
|
| 382 | - echo ' |
|
| 386 | + if ($context['theme_options_reset']) { |
|
| 387 | + echo ' |
|
| 383 | 388 | <span class="floatleft"> |
| 384 | 389 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
| 385 | 390 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -387,23 +392,26 @@ discard block |
||
| 387 | 392 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
| 388 | 393 | </select> |
| 389 | 394 | </span>'; |
| 395 | + } |
|
| 390 | 396 | |
| 391 | 397 | echo ' |
| 392 | 398 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
| 393 | 399 | |
| 394 | - if (isset($setting['description'])) |
|
| 395 | - echo ' |
|
| 400 | + if (isset($setting['description'])) { |
|
| 401 | + echo ' |
|
| 396 | 402 | <br> |
| 397 | 403 | <span class="smalltext">', $setting['description'], '</span>'; |
| 404 | + } |
|
| 398 | 405 | echo ' |
| 399 | 406 | </dt>'; |
| 400 | 407 | |
| 401 | 408 | // Display checkbox options |
| 402 | - if ($setting['type'] == 'checkbox') |
|
| 403 | - echo ' |
|
| 409 | + if ($setting['type'] == 'checkbox') { |
|
| 410 | + echo ' |
|
| 404 | 411 | <dd> |
| 405 | 412 | <input type="hidden" name="' . (!empty($setting['default']) ? 'default_' : '') . 'options[' . $setting['id'] . ']" value="0"> |
| 406 | 413 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', $context['theme_options_reset'] ? ' disabled' : '', ' value="1" class="floatleft">'; |
| 414 | + } |
|
| 407 | 415 | |
| 408 | 416 | // How about selection lists, we all love them |
| 409 | 417 | elseif ($setting['type'] == 'list') |
@@ -412,9 +420,10 @@ discard block |
||
| 412 | 420 | <dd> |
| 413 | 421 | <select class="floatleft" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
| 414 | 422 | |
| 415 | - foreach ($setting['options'] as $value => $label) |
|
| 416 | - echo ' |
|
| 423 | + foreach ($setting['options'] as $value => $label) { |
|
| 424 | + echo ' |
|
| 417 | 425 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 426 | + } |
|
| 418 | 427 | |
| 419 | 428 | echo ' |
| 420 | 429 | </select>'; |
@@ -433,14 +442,13 @@ discard block |
||
| 433 | 442 | |
| 434 | 443 | echo ' |
| 435 | 444 | <input type="number"', $min . $max . $step; |
| 436 | - } |
|
| 437 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
| 438 | - echo' |
|
| 445 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
| 446 | + echo' |
|
| 439 | 447 | <input type="url"'; |
| 440 | - |
|
| 441 | - else |
|
| 442 | - echo ' |
|
| 448 | + } else { |
|
| 449 | + echo ' |
|
| 443 | 450 | <input type="text"'; |
| 451 | + } |
|
| 444 | 452 | |
| 445 | 453 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
| 446 | 454 | } |
@@ -479,8 +487,8 @@ discard block |
||
| 479 | 487 | <br>'; |
| 480 | 488 | |
| 481 | 489 | // @todo Why can't I edit the default theme popup. |
| 482 | - if ($context['theme_settings']['theme_id'] != 1) |
|
| 483 | - echo ' |
|
| 490 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
| 491 | + echo ' |
|
| 484 | 492 | <div class="cat_bar"> |
| 485 | 493 | <h3 class="catbg config_hd"> |
| 486 | 494 | ', $txt['theme_edit'], ' |
@@ -496,6 +504,7 @@ discard block |
||
| 496 | 504 | </li> |
| 497 | 505 | </ul> |
| 498 | 506 | </div>'; |
| 507 | + } |
|
| 499 | 508 | |
| 500 | 509 | echo ' |
| 501 | 510 | <div class="cat_bar"> |
@@ -549,9 +558,10 @@ discard block |
||
| 549 | 558 | <dd> |
| 550 | 559 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
| 551 | 560 | |
| 552 | - foreach ($context['theme_variants'] as $key => $variant) |
|
| 553 | - echo ' |
|
| 561 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
| 562 | + echo ' |
|
| 554 | 563 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 564 | + } |
|
| 555 | 565 | |
| 556 | 566 | echo ' |
| 557 | 567 | </select> |
@@ -587,11 +597,12 @@ discard block |
||
| 587 | 597 | if (empty($setting) || !is_array($setting)) |
| 588 | 598 | { |
| 589 | 599 | // We don't need a separator before the first list element |
| 590 | - if ($i !== $first_setting_key) |
|
| 591 | - echo ' |
|
| 600 | + if ($i !== $first_setting_key) { |
|
| 601 | + echo ' |
|
| 592 | 602 | </dl> |
| 593 | 603 | <hr> |
| 594 | 604 | <dl class="settings">'; |
| 605 | + } |
|
| 595 | 606 | |
| 596 | 607 | // Add a fake heading? |
| 597 | 608 | if (is_string($setting) && !empty($setting)) |
@@ -600,9 +611,9 @@ discard block |
||
| 600 | 611 | echo ' |
| 601 | 612 | <dt><strong>' . $setting . '</strong></dt> |
| 602 | 613 | <dd></dd>'; |
| 614 | + } else { |
|
| 615 | + $titled_section = false; |
|
| 603 | 616 | } |
| 604 | - else |
|
| 605 | - $titled_section = false; |
|
| 606 | 617 | |
| 607 | 618 | continue; |
| 608 | 619 | } |
@@ -611,20 +622,22 @@ discard block |
||
| 611 | 622 | <dt> |
| 612 | 623 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
| 613 | 624 | |
| 614 | - if (isset($setting['description'])) |
|
| 615 | - echo '<br> |
|
| 625 | + if (isset($setting['description'])) { |
|
| 626 | + echo '<br> |
|
| 616 | 627 | <span class="smalltext">', $setting['description'], '</span>'; |
| 628 | + } |
|
| 617 | 629 | |
| 618 | 630 | echo ' |
| 619 | 631 | </dt>'; |
| 620 | 632 | |
| 621 | 633 | // A checkbox? |
| 622 | - if ($setting['type'] == 'checkbox') |
|
| 623 | - echo ' |
|
| 634 | + if ($setting['type'] == 'checkbox') { |
|
| 635 | + echo ' |
|
| 624 | 636 | <dd> |
| 625 | 637 | <input type="hidden" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" value="0"> |
| 626 | 638 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', ' value="1"> |
| 627 | 639 | </dd>'; |
| 640 | + } |
|
| 628 | 641 | |
| 629 | 642 | // A list with options? |
| 630 | 643 | elseif ($setting['type'] == 'list') |
@@ -633,9 +646,10 @@ discard block |
||
| 633 | 646 | <dd> |
| 634 | 647 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
| 635 | 648 | |
| 636 | - foreach ($setting['options'] as $value => $label) |
|
| 637 | - echo ' |
|
| 649 | + foreach ($setting['options'] as $value => $label) { |
|
| 650 | + echo ' |
|
| 638 | 651 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 652 | + } |
|
| 639 | 653 | |
| 640 | 654 | echo ' |
| 641 | 655 | </select> |
@@ -663,14 +677,13 @@ discard block |
||
| 663 | 677 | |
| 664 | 678 | echo ' |
| 665 | 679 | <input type="number"', $min . $max . $step; |
| 666 | - } |
|
| 667 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
| 668 | - echo' |
|
| 680 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
| 681 | + echo' |
|
| 669 | 682 | <input type="url"'; |
| 670 | - |
|
| 671 | - else |
|
| 672 | - echo ' |
|
| 683 | + } else { |
|
| 684 | + echo ' |
|
| 673 | 685 | <input type="text"'; |
| 686 | + } |
|
| 674 | 687 | |
| 675 | 688 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : (empty($settings['size']) ? ' size="40"' : ' size="' . $setting['size'] . '"'), '> |
| 676 | 689 | </dd>'; |
@@ -742,9 +755,10 @@ discard block |
||
| 742 | 755 | <label for="variant', $theme['id'], '"><strong>', $theme['pick_label'], '</strong></label>: |
| 743 | 756 | <select id="variant', $theme['id'], '" name="vrt[', $theme['id'], ']" onchange="changeVariant', $theme['id'], '(this.value);">'; |
| 744 | 757 | |
| 745 | - foreach ($theme['variants'] as $key => $variant) |
|
| 746 | - echo ' |
|
| 758 | + foreach ($theme['variants'] as $key => $variant) { |
|
| 759 | + echo ' |
|
| 747 | 760 | <option value="', $key, '"', $theme['selected_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 761 | + } |
|
| 748 | 762 | |
| 749 | 763 | echo ' |
| 750 | 764 | </select> |
@@ -822,21 +836,23 @@ discard block |
||
| 822 | 836 | <div class="windowbg">'; |
| 823 | 837 | |
| 824 | 838 | // Oops! there was an error :( |
| 825 | - if (!empty($context['error_message'])) |
|
| 826 | - echo ' |
|
| 839 | + if (!empty($context['error_message'])) { |
|
| 840 | + echo ' |
|
| 827 | 841 | <p> |
| 828 | 842 | ', $context['error_message'], ' |
| 829 | 843 | </p>'; |
| 844 | + } |
|
| 830 | 845 | |
| 831 | 846 | // Not much to show except a link back... |
| 832 | - else |
|
| 833 | - echo ' |
|
| 847 | + else { |
|
| 848 | + echo ' |
|
| 834 | 849 | <p> |
| 835 | 850 | <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], ' |
| 836 | 851 | </p> |
| 837 | 852 | <p> |
| 838 | 853 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
| 839 | 854 | </p>'; |
| 855 | + } |
|
| 840 | 856 | |
| 841 | 857 | echo ' |
| 842 | 858 | </div><!-- .windowbg --> |
@@ -903,11 +919,12 @@ discard block |
||
| 903 | 919 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
| 904 | 920 | <span class="floatright">'; |
| 905 | 921 | |
| 906 | - if ($template['can_copy']) |
|
| 907 | - echo ' |
|
| 922 | + if ($template['can_copy']) { |
|
| 923 | + echo ' |
|
| 908 | 924 | <a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
| 909 | - else |
|
| 910 | - echo $txt['themeadmin_edit_no_copy']; |
|
| 925 | + } else { |
|
| 926 | + echo $txt['themeadmin_edit_no_copy']; |
|
| 927 | + } |
|
| 911 | 928 | |
| 912 | 929 | echo ' |
| 913 | 930 | </span> |
@@ -930,11 +947,12 @@ discard block |
||
| 930 | 947 | echo ' |
| 931 | 948 | <div id="admincenter">'; |
| 932 | 949 | |
| 933 | - if (!empty($context['browse_title'])) |
|
| 934 | - echo ' |
|
| 950 | + if (!empty($context['browse_title'])) { |
|
| 951 | + echo ' |
|
| 935 | 952 | <div class="cat_bar"> |
| 936 | 953 | <h3 class="catbg">', $context['browse_title'], '</h3> |
| 937 | 954 | </div>'; |
| 955 | + } |
|
| 938 | 956 | |
| 939 | 957 | echo ' |
| 940 | 958 | <table class="table_grid tborder"> |
@@ -954,16 +972,15 @@ discard block |
||
| 954 | 972 | <tr class="windowbg"> |
| 955 | 973 | <td>'; |
| 956 | 974 | |
| 957 | - if ($file['is_editable']) |
|
| 958 | - echo ' |
|
| 975 | + if ($file['is_editable']) { |
|
| 976 | + echo ' |
|
| 959 | 977 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
| 960 | - |
|
| 961 | - elseif ($file['is_directory']) |
|
| 962 | - echo ' |
|
| 978 | + } elseif ($file['is_directory']) { |
|
| 979 | + echo ' |
|
| 963 | 980 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
| 964 | - |
|
| 965 | - else |
|
| 966 | - echo $file['filename']; |
|
| 981 | + } else { |
|
| 982 | + echo $file['filename']; |
|
| 983 | + } |
|
| 967 | 984 | |
| 968 | 985 | echo ' |
| 969 | 986 | </td> |
@@ -985,11 +1002,12 @@ discard block |
||
| 985 | 1002 | { |
| 986 | 1003 | global $context, $settings, $scripturl, $txt; |
| 987 | 1004 | |
| 988 | - if ($context['session_error']) |
|
| 989 | - echo ' |
|
| 1005 | + if ($context['session_error']) { |
|
| 1006 | + echo ' |
|
| 990 | 1007 | <div class="errorbox"> |
| 991 | 1008 | ', $txt['error_session_timeout'], ' |
| 992 | 1009 | </div>'; |
| 1010 | + } |
|
| 993 | 1011 | |
| 994 | 1012 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
| 995 | 1013 | echo ' |
@@ -1053,17 +1071,18 @@ discard block |
||
| 1053 | 1071 | { |
| 1054 | 1072 | '; |
| 1055 | 1073 | |
| 1056 | - if (isBrowser('is_ie')) |
|
| 1057 | - echo ' |
|
| 1074 | + if (isBrowser('is_ie')) { |
|
| 1075 | + echo ' |
|
| 1058 | 1076 | var sheets = frames["css_preview_box"].document.styleSheets; |
| 1059 | 1077 | for (var j = 0; j < sheets.length; j++) |
| 1060 | 1078 | { |
| 1061 | 1079 | if (sheets[j].id == "css_preview_box") |
| 1062 | 1080 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
| 1063 | 1081 | }'; |
| 1064 | - else |
|
| 1065 | - echo ' |
|
| 1082 | + } else { |
|
| 1083 | + echo ' |
|
| 1066 | 1084 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
| 1085 | + } |
|
| 1067 | 1086 | echo ' |
| 1068 | 1087 | } |
| 1069 | 1088 | catch (e) |
@@ -1115,9 +1134,10 @@ discard block |
||
| 1115 | 1134 | </div> |
| 1116 | 1135 | <div class="windowbg">'; |
| 1117 | 1136 | |
| 1118 | - if (!$context['allow_save']) |
|
| 1119 | - echo ' |
|
| 1137 | + if (!$context['allow_save']) { |
|
| 1138 | + echo ' |
|
| 1120 | 1139 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1140 | + } |
|
| 1121 | 1141 | |
| 1122 | 1142 | echo ' |
| 1123 | 1143 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1131,9 +1151,10 @@ discard block |
||
| 1131 | 1151 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1132 | 1152 | |
| 1133 | 1153 | // Hopefully it exists. |
| 1134 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1135 | - echo ' |
|
| 1154 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1155 | + echo ' |
|
| 1136 | 1156 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1157 | + } |
|
| 1137 | 1158 | |
| 1138 | 1159 | echo ' |
| 1139 | 1160 | </form> |
@@ -1147,18 +1168,20 @@ discard block |
||
| 1147 | 1168 | { |
| 1148 | 1169 | global $context, $scripturl, $txt; |
| 1149 | 1170 | |
| 1150 | - if ($context['session_error']) |
|
| 1151 | - echo ' |
|
| 1171 | + if ($context['session_error']) { |
|
| 1172 | + echo ' |
|
| 1152 | 1173 | <div class="errorbox"> |
| 1153 | 1174 | ', $txt['error_session_timeout'], ' |
| 1154 | 1175 | </div>'; |
| 1176 | + } |
|
| 1155 | 1177 | |
| 1156 | - if (isset($context['parse_error'])) |
|
| 1157 | - echo ' |
|
| 1178 | + if (isset($context['parse_error'])) { |
|
| 1179 | + echo ' |
|
| 1158 | 1180 | <div class="errorbox"> |
| 1159 | 1181 | ', $txt['themeadmin_edit_error'], ' |
| 1160 | 1182 | <div><pre>', $context['parse_error'], '</pre></div> |
| 1161 | 1183 | </div>'; |
| 1184 | + } |
|
| 1162 | 1185 | |
| 1163 | 1186 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1164 | 1187 | echo ' |
@@ -1169,16 +1192,18 @@ discard block |
||
| 1169 | 1192 | </div> |
| 1170 | 1193 | <div class="windowbg">'; |
| 1171 | 1194 | |
| 1172 | - if (!$context['allow_save']) |
|
| 1173 | - echo ' |
|
| 1195 | + if (!$context['allow_save']) { |
|
| 1196 | + echo ' |
|
| 1174 | 1197 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1198 | + } |
|
| 1175 | 1199 | |
| 1176 | - foreach ($context['file_parts'] as $part) |
|
| 1177 | - echo ' |
|
| 1200 | + foreach ($context['file_parts'] as $part) { |
|
| 1201 | + echo ' |
|
| 1178 | 1202 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
| 1179 | 1203 | <div class="centertext"> |
| 1180 | 1204 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
| 1181 | 1205 | </div>'; |
| 1206 | + } |
|
| 1182 | 1207 | |
| 1183 | 1208 | echo ' |
| 1184 | 1209 | <div class="padding righttext"> |
@@ -1187,9 +1212,10 @@ discard block |
||
| 1187 | 1212 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1188 | 1213 | |
| 1189 | 1214 | // Hopefully it exists. |
| 1190 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1191 | - echo ' |
|
| 1215 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1216 | + echo ' |
|
| 1192 | 1217 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1218 | + } |
|
| 1193 | 1219 | |
| 1194 | 1220 | echo ' |
| 1195 | 1221 | </div><!-- .righttext --> |
@@ -1205,18 +1231,20 @@ discard block |
||
| 1205 | 1231 | { |
| 1206 | 1232 | global $context, $scripturl, $txt; |
| 1207 | 1233 | |
| 1208 | - if ($context['session_error']) |
|
| 1209 | - echo ' |
|
| 1234 | + if ($context['session_error']) { |
|
| 1235 | + echo ' |
|
| 1210 | 1236 | <div class="errorbox"> |
| 1211 | 1237 | ', $txt['error_session_timeout'], ' |
| 1212 | 1238 | </div>'; |
| 1239 | + } |
|
| 1213 | 1240 | |
| 1214 | 1241 | // Is this file writeable? |
| 1215 | - if (!$context['allow_save']) |
|
| 1216 | - echo ' |
|
| 1242 | + if (!$context['allow_save']) { |
|
| 1243 | + echo ' |
|
| 1217 | 1244 | <div class="errorbox"> |
| 1218 | 1245 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
| 1219 | 1246 | </div>'; |
| 1247 | + } |
|
| 1220 | 1248 | |
| 1221 | 1249 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1222 | 1250 | echo ' |
@@ -1232,9 +1260,10 @@ discard block |
||
| 1232 | 1260 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1233 | 1261 | |
| 1234 | 1262 | // Hopefully it exists. |
| 1235 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1236 | - echo ' |
|
| 1263 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1264 | + echo ' |
|
| 1237 | 1265 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1266 | + } |
|
| 1238 | 1267 | |
| 1239 | 1268 | echo ' |
| 1240 | 1269 | </div><!-- .windowbg --> |
@@ -89,16 +89,18 @@ discard block |
||
| 89 | 89 | foreach ($section['areas'] as $i => $area) |
| 90 | 90 | { |
| 91 | 91 | // Not supposed to be printed? |
| 92 | - if (empty($area['label'])) |
|
| 93 | - continue; |
|
| 92 | + if (empty($area['label'])) { |
|
| 93 | + continue; |
|
| 94 | + } |
|
| 94 | 95 | |
| 95 | 96 | echo ' |
| 96 | 97 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '> |
| 97 | 98 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
| 98 | 99 | |
| 99 | 100 | // Is this the current area, or just some area? |
| 100 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
| 101 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
| 101 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
| 102 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
| 103 | + } |
|
| 102 | 104 | |
| 103 | 105 | // Are there any subsections? |
| 104 | 106 | if (!empty($area['subsections'])) |
@@ -108,8 +110,9 @@ discard block |
||
| 108 | 110 | |
| 109 | 111 | foreach ($area['subsections'] as $sa => $sub) |
| 110 | 112 | { |
| 111 | - if (!empty($sub['disabled'])) |
|
| 112 | - continue; |
|
| 113 | + if (!empty($sub['disabled'])) { |
|
| 114 | + continue; |
|
| 115 | + } |
|
| 113 | 116 | |
| 114 | 117 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
| 115 | 118 | |
@@ -156,8 +159,9 @@ discard block |
||
| 156 | 159 | <h3 class="catbg">'; |
| 157 | 160 | |
| 158 | 161 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
| 159 | - if (function_exists('template_admin_quick_search')) |
|
| 160 | - template_admin_quick_search(); |
|
| 162 | + if (function_exists('template_admin_quick_search')) { |
|
| 163 | + template_admin_quick_search(); |
|
| 164 | + } |
|
| 161 | 165 | |
| 162 | 166 | // Exactly how many tabs do we have? |
| 163 | 167 | if (!empty($context['tabs'])) |
@@ -172,30 +176,36 @@ discard block |
||
| 172 | 176 | } |
| 173 | 177 | |
| 174 | 178 | // Did this not even exist - or do we not have a label? |
| 175 | - if (!isset($tab_context['tabs'][$id])) |
|
| 176 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
| 177 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
| 178 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
| 179 | + if (!isset($tab_context['tabs'][$id])) { |
|
| 180 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
| 181 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
| 182 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
| 183 | + } |
|
| 179 | 184 | |
| 180 | 185 | // Has a custom URL defined in the main admin structure? |
| 181 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
| 182 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
| 186 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
| 187 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
| 188 | + } |
|
| 183 | 189 | |
| 184 | 190 | // Any additional paramaters for the url? |
| 185 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
| 186 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
| 191 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
| 192 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
| 193 | + } |
|
| 187 | 194 | |
| 188 | 195 | // Has it been deemed selected? |
| 189 | - if (!empty($tab['is_selected'])) |
|
| 190 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
| 196 | + if (!empty($tab['is_selected'])) { |
|
| 197 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
| 198 | + } |
|
| 191 | 199 | |
| 192 | 200 | // Does it have its own help? |
| 193 | - if (!empty($tab['help'])) |
|
| 194 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
| 201 | + if (!empty($tab['help'])) { |
|
| 202 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
| 203 | + } |
|
| 195 | 204 | |
| 196 | 205 | // Is this the last one? |
| 197 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
| 198 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
| 206 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
| 207 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
| 208 | + } |
|
| 199 | 209 | } |
| 200 | 210 | |
| 201 | 211 | // Find the selected tab |
@@ -212,22 +222,24 @@ discard block |
||
| 212 | 222 | // Show an icon and/or a help item? |
| 213 | 223 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
| 214 | 224 | { |
| 215 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
| 216 | - echo ' |
|
| 225 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
| 226 | + echo ' |
|
| 217 | 227 | <span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
| 218 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
| 219 | - echo ' |
|
| 228 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
| 229 | + echo ' |
|
| 220 | 230 | <img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
| 231 | + } |
|
| 221 | 232 | |
| 222 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
| 223 | - echo ' |
|
| 233 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
| 234 | + echo ' |
|
| 224 | 235 | <a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
| 236 | + } |
|
| 225 | 237 | |
| 226 | 238 | echo $tab_context['title']; |
| 227 | - } |
|
| 228 | - else |
|
| 229 | - echo ' |
|
| 239 | + } else { |
|
| 240 | + echo ' |
|
| 230 | 241 | ', $tab_context['title']; |
| 242 | + } |
|
| 231 | 243 | |
| 232 | 244 | echo ' |
| 233 | 245 | </h3>', (function_exists('template_admin_quick_search') ? ' |
@@ -236,11 +248,12 @@ discard block |
||
| 236 | 248 | } |
| 237 | 249 | |
| 238 | 250 | // Shall we use the tabs? Yes, it's the only known way! |
| 239 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
| 240 | - echo ' |
|
| 251 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
| 252 | + echo ' |
|
| 241 | 253 | <p class="information"> |
| 242 | 254 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
| 243 | 255 | </p>'; |
| 256 | + } |
|
| 244 | 257 | |
| 245 | 258 | // Print out all the items in this tab (if any). |
| 246 | 259 | if (!empty($context['tabs'])) |
@@ -252,19 +265,21 @@ discard block |
||
| 252 | 265 | |
| 253 | 266 | foreach ($tab_context['tabs'] as $sa => $tab) |
| 254 | 267 | { |
| 255 | - if (!empty($tab['disabled'])) |
|
| 256 | - continue; |
|
| 268 | + if (!empty($tab['disabled'])) { |
|
| 269 | + continue; |
|
| 270 | + } |
|
| 257 | 271 | |
| 258 | - if (!empty($tab['is_selected'])) |
|
| 259 | - echo ' |
|
| 272 | + if (!empty($tab['is_selected'])) { |
|
| 273 | + echo ' |
|
| 260 | 274 | <li> |
| 261 | 275 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
| 262 | 276 | </li>'; |
| 263 | - else |
|
| 264 | - echo ' |
|
| 277 | + } else { |
|
| 278 | + echo ' |
|
| 265 | 279 | <li> |
| 266 | 280 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
| 267 | 281 | </li>'; |
| 282 | + } |
|
| 268 | 283 | } |
| 269 | 284 | |
| 270 | 285 | // The end of tabs |
@@ -29,9 +29,10 @@ discard block |
||
| 29 | 29 | // Go through each type of report they can run. |
| 30 | 30 | foreach ($context['report_types'] as $type) |
| 31 | 31 | { |
| 32 | - if (isset($type['description'])) |
|
| 33 | - echo ' |
|
| 32 | + if (isset($type['description'])) { |
|
| 33 | + echo ' |
|
| 34 | 34 | <dt>', $type['description'], '</dt>'; |
| 35 | + } |
|
| 35 | 36 | |
| 36 | 37 | echo ' |
| 37 | 38 | <dd> |
@@ -62,8 +63,9 @@ discard block |
||
| 62 | 63 | </div> |
| 63 | 64 | <div id="report_buttons">'; |
| 64 | 65 | |
| 65 | - if (!empty($context['report_buttons'])) |
|
| 66 | - template_button_strip($context['report_buttons'], 'right'); |
|
| 66 | + if (!empty($context['report_buttons'])) { |
|
| 67 | + template_button_strip($context['report_buttons'], 'right'); |
|
| 68 | + } |
|
| 67 | 69 | |
| 68 | 70 | echo ' |
| 69 | 71 | </div>'; |
@@ -74,25 +76,27 @@ discard block |
||
| 74 | 76 | echo ' |
| 75 | 77 | <table class="table_grid report_results">'; |
| 76 | 78 | |
| 77 | - if (!empty($table['title'])) |
|
| 78 | - echo ' |
|
| 79 | + if (!empty($table['title'])) { |
|
| 80 | + echo ' |
|
| 79 | 81 | <thead> |
| 80 | 82 | <tr class="title_bar"> |
| 81 | 83 | <th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th> |
| 82 | 84 | </tr> |
| 83 | 85 | </thead> |
| 84 | 86 | <tbody>'; |
| 87 | + } |
|
| 85 | 88 | |
| 86 | 89 | // Now do each row! |
| 87 | 90 | $row_number = 0; |
| 88 | 91 | foreach ($table['data'] as $row) |
| 89 | 92 | { |
| 90 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
| 91 | - echo ' |
|
| 93 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
| 94 | + echo ' |
|
| 92 | 95 | <tr class="windowbg table_caption">'; |
| 93 | - else |
|
| 94 | - echo ' |
|
| 96 | + } else { |
|
| 97 | + echo ' |
|
| 95 | 98 | <tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">'; |
| 99 | + } |
|
| 96 | 100 | |
| 97 | 101 | // Now do each column. |
| 98 | 102 | $column_number = 0; |
@@ -110,16 +114,17 @@ discard block |
||
| 110 | 114 | } |
| 111 | 115 | |
| 112 | 116 | // Shaded? |
| 113 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
| 114 | - echo ' |
|
| 117 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
| 118 | + echo ' |
|
| 115 | 119 | <td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
| 116 | 120 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
| 117 | 121 | </td>'; |
| 118 | - else |
|
| 119 | - echo ' |
|
| 122 | + } else { |
|
| 123 | + echo ' |
|
| 120 | 124 | <td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
| 121 | 125 | ', $data['v'], ' |
| 122 | 126 | </td>'; |
| 127 | + } |
|
| 123 | 128 | |
| 124 | 129 | $column_number++; |
| 125 | 130 | } |
@@ -168,24 +173,26 @@ discard block |
||
| 168 | 173 | <div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '"> |
| 169 | 174 | <table class="bordercolor">'; |
| 170 | 175 | |
| 171 | - if (!empty($table['title'])) |
|
| 172 | - echo ' |
|
| 176 | + if (!empty($table['title'])) { |
|
| 177 | + echo ' |
|
| 173 | 178 | <tr class="title_bar"> |
| 174 | 179 | <td colspan="', $table['column_count'], '"> |
| 175 | 180 | ', $table['title'], ' |
| 176 | 181 | </td> |
| 177 | 182 | </tr>'; |
| 183 | + } |
|
| 178 | 184 | |
| 179 | 185 | // Now do each row! |
| 180 | 186 | $row_number = 0; |
| 181 | 187 | foreach ($table['data'] as $row) |
| 182 | 188 | { |
| 183 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
| 184 | - echo ' |
|
| 189 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
| 190 | + echo ' |
|
| 185 | 191 | <tr class="titlebg">'; |
| 186 | - else |
|
| 187 | - echo ' |
|
| 192 | + } else { |
|
| 193 | + echo ' |
|
| 188 | 194 | <tr class="windowbg">'; |
| 195 | + } |
|
| 189 | 196 | |
| 190 | 197 | // Now do each column!! |
| 191 | 198 | $column_number = 0; |
@@ -202,16 +209,17 @@ discard block |
||
| 202 | 209 | } |
| 203 | 210 | |
| 204 | 211 | // Shaded? |
| 205 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
| 206 | - echo ' |
|
| 212 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
| 213 | + echo ' |
|
| 207 | 214 | <td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
| 208 | 215 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
| 209 | 216 | </td>'; |
| 210 | - else |
|
| 211 | - echo ' |
|
| 217 | + } else { |
|
| 218 | + echo ' |
|
| 212 | 219 | <td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
| 213 | 220 | ', $data['v'], ' |
| 214 | 221 | </td>'; |
| 222 | + } |
|
| 215 | 223 | |
| 216 | 224 | $column_number++; |
| 217 | 225 | } |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | <div class="windowbg2 noup"> |
| 128 | 128 | <dl class="settings">'; |
| 129 | 129 | |
| 130 | - if (!empty($context['table_info'])) |
|
| 131 | - echo ' |
|
| 130 | + if (!empty($context['table_info'])) { |
|
| 131 | + echo ' |
|
| 132 | 132 | <dt> |
| 133 | 133 | <strong>', $txt['search_method_messages_table_space'], ':</strong> |
| 134 | 134 | </dt> |
@@ -141,6 +141,7 @@ discard block |
||
| 141 | 141 | <dd> |
| 142 | 142 | ', $context['table_info']['index_length'], ' |
| 143 | 143 | </dd>'; |
| 144 | + } |
|
| 144 | 145 | echo ' |
| 145 | 146 | </dl> |
| 146 | 147 | ', $context['double_index'] ? '<div class="noticebox"> |
@@ -163,17 +164,17 @@ discard block |
||
| 163 | 164 | <dd> |
| 164 | 165 | <span class="smalltext">'; |
| 165 | 166 | |
| 166 | - if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) |
|
| 167 | - echo ' |
|
| 167 | + if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) { |
|
| 168 | + echo ' |
|
| 168 | 169 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]'; |
| 169 | - |
|
| 170 | - elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) |
|
| 171 | - echo ' |
|
| 170 | + } elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) { |
|
| 171 | + echo ' |
|
| 172 | 172 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create']; |
| 173 | - else |
|
| 174 | - echo ' |
|
| 173 | + } else { |
|
| 174 | + echo ' |
|
| 175 | 175 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br> |
| 176 | 176 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length']; |
| 177 | + } |
|
| 177 | 178 | echo ' |
| 178 | 179 | </span> |
| 179 | 180 | </dd>'; |
@@ -187,26 +188,27 @@ discard block |
||
| 187 | 188 | <dd> |
| 188 | 189 | <span class="smalltext">'; |
| 189 | 190 | |
| 190 | - if ($context['custom_index']) |
|
| 191 | - echo ' |
|
| 191 | + if ($context['custom_index']) { |
|
| 192 | + echo ' |
|
| 192 | 193 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br> |
| 193 | 194 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
| 194 | - |
|
| 195 | - elseif ($context['partial_custom_index']) |
|
| 196 | - echo ' |
|
| 195 | + } elseif ($context['partial_custom_index']) { |
|
| 196 | + echo ' |
|
| 197 | 197 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br> |
| 198 | 198 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
| 199 | - else |
|
| 200 | - echo ' |
|
| 199 | + } else { |
|
| 200 | + echo ' |
|
| 201 | 201 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]'; |
| 202 | + } |
|
| 202 | 203 | echo ' |
| 203 | 204 | </span> |
| 204 | 205 | </dd>'; |
| 205 | 206 | |
| 206 | 207 | foreach ($context['search_apis'] as $api) |
| 207 | 208 | { |
| 208 | - if (empty($api['label']) || $api['has_template']) |
|
| 209 | - continue; |
|
| 209 | + if (empty($api['label']) || $api['has_template']) { |
|
| 210 | + continue; |
|
| 211 | + } |
|
| 210 | 212 | |
| 211 | 213 | echo ' |
| 212 | 214 | <dt> |
@@ -214,11 +216,12 @@ discard block |
||
| 214 | 216 | ', $api['label'], ' |
| 215 | 217 | </dt>'; |
| 216 | 218 | |
| 217 | - if ($api['desc']) |
|
| 218 | - echo ' |
|
| 219 | + if ($api['desc']) { |
|
| 220 | + echo ' |
|
| 219 | 221 | <dd> |
| 220 | 222 | <span class="smalltext">', $api['desc'], '</span> |
| 221 | 223 | </dd>'; |
| 224 | + } |
|
| 222 | 225 | } |
| 223 | 226 | |
| 224 | 227 | echo ' |
@@ -22,30 +22,32 @@ discard block |
||
| 22 | 22 | <div id="calendar">'; |
| 23 | 23 | |
| 24 | 24 | // Show the mini-blocks if they're enabled. |
| 25 | - if (empty($context['blocks_disabled'])) |
|
| 26 | - echo ' |
|
| 25 | + if (empty($context['blocks_disabled'])) { |
|
| 26 | + echo ' |
|
| 27 | 27 | <div id="month_grid"> |
| 28 | 28 | ', template_show_month_grid('prev', true), ' |
| 29 | 29 | ', template_show_month_grid('current', true), ' |
| 30 | 30 | ', template_show_month_grid('next', true), ' |
| 31 | 31 | </div>'; |
| 32 | + } |
|
| 32 | 33 | |
| 33 | 34 | // What view are we showing? |
| 34 | - if ($context['calendar_view'] == 'viewlist') |
|
| 35 | - echo ' |
|
| 35 | + if ($context['calendar_view'] == 'viewlist') { |
|
| 36 | + echo ' |
|
| 36 | 37 | <div id="main_grid"> |
| 37 | 38 | ', template_show_upcoming_list('main'), ' |
| 38 | 39 | </div>'; |
| 39 | - elseif ($context['calendar_view'] == 'viewweek') |
|
| 40 | - echo ' |
|
| 40 | + } elseif ($context['calendar_view'] == 'viewweek') { |
|
| 41 | + echo ' |
|
| 41 | 42 | <div id="main_grid"> |
| 42 | 43 | ', template_show_week_grid('main'), ' |
| 43 | 44 | </div>'; |
| 44 | - else |
|
| 45 | - echo ' |
|
| 45 | + } else { |
|
| 46 | + echo ' |
|
| 46 | 47 | <div id="main_grid"> |
| 47 | 48 | ', template_show_month_grid('main'), ' |
| 48 | 49 | </div>'; |
| 50 | + } |
|
| 49 | 51 | |
| 50 | 52 | // Close our wrapper. |
| 51 | 53 | echo ' |
@@ -64,20 +66,22 @@ discard block |
||
| 64 | 66 | global $context, $scripturl, $txt; |
| 65 | 67 | |
| 66 | 68 | // Bail out if we have nothing to work with |
| 67 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 68 | - return false; |
|
| 69 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 70 | + return false; |
|
| 71 | + } |
|
| 69 | 72 | |
| 70 | 73 | // Protect programmer sanity |
| 71 | 74 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
| 72 | 75 | |
| 73 | 76 | // Do we want a title? |
| 74 | - if (empty($calendar_data['disable_title'])) |
|
| 75 | - echo ' |
|
| 77 | + if (empty($calendar_data['disable_title'])) { |
|
| 78 | + echo ' |
|
| 76 | 79 | <div class="cat_bar"> |
| 77 | 80 | <h3 class="catbg centertext largetext"> |
| 78 | 81 | <a href="', $scripturl, '?action=calendar;viewlist;year=', $calendar_data['start_year'], ';month=', $calendar_data['start_month'], ';day=', $calendar_data['start_day'], '">', $txt['calendar_upcoming'], '</a> |
| 79 | 82 | </h3> |
| 80 | 83 | </div>'; |
| 84 | + } |
|
| 81 | 85 | |
| 82 | 86 | // Give the user some controls to work with |
| 83 | 87 | template_calendar_top($calendar_data); |
@@ -100,11 +104,13 @@ discard block |
||
| 100 | 104 | <li class="windowbg"> |
| 101 | 105 | <strong class="event_title">', $event['link'], '</strong>'; |
| 102 | 106 | |
| 103 | - if ($event['can_edit']) |
|
| 104 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 107 | + if ($event['can_edit']) { |
|
| 108 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 109 | + } |
|
| 105 | 110 | |
| 106 | - if ($event['can_export']) |
|
| 107 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 111 | + if ($event['can_export']) { |
|
| 112 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 113 | + } |
|
| 108 | 114 | |
| 109 | 115 | echo ' |
| 110 | 116 | <br>'; |
@@ -112,14 +118,14 @@ discard block |
||
| 112 | 118 | if (!empty($event['allday'])) |
| 113 | 119 | { |
| 114 | 120 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' – <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : ''; |
| 115 | - } |
|
| 116 | - else |
|
| 121 | + } else |
|
| 117 | 122 | { |
| 118 | 123 | // Display event info relative to user's local timezone |
| 119 | 124 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 120 | 125 | |
| 121 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
| 122 | - echo trim($event['end_date_local']) . ', '; |
|
| 126 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
| 127 | + echo trim($event['end_date_local']) . ', '; |
|
| 128 | + } |
|
| 123 | 129 | |
| 124 | 130 | echo trim($event['end_time_local']); |
| 125 | 131 | |
@@ -128,23 +134,27 @@ discard block |
||
| 128 | 134 | { |
| 129 | 135 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
| 130 | 136 | |
| 131 | - if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) |
|
| 132 | - echo trim($event['start_date_orig']), ', '; |
|
| 137 | + if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) { |
|
| 138 | + echo trim($event['start_date_orig']), ', '; |
|
| 139 | + } |
|
| 133 | 140 | |
| 134 | 141 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 135 | 142 | |
| 136 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
| 137 | - echo trim($event['end_date_orig']) . ', '; |
|
| 143 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
| 144 | + echo trim($event['end_date_orig']) . ', '; |
|
| 145 | + } |
|
| 138 | 146 | |
| 139 | 147 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
| 140 | 148 | } |
| 141 | 149 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
| 142 | - else |
|
| 143 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 150 | + else { |
|
| 151 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 152 | + } |
|
| 144 | 153 | } |
| 145 | 154 | |
| 146 | - if (!empty($event['location'])) |
|
| 147 | - echo '<br>', $event['location']; |
|
| 155 | + if (!empty($event['location'])) { |
|
| 156 | + echo '<br>', $event['location']; |
|
| 157 | + } |
|
| 148 | 158 | |
| 149 | 159 | echo ' |
| 150 | 160 | </li>'; |
@@ -176,8 +186,9 @@ discard block |
||
| 176 | 186 | |
| 177 | 187 | $birthdays = array(); |
| 178 | 188 | |
| 179 | - foreach ($date as $member) |
|
| 180 | - $birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>'; |
|
| 189 | + foreach ($date as $member) { |
|
| 190 | + $birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>'; |
|
| 191 | + } |
|
| 181 | 192 | |
| 182 | 193 | echo implode(', ', $birthdays); |
| 183 | 194 | |
@@ -208,8 +219,9 @@ discard block |
||
| 208 | 219 | $date_local = $date['date_local']; |
| 209 | 220 | unset($date['date_local']); |
| 210 | 221 | |
| 211 | - foreach ($date as $holiday) |
|
| 212 | - $holidays[] = $holiday . ' (' . $date_local . ')'; |
|
| 222 | + foreach ($date as $holiday) { |
|
| 223 | + $holidays[] = $holiday . ' (' . $date_local . ')'; |
|
| 224 | + } |
|
| 213 | 225 | } |
| 214 | 226 | |
| 215 | 227 | echo implode(', ', $holidays); |
@@ -233,17 +245,19 @@ discard block |
||
| 233 | 245 | global $context, $txt, $scripturl, $modSettings; |
| 234 | 246 | |
| 235 | 247 | // If the grid doesn't exist, no point in proceeding. |
| 236 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 237 | - return false; |
|
| 248 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 249 | + return false; |
|
| 250 | + } |
|
| 238 | 251 | |
| 239 | 252 | // A handy little pointer variable. |
| 240 | 253 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
| 241 | 254 | |
| 242 | 255 | // Some conditions for whether or not we should show the week links *here*. |
| 243 | - if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) |
|
| 244 | - $show_week_links = true; |
|
| 245 | - else |
|
| 246 | - $show_week_links = false; |
|
| 256 | + if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) { |
|
| 257 | + $show_week_links = true; |
|
| 258 | + } else { |
|
| 259 | + $show_week_links = false; |
|
| 260 | + } |
|
| 247 | 261 | |
| 248 | 262 | // Assuming that we've not disabled it, show the title block! |
| 249 | 263 | if (empty($calendar_data['disable_title'])) |
@@ -253,18 +267,20 @@ discard block |
||
| 253 | 267 | <h3 class="catbg centertext largetext">'; |
| 254 | 268 | |
| 255 | 269 | // Previous Link: If we're showing prev / next and it's not a mini-calendar. |
| 256 | - if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) |
|
| 257 | - echo ' |
|
| 270 | + if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) { |
|
| 271 | + echo ' |
|
| 258 | 272 | <span class="floatleft"> |
| 259 | 273 | <a href="', $calendar_data['previous_calendar']['href'], '">«</a> |
| 260 | 274 | </span>'; |
| 275 | + } |
|
| 261 | 276 | |
| 262 | 277 | // Next Link: if we're showing prev / next and it's not a mini-calendar. |
| 263 | - if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) |
|
| 264 | - echo ' |
|
| 278 | + if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) { |
|
| 279 | + echo ' |
|
| 265 | 280 | <span class="floatright"> |
| 266 | 281 | <a href="', $calendar_data['next_calendar']['href'], '">»</a> |
| 267 | 282 | </span>'; |
| 283 | + } |
|
| 268 | 284 | |
| 269 | 285 | // Arguably the most exciting part, the title! |
| 270 | 286 | echo ' |
@@ -274,8 +290,9 @@ discard block |
||
| 274 | 290 | } |
| 275 | 291 | |
| 276 | 292 | // Show the controls on main grids |
| 277 | - if ($is_mini === false) |
|
| 278 | - template_calendar_top($calendar_data); |
|
| 293 | + if ($is_mini === false) { |
|
| 294 | + template_calendar_top($calendar_data); |
|
| 295 | + } |
|
| 279 | 296 | |
| 280 | 297 | // Finally, the main calendar table. |
| 281 | 298 | echo ' |
@@ -288,14 +305,16 @@ discard block |
||
| 288 | 305 | <tr>'; |
| 289 | 306 | |
| 290 | 307 | // If we're showing week links, there's an extra column ahead of the week links, so let's think ahead and be prepared! |
| 291 | - if ($show_week_links === true) |
|
| 292 | - echo ' |
|
| 308 | + if ($show_week_links === true) { |
|
| 309 | + echo ' |
|
| 293 | 310 | <th></th>'; |
| 311 | + } |
|
| 294 | 312 | |
| 295 | 313 | // Now, loop through each actual day of the week. |
| 296 | - foreach ($calendar_data['week_days'] as $day) |
|
| 297 | - echo ' |
|
| 314 | + foreach ($calendar_data['week_days'] as $day) { |
|
| 315 | + echo ' |
|
| 298 | 316 | <th class="days" scope="col">', !empty($calendar_data['short_day_titles']) || $is_mini === true ? $txt['days_short'][$day] : $txt['days'][$day], '</th>'; |
| 317 | + } |
|
| 299 | 318 | |
| 300 | 319 | echo ' |
| 301 | 320 | </tr>'; |
@@ -314,11 +333,12 @@ discard block |
||
| 314 | 333 | <tr class="days_wrapper">'; |
| 315 | 334 | |
| 316 | 335 | // This is where we add the actual week link, if enabled on this location. |
| 317 | - if ($show_week_links === true) |
|
| 318 | - echo ' |
|
| 336 | + if ($show_week_links === true) { |
|
| 337 | + echo ' |
|
| 319 | 338 | <td class="windowbg2 weeks"> |
| 320 | 339 | <a href="', $scripturl, '?action=calendar;viewweek;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $week['days'][0]['day'], '" title="', $txt['calendar_view_week'], '">»</a> |
| 321 | 340 | </td>'; |
| 341 | + } |
|
| 322 | 342 | |
| 323 | 343 | // Now loop through each day in the week we're on. |
| 324 | 344 | foreach ($week['days'] as $day) |
@@ -335,27 +355,29 @@ discard block |
||
| 335 | 355 | // Additional classes are given for events, holidays, and birthdays. |
| 336 | 356 | if (!empty($day['events']) && !empty($calendar_data['highlight']['events'])) |
| 337 | 357 | { |
| 338 | - if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) |
|
| 339 | - $classes[] = 'events'; |
|
| 340 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) |
|
| 341 | - $classes[] = 'events'; |
|
| 358 | + if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) { |
|
| 359 | + $classes[] = 'events'; |
|
| 360 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) { |
|
| 361 | + $classes[] = 'events'; |
|
| 362 | + } |
|
| 342 | 363 | } |
| 343 | 364 | if (!empty($day['holidays']) && !empty($calendar_data['highlight']['holidays'])) |
| 344 | 365 | { |
| 345 | - if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) |
|
| 346 | - $classes[] = 'holidays'; |
|
| 347 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) |
|
| 348 | - $classes[] = 'holidays'; |
|
| 366 | + if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) { |
|
| 367 | + $classes[] = 'holidays'; |
|
| 368 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) { |
|
| 369 | + $classes[] = 'holidays'; |
|
| 370 | + } |
|
| 349 | 371 | } |
| 350 | 372 | if (!empty($day['birthdays']) && !empty($calendar_data['highlight']['birthdays'])) |
| 351 | 373 | { |
| 352 | - if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) |
|
| 353 | - $classes[] = 'birthdays'; |
|
| 354 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) |
|
| 355 | - $classes[] = 'birthdays'; |
|
| 374 | + if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) { |
|
| 375 | + $classes[] = 'birthdays'; |
|
| 376 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) { |
|
| 377 | + $classes[] = 'birthdays'; |
|
| 378 | + } |
|
| 356 | 379 | } |
| 357 | - } |
|
| 358 | - else |
|
| 380 | + } else |
|
| 359 | 381 | { |
| 360 | 382 | // Default Classes (either compact or comfortable and disabled). |
| 361 | 383 | $classes[] = !empty($calendar_data['size']) && $calendar_data['size'] == 'small' ? 'compact' : 'comfortable'; |
@@ -374,25 +396,27 @@ discard block |
||
| 374 | 396 | $title_prefix = !empty($day['is_first_of_month']) && $context['current_month'] == $calendar_data['current_month'] && $is_mini === false ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$calendar_data['current_month']] . ' ' : $txt['months_titles'][$calendar_data['current_month']] . ' ') : ''; |
| 375 | 397 | |
| 376 | 398 | // The actual day number - be it a link, or just plain old text! |
| 377 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
| 378 | - echo ' |
|
| 399 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
| 400 | + echo ' |
|
| 379 | 401 | <a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
| 380 | - elseif ($is_mini) |
|
| 381 | - echo ' |
|
| 402 | + } elseif ($is_mini) { |
|
| 403 | + echo ' |
|
| 382 | 404 | <a href="', $scripturl, '?action=calendar;', $context['calendar_view'], ';year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
| 383 | - else |
|
| 384 | - echo ' |
|
| 405 | + } else { |
|
| 406 | + echo ' |
|
| 385 | 407 | <span class="day_text">', $title_prefix, $day['day'], '</span>'; |
| 408 | + } |
|
| 386 | 409 | |
| 387 | 410 | // A lot of stuff, we're not showing on mini-calendars to conserve space. |
| 388 | 411 | if ($is_mini === false) |
| 389 | 412 | { |
| 390 | 413 | // Holidays are always fun, let's show them! |
| 391 | - if (!empty($day['holidays'])) |
|
| 392 | - echo ' |
|
| 414 | + if (!empty($day['holidays'])) { |
|
| 415 | + echo ' |
|
| 393 | 416 | <div class="smalltext holiday"> |
| 394 | 417 | <span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), ' |
| 395 | 418 | </div>'; |
| 419 | + } |
|
| 396 | 420 | |
| 397 | 421 | // Happy Birthday Dear Member! |
| 398 | 422 | if (!empty($day['birthdays'])) |
@@ -410,15 +434,17 @@ discard block |
||
| 410 | 434 | echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '"><span class="fix_rtl_names">', $member['name'], '</span>', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', '; |
| 411 | 435 | |
| 412 | 436 | // 9...10! Let's stop there. |
| 413 | - if ($birthday_count == 10 && $use_js_hide) |
|
| 414 | - // !!TODO - Inline CSS and JavaScript should be moved. |
|
| 437 | + if ($birthday_count == 10 && $use_js_hide) { |
|
| 438 | + // !!TODO - Inline CSS and JavaScript should be moved. |
|
| 415 | 439 | echo '<span class="hidelink" id="bdhidelink_', $day['day'], '">...<br><a href="', $scripturl, '?action=calendar;month=', $calendar_data['current_month'], ';year=', $calendar_data['current_year'], ';showbd" onclick="document.getElementById(\'bdhide_', $day['day'], '\').style.display = \'\'; document.getElementById(\'bdhidelink_', $day['day'], '\').style.display = \'none\'; return false;">(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ')</a></span><span id="bdhide_', $day['day'], '" style="display: none;">, '; |
| 440 | + } |
|
| 416 | 441 | |
| 417 | 442 | ++$birthday_count; |
| 418 | 443 | } |
| 419 | - if ($use_js_hide) |
|
| 420 | - echo ' |
|
| 444 | + if ($use_js_hide) { |
|
| 445 | + echo ' |
|
| 421 | 446 | </span>'; |
| 447 | + } |
|
| 422 | 448 | |
| 423 | 449 | echo ' |
| 424 | 450 | </div><!-- .smalltext -->'; |
@@ -429,8 +455,9 @@ discard block |
||
| 429 | 455 | { |
| 430 | 456 | // Sort events by start time (all day events will be listed first) |
| 431 | 457 | uasort($day['events'], function($a, $b) { |
| 432 | - if ($a['start_timestamp'] == $b['start_timestamp']) |
|
| 433 | - return 0; |
|
| 458 | + if ($a['start_timestamp'] == $b['start_timestamp']) { |
|
| 459 | + return 0; |
|
| 460 | + } |
|
| 434 | 461 | |
| 435 | 462 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
| 436 | 463 | }); |
@@ -450,20 +477,22 @@ discard block |
||
| 450 | 477 | ', $event['link'], '<br> |
| 451 | 478 | <span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">'; |
| 452 | 479 | |
| 453 | - if (!empty($event['start_time_local']) && $event['starts_today'] == true) |
|
| 454 | - echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); |
|
| 455 | - elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) |
|
| 456 | - echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); |
|
| 457 | - elseif (!empty($event['allday'])) |
|
| 458 | - echo $txt['calendar_allday']; |
|
| 480 | + if (!empty($event['start_time_local']) && $event['starts_today'] == true) { |
|
| 481 | + echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); |
|
| 482 | + } elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) { |
|
| 483 | + echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); |
|
| 484 | + } elseif (!empty($event['allday'])) { |
|
| 485 | + echo $txt['calendar_allday']; |
|
| 486 | + } |
|
| 459 | 487 | |
| 460 | 488 | echo ' |
| 461 | 489 | </span>'; |
| 462 | 490 | |
| 463 | - if (!empty($event['location'])) |
|
| 464 | - echo ' |
|
| 491 | + if (!empty($event['location'])) { |
|
| 492 | + echo ' |
|
| 465 | 493 | <br> |
| 466 | 494 | <span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>'; |
| 495 | + } |
|
| 467 | 496 | |
| 468 | 497 | if ($event['can_edit'] || $event['can_export']) |
| 469 | 498 | { |
@@ -471,18 +500,20 @@ discard block |
||
| 471 | 500 | <span class="modify_event_links">'; |
| 472 | 501 | |
| 473 | 502 | // If they can edit the event, show an icon they can click on.... |
| 474 | - if ($event['can_edit']) |
|
| 475 | - echo ' |
|
| 503 | + if ($event['can_edit']) { |
|
| 504 | + echo ' |
|
| 476 | 505 | <a class="modify_event" href="', $event['modify_href'], '"> |
| 477 | 506 | <span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span> |
| 478 | 507 | </a>'; |
| 508 | + } |
|
| 479 | 509 | |
| 480 | 510 | // Exporting! |
| 481 | - if ($event['can_export']) |
|
| 482 | - echo ' |
|
| 511 | + if ($event['can_export']) { |
|
| 512 | + echo ' |
|
| 483 | 513 | <a class="modify_event" href="', $event['export_href'], '"> |
| 484 | 514 | <span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span> |
| 485 | 515 | </a>'; |
| 516 | + } |
|
| 486 | 517 | |
| 487 | 518 | echo ' |
| 488 | 519 | </span><br class="clear">'; |
@@ -501,10 +532,11 @@ discard block |
||
| 501 | 532 | // Otherwise, assuming it's not a mini-calendar, we can show previous / next month days! |
| 502 | 533 | elseif ($is_mini === false) |
| 503 | 534 | { |
| 504 | - if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) |
|
| 505 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>'; |
|
| 506 | - elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) |
|
| 507 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
| 535 | + if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) { |
|
| 536 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>'; |
|
| 537 | + } elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) { |
|
| 538 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
| 539 | + } |
|
| 508 | 540 | } |
| 509 | 541 | |
| 510 | 542 | // Close this day and increase var count. |
@@ -534,8 +566,9 @@ discard block |
||
| 534 | 566 | global $context, $txt, $scripturl, $modSettings; |
| 535 | 567 | |
| 536 | 568 | // We might have no reason to proceed, if the variable isn't there. |
| 537 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 538 | - return false; |
|
| 569 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 570 | + return false; |
|
| 571 | + } |
|
| 539 | 572 | |
| 540 | 573 | // Handy pointer. |
| 541 | 574 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
@@ -552,22 +585,25 @@ discard block |
||
| 552 | 585 | <h3 class="catbg centertext largetext">'; |
| 553 | 586 | |
| 554 | 587 | // Previous Week Link... |
| 555 | - if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) |
|
| 556 | - echo ' |
|
| 588 | + if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) { |
|
| 589 | + echo ' |
|
| 557 | 590 | <span class="floatleft"> |
| 558 | 591 | <a href="', $calendar_data['previous_week']['href'], '">«</a> |
| 559 | 592 | </span>'; |
| 593 | + } |
|
| 560 | 594 | |
| 561 | 595 | // Next Week Link... |
| 562 | - if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) |
|
| 563 | - echo ' |
|
| 596 | + if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) { |
|
| 597 | + echo ' |
|
| 564 | 598 | <span class="floatright"> |
| 565 | 599 | <a href="', $calendar_data['next_week']['href'], '">»</a> |
| 566 | 600 | </span>'; |
| 601 | + } |
|
| 567 | 602 | |
| 568 | 603 | // The Month Title + Week Number... |
| 569 | - if (!empty($calendar_data['week_title'])) |
|
| 570 | - echo $calendar_data['week_title']; |
|
| 604 | + if (!empty($calendar_data['week_title'])) { |
|
| 605 | + echo $calendar_data['week_title']; |
|
| 606 | + } |
|
| 571 | 607 | |
| 572 | 608 | echo ' |
| 573 | 609 | </h3> |
@@ -608,11 +644,12 @@ discard block |
||
| 608 | 644 | <td class="', implode(' ', $classes), ' act_day">'; |
| 609 | 645 | |
| 610 | 646 | // Should the day number be a link? |
| 611 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
| 612 | - echo ' |
|
| 647 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
| 648 | + echo ' |
|
| 613 | 649 | <a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>'; |
| 614 | - else |
|
| 615 | - echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
| 650 | + } else { |
|
| 651 | + echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
| 652 | + } |
|
| 616 | 653 | |
| 617 | 654 | echo ' |
| 618 | 655 | </td> |
@@ -623,8 +660,9 @@ discard block |
||
| 623 | 660 | { |
| 624 | 661 | // Sort events by start time (all day events will be listed first) |
| 625 | 662 | uasort($day['events'], function($a, $b) { |
| 626 | - if ($a['start_timestamp'] == $b['start_timestamp']) |
|
| 627 | - return 0; |
|
| 663 | + if ($a['start_timestamp'] == $b['start_timestamp']) { |
|
| 664 | + return 0; |
|
| 665 | + } |
|
| 628 | 666 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
| 629 | 667 | }); |
| 630 | 668 | |
@@ -638,35 +676,39 @@ discard block |
||
| 638 | 676 | echo $event['link'], '<br> |
| 639 | 677 | <span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">'; |
| 640 | 678 | |
| 641 | - if (!empty($event['start_time_local'])) |
|
| 642 | - echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; |
|
| 643 | - else |
|
| 644 | - echo $txt['calendar_allday']; |
|
| 679 | + if (!empty($event['start_time_local'])) { |
|
| 680 | + echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; |
|
| 681 | + } else { |
|
| 682 | + echo $txt['calendar_allday']; |
|
| 683 | + } |
|
| 645 | 684 | |
| 646 | 685 | echo ' |
| 647 | 686 | </span>'; |
| 648 | 687 | |
| 649 | - if (!empty($event['location'])) |
|
| 650 | - echo '<br> |
|
| 688 | + if (!empty($event['location'])) { |
|
| 689 | + echo '<br> |
|
| 651 | 690 | <span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>'; |
| 691 | + } |
|
| 652 | 692 | |
| 653 | 693 | if (!empty($event_icons_needed)) |
| 654 | 694 | { |
| 655 | 695 | echo ' <span class="modify_event_links">'; |
| 656 | 696 | |
| 657 | 697 | // If they can edit the event, show a star they can click on.... |
| 658 | - if (!empty($event['can_edit'])) |
|
| 659 | - echo ' |
|
| 698 | + if (!empty($event['can_edit'])) { |
|
| 699 | + echo ' |
|
| 660 | 700 | <a class="modify_event" href="', $event['modify_href'], '"> |
| 661 | 701 | <span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span> |
| 662 | 702 | </a>'; |
| 703 | + } |
|
| 663 | 704 | |
| 664 | 705 | // Can we export? Sweet. |
| 665 | - if (!empty($event['can_export'])) |
|
| 666 | - echo ' |
|
| 706 | + if (!empty($event['can_export'])) { |
|
| 707 | + echo ' |
|
| 667 | 708 | <a class="modify_event" href="', $event['export_href'], '"> |
| 668 | 709 | <span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span> |
| 669 | 710 | </a>'; |
| 711 | + } |
|
| 670 | 712 | |
| 671 | 713 | echo ' |
| 672 | 714 | </span><br class="clear">'; |
@@ -684,22 +726,23 @@ discard block |
||
| 684 | 726 | </div> |
| 685 | 727 | <br class="clear">'; |
| 686 | 728 | } |
| 687 | - } |
|
| 688 | - else |
|
| 729 | + } else |
|
| 689 | 730 | { |
| 690 | - if (!empty($context['can_post'])) |
|
| 691 | - echo ' |
|
| 731 | + if (!empty($context['can_post'])) { |
|
| 732 | + echo ' |
|
| 692 | 733 | <div class="week_add_event"> |
| 693 | 734 | <a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['calendar_post_event'], '</a> |
| 694 | 735 | </div>'; |
| 736 | + } |
|
| 695 | 737 | } |
| 696 | 738 | echo ' |
| 697 | 739 | </td> |
| 698 | 740 | <td class="', implode(' ', $classes), !empty($day['holidays']) ? ' holidays' : ' disabled', ' holiday_col" data-css-prefix="' . $txt['calendar_prompt'] . ' ">'; |
| 699 | 741 | |
| 700 | 742 | // Show any holidays! |
| 701 | - if (!empty($day['holidays'])) |
|
| 702 | - echo implode('<br>', $day['holidays']); |
|
| 743 | + if (!empty($day['holidays'])) { |
|
| 744 | + echo implode('<br>', $day['holidays']); |
|
| 745 | + } |
|
| 703 | 746 | |
| 704 | 747 | echo ' |
| 705 | 748 | </td> |
@@ -708,11 +751,12 @@ discard block |
||
| 708 | 751 | // Show any birthdays... |
| 709 | 752 | if (!empty($day['birthdays'])) |
| 710 | 753 | { |
| 711 | - foreach ($day['birthdays'] as $member) |
|
| 712 | - echo ' |
|
| 754 | + foreach ($day['birthdays'] as $member) { |
|
| 755 | + echo ' |
|
| 713 | 756 | <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], '</a> |
| 714 | 757 | ', isset($member['age']) ? ' (' . $member['age'] . ')' : '', ' |
| 715 | 758 | ', $member['is_last'] ? '' : '<br>'; |
| 759 | + } |
|
| 716 | 760 | } |
| 717 | 761 | echo ' |
| 718 | 762 | </td> |
@@ -758,26 +802,27 @@ discard block |
||
| 758 | 802 | <input type="text" name="end_date" id="end_date" maxlength="10" value="', $calendar_data['end_date'], '" tabindex="', $context['tabindex']++, '" class="date_input end" data-type="date"> |
| 759 | 803 | <input type="submit" class="button" style="float:none" id="view_button" value="', $txt['view'], '"> |
| 760 | 804 | </form>'; |
| 761 | - } |
|
| 762 | - else |
|
| 805 | + } else |
|
| 763 | 806 | { |
| 764 | 807 | echo' |
| 765 | 808 | <form action="', $scripturl, '?action=calendar" id="calendar_navigation" method="post" accept-charset="', $context['character_set'], '"> |
| 766 | 809 | <select name="month" id="input_month">'; |
| 767 | 810 | |
| 768 | 811 | // Show a select box with all the months. |
| 769 | - foreach ($txt['months_short'] as $number => $month) |
|
| 770 | - echo ' |
|
| 812 | + foreach ($txt['months_short'] as $number => $month) { |
|
| 813 | + echo ' |
|
| 771 | 814 | <option value="', $number, '"', $number == $context['current_month'] ? ' selected' : '', '>', $month, '</option>'; |
| 815 | + } |
|
| 772 | 816 | |
| 773 | 817 | echo ' |
| 774 | 818 | </select> |
| 775 | 819 | <select name="year">'; |
| 776 | 820 | |
| 777 | 821 | // Show a link for every year... |
| 778 | - for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) |
|
| 779 | - echo ' |
|
| 822 | + for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) { |
|
| 823 | + echo ' |
|
| 780 | 824 | <option value="', $year, '"', $year == $context['current_year'] ? ' selected' : '', '>', $year, '</option>'; |
| 825 | + } |
|
| 781 | 826 | |
| 782 | 827 | echo ' |
| 783 | 828 | </select> |
@@ -799,9 +844,10 @@ discard block |
||
| 799 | 844 | echo ' |
| 800 | 845 | <form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">'; |
| 801 | 846 | |
| 802 | - if (!empty($context['event']['new'])) |
|
| 803 | - echo ' |
|
| 847 | + if (!empty($context['event']['new'])) { |
|
| 848 | + echo ' |
|
| 804 | 849 | <input type="hidden" name="eventid" value="', $context['event']['eventid'], '">'; |
| 850 | + } |
|
| 805 | 851 | |
| 806 | 852 | // Start the main table. |
| 807 | 853 | echo ' |
@@ -812,8 +858,8 @@ discard block |
||
| 812 | 858 | </h3> |
| 813 | 859 | </div>'; |
| 814 | 860 | |
| 815 | - if (!empty($context['post_error']['messages'])) |
|
| 816 | - echo ' |
|
| 861 | + if (!empty($context['post_error']['messages'])) { |
|
| 862 | + echo ' |
|
| 817 | 863 | <div class="errorbox"> |
| 818 | 864 | <dl class="event_error"> |
| 819 | 865 | <dt> |
@@ -824,6 +870,7 @@ discard block |
||
| 824 | 870 | </dt> |
| 825 | 871 | </dl> |
| 826 | 872 | </div>'; |
| 873 | + } |
|
| 827 | 874 | |
| 828 | 875 | echo ' |
| 829 | 876 | <div class="roundframe noup"> |
@@ -851,9 +898,10 @@ discard block |
||
| 851 | 898 | echo ' |
| 852 | 899 | <optgroup label="', $category['name'], '">'; |
| 853 | 900 | |
| 854 | - foreach ($category['boards'] as $board) |
|
| 855 | - echo ' |
|
| 901 | + foreach ($category['boards'] as $board) { |
|
| 902 | + echo ' |
|
| 856 | 903 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 904 | + } |
|
| 857 | 905 | echo ' |
| 858 | 906 | </optgroup>'; |
| 859 | 907 | } |
@@ -889,9 +937,10 @@ discard block |
||
| 889 | 937 | <span class="label">', $txt['calendar_timezone'], '</span> |
| 890 | 938 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
| 891 | 939 | |
| 892 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
| 893 | - echo ' |
|
| 940 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
| 941 | + echo ' |
|
| 894 | 942 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
| 943 | + } |
|
| 895 | 944 | |
| 896 | 945 | echo ' |
| 897 | 946 | </select> |
@@ -907,9 +956,10 @@ discard block |
||
| 907 | 956 | <input type="submit" value="', empty($context['event']['new']) ? $txt['save'] : $txt['post'], '" class="button">'; |
| 908 | 957 | |
| 909 | 958 | // Delete button? |
| 910 | - if (empty($context['event']['new'])) |
|
| 911 | - echo ' |
|
| 959 | + if (empty($context['event']['new'])) { |
|
| 960 | + echo ' |
|
| 912 | 961 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['calendar_confirm_delete'], '" class="button you_sure">'; |
| 962 | + } |
|
| 913 | 963 | |
| 914 | 964 | echo ' |
| 915 | 965 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -937,9 +987,10 @@ discard block |
||
| 937 | 987 | echo ' |
| 938 | 988 | <td style="padding-', $alt ? 'right' : 'left', ': 1.5em;">'; |
| 939 | 989 | |
| 940 | - foreach ($v as $i) |
|
| 941 | - echo ' |
|
| 990 | + foreach ($v as $i) { |
|
| 991 | + echo ' |
|
| 942 | 992 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '"><br>'; |
| 993 | + } |
|
| 943 | 994 | |
| 944 | 995 | echo ' |
| 945 | 996 | </td>'; |
@@ -960,9 +1011,10 @@ discard block |
||
| 960 | 1011 | |
| 961 | 1012 | foreach ($context['clockicons'] as $t => $v) |
| 962 | 1013 | { |
| 963 | - foreach ($v as $i) |
|
| 964 | - echo ' |
|
| 1014 | + foreach ($v as $i) { |
|
| 1015 | + echo ' |
|
| 965 | 1016 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1017 | + } |
|
| 966 | 1018 | } |
| 967 | 1019 | |
| 968 | 1020 | echo ' |
@@ -987,13 +1039,14 @@ discard block |
||
| 987 | 1039 | |
| 988 | 1040 | foreach ($context['clockicons'] as $t => $v) |
| 989 | 1041 | { |
| 990 | - foreach ($v as $i) |
|
| 991 | - echo ' |
|
| 1042 | + foreach ($v as $i) { |
|
| 1043 | + echo ' |
|
| 992 | 1044 | if (', $t, ' >= ', $i, ') |
| 993 | 1045 | { |
| 994 | 1046 | turnon.push("', $t, '_', $i, '"); |
| 995 | 1047 | ', $t, ' -= ', $i, '; |
| 996 | 1048 | }'; |
| 1049 | + } |
|
| 997 | 1050 | } |
| 998 | 1051 | |
| 999 | 1052 | echo ' |
@@ -1037,9 +1090,10 @@ discard block |
||
| 1037 | 1090 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
| 1038 | 1091 | <td>'; |
| 1039 | 1092 | |
| 1040 | - foreach ($v as $i) |
|
| 1041 | - echo ' |
|
| 1093 | + foreach ($v as $i) { |
|
| 1094 | + echo ' |
|
| 1042 | 1095 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">'; |
| 1096 | + } |
|
| 1043 | 1097 | |
| 1044 | 1098 | echo ' |
| 1045 | 1099 | </td> |
@@ -1061,9 +1115,10 @@ discard block |
||
| 1061 | 1115 | |
| 1062 | 1116 | foreach ($context['clockicons'] as $t => $v) |
| 1063 | 1117 | { |
| 1064 | - foreach ($v as $i) |
|
| 1065 | - echo ' |
|
| 1118 | + foreach ($v as $i) { |
|
| 1119 | + echo ' |
|
| 1066 | 1120 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1121 | + } |
|
| 1067 | 1122 | } |
| 1068 | 1123 | |
| 1069 | 1124 | echo ' |
@@ -1080,13 +1135,14 @@ discard block |
||
| 1080 | 1135 | |
| 1081 | 1136 | foreach ($context['clockicons'] as $t => $v) |
| 1082 | 1137 | { |
| 1083 | - foreach ($v as $i) |
|
| 1084 | - echo ' |
|
| 1138 | + foreach ($v as $i) { |
|
| 1139 | + echo ' |
|
| 1085 | 1140 | if (', $t, ' >= ', $i, ') |
| 1086 | 1141 | { |
| 1087 | 1142 | turnon.push("', $t, '_', $i, '"); |
| 1088 | 1143 | ', $t, ' -= ', $i, '; |
| 1089 | 1144 | }'; |
| 1145 | + } |
|
| 1090 | 1146 | } |
| 1091 | 1147 | |
| 1092 | 1148 | echo ' |
@@ -1130,9 +1186,10 @@ discard block |
||
| 1130 | 1186 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
| 1131 | 1187 | <td>'; |
| 1132 | 1188 | |
| 1133 | - foreach ($v as $i) |
|
| 1134 | - echo ' |
|
| 1189 | + foreach ($v as $i) { |
|
| 1190 | + echo ' |
|
| 1135 | 1191 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">'; |
| 1192 | + } |
|
| 1136 | 1193 | |
| 1137 | 1194 | echo ' |
| 1138 | 1195 | </td> |
@@ -1148,9 +1205,10 @@ discard block |
||
| 1148 | 1205 | |
| 1149 | 1206 | foreach ($context['clockicons'] as $t => $v) |
| 1150 | 1207 | { |
| 1151 | - foreach ($v as $i) |
|
| 1152 | - echo ' |
|
| 1208 | + foreach ($v as $i) { |
|
| 1209 | + echo ' |
|
| 1153 | 1210 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1211 | + } |
|
| 1154 | 1212 | } |
| 1155 | 1213 | |
| 1156 | 1214 | echo ' |
@@ -1171,13 +1229,14 @@ discard block |
||
| 1171 | 1229 | |
| 1172 | 1230 | foreach ($context['clockicons'] as $t => $v) |
| 1173 | 1231 | { |
| 1174 | - foreach ($v as $i) |
|
| 1175 | - echo ' |
|
| 1232 | + foreach ($v as $i) { |
|
| 1233 | + echo ' |
|
| 1176 | 1234 | if (', $t, ' >= ', $i, ') |
| 1177 | 1235 | { |
| 1178 | 1236 | turnon.push("', $t, '_', $i, '"); |
| 1179 | 1237 | ', $t, ' -= ', $i, '; |
| 1180 | 1238 | }'; |
| 1239 | + } |
|
| 1181 | 1240 | } |
| 1182 | 1241 | |
| 1183 | 1242 | echo ' |
@@ -1221,9 +1280,10 @@ discard block |
||
| 1221 | 1280 | <tr class="', $alt ? 'windowbg2' : 'windowbg', '"> |
| 1222 | 1281 | <td>'; |
| 1223 | 1282 | |
| 1224 | - foreach ($v as $i) |
|
| 1225 | - echo ' |
|
| 1283 | + foreach ($v as $i) { |
|
| 1284 | + echo ' |
|
| 1226 | 1285 | <img src="', $i ? $context['onimg'] : $context['offimg'], '" alt="" style="padding: 2px;">'; |
| 1286 | + } |
|
| 1227 | 1287 | |
| 1228 | 1288 | echo ' |
| 1229 | 1289 | </td> |