@@ -64,20 +64,20 @@ discard block |
||
| 64 | 64 | <dd> |
| 65 | 65 | ', $modSettings['smileys_url'], '/'; |
| 66 | 66 | |
| 67 | - if ($context['current_set']['id'] == 'default') |
|
| 68 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
| 69 | - |
|
| 70 | - elseif (empty($context['smiley_set_dirs'])) |
|
| 71 | - echo ' |
|
| 67 | + if ($context['current_set']['id'] == 'default') { |
|
| 68 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
| 69 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
| 70 | + echo ' |
|
| 72 | 71 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> '; |
| 73 | - else |
|
| 72 | + } else |
|
| 74 | 73 | { |
| 75 | 74 | echo ' |
| 76 | 75 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
| 77 | 76 | |
| 78 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
| 79 | - echo ' |
|
| 77 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
| 78 | + echo ' |
|
| 80 | 79 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
| 80 | + } |
|
| 81 | 81 | echo ' |
| 82 | 82 | </select> '; |
| 83 | 83 | } |
@@ -92,14 +92,15 @@ discard block |
||
| 92 | 92 | </dd>'; |
| 93 | 93 | |
| 94 | 94 | // If this is a new smiley set they have the option to import smileys already in the directory. |
| 95 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
| 96 | - echo ' |
|
| 95 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
| 96 | + echo ' |
|
| 97 | 97 | <dt> |
| 98 | 98 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
| 99 | 99 | </dt> |
| 100 | 100 | <dd> |
| 101 | 101 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1"> |
| 102 | 102 | </dd>'; |
| 103 | + } |
|
| 103 | 104 | |
| 104 | 105 | echo ' |
| 105 | 106 | </dl> |
@@ -133,9 +134,10 @@ discard block |
||
| 133 | 134 | <dd> |
| 134 | 135 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">'; |
| 135 | 136 | |
| 136 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 137 | - echo ' |
|
| 137 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 138 | + echo ' |
|
| 138 | 139 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
| 140 | + } |
|
| 139 | 141 | |
| 140 | 142 | echo ' |
| 141 | 143 | </select>) |
@@ -151,17 +153,18 @@ discard block |
||
| 151 | 153 | </dt> |
| 152 | 154 | <dd>'; |
| 153 | 155 | |
| 154 | - if (empty($context['filenames'])) |
|
| 155 | - echo ' |
|
| 156 | + if (empty($context['filenames'])) { |
|
| 157 | + echo ' |
|
| 156 | 158 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">'; |
| 157 | - else |
|
| 159 | + } else |
|
| 158 | 160 | { |
| 159 | 161 | echo ' |
| 160 | 162 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
| 161 | 163 | |
| 162 | - foreach ($context['filenames'] as $filename) |
|
| 163 | - echo ' |
|
| 164 | + foreach ($context['filenames'] as $filename) { |
|
| 165 | + echo ' |
|
| 164 | 166 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
| 167 | + } |
|
| 165 | 168 | echo ' |
| 166 | 169 | </select>'; |
| 167 | 170 | } |
@@ -230,9 +233,10 @@ discard block |
||
| 230 | 233 | <dd> |
| 231 | 234 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
| 232 | 235 | |
| 233 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 234 | - echo ' |
|
| 236 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 237 | + echo ' |
|
| 235 | 238 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
| 239 | + } |
|
| 236 | 240 | |
| 237 | 241 | echo ' |
| 238 | 242 | </select> |
@@ -242,17 +246,18 @@ discard block |
||
| 242 | 246 | </dt> |
| 243 | 247 | <dd>'; |
| 244 | 248 | |
| 245 | - if (empty($context['filenames'])) |
|
| 246 | - echo ' |
|
| 249 | + if (empty($context['filenames'])) { |
|
| 250 | + echo ' |
|
| 247 | 251 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">'; |
| 248 | - else |
|
| 252 | + } else |
|
| 249 | 253 | { |
| 250 | 254 | echo ' |
| 251 | 255 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
| 252 | 256 | |
| 253 | - foreach ($context['filenames'] as $filename) |
|
| 254 | - echo ' |
|
| 257 | + foreach ($context['filenames'] as $filename) { |
|
| 258 | + echo ' |
|
| 255 | 259 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
| 260 | + } |
|
| 256 | 261 | echo ' |
| 257 | 262 | </select>'; |
| 258 | 263 | } |
@@ -281,14 +286,15 @@ discard block |
||
| 281 | 286 | |
| 282 | 287 | <dl id="uploadMore" style="display: none;" class="settings">'; |
| 283 | 288 | |
| 284 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 285 | - echo ' |
|
| 289 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 290 | + echo ' |
|
| 286 | 291 | <dt> |
| 287 | 292 | ', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ': |
| 288 | 293 | </dt> |
| 289 | 294 | <dd> |
| 290 | 295 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');"> |
| 291 | 296 | </dd>'; |
| 297 | + } |
|
| 292 | 298 | echo ' |
| 293 | 299 | </dl> |
| 294 | 300 | </div><!-- .windowbg2 --> |
@@ -358,27 +364,30 @@ discard block |
||
| 358 | 364 | |
| 359 | 365 | foreach ($location['rows'] as $row) |
| 360 | 366 | { |
| 361 | - if (!empty($context['move_smiley'])) |
|
| 362 | - echo ' |
|
| 367 | + if (!empty($context['move_smiley'])) { |
|
| 368 | + echo ' |
|
| 363 | 369 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 370 | + } |
|
| 364 | 371 | |
| 365 | 372 | foreach ($row as $smiley) |
| 366 | 373 | { |
| 367 | - if (empty($context['move_smiley'])) |
|
| 368 | - echo ' |
|
| 374 | + if (empty($context['move_smiley'])) { |
|
| 375 | + echo ' |
|
| 369 | 376 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>'; |
| 370 | - else |
|
| 371 | - echo ' |
|
| 377 | + } else { |
|
| 378 | + echo ' |
|
| 372 | 379 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"> |
| 373 | 380 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 381 | + } |
|
| 374 | 382 | } |
| 375 | 383 | |
| 376 | 384 | echo ' |
| 377 | 385 | <br>'; |
| 378 | 386 | } |
| 379 | - if (!empty($context['move_smiley'])) |
|
| 380 | - echo ' |
|
| 387 | + if (!empty($context['move_smiley'])) { |
|
| 388 | + echo ' |
|
| 381 | 389 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 390 | + } |
|
| 382 | 391 | echo ' |
| 383 | 392 | </div><!-- .windowbg2 --> |
| 384 | 393 | <input type="hidden" name="reorder" value="1"> |
@@ -415,14 +424,15 @@ discard block |
||
| 415 | 424 | <div class="windowbg2"> |
| 416 | 425 | <dl class="settings">'; |
| 417 | 426 | |
| 418 | - if (!$context['new_icon']) |
|
| 419 | - echo ' |
|
| 427 | + if (!$context['new_icon']) { |
|
| 428 | + echo ' |
|
| 420 | 429 | <dt> |
| 421 | 430 | <strong>', $txt['smiley_preview'], ': </strong> |
| 422 | 431 | </dt> |
| 423 | 432 | <dd> |
| 424 | 433 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
| 425 | 434 | </dd>'; |
| 435 | + } |
|
| 426 | 436 | |
| 427 | 437 | echo ' |
| 428 | 438 | <dt> |
@@ -449,9 +459,10 @@ discard block |
||
| 449 | 459 | echo ' |
| 450 | 460 | <optgroup label="', $category['name'], '">'; |
| 451 | 461 | |
| 452 | - foreach ($category['boards'] as $board) |
|
| 453 | - echo ' |
|
| 462 | + foreach ($category['boards'] as $board) { |
|
| 463 | + echo ' |
|
| 454 | 464 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 465 | + } |
|
| 455 | 466 | echo ' |
| 456 | 467 | </optgroup>'; |
| 457 | 468 | } |
@@ -466,19 +477,21 @@ discard block |
||
| 466 | 477 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
| 467 | 478 | |
| 468 | 479 | // Print the list of all the icons it can be put after... |
| 469 | - foreach ($context['icons'] as $id => $data) |
|
| 470 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
| 480 | + foreach ($context['icons'] as $id => $data) { |
|
| 481 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
| 471 | 482 | echo ' |
| 472 | 483 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
| 484 | + } |
|
| 473 | 485 | |
| 474 | 486 | echo ' |
| 475 | 487 | </select> |
| 476 | 488 | </dd> |
| 477 | 489 | </dl>'; |
| 478 | 490 | |
| 479 | - if (!$context['new_icon']) |
|
| 480 | - echo ' |
|
| 491 | + if (!$context['new_icon']) { |
|
| 492 | + echo ' |
|
| 481 | 493 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
| 494 | + } |
|
| 482 | 495 | |
| 483 | 496 | echo ' |
| 484 | 497 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button"> |
@@ -67,8 +67,9 @@ discard block |
||
| 67 | 67 | foreach ($context['categories'] as $category) |
| 68 | 68 | { |
| 69 | 69 | // If theres no parent boards we can see, avoid showing an empty category (unless its collapsed) |
| 70 | - if (empty($category['boards']) && !$category['is_collapsed']) |
|
| 71 | - continue; |
|
| 70 | + if (empty($category['boards']) && !$category['is_collapsed']) { |
|
| 71 | + continue; |
|
| 72 | + } |
|
| 72 | 73 | |
| 73 | 74 | echo ' |
| 74 | 75 | <div class="main_container"> |
@@ -76,9 +77,10 @@ discard block |
||
| 76 | 77 | <h3 class="catbg">'; |
| 77 | 78 | |
| 78 | 79 | // If this category even can collapse, show a link to collapse it. |
| 79 | - if ($category['can_collapse']) |
|
| 80 | - echo ' |
|
| 80 | + if ($category['can_collapse']) { |
|
| 81 | + echo ' |
|
| 81 | 82 | <span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' floatright" data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'], '" style="display: none;"></span>'; |
| 83 | + } |
|
| 82 | 84 | |
| 83 | 85 | echo ' |
| 84 | 86 | ', $category['link'], ' |
@@ -108,10 +110,11 @@ discard block |
||
| 108 | 110 | </div>'; |
| 109 | 111 | |
| 110 | 112 | // Won't somebody think of the children! |
| 111 | - if (function_exists('template_bi_' . $board['type'] . '_children')) |
|
| 112 | - call_user_func('template_bi_' . $board['type'] . '_children', $board); |
|
| 113 | - else |
|
| 114 | - template_bi_board_children($board); |
|
| 113 | + if (function_exists('template_bi_' . $board['type'] . '_children')) { |
|
| 114 | + call_user_func('template_bi_' . $board['type'] . '_children', $board); |
|
| 115 | + } else { |
|
| 116 | + template_bi_board_children($board); |
|
| 117 | + } |
|
| 115 | 118 | |
| 116 | 119 | echo ' |
| 117 | 120 | </div><!-- #board_[id] -->'; |
@@ -126,12 +129,13 @@ discard block |
||
| 126 | 129 | </div><!-- #boardindex_table -->'; |
| 127 | 130 | |
| 128 | 131 | // Show the mark all as read button? |
| 129 | - if ($context['user']['is_logged'] && !empty($context['categories'])) |
|
| 130 | - echo ' |
|
| 132 | + if ($context['user']['is_logged'] && !empty($context['categories'])) { |
|
| 133 | + echo ' |
|
| 131 | 134 | <div class="mark_read"> |
| 132 | 135 | ', template_button_strip($context['mark_read_button'], 'right'), ' |
| 133 | 136 | </div>'; |
| 134 | -} |
|
| 137 | + } |
|
| 138 | + } |
|
| 135 | 139 | |
| 136 | 140 | /** |
| 137 | 141 | * Outputs the board icon for a standard board. |
@@ -175,18 +179,20 @@ discard block |
||
| 175 | 179 | </a>'; |
| 176 | 180 | |
| 177 | 181 | // Has it outstanding posts for approval? |
| 178 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
| 179 | - echo ' |
|
| 182 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
| 183 | + echo ' |
|
| 180 | 184 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>'; |
| 185 | + } |
|
| 181 | 186 | |
| 182 | 187 | echo ' |
| 183 | 188 | <p class="board_description">', $board['description'], '</p>'; |
| 184 | 189 | |
| 185 | 190 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
| 186 | - if (!empty($board['link_moderators'])) |
|
| 187 | - echo ' |
|
| 191 | + if (!empty($board['link_moderators'])) { |
|
| 192 | + echo ' |
|
| 188 | 193 | <p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
| 189 | -} |
|
| 194 | + } |
|
| 195 | + } |
|
| 190 | 196 | |
| 191 | 197 | /** |
| 192 | 198 | * Outputs the board stats for a standard board. |
@@ -227,10 +233,11 @@ discard block |
||
| 227 | 233 | */ |
| 228 | 234 | function template_bi_board_lastpost($board) |
| 229 | 235 | { |
| 230 | - if (!empty($board['last_post']['id'])) |
|
| 231 | - echo ' |
|
| 236 | + if (!empty($board['last_post']['id'])) { |
|
| 237 | + echo ' |
|
| 232 | 238 | <p>', $board['last_post']['last_post_message'], '</p>'; |
| 233 | -} |
|
| 239 | + } |
|
| 240 | + } |
|
| 234 | 241 | |
| 235 | 242 | /** |
| 236 | 243 | * Outputs the board children for a standard board. |
@@ -251,14 +258,16 @@ discard block |
||
| 251 | 258 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
| 252 | 259 | foreach ($board['children'] as $child) |
| 253 | 260 | { |
| 254 | - if (!$child['is_redirect']) |
|
| 255 | - $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
| 256 | - else |
|
| 257 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
| 261 | + if (!$child['is_redirect']) { |
|
| 262 | + $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
| 263 | + } else { |
|
| 264 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
| 265 | + } |
|
| 258 | 266 | |
| 259 | 267 | // Has it posts awaiting approval? |
| 260 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) |
|
| 261 | - $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 268 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) { |
|
| 269 | + $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 270 | + } |
|
| 262 | 271 | |
| 263 | 272 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
| 264 | 273 | } |
@@ -285,8 +294,9 @@ discard block |
||
| 285 | 294 | { |
| 286 | 295 | global $context, $options, $txt; |
| 287 | 296 | |
| 288 | - if (empty($context['info_center'])) |
|
| 289 | - return; |
|
| 297 | + if (empty($context['info_center'])) { |
|
| 298 | + return; |
|
| 299 | + } |
|
| 290 | 300 | |
| 291 | 301 | // Here's where the "Info Center" starts... |
| 292 | 302 | echo ' |
@@ -386,14 +396,15 @@ discard block |
||
| 386 | 396 | /* Each post in latest_posts has: |
| 387 | 397 | board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.), |
| 388 | 398 | subject, short_subject (shortened with...), time, link, and href. */ |
| 389 | - foreach ($context['latest_posts'] as $post) |
|
| 390 | - echo ' |
|
| 399 | + foreach ($context['latest_posts'] as $post) { |
|
| 400 | + echo ' |
|
| 391 | 401 | <tr class="windowbg"> |
| 392 | 402 | <td class="recentpost"><strong>', $post['link'], '</strong></td> |
| 393 | 403 | <td class="recentposter">', $post['poster']['link'], '</td> |
| 394 | 404 | <td class="recentboard">', $post['board']['link'], '</td> |
| 395 | 405 | <td class="recenttime">', $post['time'], '</td> |
| 396 | 406 | </tr>'; |
| 407 | + } |
|
| 397 | 408 | echo ' |
| 398 | 409 | </table>'; |
| 399 | 410 | } |
@@ -417,11 +428,12 @@ discard block |
||
| 417 | 428 | </div>'; |
| 418 | 429 | |
| 419 | 430 | // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P |
| 420 | - if (!empty($context['calendar_holidays'])) |
|
| 421 | - echo ' |
|
| 431 | + if (!empty($context['calendar_holidays'])) { |
|
| 432 | + echo ' |
|
| 422 | 433 | <p class="inline holiday"> |
| 423 | 434 | <span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), ' |
| 424 | 435 | </p>'; |
| 436 | + } |
|
| 425 | 437 | |
| 426 | 438 | // People's birthdays. Like mine. And yours, I guess. Kidding. |
| 427 | 439 | if (!empty($context['calendar_birthdays'])) |
@@ -431,9 +443,10 @@ discard block |
||
| 431 | 443 | <span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>'; |
| 432 | 444 | |
| 433 | 445 | // Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) |
| 434 | - foreach ($context['calendar_birthdays'] as $member) |
|
| 435 | - echo ' |
|
| 446 | + foreach ($context['calendar_birthdays'] as $member) { |
|
| 447 | + echo ' |
|
| 436 | 448 | <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', '; |
| 449 | + } |
|
| 437 | 450 | |
| 438 | 451 | echo ' |
| 439 | 452 | </p>'; |
@@ -448,9 +461,10 @@ discard block |
||
| 448 | 461 | |
| 449 | 462 | // Each event in calendar_events should have: |
| 450 | 463 | // title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. |
| 451 | - foreach ($context['calendar_events'] as $event) |
|
| 452 | - echo ' |
|
| 464 | + foreach ($context['calendar_events'] as $event) { |
|
| 465 | + echo ' |
|
| 453 | 466 | ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><span class="generic_icons calendar_modify"></span></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br>' : ', '; |
| 467 | + } |
|
| 454 | 468 | echo ' |
| 455 | 469 | </p>'; |
| 456 | 470 | } |
@@ -496,15 +510,19 @@ discard block |
||
| 496 | 510 | // Handle hidden users and buddies. |
| 497 | 511 | $bracketList = array(); |
| 498 | 512 | |
| 499 | - if ($context['show_buddies']) |
|
| 500 | - $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
| 501 | - if (!empty($context['num_spiders'])) |
|
| 502 | - $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
| 503 | - if (!empty($context['num_users_hidden'])) |
|
| 504 | - $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
| 513 | + if ($context['show_buddies']) { |
|
| 514 | + $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
| 515 | + } |
|
| 516 | + if (!empty($context['num_spiders'])) { |
|
| 517 | + $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
| 518 | + } |
|
| 519 | + if (!empty($context['num_users_hidden'])) { |
|
| 520 | + $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
| 521 | + } |
|
| 505 | 522 | |
| 506 | - if (!empty($bracketList)) |
|
| 507 | - echo ' (' . implode(', ', $bracketList) . ')'; |
|
| 523 | + if (!empty($bracketList)) { |
|
| 524 | + echo ' (' . implode(', ', $bracketList) . ')'; |
|
| 525 | + } |
|
| 508 | 526 | |
| 509 | 527 | echo $context['show_who'] ? '</a>' : '', ' |
| 510 | 528 | |
@@ -518,9 +536,10 @@ discard block |
||
| 518 | 536 | ', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']); |
| 519 | 537 | |
| 520 | 538 | // Showing membergroups? |
| 521 | - if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) |
|
| 522 | - echo ' |
|
| 539 | + if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) { |
|
| 540 | + echo ' |
|
| 523 | 541 | <span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>'; |
| 542 | + } |
|
| 524 | 543 | } |
| 525 | 544 | |
| 526 | 545 | echo ' |
@@ -64,9 +64,10 @@ discard block |
||
| 64 | 64 | <strong>', $txt['administrators'], ':</strong> |
| 65 | 65 | ', implode(', ', $context['administrators']); |
| 66 | 66 | // If we have lots of admins... don't show them all. |
| 67 | - if (!empty($context['more_admins_link'])) |
|
| 68 | - echo ' |
|
| 67 | + if (!empty($context['more_admins_link'])) { |
|
| 68 | + echo ' |
|
| 69 | 69 | (', $context['more_admins_link'], ')'; |
| 70 | + } |
|
| 70 | 71 | |
| 71 | 72 | echo ' |
| 72 | 73 | </div><!-- #version_details --> |
@@ -83,17 +84,19 @@ discard block |
||
| 83 | 84 | foreach ($area['areas'] as $item_id => $item) |
| 84 | 85 | { |
| 85 | 86 | // No point showing the 'home' page here, we're already on it! |
| 86 | - if ($area_id == 'forum' && $item_id == 'index') |
|
| 87 | - continue; |
|
| 87 | + if ($area_id == 'forum' && $item_id == 'index') { |
|
| 88 | + continue; |
|
| 89 | + } |
|
| 88 | 90 | |
| 89 | 91 | $url = isset($item['url']) ? $item['url'] : $scripturl . '?action=admin;area=' . $item_id . (!empty($context[$context['admin_menu_name']]['extra_parameters']) ? $context[$context['admin_menu_name']]['extra_parameters'] : ''); |
| 90 | 92 | |
| 91 | - if (!empty($item['icon_file'])) |
|
| 92 | - echo ' |
|
| 93 | + if (!empty($item['icon_file'])) { |
|
| 94 | + echo ' |
|
| 93 | 95 | <a href="', $url, '" class="admin_group', !empty($item['inactive']) ? ' inactive' : '', '"><img class="large_admin_menu_icon_file" src="', $item['icon_file'], '" alt="">', $item['label'], '</a>'; |
| 94 | - else |
|
| 95 | - echo ' |
|
| 96 | + } else { |
|
| 97 | + echo ' |
|
| 96 | 98 | <a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>'; |
| 99 | + } |
|
| 97 | 100 | } |
| 98 | 101 | |
| 99 | 102 | echo ' |
@@ -104,10 +107,11 @@ discard block |
||
| 104 | 107 | </div><!-- #admincenter -->'; |
| 105 | 108 | |
| 106 | 109 | // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization. |
| 107 | - if (empty($modSettings['disable_smf_js'])) |
|
| 108 | - echo ' |
|
| 110 | + if (empty($modSettings['disable_smf_js'])) { |
|
| 111 | + echo ' |
|
| 109 | 112 | <script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script> |
| 110 | 113 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
| 114 | + } |
|
| 111 | 115 | |
| 112 | 116 | // This sets the announcements and current versions themselves ;). |
| 113 | 117 | echo ' |
@@ -186,9 +190,10 @@ discard block |
||
| 186 | 190 | <em>', $version['version'], '</em>'; |
| 187 | 191 | |
| 188 | 192 | // more details for this item, show them a link |
| 189 | - if ($context['can_admin'] && isset($version['more'])) |
|
| 190 | - echo |
|
| 193 | + if ($context['can_admin'] && isset($version['more'])) { |
|
| 194 | + echo |
|
| 191 | 195 | ' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>'; |
| 196 | + } |
|
| 192 | 197 | echo ' |
| 193 | 198 | <br>'; |
| 194 | 199 | } |
@@ -219,21 +224,23 @@ discard block |
||
| 219 | 224 | |
| 220 | 225 | foreach ($context['credits'] as $section) |
| 221 | 226 | { |
| 222 | - if (isset($section['pretext'])) |
|
| 223 | - echo ' |
|
| 227 | + if (isset($section['pretext'])) { |
|
| 228 | + echo ' |
|
| 224 | 229 | <p>', $section['pretext'], '</p> |
| 225 | 230 | <hr>'; |
| 231 | + } |
|
| 226 | 232 | |
| 227 | 233 | echo ' |
| 228 | 234 | <dl>'; |
| 229 | 235 | |
| 230 | 236 | foreach ($section['groups'] as $group) |
| 231 | 237 | { |
| 232 | - if (isset($group['title'])) |
|
| 233 | - echo ' |
|
| 238 | + if (isset($group['title'])) { |
|
| 239 | + echo ' |
|
| 234 | 240 | <dt> |
| 235 | 241 | <strong>', $group['title'], ':</strong> |
| 236 | 242 | </dt>'; |
| 243 | + } |
|
| 237 | 244 | |
| 238 | 245 | echo ' |
| 239 | 246 | <dd>', implode(', ', $group['members']), '</dd>'; |
@@ -242,10 +249,11 @@ discard block |
||
| 242 | 249 | echo ' |
| 243 | 250 | </dl>'; |
| 244 | 251 | |
| 245 | - if (isset($section['posttext'])) |
|
| 246 | - echo ' |
|
| 252 | + if (isset($section['posttext'])) { |
|
| 253 | + echo ' |
|
| 247 | 254 | <hr> |
| 248 | 255 | <p>', $section['posttext'], '</p>'; |
| 256 | + } |
|
| 249 | 257 | } |
| 250 | 258 | |
| 251 | 259 | echo ' |
@@ -261,9 +269,10 @@ discard block |
||
| 261 | 269 | smfSupportVersions.forum = "', $context['forum_version'], '";'; |
| 262 | 270 | |
| 263 | 271 | // Don't worry, none of this is logged, it's just used to give information that might be of use. |
| 264 | - foreach ($context['current_versions'] as $variable => $version) |
|
| 265 | - echo ' |
|
| 272 | + foreach ($context['current_versions'] as $variable => $version) { |
|
| 273 | + echo ' |
|
| 266 | 274 | smfSupportVersions.', $variable, ' = "', $version['version'], '";'; |
| 275 | + } |
|
| 267 | 276 | |
| 268 | 277 | // Now we just have to include the script and wait ;). |
| 269 | 278 | echo ' |
@@ -360,8 +369,8 @@ discard block |
||
| 360 | 369 | <tbody>'; |
| 361 | 370 | |
| 362 | 371 | // Loop through every source file displaying its version - using javascript. |
| 363 | - foreach ($context['file_versions'] as $filename => $version) |
|
| 364 | - echo ' |
|
| 372 | + foreach ($context['file_versions'] as $filename => $version) { |
|
| 373 | + echo ' |
|
| 365 | 374 | <tr class="windowbg"> |
| 366 | 375 | <td class="half_table"> |
| 367 | 376 | ', $filename, ' |
@@ -373,6 +382,7 @@ discard block |
||
| 373 | 382 | <em id="currentSources', $filename, '">??</em> |
| 374 | 383 | </td> |
| 375 | 384 | </tr>'; |
| 385 | + } |
|
| 376 | 386 | |
| 377 | 387 | // Default template files. |
| 378 | 388 | echo ' |
@@ -398,8 +408,8 @@ discard block |
||
| 398 | 408 | <table id="Default" class="table_grid"> |
| 399 | 409 | <tbody>'; |
| 400 | 410 | |
| 401 | - foreach ($context['default_template_versions'] as $filename => $version) |
|
| 402 | - echo ' |
|
| 411 | + foreach ($context['default_template_versions'] as $filename => $version) { |
|
| 412 | + echo ' |
|
| 403 | 413 | <tr class="windowbg"> |
| 404 | 414 | <td class="half_table"> |
| 405 | 415 | ', $filename, ' |
@@ -411,6 +421,7 @@ discard block |
||
| 411 | 421 | <em id="currentDefault', $filename, '">??</em> |
| 412 | 422 | </td> |
| 413 | 423 | </tr>'; |
| 424 | + } |
|
| 414 | 425 | |
| 415 | 426 | // Now the language files... |
| 416 | 427 | echo ' |
@@ -438,8 +449,8 @@ discard block |
||
| 438 | 449 | |
| 439 | 450 | foreach ($context['default_language_versions'] as $language => $files) |
| 440 | 451 | { |
| 441 | - foreach ($files as $filename => $version) |
|
| 442 | - echo ' |
|
| 452 | + foreach ($files as $filename => $version) { |
|
| 453 | + echo ' |
|
| 443 | 454 | <tr class="windowbg"> |
| 444 | 455 | <td class="half_table"> |
| 445 | 456 | ', $filename, '.<em>', $language, '</em>.php |
@@ -451,6 +462,7 @@ discard block |
||
| 451 | 462 | <em id="current', $filename, '.', $language, '">??</em> |
| 452 | 463 | </td> |
| 453 | 464 | </tr>'; |
| 465 | + } |
|
| 454 | 466 | } |
| 455 | 467 | |
| 456 | 468 | echo ' |
@@ -480,8 +492,8 @@ discard block |
||
| 480 | 492 | <table id="Templates" class="table_grid"> |
| 481 | 493 | <tbody>'; |
| 482 | 494 | |
| 483 | - foreach ($context['template_versions'] as $filename => $version) |
|
| 484 | - echo ' |
|
| 495 | + foreach ($context['template_versions'] as $filename => $version) { |
|
| 496 | + echo ' |
|
| 485 | 497 | <tr class="windowbg"> |
| 486 | 498 | <td class="half_table"> |
| 487 | 499 | ', $filename, ' |
@@ -493,6 +505,7 @@ discard block |
||
| 493 | 505 | <em id="currentTemplates', $filename, '">??</em> |
| 494 | 506 | </td> |
| 495 | 507 | </tr>'; |
| 508 | + } |
|
| 496 | 509 | |
| 497 | 510 | echo ' |
| 498 | 511 | </tbody> |
@@ -522,8 +535,8 @@ discard block |
||
| 522 | 535 | <table id="Tasks" class="table_grid"> |
| 523 | 536 | <tbody>'; |
| 524 | 537 | |
| 525 | - foreach ($context['tasks_versions'] as $filename => $version) |
|
| 526 | - echo ' |
|
| 538 | + foreach ($context['tasks_versions'] as $filename => $version) { |
|
| 539 | + echo ' |
|
| 527 | 540 | <tr class="windowbg"> |
| 528 | 541 | <td class="half_table"> |
| 529 | 542 | ', $filename, ' |
@@ -535,6 +548,7 @@ discard block |
||
| 535 | 548 | <em id="currentTasks', $filename, '">??</em> |
| 536 | 549 | </td> |
| 537 | 550 | </tr>'; |
| 551 | + } |
|
| 538 | 552 | |
| 539 | 553 | echo ' |
| 540 | 554 | </tbody> |
@@ -576,9 +590,10 @@ discard block |
||
| 576 | 590 | { |
| 577 | 591 | global $context, $scripturl, $txt, $modSettings; |
| 578 | 592 | |
| 579 | - if (!empty($context['saved_successful'])) |
|
| 580 | - echo ' |
|
| 593 | + if (!empty($context['saved_successful'])) { |
|
| 594 | + echo ' |
|
| 581 | 595 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 596 | + } |
|
| 582 | 597 | |
| 583 | 598 | // First section is for adding/removing words from the censored list. |
| 584 | 599 | echo ' |
@@ -593,11 +608,12 @@ discard block |
||
| 593 | 608 | <p>', $txt['admin_censored_where'], '</p>'; |
| 594 | 609 | |
| 595 | 610 | // Show text boxes for censoring [bad ] => [good ]. |
| 596 | - foreach ($context['censored_words'] as $vulgar => $proper) |
|
| 597 | - echo ' |
|
| 611 | + foreach ($context['censored_words'] as $vulgar => $proper) { |
|
| 612 | + echo ' |
|
| 598 | 613 | <div class="block"> |
| 599 | 614 | <input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> => <input type="text" name="censor_proper[]" value="', $proper, '" size="30"> |
| 600 | 615 | </div>'; |
| 616 | + } |
|
| 601 | 617 | |
| 602 | 618 | // Now provide a way to censor more words. |
| 603 | 619 | echo ' |
@@ -672,19 +688,21 @@ discard block |
||
| 672 | 688 | <div class="windowbg2 noup"> |
| 673 | 689 | ', $txt['not_done_reason']; |
| 674 | 690 | |
| 675 | - if (!empty($context['continue_percent'])) |
|
| 676 | - echo ' |
|
| 691 | + if (!empty($context['continue_percent'])) { |
|
| 692 | + echo ' |
|
| 677 | 693 | <div class="progress_bar"> |
| 678 | 694 | <div class="full_bar">', $context['continue_percent'], '%</div> |
| 679 | 695 | <div class="green_percent" style="width: ', $context['continue_percent'], '%;"> </div> |
| 680 | 696 | </div>'; |
| 697 | + } |
|
| 681 | 698 | |
| 682 | - if (!empty($context['substep_enabled'])) |
|
| 683 | - echo ' |
|
| 699 | + if (!empty($context['substep_enabled'])) { |
|
| 700 | + echo ' |
|
| 684 | 701 | <div class="progress_bar"> |
| 685 | 702 | <div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div> |
| 686 | 703 | <div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;"> </div> |
| 687 | 704 | </div>'; |
| 705 | + } |
|
| 688 | 706 | |
| 689 | 707 | echo ' |
| 690 | 708 | <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit"> |
@@ -719,35 +737,40 @@ discard block |
||
| 719 | 737 | { |
| 720 | 738 | global $context, $txt, $scripturl; |
| 721 | 739 | |
| 722 | - if (!empty($context['saved_successful'])) |
|
| 723 | - echo ' |
|
| 740 | + if (!empty($context['saved_successful'])) { |
|
| 741 | + echo ' |
|
| 724 | 742 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 725 | - elseif (!empty($context['saved_failed'])) |
|
| 726 | - echo ' |
|
| 743 | + } elseif (!empty($context['saved_failed'])) { |
|
| 744 | + echo ' |
|
| 727 | 745 | <div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>'; |
| 746 | + } |
|
| 728 | 747 | |
| 729 | - if (!empty($context['settings_pre_javascript'])) |
|
| 730 | - echo ' |
|
| 748 | + if (!empty($context['settings_pre_javascript'])) { |
|
| 749 | + echo ' |
|
| 731 | 750 | <script>', $context['settings_pre_javascript'], '</script>'; |
| 751 | + } |
|
| 732 | 752 | |
| 733 | - if (!empty($context['settings_insert_above'])) |
|
| 734 | - echo $context['settings_insert_above']; |
|
| 753 | + if (!empty($context['settings_insert_above'])) { |
|
| 754 | + echo $context['settings_insert_above']; |
|
| 755 | + } |
|
| 735 | 756 | |
| 736 | 757 | echo ' |
| 737 | 758 | <div id="admincenter"> |
| 738 | 759 | <form id="admin_form_wrapper" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>'; |
| 739 | 760 | |
| 740 | 761 | // Is there a custom title? |
| 741 | - if (isset($context['settings_title'])) |
|
| 742 | - echo ' |
|
| 762 | + if (isset($context['settings_title'])) { |
|
| 763 | + echo ' |
|
| 743 | 764 | <div class="cat_bar"> |
| 744 | 765 | <h3 class="catbg">', $context['settings_title'], '</h3> |
| 745 | 766 | </div>'; |
| 767 | + } |
|
| 746 | 768 | |
| 747 | 769 | // Have we got a message to display? |
| 748 | - if (!empty($context['settings_message'])) |
|
| 749 | - echo ' |
|
| 770 | + if (!empty($context['settings_message'])) { |
|
| 771 | + echo ' |
|
| 750 | 772 | <div class="information">', $context['settings_message'], '</div>'; |
| 773 | + } |
|
| 751 | 774 | |
| 752 | 775 | // Now actually loop through all the variables. |
| 753 | 776 | $is_open = false; |
@@ -800,8 +823,9 @@ discard block |
||
| 800 | 823 | // Hang about? Are you pulling my leg - a callback?! |
| 801 | 824 | if (is_array($config_var) && $config_var['type'] == 'callback') |
| 802 | 825 | { |
| 803 | - if (function_exists('template_callback_' . $config_var['name'])) |
|
| 804 | - call_user_func('template_callback_' . $config_var['name']); |
|
| 826 | + if (function_exists('template_callback_' . $config_var['name'])) { |
|
| 827 | + call_user_func('template_callback_' . $config_var['name']); |
|
| 828 | + } |
|
| 805 | 829 | |
| 806 | 830 | continue; |
| 807 | 831 | } |
@@ -831,9 +855,10 @@ discard block |
||
| 831 | 855 | $text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time'); |
| 832 | 856 | |
| 833 | 857 | // Show the [?] button. |
| 834 | - if ($config_var['help']) |
|
| 835 | - echo ' |
|
| 858 | + if ($config_var['help']) { |
|
| 859 | + echo ' |
|
| 836 | 860 | <a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a> '; |
| 861 | + } |
|
| 837 | 862 | |
| 838 | 863 | echo ' |
| 839 | 864 | <a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span> |
@@ -842,22 +867,25 @@ discard block |
||
| 842 | 867 | $config_var['preinput']; |
| 843 | 868 | |
| 844 | 869 | // Show a check box. |
| 845 | - if ($config_var['type'] == 'check') |
|
| 846 | - echo ' |
|
| 870 | + if ($config_var['type'] == 'check') { |
|
| 871 | + echo ' |
|
| 847 | 872 | <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">'; |
| 873 | + } |
|
| 848 | 874 | // Escape (via htmlspecialchars.) the text box. |
| 849 | - elseif ($config_var['type'] == 'password') |
|
| 850 | - echo ' |
|
| 875 | + elseif ($config_var['type'] == 'password') { |
|
| 876 | + echo ' |
|
| 851 | 877 | <input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;"><br> |
| 852 | 878 | <input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
| 879 | + } |
|
| 853 | 880 | // Show a selection box. |
| 854 | 881 | elseif ($config_var['type'] == 'select') |
| 855 | 882 | { |
| 856 | 883 | echo ' |
| 857 | 884 | <select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), (!empty($config_var['multiple']) && !empty($config_var['size']) ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
| 858 | - foreach ($config_var['data'] as $option) |
|
| 859 | - echo ' |
|
| 885 | + foreach ($config_var['data'] as $option) { |
|
| 886 | + echo ' |
|
| 860 | 887 | <option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected' : ''), '>', $option[1], '</option>'; |
| 888 | + } |
|
| 861 | 889 | echo ' |
| 862 | 890 | </select>'; |
| 863 | 891 | } |
@@ -874,16 +902,18 @@ discard block |
||
| 874 | 902 | |
| 875 | 903 | foreach ($context['board_list'] as $id_cat => $cat) |
| 876 | 904 | { |
| 877 | - if (!$first) |
|
| 878 | - echo ' |
|
| 905 | + if (!$first) { |
|
| 906 | + echo ' |
|
| 879 | 907 | <hr>'; |
| 908 | + } |
|
| 880 | 909 | echo ' |
| 881 | 910 | <strong>', $cat['name'], '</strong> |
| 882 | 911 | <ul>'; |
| 883 | 912 | |
| 884 | - foreach ($cat['boards'] as $id_board => $brd) |
|
| 885 | - echo ' |
|
| 913 | + foreach ($cat['boards'] as $id_board => $brd) { |
|
| 914 | + echo ' |
|
| 886 | 915 | <li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat(' ', $brd['child_level']) : '', $brd['name'], '</label></li>'; |
| 916 | + } |
|
| 887 | 917 | |
| 888 | 918 | echo ' |
| 889 | 919 | </ul>'; |
@@ -893,12 +923,14 @@ discard block |
||
| 893 | 923 | </fieldset>'; |
| 894 | 924 | } |
| 895 | 925 | // Text area? |
| 896 | - elseif ($config_var['type'] == 'large_text') |
|
| 897 | - echo ' |
|
| 926 | + elseif ($config_var['type'] == 'large_text') { |
|
| 927 | + echo ' |
|
| 898 | 928 | <textarea rows="', (!empty($config_var['size']) ? $config_var['size'] : (!empty($config_var['rows']) ? $config_var['rows'] : 4)), '" cols="', (!empty($config_var['cols']) ? $config_var['cols'] : 30), '" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>'; |
| 929 | + } |
|
| 899 | 930 | // Permission group? |
| 900 | - elseif ($config_var['type'] == 'permissions') |
|
| 901 | - theme_inline_permissions($config_var['name']); |
|
| 931 | + elseif ($config_var['type'] == 'permissions') { |
|
| 932 | + theme_inline_permissions($config_var['name']); |
|
| 933 | + } |
|
| 902 | 934 | |
| 903 | 935 | // BBC selection? |
| 904 | 936 | elseif ($config_var['type'] == 'bbc') |
@@ -910,20 +942,22 @@ discard block |
||
| 910 | 942 | |
| 911 | 943 | foreach ($context['bbc_columns'] as $bbcColumn) |
| 912 | 944 | { |
| 913 | - foreach ($bbcColumn as $bbcTag) |
|
| 914 | - echo ' |
|
| 945 | + foreach ($bbcColumn as $bbcTag) { |
|
| 946 | + echo ' |
|
| 915 | 947 | <li class="list_bbc floatleft"> |
| 916 | 948 | <input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked' : '', '> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', ' |
| 917 | 949 | </li>'; |
| 950 | + } |
|
| 918 | 951 | } |
| 919 | 952 | echo ' </ul> |
| 920 | 953 | <input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked' : '', '> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label> |
| 921 | 954 | </fieldset>'; |
| 922 | 955 | } |
| 923 | 956 | // A simple message? |
| 924 | - elseif ($config_var['type'] == 'var_message') |
|
| 925 | - echo ' |
|
| 957 | + elseif ($config_var['type'] == 'var_message') { |
|
| 958 | + echo ' |
|
| 926 | 959 | <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>'; |
| 960 | + } |
|
| 927 | 961 | // Assume it must be a text box |
| 928 | 962 | else |
| 929 | 963 | { |
@@ -948,63 +982,70 @@ discard block |
||
| 948 | 982 | ' . $config_var['postinput'] : '',' |
| 949 | 983 | </dd>'; |
| 950 | 984 | } |
| 951 | - } |
|
| 952 | - |
|
| 953 | - else |
|
| 985 | + } else |
|
| 954 | 986 | { |
| 955 | 987 | // Just show a separator. |
| 956 | - if ($config_var == '') |
|
| 957 | - echo ' |
|
| 988 | + if ($config_var == '') { |
|
| 989 | + echo ' |
|
| 958 | 990 | </dl> |
| 959 | 991 | <hr> |
| 960 | 992 | <dl class="settings">'; |
| 961 | - else |
|
| 962 | - echo ' |
|
| 993 | + } else { |
|
| 994 | + echo ' |
|
| 963 | 995 | <dd> |
| 964 | 996 | <strong>' . $config_var . '</strong> |
| 965 | 997 | </dd>'; |
| 998 | + } |
|
| 966 | 999 | } |
| 967 | 1000 | } |
| 968 | 1001 | |
| 969 | - if ($is_open) |
|
| 970 | - echo ' |
|
| 1002 | + if ($is_open) { |
|
| 1003 | + echo ' |
|
| 971 | 1004 | </dl>'; |
| 1005 | + } |
|
| 972 | 1006 | |
| 973 | - if (empty($context['settings_save_dont_show'])) |
|
| 974 | - echo ' |
|
| 1007 | + if (empty($context['settings_save_dont_show'])) { |
|
| 1008 | + echo ' |
|
| 975 | 1009 | <input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">'; |
| 1010 | + } |
|
| 976 | 1011 | |
| 977 | - if ($is_open) |
|
| 978 | - echo ' |
|
| 1012 | + if ($is_open) { |
|
| 1013 | + echo ' |
|
| 979 | 1014 | </div><!-- .windowbg2 -->'; |
| 1015 | + } |
|
| 980 | 1016 | |
| 981 | 1017 | |
| 982 | 1018 | // At least one token has to be used! |
| 983 | - if (isset($context['admin-ssc_token'])) |
|
| 984 | - echo ' |
|
| 1019 | + if (isset($context['admin-ssc_token'])) { |
|
| 1020 | + echo ' |
|
| 985 | 1021 | <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">'; |
| 1022 | + } |
|
| 986 | 1023 | |
| 987 | - if (isset($context['admin-dbsc_token'])) |
|
| 988 | - echo ' |
|
| 1024 | + if (isset($context['admin-dbsc_token'])) { |
|
| 1025 | + echo ' |
|
| 989 | 1026 | <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">'; |
| 1027 | + } |
|
| 990 | 1028 | |
| 991 | - if (isset($context['admin-mp_token'])) |
|
| 992 | - echo ' |
|
| 1029 | + if (isset($context['admin-mp_token'])) { |
|
| 1030 | + echo ' |
|
| 993 | 1031 | <input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">'; |
| 1032 | + } |
|
| 994 | 1033 | |
| 995 | 1034 | echo ' |
| 996 | 1035 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 997 | 1036 | </form> |
| 998 | 1037 | </div><!-- #admincenter -->'; |
| 999 | 1038 | |
| 1000 | - if (!empty($context['settings_post_javascript'])) |
|
| 1001 | - echo ' |
|
| 1039 | + if (!empty($context['settings_post_javascript'])) { |
|
| 1040 | + echo ' |
|
| 1002 | 1041 | <script> |
| 1003 | 1042 | ', $context['settings_post_javascript'], ' |
| 1004 | 1043 | </script>'; |
| 1044 | + } |
|
| 1005 | 1045 | |
| 1006 | - if (!empty($context['settings_insert_below'])) |
|
| 1007 | - echo $context['settings_insert_below']; |
|
| 1046 | + if (!empty($context['settings_insert_below'])) { |
|
| 1047 | + echo $context['settings_insert_below']; |
|
| 1048 | + } |
|
| 1008 | 1049 | |
| 1009 | 1050 | // We may have added a board listing. If we did, we need to make it work. |
| 1010 | 1051 | addInlineJavascript(' |
@@ -1027,9 +1068,10 @@ discard block |
||
| 1027 | 1068 | { |
| 1028 | 1069 | global $context, $txt; |
| 1029 | 1070 | |
| 1030 | - if (!empty($context['saved_successful'])) |
|
| 1031 | - echo ' |
|
| 1071 | + if (!empty($context['saved_successful'])) { |
|
| 1072 | + echo ' |
|
| 1032 | 1073 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 1074 | + } |
|
| 1033 | 1075 | |
| 1034 | 1076 | // Standard fields. |
| 1035 | 1077 | template_show_list('standard_profile_fields'); |
@@ -1062,11 +1104,12 @@ discard block |
||
| 1062 | 1104 | if (isset($_GET['msg'])) |
| 1063 | 1105 | { |
| 1064 | 1106 | loadLanguage('Errors'); |
| 1065 | - if (isset($txt['custom_option_' . $_GET['msg']])) |
|
| 1066 | - echo ' |
|
| 1107 | + if (isset($txt['custom_option_' . $_GET['msg']])) { |
|
| 1108 | + echo ' |
|
| 1067 | 1109 | <div class="errorbox">', |
| 1068 | 1110 | $txt['custom_option_' . $_GET['msg']], ' |
| 1069 | 1111 | </div>'; |
| 1112 | + } |
|
| 1070 | 1113 | } |
| 1071 | 1114 | |
| 1072 | 1115 | echo ' |
@@ -1133,9 +1176,10 @@ discard block |
||
| 1133 | 1176 | <dd> |
| 1134 | 1177 | <select name="placement" id="placement">'; |
| 1135 | 1178 | |
| 1136 | - foreach ($context['cust_profile_fields_placement'] as $order => $name) |
|
| 1137 | - echo ' |
|
| 1179 | + foreach ($context['cust_profile_fields_placement'] as $order => $name) { |
|
| 1180 | + echo ' |
|
| 1138 | 1181 | <option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>'; |
| 1182 | + } |
|
| 1139 | 1183 | |
| 1140 | 1184 | echo ' |
| 1141 | 1185 | </select> |
@@ -1159,9 +1203,10 @@ discard block |
||
| 1159 | 1203 | <dd> |
| 1160 | 1204 | <select name="field_type" id="field_type" onchange="updateInputBoxes();">'; |
| 1161 | 1205 | |
| 1162 | - foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) |
|
| 1163 | - echo ' |
|
| 1206 | + foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) { |
|
| 1207 | + echo ' |
|
| 1164 | 1208 | <option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>'; |
| 1209 | + } |
|
| 1165 | 1210 | |
| 1166 | 1211 | echo ' |
| 1167 | 1212 | </select> |
@@ -1262,9 +1307,10 @@ discard block |
||
| 1262 | 1307 | </fieldset> |
| 1263 | 1308 | <input type="submit" name="save" value="', $txt['save'], '" class="button">'; |
| 1264 | 1309 | |
| 1265 | - if ($context['fid']) |
|
| 1266 | - echo ' |
|
| 1310 | + if ($context['fid']) { |
|
| 1311 | + echo ' |
|
| 1267 | 1312 | <input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">'; |
| 1313 | + } |
|
| 1268 | 1314 | |
| 1269 | 1315 | echo ' |
| 1270 | 1316 | </div><!-- .windowbg2 --> |
@@ -1307,8 +1353,7 @@ discard block |
||
| 1307 | 1353 | { |
| 1308 | 1354 | echo ' |
| 1309 | 1355 | <p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>'; |
| 1310 | - } |
|
| 1311 | - else |
|
| 1356 | + } else |
|
| 1312 | 1357 | { |
| 1313 | 1358 | echo ' |
| 1314 | 1359 | <ol class="search_results">'; |
@@ -1335,9 +1380,10 @@ discard block |
||
| 1335 | 1380 | <li> |
| 1336 | 1381 | <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']'; |
| 1337 | 1382 | |
| 1338 | - if ($result['help']) |
|
| 1339 | - echo ' |
|
| 1383 | + if ($result['help']) { |
|
| 1384 | + echo ' |
|
| 1340 | 1385 | <p class="double_height">', $result['help'], '</p>'; |
| 1386 | + } |
|
| 1341 | 1387 | |
| 1342 | 1388 | echo ' |
| 1343 | 1389 | </li>'; |
@@ -1377,10 +1423,11 @@ discard block |
||
| 1377 | 1423 | <strong>', $txt['setup_verification_answer'], '</strong> |
| 1378 | 1424 | </dd>'; |
| 1379 | 1425 | |
| 1380 | - if (!empty($context['qa_by_lang'][$lang_id])) |
|
| 1381 | - foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1426 | + if (!empty($context['qa_by_lang'][$lang_id])) { |
|
| 1427 | + foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1382 | 1428 | { |
| 1383 | 1429 | $question = $context['question_answers'][$q_id]; |
| 1430 | + } |
|
| 1384 | 1431 | |
| 1385 | 1432 | echo ' |
| 1386 | 1433 | <dt> |
@@ -1388,9 +1435,10 @@ discard block |
||
| 1388 | 1435 | </dt> |
| 1389 | 1436 | <dd>'; |
| 1390 | 1437 | |
| 1391 | - foreach ($question['answers'] as $answer) |
|
| 1392 | - echo ' |
|
| 1438 | + foreach ($question['answers'] as $answer) { |
|
| 1439 | + echo ' |
|
| 1393 | 1440 | <input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">'; |
| 1441 | + } |
|
| 1394 | 1442 | |
| 1395 | 1443 | echo ' |
| 1396 | 1444 | <div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div> |
@@ -1429,11 +1477,12 @@ discard block |
||
| 1429 | 1477 | ', $txt['errors_found'], ': |
| 1430 | 1478 | <ul>'; |
| 1431 | 1479 | |
| 1432 | - foreach ($context['repair_errors'] as $error) |
|
| 1433 | - echo ' |
|
| 1480 | + foreach ($context['repair_errors'] as $error) { |
|
| 1481 | + echo ' |
|
| 1434 | 1482 | <li> |
| 1435 | 1483 | ', $error, ' |
| 1436 | 1484 | </li>'; |
| 1485 | + } |
|
| 1437 | 1486 | |
| 1438 | 1487 | echo ' |
| 1439 | 1488 | </ul> |
@@ -1443,16 +1492,15 @@ discard block |
||
| 1443 | 1492 | <p class="padding"> |
| 1444 | 1493 | <strong><a href="', $scripturl, '?action=admin;area=repairboards;fixErrors;', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=admin;area=maintain">', $txt['no'], '</a></strong> |
| 1445 | 1494 | </p>'; |
| 1446 | - } |
|
| 1447 | - else |
|
| 1448 | - echo ' |
|
| 1495 | + } else { |
|
| 1496 | + echo ' |
|
| 1449 | 1497 | <p>', $txt['maintain_no_errors'], '</p> |
| 1450 | 1498 | <p class="padding"> |
| 1451 | 1499 | <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a> |
| 1452 | 1500 | </p>'; |
| 1501 | + } |
|
| 1453 | 1502 | |
| 1454 | - } |
|
| 1455 | - else |
|
| 1503 | + } else |
|
| 1456 | 1504 | { |
| 1457 | 1505 | if (!empty($context['redirect_to_recount'])) |
| 1458 | 1506 | { |
@@ -1464,8 +1512,7 @@ discard block |
||
| 1464 | 1512 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1465 | 1513 | <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '"> |
| 1466 | 1514 | </form>'; |
| 1467 | - } |
|
| 1468 | - else |
|
| 1515 | + } else |
|
| 1469 | 1516 | { |
| 1470 | 1517 | echo ' |
| 1471 | 1518 | <p>', $txt['errors_fixed'], '</p> |
@@ -1619,8 +1666,8 @@ discard block |
||
| 1619 | 1666 | { |
| 1620 | 1667 | global $context, $txt; |
| 1621 | 1668 | |
| 1622 | - if ($context['user']['is_admin']) |
|
| 1623 | - echo ' |
|
| 1669 | + if ($context['user']['is_admin']) { |
|
| 1670 | + echo ' |
|
| 1624 | 1671 | <span class="floatright admin_search"> |
| 1625 | 1672 | <span class="generic_icons filter centericon"></span> |
| 1626 | 1673 | <input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';"> |
@@ -1631,6 +1678,7 @@ discard block |
||
| 1631 | 1678 | </select> |
| 1632 | 1679 | <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button"> |
| 1633 | 1680 | </span>'; |
| 1634 | -} |
|
| 1681 | + } |
|
| 1682 | + } |
|
| 1635 | 1683 | |
| 1636 | 1684 | ?> |
| 1637 | 1685 | \ No newline at end of file |
@@ -27,9 +27,10 @@ discard block |
||
| 27 | 27 | <h3 class="catbg"> |
| 28 | 28 | <span class="floatleft">', $txt['members_list'], '</span>'; |
| 29 | 29 | |
| 30 | - if (!isset($context['old_search'])) |
|
| 31 | - echo ' |
|
| 30 | + if (!isset($context['old_search'])) { |
|
| 31 | + echo ' |
|
| 32 | 32 | <span class="floatright">', $context['letter_links'], '</span>'; |
| 33 | + } |
|
| 33 | 34 | echo ' |
| 34 | 35 | </h3> |
| 35 | 36 | </div>'; |
@@ -44,19 +45,22 @@ discard block |
||
| 44 | 45 | foreach ($context['columns'] as $key => $column) |
| 45 | 46 | { |
| 46 | 47 | // @TODO maybe find something nicer? |
| 47 | - if ($key == 'email_address' && !$context['can_send_email']) |
|
| 48 | - continue; |
|
| 48 | + if ($key == 'email_address' && !$context['can_send_email']) { |
|
| 49 | + continue; |
|
| 50 | + } |
|
| 49 | 51 | |
| 50 | 52 | // This is a selected column, so underline it or some such. |
| 51 | - if ($column['selected']) |
|
| 52 | - echo ' |
|
| 53 | + if ($column['selected']) { |
|
| 54 | + echo ' |
|
| 53 | 55 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '> |
| 54 | 56 | <a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></th>'; |
| 57 | + } |
|
| 55 | 58 | // This is just some column... show the link and be done with it. |
| 56 | - else |
|
| 57 | - echo ' |
|
| 59 | + else { |
|
| 60 | + echo ' |
|
| 58 | 61 | <th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '> |
| 59 | 62 | ', $column['link'], '</th>'; |
| 63 | + } |
|
| 60 | 64 | } |
| 61 | 65 | echo ' |
| 62 | 66 | </tr> |
@@ -75,9 +79,10 @@ discard block |
||
| 75 | 79 | </td> |
| 76 | 80 | <td class="lefttext">', $member['link'], '</td>'; |
| 77 | 81 | |
| 78 | - if (!isset($context['disabled_fields']['website'])) |
|
| 79 | - echo ' |
|
| 82 | + if (!isset($context['disabled_fields']['website'])) { |
|
| 83 | + echo ' |
|
| 80 | 84 | <td class="centertext website_url">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><span class="generic_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>'; |
| 85 | + } |
|
| 81 | 86 | |
| 82 | 87 | // Group and date. |
| 83 | 88 | echo ' |
@@ -90,11 +95,12 @@ discard block |
||
| 90 | 95 | <td class="centertext" style="white-space: nowrap; width: 15px">', $member['posts'], '</td> |
| 91 | 96 | <td class="centertext statsbar" style="width: 120px">'; |
| 92 | 97 | |
| 93 | - if (!empty($member['post_percent'])) |
|
| 94 | - echo ' |
|
| 98 | + if (!empty($member['post_percent'])) { |
|
| 99 | + echo ' |
|
| 95 | 100 | <div class="bar" style="width: ', $member['post_percent'] + 4, 'px;"> |
| 96 | 101 | <div style="width: ', $member['post_percent'], 'px;"></div> |
| 97 | 102 | </div>'; |
| 103 | + } |
|
| 98 | 104 | |
| 99 | 105 | echo ' |
| 100 | 106 | </td>'; |
@@ -103,9 +109,10 @@ discard block |
||
| 103 | 109 | // Show custom fields marked to be shown here |
| 104 | 110 | if (!empty($context['custom_profile_fields']['columns'])) |
| 105 | 111 | { |
| 106 | - foreach ($context['custom_profile_fields']['columns'] as $key => $column) |
|
| 107 | - echo ' |
|
| 112 | + foreach ($context['custom_profile_fields']['columns'] as $key => $column) { |
|
| 113 | + echo ' |
|
| 108 | 114 | <td class="righttext">', $member['options'][$key], '</td>'; |
| 115 | + } |
|
| 109 | 116 | } |
| 110 | 117 | |
| 111 | 118 | echo ' |
@@ -113,11 +120,12 @@ discard block |
||
| 113 | 120 | } |
| 114 | 121 | } |
| 115 | 122 | // No members? |
| 116 | - else |
|
| 117 | - echo ' |
|
| 123 | + else { |
|
| 124 | + echo ' |
|
| 118 | 125 | <tr> |
| 119 | 126 | <td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td> |
| 120 | 127 | </tr>'; |
| 128 | + } |
|
| 121 | 129 | |
| 122 | 130 | echo ' |
| 123 | 131 | </tbody> |
@@ -130,9 +138,10 @@ discard block |
||
| 130 | 138 | <div class="pagelinks floatleft">', $context['page_index'], '</div>'; |
| 131 | 139 | |
| 132 | 140 | // If it is displaying the result of a search show a "search again" link to edit their criteria. |
| 133 | - if (isset($context['old_search'])) |
|
| 134 | - echo ' |
|
| 141 | + if (isset($context['old_search'])) { |
|
| 142 | + echo ' |
|
| 135 | 143 | <a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>'; |
| 144 | + } |
|
| 136 | 145 | echo ' |
| 137 | 146 | </div> |
| 138 | 147 | </div><!-- #memberlist -->'; |
@@ -23,15 +23,15 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | global $context, $txt; |
| 25 | 25 | |
| 26 | - if (!empty($context['simple_action'])) |
|
| 27 | - echo ' |
|
| 26 | + if (!empty($context['simple_action'])) { |
|
| 27 | + echo ' |
|
| 28 | 28 | <strong> |
| 29 | 29 | ', $context['error_title'], ' |
| 30 | 30 | </strong><br> |
| 31 | 31 | <div ', $context['error_code'], 'class="padding"> |
| 32 | 32 | ', $context['error_message'], ' |
| 33 | 33 | </div>'; |
| 34 | - else |
|
| 34 | + } else |
|
| 35 | 35 | { |
| 36 | 36 | echo ' |
| 37 | 37 | <div id="fatal_error"> |
@@ -87,21 +87,23 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $error_types = array(); |
| 89 | 89 | |
| 90 | - foreach ($context['error_types'] as $type => $details) |
|
| 91 | - $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
| 90 | + foreach ($context['error_types'] as $type => $details) { |
|
| 91 | + $error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>'; |
|
| 92 | + } |
|
| 92 | 93 | |
| 93 | 94 | echo ' |
| 94 | 95 | ', implode(' | ', $error_types), ' |
| 95 | 96 | </td> |
| 96 | 97 | </tr>'; |
| 97 | 98 | |
| 98 | - if ($context['has_filter']) |
|
| 99 | - echo ' |
|
| 99 | + if ($context['has_filter']) { |
|
| 100 | + echo ' |
|
| 100 | 101 | <tr> |
| 101 | 102 | <td colspan="3" class="windowbg"> |
| 102 | 103 | <strong> ', $txt['applying_filter'], ':</strong> ', $context['filter']['entity'], ' ', $context['filter']['value']['html'], ' [<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', '">', $txt['clear_filter'], '</a>] |
| 103 | 104 | </td> |
| 104 | 105 | </tr>'; |
| 106 | + } |
|
| 105 | 107 | |
| 106 | 108 | echo ' |
| 107 | 109 | <tr> |
@@ -112,11 +114,12 @@ discard block |
||
| 112 | 114 | </tr>'; |
| 113 | 115 | |
| 114 | 116 | // No errors, then show a message |
| 115 | - if (count($context['errors']) == 0) |
|
| 116 | - echo ' |
|
| 117 | + if (count($context['errors']) == 0) { |
|
| 118 | + echo ' |
|
| 117 | 119 | <tr class="windowbg"> |
| 118 | 120 | <td class="centertext" colspan="2">', $txt['errlog_no_entries'], '</td> |
| 119 | 121 | </tr>'; |
| 122 | + } |
|
| 120 | 123 | |
| 121 | 124 | // we have some errors, must be some mods installed :P |
| 122 | 125 | foreach ($context['errors'] as $error) |
@@ -130,19 +133,21 @@ discard block |
||
| 130 | 133 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? '' : ';desc', $context['has_filter'] ? $context['filter']['href'] : '', '" title="', $txt['reverse_direction'], '"><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></a> |
| 131 | 134 | ', $error['time'], '<br>'; |
| 132 | 135 | |
| 133 | - if (!empty($error['member']['ip'])) |
|
| 134 | - echo ' |
|
| 136 | + if (!empty($error['member']['ip'])) { |
|
| 137 | + echo ' |
|
| 135 | 138 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=ip;value=', $error['member']['ip'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_ip'], '"><span class="generic_icons filter centericon"></span></a> |
| 136 | 139 | <strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong> <br>'; |
| 140 | + } |
|
| 137 | 141 | |
| 138 | 142 | echo ' |
| 139 | 143 | </div> |
| 140 | 144 | <div style="float: left; width: 50%; line-height: 1.8em; padding: 0 4px;">'; |
| 141 | 145 | |
| 142 | - if ($error['member']['session'] != '') |
|
| 143 | - echo ' |
|
| 146 | + if ($error['member']['session'] != '') { |
|
| 147 | + echo ' |
|
| 144 | 148 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=session;value=', $error['member']['session'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '"><span class="generic_icons filter centericon"></span></a> |
| 145 | 149 | ', $error['member']['session'], '<br>'; |
| 150 | + } |
|
| 146 | 151 | |
| 147 | 152 | echo ' |
| 148 | 153 | <a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=error_type;value=', $error['error_type']['type'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_type'], '"><span class="generic_icons filter centericon"></span></a> |
@@ -156,8 +161,8 @@ discard block |
||
| 156 | 161 | <a style="display: table-cell;" href="', $error['url']['html'], '">', $error['url']['html'], '</a> |
| 157 | 162 | </div>'; |
| 158 | 163 | |
| 159 | - if (!empty($error['file'])) |
|
| 160 | - echo ' |
|
| 164 | + if (!empty($error['file'])) { |
|
| 165 | + echo ' |
|
| 161 | 166 | <div style="float: left; width: 100%; padding: 4px 0; line-height: 1.6em; border-top: 1px solid #e3e3e3;"> |
| 162 | 167 | <a style="display: table-cell; padding: 4px; width: 20px; vertical-align: top;" href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=file;value=', $error['file']['search'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_file'], '"><span class="generic_icons filter"></span></a> |
| 163 | 168 | <div> |
@@ -165,6 +170,7 @@ discard block |
||
| 165 | 170 | ', $txt['line'], ': ', $error['file']['line'], ' |
| 166 | 171 | </div> |
| 167 | 172 | </div>'; |
| 173 | + } |
|
| 168 | 174 | |
| 169 | 175 | echo ' |
| 170 | 176 | </td> |
@@ -192,9 +198,10 @@ discard block |
||
| 192 | 198 | </div> |
| 193 | 199 | </div>'; |
| 194 | 200 | |
| 195 | - if ($context['sort_direction'] == 'down') |
|
| 196 | - echo ' |
|
| 201 | + if ($context['sort_direction'] == 'down') { |
|
| 202 | + echo ' |
|
| 197 | 203 | <input type="hidden" name="desc" value="1">'; |
| 204 | + } |
|
| 198 | 205 | |
| 199 | 206 | echo ' |
| 200 | 207 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -53,14 +53,15 @@ discard block |
||
| 53 | 53 | foreach ($context['smileys'] as $location => $smileyRows) |
| 54 | 54 | { |
| 55 | 55 | $countLocations--; |
| 56 | - if ($location == 'postform') |
|
| 57 | - echo ' |
|
| 56 | + if ($location == 'postform') { |
|
| 57 | + echo ' |
|
| 58 | 58 | dropdown: |
| 59 | 59 | {'; |
| 60 | - elseif ($location == 'popup') |
|
| 61 | - echo ' |
|
| 60 | + } elseif ($location == 'popup') { |
|
| 61 | + echo ' |
|
| 62 | 62 | popup: |
| 63 | 63 | {'; |
| 64 | + } |
|
| 64 | 65 | |
| 65 | 66 | $numRows = count($smileyRows); |
| 66 | 67 | |
@@ -74,21 +75,22 @@ discard block |
||
| 74 | 75 | echo ' |
| 75 | 76 | ', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), empty($smiley['isLast']) ? ',' : ''; |
| 76 | 77 | } |
| 77 | - if (empty($smileyRow['isLast']) && $numRows != 1) |
|
| 78 | - echo ', |
|
| 78 | + if (empty($smileyRow['isLast']) && $numRows != 1) { |
|
| 79 | + echo ', |
|
| 79 | 80 | \'-', $emptyPlaceholder++, '\': \'\','; |
| 81 | + } |
|
| 80 | 82 | } |
| 81 | 83 | echo ' |
| 82 | 84 | }', $countLocations != 0 ? ',' : ''; |
| 83 | 85 | } |
| 84 | 86 | echo ' |
| 85 | 87 | }'; |
| 86 | - } |
|
| 87 | - else |
|
| 88 | - echo ', |
|
| 88 | + } else { |
|
| 89 | + echo ', |
|
| 89 | 90 | emoticons: |
| 90 | 91 | {}, |
| 91 | 92 | emoticonsEnabled:false'; |
| 93 | + } |
|
| 92 | 94 | |
| 93 | 95 | if ($context['show_bbc'] && $bbcContainer !== null) |
| 94 | 96 | { |
@@ -101,15 +103,16 @@ discard block |
||
| 101 | 103 | |
| 102 | 104 | $count_tags--; |
| 103 | 105 | |
| 104 | - if (!empty($count_tags)) |
|
| 105 | - echo '||'; |
|
| 106 | + if (!empty($count_tags)) { |
|
| 107 | + echo '||'; |
|
| 108 | + } |
|
| 106 | 109 | } |
| 107 | 110 | |
| 108 | 111 | echo '",'; |
| 109 | - } |
|
| 110 | - else |
|
| 111 | - echo ', |
|
| 112 | + } else { |
|
| 113 | + echo ', |
|
| 112 | 114 | toolbar: "",'; |
| 115 | + } |
|
| 113 | 116 | |
| 114 | 117 | echo ' |
| 115 | 118 | }); |
@@ -151,43 +154,48 @@ discard block |
||
| 151 | 154 | |
| 152 | 155 | $tempTab = $context['tabindex']; |
| 153 | 156 | |
| 154 | - if (!empty($context['drafts_pm_save'])) |
|
| 155 | - $tempTab++; |
|
| 156 | - elseif (!empty($context['drafts_save'])) |
|
| 157 | - $tempTab++; |
|
| 158 | - elseif ($editor_context['preview_type']) |
|
| 159 | - $tempTab++; |
|
| 160 | - elseif ($context['show_spellchecking']) |
|
| 161 | - $tempTab++; |
|
| 157 | + if (!empty($context['drafts_pm_save'])) { |
|
| 158 | + $tempTab++; |
|
| 159 | + } elseif (!empty($context['drafts_save'])) { |
|
| 160 | + $tempTab++; |
|
| 161 | + } elseif ($editor_context['preview_type']) { |
|
| 162 | + $tempTab++; |
|
| 163 | + } elseif ($context['show_spellchecking']) { |
|
| 164 | + $tempTab++; |
|
| 165 | + } |
|
| 162 | 166 | |
| 163 | 167 | $tempTab++; |
| 164 | 168 | $context['tabindex'] = $tempTab; |
| 165 | 169 | |
| 166 | - if (!empty($context['drafts_pm_save'])) |
|
| 167 | - echo ' |
|
| 170 | + if (!empty($context['drafts_pm_save'])) { |
|
| 171 | + echo ' |
|
| 168 | 172 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button"> |
| 169 | 173 | <input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">'; |
| 174 | + } |
|
| 170 | 175 | |
| 171 | - if (!empty($context['drafts_save'])) |
|
| 172 | - echo ' |
|
| 176 | + if (!empty($context['drafts_save'])) { |
|
| 177 | + echo ' |
|
| 173 | 178 | <input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" class="button"> |
| 174 | 179 | <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">'; |
| 180 | + } |
|
| 175 | 181 | |
| 176 | - if ($context['show_spellchecking']) |
|
| 177 | - echo ' |
|
| 182 | + if ($context['show_spellchecking']) { |
|
| 183 | + echo ' |
|
| 178 | 184 | <input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button">'; |
| 185 | + } |
|
| 179 | 186 | |
| 180 | - if ($editor_context['preview_type']) |
|
| 181 | - echo ' |
|
| 187 | + if ($editor_context['preview_type']) { |
|
| 188 | + echo ' |
|
| 182 | 189 | <input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', --$tempTab, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button">'; |
| 190 | + } |
|
| 183 | 191 | |
| 184 | 192 | |
| 185 | 193 | echo ' |
| 186 | 194 | <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button">'; |
| 187 | 195 | |
| 188 | 196 | // Load in the PM autosaver if it's enabled |
| 189 | - if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) |
|
| 190 | - echo ' |
|
| 197 | + if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) { |
|
| 198 | + echo ' |
|
| 191 | 199 | <span class="righttext padding" style="display: block"> |
| 192 | 200 | <span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"> </span> |
| 193 | 201 | <span id="draft_lastautosave" ></span> |
@@ -205,10 +213,11 @@ discard block |
||
| 205 | 213 | iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), ' |
| 206 | 214 | }); |
| 207 | 215 | </script>'; |
| 216 | + } |
|
| 208 | 217 | |
| 209 | 218 | // Start an instance of the auto saver if its enabled |
| 210 | - if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) |
|
| 211 | - echo ' |
|
| 219 | + if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) { |
|
| 220 | + echo ' |
|
| 212 | 221 | <span class="righttext padding" style="display: block"> |
| 213 | 222 | <span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"> </span> |
| 214 | 223 | <span id="draft_lastautosave" ></span> |
@@ -225,7 +234,8 @@ discard block |
||
| 225 | 234 | iFreq: ', $context['drafts_autosave_frequency'], ' |
| 226 | 235 | }); |
| 227 | 236 | </script>'; |
| 228 | -} |
|
| 237 | + } |
|
| 238 | + } |
|
| 229 | 239 | |
| 230 | 240 | /** |
| 231 | 241 | * This template displays a verification form |
@@ -242,51 +252,57 @@ discard block |
||
| 242 | 252 | $verify_context = &$context['controls']['verification'][$verify_id]; |
| 243 | 253 | |
| 244 | 254 | // Keep track of where we are. |
| 245 | - if (empty($verify_context['tracking']) || $reset) |
|
| 246 | - $verify_context['tracking'] = 0; |
|
| 255 | + if (empty($verify_context['tracking']) || $reset) { |
|
| 256 | + $verify_context['tracking'] = 0; |
|
| 257 | + } |
|
| 247 | 258 | |
| 248 | 259 | // How many items are there to display in total. |
| 249 | 260 | $total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0); |
| 250 | 261 | |
| 251 | 262 | // If we've gone too far, stop. |
| 252 | - if ($verify_context['tracking'] > $total_items) |
|
| 253 | - return false; |
|
| 263 | + if ($verify_context['tracking'] > $total_items) { |
|
| 264 | + return false; |
|
| 265 | + } |
|
| 254 | 266 | |
| 255 | 267 | // Loop through each item to show them. |
| 256 | 268 | for ($i = 0; $i < $total_items; $i++) |
| 257 | 269 | { |
| 258 | 270 | // If we're after a single item only show it if we're in the right place. |
| 259 | - if ($display_type == 'single' && $verify_context['tracking'] != $i) |
|
| 260 | - continue; |
|
| 271 | + if ($display_type == 'single' && $verify_context['tracking'] != $i) { |
|
| 272 | + continue; |
|
| 273 | + } |
|
| 261 | 274 | |
| 262 | - if ($display_type != 'single') |
|
| 263 | - echo ' |
|
| 275 | + if ($display_type != 'single') { |
|
| 276 | + echo ' |
|
| 264 | 277 | <div id="verification_control_', $i, '" class="verification_control">'; |
| 278 | + } |
|
| 265 | 279 | |
| 266 | 280 | // Display empty field, but only if we have one, and it's the first time. |
| 267 | - if ($verify_context['empty_field'] && empty($i)) |
|
| 268 | - echo ' |
|
| 281 | + if ($verify_context['empty_field'] && empty($i)) { |
|
| 282 | + echo ' |
|
| 269 | 283 | <div class="smalltext vv_special"> |
| 270 | 284 | ', $txt['visual_verification_hidden'], ': |
| 271 | 285 | <input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value=""> |
| 272 | 286 | </div>'; |
| 287 | + } |
|
| 273 | 288 | |
| 274 | 289 | // Do the actual stuff |
| 275 | 290 | if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha'])) |
| 276 | 291 | { |
| 277 | 292 | if ($verify_context['show_visual']) |
| 278 | 293 | { |
| 279 | - if ($context['use_graphic_library']) |
|
| 280 | - echo ' |
|
| 294 | + if ($context['use_graphic_library']) { |
|
| 295 | + echo ' |
|
| 281 | 296 | <img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">'; |
| 282 | - else |
|
| 283 | - echo ' |
|
| 297 | + } else { |
|
| 298 | + echo ' |
|
| 284 | 299 | <img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1"> |
| 285 | 300 | <img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2"> |
| 286 | 301 | <img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3"> |
| 287 | 302 | <img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4"> |
| 288 | 303 | <img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5"> |
| 289 | 304 | <img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">'; |
| 305 | + } |
|
| 290 | 306 | |
| 291 | 307 | echo ' |
| 292 | 308 | <div class="smalltext" style="margin: 4px 0 8px 0;"> |
@@ -303,8 +319,7 @@ discard block |
||
| 303 | 319 | <br> |
| 304 | 320 | <script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>'; |
| 305 | 321 | } |
| 306 | - } |
|
| 307 | - else |
|
| 322 | + } else |
|
| 308 | 323 | { |
| 309 | 324 | // Where in the question array is this question? |
| 310 | 325 | $qIndex = $verify_context['show_visual'] ? $i - 1 : $i; |
@@ -316,21 +331,24 @@ discard block |
||
| 316 | 331 | </div>'; |
| 317 | 332 | } |
| 318 | 333 | |
| 319 | - if ($display_type != 'single') |
|
| 320 | - echo ' |
|
| 334 | + if ($display_type != 'single') { |
|
| 335 | + echo ' |
|
| 321 | 336 | </div><!-- #verification_control_[i] -->'; |
| 337 | + } |
|
| 322 | 338 | |
| 323 | 339 | // If we were displaying just one and we did it, break. |
| 324 | - if ($display_type == 'single' && $verify_context['tracking'] == $i) |
|
| 325 | - break; |
|
| 340 | + if ($display_type == 'single' && $verify_context['tracking'] == $i) { |
|
| 341 | + break; |
|
| 342 | + } |
|
| 326 | 343 | } |
| 327 | 344 | |
| 328 | 345 | // Assume we found something, always, |
| 329 | 346 | $verify_context['tracking']++; |
| 330 | 347 | |
| 331 | 348 | // Tell something displaying piecemeal to keep going. |
| 332 | - if ($display_type == 'single') |
|
| 333 | - return true; |
|
| 334 | -} |
|
| 349 | + if ($display_type == 'single') { |
|
| 350 | + return true; |
|
| 351 | + } |
|
| 352 | + } |
|
| 335 | 353 | |
| 336 | 354 | ?> |
| 337 | 355 | \ No newline at end of file |
@@ -28,15 +28,17 @@ discard block |
||
| 28 | 28 | <form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">'; |
| 29 | 29 | |
| 30 | 30 | // Did they make a mistake last time? |
| 31 | - if (!empty($context['login_errors'])) |
|
| 32 | - echo ' |
|
| 31 | + if (!empty($context['login_errors'])) { |
|
| 32 | + echo ' |
|
| 33 | 33 | <div class="errorbox">', implode('<br>', $context['login_errors']), '</div> |
| 34 | 34 | <br>'; |
| 35 | + } |
|
| 35 | 36 | |
| 36 | 37 | // Or perhaps there's some special description for this time? |
| 37 | - if (isset($context['description'])) |
|
| 38 | - echo ' |
|
| 38 | + if (isset($context['description'])) { |
|
| 39 | + echo ' |
|
| 39 | 40 | <div class="information">', $context['description'], '</div>'; |
| 41 | + } |
|
| 40 | 42 | |
| 41 | 43 | // Now just get the basic information - username, password, etc. |
| 42 | 44 | echo ' |
@@ -61,10 +63,11 @@ discard block |
||
| 61 | 63 | </dd>'; |
| 62 | 64 | |
| 63 | 65 | // If they have deleted their account, give them a chance to change their mind. |
| 64 | - if (isset($context['login_show_undelete'])) |
|
| 65 | - echo ' |
|
| 66 | + if (isset($context['login_show_undelete'])) { |
|
| 67 | + echo ' |
|
| 66 | 68 | <dt class="alert">', $txt['undelete_account'], ':</dt> |
| 67 | 69 | <dd><input type="checkbox" name="undelete"></dd>'; |
| 70 | + } |
|
| 68 | 71 | |
| 69 | 72 | echo ' |
| 70 | 73 | </dl> |
@@ -82,8 +85,8 @@ discard block |
||
| 82 | 85 | document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus(); |
| 83 | 86 | }, 150);'; |
| 84 | 87 | |
| 85 | - if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) |
|
| 86 | - echo ' |
|
| 88 | + if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) { |
|
| 89 | + echo ' |
|
| 87 | 90 | form = $("#frmLogin"); |
| 88 | 91 | form.submit(function(e) { |
| 89 | 92 | e.preventDefault(); |
@@ -116,16 +119,18 @@ discard block |
||
| 116 | 119 | |
| 117 | 120 | return false; |
| 118 | 121 | });'; |
| 122 | + } |
|
| 119 | 123 | |
| 120 | 124 | echo ' |
| 121 | 125 | </script> |
| 122 | 126 | </form>'; |
| 123 | 127 | |
| 124 | 128 | // It is a long story as to why we have this when we're clearly not going to use it. |
| 125 | - if (!empty($context['from_ajax'])) |
|
| 126 | - echo ' |
|
| 129 | + if (!empty($context['from_ajax'])) { |
|
| 130 | + echo ' |
|
| 127 | 131 | <br> |
| 128 | 132 | <a href="javascript:self.close();"></a>'; |
| 133 | + } |
|
| 129 | 134 | echo ' |
| 130 | 135 | </div><!-- .roundframe --> |
| 131 | 136 | </div><!-- .login -->'; |
@@ -147,11 +152,12 @@ discard block |
||
| 147 | 152 | </div> |
| 148 | 153 | <div class="roundframe noup">'; |
| 149 | 154 | |
| 150 | - if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) |
|
| 151 | - echo ' |
|
| 155 | + if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) { |
|
| 156 | + echo ' |
|
| 152 | 157 | <div class="error"> |
| 153 | 158 | ', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], ' |
| 154 | 159 | </div>'; |
| 160 | + } |
|
| 155 | 161 | |
| 156 | 162 | echo ' |
| 157 | 163 | <form action="', $context['tfa_url'], '" method="post" id="frmTfa"> |
@@ -180,8 +186,8 @@ discard block |
||
| 180 | 186 | <script> |
| 181 | 187 | form = $("#frmTfa");'; |
| 182 | 188 | |
| 183 | - if (!empty($context['from_ajax'])) |
|
| 184 | - echo ' |
|
| 189 | + if (!empty($context['from_ajax'])) { |
|
| 190 | + echo ' |
|
| 185 | 191 | form.submit(function(e) { |
| 186 | 192 | // If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page |
| 187 | 193 | if (form.find("input[name=tfa_backup]:first").val().length > 0) |
@@ -200,6 +206,7 @@ discard block |
||
| 200 | 206 | |
| 201 | 207 | return false; |
| 202 | 208 | });'; |
| 209 | + } |
|
| 203 | 210 | |
| 204 | 211 | echo ' |
| 205 | 212 | form.find("input[name=backup]").click(function(e) { |
@@ -232,10 +239,11 @@ discard block |
||
| 232 | 239 | ', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>'; |
| 233 | 240 | |
| 234 | 241 | |
| 235 | - if ($context['can_register']) |
|
| 236 | - echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
| 237 | - else |
|
| 238 | - echo $txt['login_below']; |
|
| 242 | + if ($context['can_register']) { |
|
| 243 | + echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
| 244 | + } else { |
|
| 245 | + echo $txt['login_below']; |
|
| 246 | + } |
|
| 239 | 247 | |
| 240 | 248 | // And now the login information. |
| 241 | 249 | echo ' |
@@ -335,9 +343,10 @@ discard block |
||
| 335 | 343 | </div> |
| 336 | 344 | <div class="roundframe centertext noup">'; |
| 337 | 345 | |
| 338 | - if (!empty($context['incorrect_password'])) |
|
| 339 | - echo ' |
|
| 346 | + if (!empty($context['incorrect_password'])) { |
|
| 347 | + echo ' |
|
| 340 | 348 | <div class="error">', $txt['admin_incorrect_password'], '</div>'; |
| 349 | + } |
|
| 341 | 350 | |
| 342 | 351 | echo ' |
| 343 | 352 | <strong>', $txt['password'], ':</strong> |
@@ -378,11 +387,12 @@ discard block |
||
| 378 | 387 | <div class="roundframe">'; |
| 379 | 388 | |
| 380 | 389 | // You didn't even have an ID? |
| 381 | - if (empty($context['member_id'])) |
|
| 382 | - echo ' |
|
| 390 | + if (empty($context['member_id'])) { |
|
| 391 | + echo ' |
|
| 383 | 392 | <dl> |
| 384 | 393 | <dt>', $txt['invalid_activation_username'], ':</dt> |
| 385 | 394 | <dd><input type="text" name="user" size="30"></dd>'; |
| 395 | + } |
|
| 386 | 396 | |
| 387 | 397 | echo ' |
| 388 | 398 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
@@ -419,13 +429,14 @@ discard block |
||
| 419 | 429 | <dd><input type="password" name="passwd" size="30"></dd> |
| 420 | 430 | </dl>'; |
| 421 | 431 | |
| 422 | - if ($context['can_activate']) |
|
| 423 | - echo ' |
|
| 432 | + if ($context['can_activate']) { |
|
| 433 | + echo ' |
|
| 424 | 434 | <p>', $txt['invalid_activation_known'], '</p> |
| 425 | 435 | <dl> |
| 426 | 436 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
| 427 | 437 | <dd><input type="text" name="code" size="30"></dd> |
| 428 | 438 | </dl>'; |
| 439 | + } |
|
| 429 | 440 | |
| 430 | 441 | echo ' |
| 431 | 442 | <p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button"></p> |
@@ -43,28 +43,33 @@ discard block |
||
| 43 | 43 | </div> |
| 44 | 44 | <div class="list_posts">', $post['message'], '</div>'; |
| 45 | 45 | |
| 46 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 47 | - echo ' |
|
| 46 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 47 | + echo ' |
|
| 48 | 48 | <ul class="quickbuttons">'; |
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | // If they *can* reply? |
| 51 | - if ($post['can_reply']) |
|
| 52 | - echo ' |
|
| 52 | + if ($post['can_reply']) { |
|
| 53 | + echo ' |
|
| 53 | 54 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
| 55 | + } |
|
| 54 | 56 | |
| 55 | 57 | // If they *can* quote? |
| 56 | - if ($post['can_quote']) |
|
| 57 | - echo ' |
|
| 58 | + if ($post['can_quote']) { |
|
| 59 | + echo ' |
|
| 58 | 60 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
| 61 | + } |
|
| 59 | 62 | |
| 60 | 63 | // How about... even... remove it entirely?! |
| 61 | - if ($post['can_delete']) |
|
| 62 | - echo ' |
|
| 64 | + if ($post['can_delete']) { |
|
| 65 | + echo ' |
|
| 63 | 66 | <li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
| 67 | + } |
|
| 64 | 68 | |
| 65 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 66 | - echo ' |
|
| 69 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 70 | + echo ' |
|
| 67 | 71 | </ul>'; |
| 72 | + } |
|
| 68 | 73 | |
| 69 | 74 | echo ' |
| 70 | 75 | </div><!-- $post[css_class] -->'; |
@@ -86,12 +91,13 @@ discard block |
||
| 86 | 91 | echo ' |
| 87 | 92 | <div id="recent" class="main_content">'; |
| 88 | 93 | |
| 89 | - if ($context['showCheckboxes']) |
|
| 90 | - echo ' |
|
| 94 | + if ($context['showCheckboxes']) { |
|
| 95 | + echo ' |
|
| 91 | 96 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm"> |
| 92 | 97 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 93 | 98 | <input type="hidden" name="qaction" value="markread"> |
| 94 | 99 | <input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
| 100 | + } |
|
| 95 | 101 | |
| 96 | 102 | if (!empty($context['topics'])) |
| 97 | 103 | { |
@@ -120,11 +126,12 @@ discard block |
||
| 120 | 126 | </div>'; |
| 121 | 127 | |
| 122 | 128 | // Show a "select all" box for quick moderation? |
| 123 | - if ($context['showCheckboxes']) |
|
| 124 | - echo ' |
|
| 129 | + if ($context['showCheckboxes']) { |
|
| 130 | + echo ' |
|
| 125 | 131 | <div class="moderation"> |
| 126 | 132 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 127 | 133 | </div>'; |
| 134 | + } |
|
| 128 | 135 | |
| 129 | 136 | echo ' |
| 130 | 137 | </div><!-- #topic_header --> |
@@ -143,15 +150,18 @@ discard block |
||
| 143 | 150 | // Now we handle the icons |
| 144 | 151 | echo ' |
| 145 | 152 | <div class="icons floatright">'; |
| 146 | - if ($topic['is_locked']) |
|
| 147 | - echo ' |
|
| 153 | + if ($topic['is_locked']) { |
|
| 154 | + echo ' |
|
| 148 | 155 | <span class="generic_icons lock"></span>'; |
| 149 | - if ($topic['is_sticky']) |
|
| 150 | - echo ' |
|
| 156 | + } |
|
| 157 | + if ($topic['is_sticky']) { |
|
| 158 | + echo ' |
|
| 151 | 159 | <span class="generic_icons sticky"></span>'; |
| 152 | - if ($topic['is_poll']) |
|
| 153 | - echo ' |
|
| 160 | + } |
|
| 161 | + if ($topic['is_poll']) { |
|
| 162 | + echo ' |
|
| 154 | 163 | <span class="generic_icons poll"></span>'; |
| 164 | + } |
|
| 155 | 165 | echo ' |
| 156 | 166 | </div>'; |
| 157 | 167 | |
@@ -176,19 +186,21 @@ discard block |
||
| 176 | 186 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
| 177 | 187 | </div>'; |
| 178 | 188 | |
| 179 | - if ($context['showCheckboxes']) |
|
| 180 | - echo ' |
|
| 189 | + if ($context['showCheckboxes']) { |
|
| 190 | + echo ' |
|
| 181 | 191 | <div class="moderation"> |
| 182 | 192 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
| 183 | 193 | </div>'; |
| 194 | + } |
|
| 184 | 195 | |
| 185 | 196 | echo ' |
| 186 | 197 | </div><!-- $topic[css_class] -->'; |
| 187 | 198 | } |
| 188 | 199 | |
| 189 | - if (empty($context['topics'])) |
|
| 190 | - echo ' |
|
| 200 | + if (empty($context['topics'])) { |
|
| 201 | + echo ' |
|
| 191 | 202 | <div style="display: none;"></div>'; |
| 203 | + } |
|
| 192 | 204 | |
| 193 | 205 | echo ' |
| 194 | 206 | </div><!-- #topic_container --> |
@@ -203,25 +215,27 @@ discard block |
||
| 203 | 215 | ', $context['page_index'], ' |
| 204 | 216 | </div> |
| 205 | 217 | </div>'; |
| 206 | - } |
|
| 207 | - else |
|
| 208 | - echo ' |
|
| 218 | + } else { |
|
| 219 | + echo ' |
|
| 209 | 220 | <div class="cat_bar"> |
| 210 | 221 | <h3 class="catbg centertext"> |
| 211 | 222 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
| 212 | 223 | </h3> |
| 213 | 224 | </div>'; |
| 225 | + } |
|
| 214 | 226 | |
| 215 | - if ($context['showCheckboxes']) |
|
| 216 | - echo ' |
|
| 227 | + if ($context['showCheckboxes']) { |
|
| 228 | + echo ' |
|
| 217 | 229 | </form>'; |
| 230 | + } |
|
| 218 | 231 | |
| 219 | 232 | echo ' |
| 220 | 233 | </div><!-- #recent -->'; |
| 221 | 234 | |
| 222 | - if (empty($context['no_topic_listing'])) |
|
| 223 | - template_topic_legend(); |
|
| 224 | -} |
|
| 235 | + if (empty($context['no_topic_listing'])) { |
|
| 236 | + template_topic_legend(); |
|
| 237 | + } |
|
| 238 | + } |
|
| 225 | 239 | |
| 226 | 240 | /** |
| 227 | 241 | * Template for showing unread replies (eg new replies to topics you've posted in) |
@@ -233,12 +247,13 @@ discard block |
||
| 233 | 247 | echo ' |
| 234 | 248 | <div id="recent">'; |
| 235 | 249 | |
| 236 | - if ($context['showCheckboxes']) |
|
| 237 | - echo ' |
|
| 250 | + if ($context['showCheckboxes']) { |
|
| 251 | + echo ' |
|
| 238 | 252 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm"> |
| 239 | 253 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 240 | 254 | <input type="hidden" name="qaction" value="markread"> |
| 241 | 255 | <input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
| 256 | + } |
|
| 242 | 257 | |
| 243 | 258 | if (!empty($context['topics'])) |
| 244 | 259 | { |
@@ -267,11 +282,12 @@ discard block |
||
| 267 | 282 | </div>'; |
| 268 | 283 | |
| 269 | 284 | // Show a "select all" box for quick moderation? |
| 270 | - if ($context['showCheckboxes']) |
|
| 271 | - echo ' |
|
| 285 | + if ($context['showCheckboxes']) { |
|
| 286 | + echo ' |
|
| 272 | 287 | <div class="moderation"> |
| 273 | 288 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 274 | 289 | </div>'; |
| 290 | + } |
|
| 275 | 291 | |
| 276 | 292 | echo ' |
| 277 | 293 | </div><!-- #topic_header --> |
@@ -290,15 +306,18 @@ discard block |
||
| 290 | 306 | // Now we handle the icons |
| 291 | 307 | echo ' |
| 292 | 308 | <div class="icons floatright">'; |
| 293 | - if ($topic['is_locked']) |
|
| 294 | - echo ' |
|
| 309 | + if ($topic['is_locked']) { |
|
| 310 | + echo ' |
|
| 295 | 311 | <span class="generic_icons lock"></span>'; |
| 296 | - if ($topic['is_sticky']) |
|
| 297 | - echo ' |
|
| 312 | + } |
|
| 313 | + if ($topic['is_sticky']) { |
|
| 314 | + echo ' |
|
| 298 | 315 | <span class="generic_icons sticky"></span>'; |
| 299 | - if ($topic['is_poll']) |
|
| 300 | - echo ' |
|
| 316 | + } |
|
| 317 | + if ($topic['is_poll']) { |
|
| 318 | + echo ' |
|
| 301 | 319 | <span class="generic_icons poll"></span>'; |
| 320 | + } |
|
| 302 | 321 | echo ' |
| 303 | 322 | </div>'; |
| 304 | 323 | |
@@ -323,11 +342,12 @@ discard block |
||
| 323 | 342 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
| 324 | 343 | </div>'; |
| 325 | 344 | |
| 326 | - if ($context['showCheckboxes']) |
|
| 327 | - echo ' |
|
| 345 | + if ($context['showCheckboxes']) { |
|
| 346 | + echo ' |
|
| 328 | 347 | <div class="moderation"> |
| 329 | 348 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
| 330 | 349 | </div>'; |
| 350 | + } |
|
| 331 | 351 | echo ' |
| 332 | 352 | </div><!-- $topic[css_class] -->'; |
| 333 | 353 | } |
@@ -343,24 +363,26 @@ discard block |
||
| 343 | 363 | ', $context['page_index'], ' |
| 344 | 364 | </div> |
| 345 | 365 | </div>'; |
| 346 | - } |
|
| 347 | - else |
|
| 348 | - echo ' |
|
| 366 | + } else { |
|
| 367 | + echo ' |
|
| 349 | 368 | <div class="cat_bar"> |
| 350 | 369 | <h3 class="catbg centertext"> |
| 351 | 370 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
| 352 | 371 | </h3> |
| 353 | 372 | </div>'; |
| 373 | + } |
|
| 354 | 374 | |
| 355 | - if ($context['showCheckboxes']) |
|
| 356 | - echo ' |
|
| 375 | + if ($context['showCheckboxes']) { |
|
| 376 | + echo ' |
|
| 357 | 377 | </form>'; |
| 378 | + } |
|
| 358 | 379 | |
| 359 | 380 | echo ' |
| 360 | 381 | </div><!-- #recent -->'; |
| 361 | 382 | |
| 362 | - if (empty($context['no_topic_listing'])) |
|
| 363 | - template_topic_legend(); |
|
| 364 | -} |
|
| 383 | + if (empty($context['no_topic_listing'])) { |
|
| 384 | + template_topic_legend(); |
|
| 385 | + } |
|
| 386 | + } |
|
| 365 | 387 | |
| 366 | 388 | ?> |
| 367 | 389 | \ No newline at end of file |
@@ -22,27 +22,31 @@ discard block |
||
| 22 | 22 | // Get a shortcut to the current list. |
| 23 | 23 | $list_id = $list_id === null ? (!empty($context['default_list']) ? $context['default_list'] : '') : $list_id; |
| 24 | 24 | |
| 25 | - if (empty($list_id) || empty($context[$list_id])) |
|
| 26 | - return; |
|
| 25 | + if (empty($list_id) || empty($context[$list_id])) { |
|
| 26 | + return; |
|
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | $cur_list = &$context[$list_id]; |
| 29 | 30 | |
| 30 | 31 | // These are the main tabs that is used all around the template. |
| 31 | - if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) |
|
| 32 | - template_create_list_menu($cur_list['list_menu'], 'top'); |
|
| 32 | + if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) { |
|
| 33 | + template_create_list_menu($cur_list['list_menu'], 'top'); |
|
| 34 | + } |
|
| 33 | 35 | |
| 34 | - if (isset($cur_list['form'])) |
|
| 35 | - echo ' |
|
| 36 | + if (isset($cur_list['form'])) { |
|
| 37 | + echo ' |
|
| 36 | 38 | <form action="', $cur_list['form']['href'], '" method="post"', empty($cur_list['form']['name']) ? '' : ' name="' . $cur_list['form']['name'] . '" id="' . $cur_list['form']['name'] . '"', ' accept-charset="', $context['character_set'], '">'; |
| 39 | + } |
|
| 37 | 40 | |
| 38 | 41 | // Show the title of the table (if any). |
| 39 | - if (!empty($cur_list['title'])) |
|
| 40 | - echo ' |
|
| 42 | + if (!empty($cur_list['title'])) { |
|
| 43 | + echo ' |
|
| 41 | 44 | <div class="cat_bar"> |
| 42 | 45 | <h3 class="catbg"> |
| 43 | 46 | ', $cur_list['title'], ' |
| 44 | 47 | </h3> |
| 45 | 48 | </div>'; |
| 49 | + } |
|
| 46 | 50 | |
| 47 | 51 | if (isset($cur_list['additional_rows']['after_title'])) |
| 48 | 52 | { |
@@ -55,20 +59,23 @@ discard block |
||
| 55 | 59 | </div>'; |
| 56 | 60 | } |
| 57 | 61 | |
| 58 | - if (isset($cur_list['additional_rows']['top_of_list'])) |
|
| 59 | - template_additional_rows('top_of_list', $cur_list); |
|
| 62 | + if (isset($cur_list['additional_rows']['top_of_list'])) { |
|
| 63 | + template_additional_rows('top_of_list', $cur_list); |
|
| 64 | + } |
|
| 60 | 65 | |
| 61 | 66 | if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers'])) |
| 62 | 67 | { |
| 63 | 68 | // Show the page index (if this list doesn't intend to show all items). |
| 64 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
| 65 | - echo ' |
|
| 69 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
| 70 | + echo ' |
|
| 66 | 71 | <div class="floatleft"> |
| 67 | 72 | <div class="pagesection">', $cur_list['page_index'], '</div> |
| 68 | 73 | </div>'; |
| 74 | + } |
|
| 69 | 75 | |
| 70 | - if (isset($cur_list['additional_rows']['above_column_headers'])) |
|
| 71 | - template_additional_rows('above_column_headers', $cur_list); |
|
| 76 | + if (isset($cur_list['additional_rows']['above_column_headers'])) { |
|
| 77 | + template_additional_rows('above_column_headers', $cur_list); |
|
| 78 | + } |
|
| 72 | 79 | } |
| 73 | 80 | |
| 74 | 81 | echo ' |
@@ -100,13 +107,14 @@ discard block |
||
| 100 | 107 | <tbody>'; |
| 101 | 108 | |
| 102 | 109 | // Show a nice message informing there are no items in this list. |
| 103 | - if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) |
|
| 104 | - echo ' |
|
| 110 | + if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) { |
|
| 111 | + echo ' |
|
| 105 | 112 | <tr class="windowbg"> |
| 106 | 113 | <td colspan="', $cur_list['num_columns'], '" class="', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'centertext', '"> |
| 107 | 114 | ', $cur_list['no_items_label'], ' |
| 108 | 115 | </td> |
| 109 | 116 | </tr>'; |
| 117 | + } |
|
| 110 | 118 | |
| 111 | 119 | // Show the list rows. |
| 112 | 120 | elseif (!empty($cur_list['rows'])) |
@@ -116,12 +124,13 @@ discard block |
||
| 116 | 124 | echo ' |
| 117 | 125 | <tr class="windowbg', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', ' id="list_', $list_id, '_', $id, '">'; |
| 118 | 126 | |
| 119 | - if (!empty($row['data'])) |
|
| 120 | - foreach ($row['data'] as $row_data) |
|
| 127 | + if (!empty($row['data'])) { |
|
| 128 | + foreach ($row['data'] as $row_data) |
|
| 121 | 129 | echo ' |
| 122 | 130 | <td', empty($row_data['class']) ? '' : ' class="' . $row_data['class'] . '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '> |
| 123 | 131 | ', $row_data['value'], ' |
| 124 | 132 | </td>'; |
| 133 | + } |
|
| 125 | 134 | |
| 126 | 135 | echo ' |
| 127 | 136 | </tr>'; |
@@ -138,46 +147,53 @@ discard block |
||
| 138 | 147 | <div class="flow_auto">'; |
| 139 | 148 | |
| 140 | 149 | // Show the page index (if this list doesn't intend to show all items). |
| 141 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
| 142 | - echo ' |
|
| 150 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
| 151 | + echo ' |
|
| 143 | 152 | <div class="floatleft"> |
| 144 | 153 | <div class="pagesection">', $cur_list['page_index'], '</div> |
| 145 | 154 | </div>'; |
| 155 | + } |
|
| 146 | 156 | |
| 147 | - if (isset($cur_list['additional_rows']['below_table_data'])) |
|
| 148 | - template_additional_rows('below_table_data', $cur_list); |
|
| 157 | + if (isset($cur_list['additional_rows']['below_table_data'])) { |
|
| 158 | + template_additional_rows('below_table_data', $cur_list); |
|
| 159 | + } |
|
| 149 | 160 | |
| 150 | 161 | echo ' |
| 151 | 162 | </div>'; |
| 152 | 163 | } |
| 153 | 164 | |
| 154 | - if (isset($cur_list['additional_rows']['bottom_of_list'])) |
|
| 155 | - template_additional_rows('bottom_of_list', $cur_list); |
|
| 165 | + if (isset($cur_list['additional_rows']['bottom_of_list'])) { |
|
| 166 | + template_additional_rows('bottom_of_list', $cur_list); |
|
| 167 | + } |
|
| 156 | 168 | |
| 157 | 169 | if (isset($cur_list['form'])) |
| 158 | 170 | { |
| 159 | - foreach ($cur_list['form']['hidden_fields'] as $name => $value) |
|
| 160 | - echo ' |
|
| 171 | + foreach ($cur_list['form']['hidden_fields'] as $name => $value) { |
|
| 172 | + echo ' |
|
| 161 | 173 | <input type="hidden" name="', $name, '" value="', $value, '">'; |
| 174 | + } |
|
| 162 | 175 | |
| 163 | - if (isset($cur_list['form']['token'])) |
|
| 164 | - echo ' |
|
| 176 | + if (isset($cur_list['form']['token'])) { |
|
| 177 | + echo ' |
|
| 165 | 178 | <input type="hidden" name="', $context[$cur_list['form']['token'] . '_token_var'], '" value="', $context[$cur_list['form']['token'] . '_token'], '">'; |
| 179 | + } |
|
| 166 | 180 | |
| 167 | 181 | echo ' |
| 168 | 182 | </form>'; |
| 169 | 183 | } |
| 170 | 184 | |
| 171 | 185 | // Tabs at the bottom. Usually bottom aligned. |
| 172 | - if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) |
|
| 173 | - template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
| 186 | + if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) { |
|
| 187 | + template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
| 188 | + } |
|
| 174 | 189 | |
| 175 | - if (isset($cur_list['javascript'])) |
|
| 176 | - echo ' |
|
| 190 | + if (isset($cur_list['javascript'])) { |
|
| 191 | + echo ' |
|
| 177 | 192 | <script> |
| 178 | 193 | ', $cur_list['javascript'], ' |
| 179 | 194 | </script>'; |
| 180 | -} |
|
| 195 | + } |
|
| 196 | + } |
|
| 181 | 197 | |
| 182 | 198 | /** |
| 183 | 199 | * This template displays additional rows above or below the list. |
@@ -187,12 +203,13 @@ discard block |
||
| 187 | 203 | */ |
| 188 | 204 | function template_additional_rows($row_position, $cur_list) |
| 189 | 205 | { |
| 190 | - foreach ($cur_list['additional_rows'][$row_position] as $row) |
|
| 191 | - echo ' |
|
| 206 | + foreach ($cur_list['additional_rows'][$row_position] as $row) { |
|
| 207 | + echo ' |
|
| 192 | 208 | <div class="additional_row', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', '> |
| 193 | 209 | ', $row['value'], ' |
| 194 | 210 | </div>'; |
| 195 | -} |
|
| 211 | + } |
|
| 212 | + } |
|
| 196 | 213 | |
| 197 | 214 | /** |
| 198 | 215 | * This function creates a menu |
@@ -251,18 +268,19 @@ discard block |
||
| 251 | 268 | |
| 252 | 269 | foreach ($list_menu['links'] as $link) |
| 253 | 270 | { |
| 254 | - if ($link['is_selected']) |
|
| 255 | - echo ' |
|
| 271 | + if ($link['is_selected']) { |
|
| 272 | + echo ' |
|
| 256 | 273 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $first, '"> </td> |
| 257 | 274 | <td class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back"> |
| 258 | 275 | <a href="', $link['href'], '">', $link['label'], '</a> |
| 259 | 276 | </td> |
| 260 | 277 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $last, '"> </td>'; |
| 261 | - else |
|
| 262 | - echo ' |
|
| 278 | + } else { |
|
| 279 | + echo ' |
|
| 263 | 280 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back"> |
| 264 | 281 | <a href="', $link['href'], '">', $link['label'], '</a> |
| 265 | 282 | </td>'; |
| 283 | + } |
|
| 266 | 284 | } |
| 267 | 285 | |
| 268 | 286 | echo ' |
@@ -273,12 +291,12 @@ discard block |
||
| 273 | 291 | <td> </td>' : '', ' |
| 274 | 292 | </tr> |
| 275 | 293 | </table>'; |
| 276 | - } |
|
| 277 | - elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
| 294 | + } elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
| 278 | 295 | { |
| 279 | 296 | $links = array(); |
| 280 | - foreach ($list_menu['links'] as $link) |
|
| 281 | - $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
| 297 | + foreach ($list_menu['links'] as $link) { |
|
| 298 | + $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
| 299 | + } |
|
| 282 | 300 | |
| 283 | 301 | echo ' |
| 284 | 302 | <table style="margin-', $list_menu['position'], ': 10px; width: 100%;"> |