@@ -20,12 +20,12 @@ |
||
| 20 | 20 | // We completed some tasks? |
| 21 | 21 | if (!empty($context['tasks_were_run'])) |
| 22 | 22 | { |
| 23 | - if (empty($context['scheduled_errors'])) |
|
| 24 | - echo ' |
|
| 23 | + if (empty($context['scheduled_errors'])) { |
|
| 24 | + echo ' |
|
| 25 | 25 | <div class="infobox"> |
| 26 | 26 | ', $txt['scheduled_tasks_were_run'], ' |
| 27 | 27 | </div>'; |
| 28 | - else |
|
| 28 | + } else |
|
| 29 | 29 | { |
| 30 | 30 | echo ' |
| 31 | 31 | <div class="errorbox" id="errors"> |
@@ -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'], ' |
@@ -102,18 +104,20 @@ discard block |
||
| 102 | 104 | <a class="subject" href="', $board['href'], '" id="b', $board['id'], '">', $board['name'], '</a>'; |
| 103 | 105 | |
| 104 | 106 | // Has it outstanding posts for approval? |
| 105 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
| 106 | - echo ' |
|
| 107 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
| 108 | + echo ' |
|
| 107 | 109 | <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>'; |
| 110 | + } |
|
| 108 | 111 | |
| 109 | 112 | echo ' |
| 110 | 113 | |
| 111 | 114 | <p class="board_description">', $board['description'] , '</p>'; |
| 112 | 115 | |
| 113 | 116 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
| 114 | - if (!empty($board['link_moderators'])) |
|
| 115 | - echo ' |
|
| 117 | + if (!empty($board['link_moderators'])) { |
|
| 118 | + echo ' |
|
| 116 | 119 | <p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
| 120 | + } |
|
| 117 | 121 | |
| 118 | 122 | // Show some basic information about the number of posts, etc. |
| 119 | 123 | echo ' |
@@ -125,9 +129,10 @@ discard block |
||
| 125 | 129 | </div> |
| 126 | 130 | <div class="lastpost ',!empty($board['last_post']['id']) ? 'lpr_border' : 'hidden','">'; |
| 127 | 131 | |
| 128 | - if (!empty($board['last_post']['id'])) |
|
| 129 | - echo ' |
|
| 132 | + if (!empty($board['last_post']['id'])) { |
|
| 133 | + echo ' |
|
| 130 | 134 | <p>', $board['last_post']['last_post_message'], '</p>'; |
| 135 | + } |
|
| 131 | 136 | echo ' |
| 132 | 137 | </div>'; |
| 133 | 138 | // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...) |
@@ -139,14 +144,16 @@ discard block |
||
| 139 | 144 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
| 140 | 145 | foreach ($board['children'] as $child) |
| 141 | 146 | { |
| 142 | - if (!$child['is_redirect']) |
|
| 143 | - $child['link'] = '<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'] . ($child['new'] ? '</a> <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>'; |
|
| 144 | - else |
|
| 145 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
| 147 | + if (!$child['is_redirect']) { |
|
| 148 | + $child['link'] = '<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'] . ($child['new'] ? '</a> <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>'; |
|
| 149 | + } else { |
|
| 150 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
|
| 151 | + } |
|
| 146 | 152 | |
| 147 | 153 | // Has it posts awaiting approval? |
| 148 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) |
|
| 149 | - $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>'; |
|
| 154 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) { |
|
| 155 | + $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>'; |
|
| 156 | + } |
|
| 150 | 157 | |
| 151 | 158 | $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link']; |
| 152 | 159 | } |
@@ -170,10 +177,11 @@ discard block |
||
| 170 | 177 | </div>'; |
| 171 | 178 | |
| 172 | 179 | // Show the mark all as read button? |
| 173 | - if ($context['user']['is_logged'] && !empty($context['categories'])) |
|
| 174 | - echo ' |
|
| 180 | + if ($context['user']['is_logged'] && !empty($context['categories'])) { |
|
| 181 | + echo ' |
|
| 175 | 182 | <div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>'; |
| 176 | -} |
|
| 183 | + } |
|
| 184 | + } |
|
| 177 | 185 | |
| 178 | 186 | /** |
| 179 | 187 | * The lower part of the outer layer of the board index |
@@ -190,8 +198,9 @@ discard block |
||
| 190 | 198 | { |
| 191 | 199 | global $context, $options, $txt; |
| 192 | 200 | |
| 193 | - if (empty($context['info_center'])) |
|
| 194 | - return; |
|
| 201 | + if (empty($context['info_center'])) { |
|
| 202 | + return; |
|
| 203 | + } |
|
| 195 | 204 | |
| 196 | 205 | // Here's where the "Info Center" starts... |
| 197 | 206 | echo ' |
@@ -291,14 +300,15 @@ discard block |
||
| 291 | 300 | /* Each post in latest_posts has: |
| 292 | 301 | board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.), |
| 293 | 302 | subject, short_subject (shortened with...), time, link, and href. */ |
| 294 | - foreach ($context['latest_posts'] as $post) |
|
| 295 | - echo ' |
|
| 303 | + foreach ($context['latest_posts'] as $post) { |
|
| 304 | + echo ' |
|
| 296 | 305 | <tr class="windowbg"> |
| 297 | 306 | <td class="recentpost"><strong>', $post['link'], '</strong></td> |
| 298 | 307 | <td class="recentposter">', $post['poster']['link'], '</td> |
| 299 | 308 | <td class="recentboard">', $post['board']['link'], '</td> |
| 300 | 309 | <td class="recenttime">', $post['time'], '</td> |
| 301 | 310 | </tr>'; |
| 311 | + } |
|
| 302 | 312 | echo ' |
| 303 | 313 | </table>'; |
| 304 | 314 | } |
@@ -322,9 +332,10 @@ discard block |
||
| 322 | 332 | </div>'; |
| 323 | 333 | |
| 324 | 334 | // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P. |
| 325 | - if (!empty($context['calendar_holidays'])) |
|
| 326 | - echo ' |
|
| 335 | + if (!empty($context['calendar_holidays'])) { |
|
| 336 | + echo ' |
|
| 327 | 337 | <p class="inline holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), '</p>'; |
| 338 | + } |
|
| 328 | 339 | |
| 329 | 340 | // People's birthdays. Like mine. And yours, I guess. Kidding. |
| 330 | 341 | if (!empty($context['calendar_birthdays'])) |
@@ -333,9 +344,10 @@ discard block |
||
| 333 | 344 | <p class="inline"> |
| 334 | 345 | <span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>'; |
| 335 | 346 | // 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?) |
| 336 | - foreach ($context['calendar_birthdays'] as $member) |
|
| 337 | - echo ' |
|
| 347 | + foreach ($context['calendar_birthdays'] as $member) { |
|
| 348 | + echo ' |
|
| 338 | 349 | <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'] ? '' : ', '; |
| 350 | + } |
|
| 339 | 351 | echo ' |
| 340 | 352 | </p>'; |
| 341 | 353 | } |
@@ -349,9 +361,10 @@ discard block |
||
| 349 | 361 | |
| 350 | 362 | // Each event in calendar_events should have: |
| 351 | 363 | // title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. |
| 352 | - foreach ($context['calendar_events'] as $event) |
|
| 353 | - echo ' |
|
| 364 | + foreach ($context['calendar_events'] as $event) { |
|
| 365 | + echo ' |
|
| 354 | 366 | ', $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>' : ', '; |
| 367 | + } |
|
| 355 | 368 | echo ' |
| 356 | 369 | </p>'; |
| 357 | 370 | } |
@@ -396,15 +409,19 @@ discard block |
||
| 396 | 409 | |
| 397 | 410 | // Handle hidden users and buddies. |
| 398 | 411 | $bracketList = array(); |
| 399 | - if ($context['show_buddies']) |
|
| 400 | - $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
| 401 | - if (!empty($context['num_spiders'])) |
|
| 402 | - $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
| 403 | - if (!empty($context['num_users_hidden'])) |
|
| 404 | - $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
| 412 | + if ($context['show_buddies']) { |
|
| 413 | + $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); |
|
| 414 | + } |
|
| 415 | + if (!empty($context['num_spiders'])) { |
|
| 416 | + $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); |
|
| 417 | + } |
|
| 418 | + if (!empty($context['num_users_hidden'])) { |
|
| 419 | + $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']); |
|
| 420 | + } |
|
| 405 | 421 | |
| 406 | - if (!empty($bracketList)) |
|
| 407 | - echo ' (' . implode(', ', $bracketList) . ')'; |
|
| 422 | + if (!empty($bracketList)) { |
|
| 423 | + echo ' (' . implode(', ', $bracketList) . ')'; |
|
| 424 | + } |
|
| 408 | 425 | |
| 409 | 426 | echo $context['show_who'] ? '</a>' : '', ' |
| 410 | 427 | |
@@ -418,9 +435,10 @@ discard block |
||
| 418 | 435 | ', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']); |
| 419 | 436 | |
| 420 | 437 | // Showing membergroups? |
| 421 | - if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) |
|
| 422 | - echo ' |
|
| 438 | + if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) { |
|
| 439 | + echo ' |
|
| 423 | 440 | <span class="membergroups">' . implode(', ', $context['membergroups']). '</span>'; |
| 441 | + } |
|
| 424 | 442 | } |
| 425 | 443 | |
| 426 | 444 | echo ' |
@@ -18,9 +18,10 @@ discard block |
||
| 18 | 18 | global $context, $txt, $scripturl; |
| 19 | 19 | |
| 20 | 20 | // Are we done sending the newsletter? |
| 21 | - if (!empty($context['newsletter_sent'])) |
|
| 22 | - echo ' |
|
| 21 | + if (!empty($context['newsletter_sent'])) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="infobox">', $txt['admin_news_newsletter_'. $context['newsletter_sent']] ,'</div>'; |
| 24 | + } |
|
| 24 | 25 | |
| 25 | 26 | echo ' |
| 26 | 27 | <div id="admincenter"> |
@@ -39,9 +40,10 @@ discard block |
||
| 39 | 40 | </dt> |
| 40 | 41 | <dd>'; |
| 41 | 42 | |
| 42 | - foreach ($context['groups'] as $group) |
|
| 43 | - echo ' |
|
| 43 | + foreach ($context['groups'] as $group) { |
|
| 44 | + echo ' |
|
| 44 | 45 | <label for="groups_', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
| 46 | + } |
|
| 45 | 47 | |
| 46 | 48 | echo ' |
| 47 | 49 | <br> |
@@ -86,9 +88,10 @@ discard block |
||
| 86 | 88 | </dt> |
| 87 | 89 | <dd>'; |
| 88 | 90 | |
| 89 | - foreach ($context['groups'] as $group) |
|
| 90 | - echo ' |
|
| 91 | + foreach ($context['groups'] as $group) { |
|
| 92 | + echo ' |
|
| 91 | 93 | <label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '" class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
| 94 | + } |
|
| 92 | 95 | |
| 93 | 96 | echo ' |
| 94 | 97 | <br> |
@@ -233,9 +236,10 @@ discard block |
||
| 233 | 236 | <div id="bbcBox_message"></div>'; |
| 234 | 237 | |
| 235 | 238 | // What about smileys? |
| 236 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
| 237 | - echo ' |
|
| 239 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
| 240 | + echo ' |
|
| 238 | 241 | <div id="smileyBox_message"></div>'; |
| 242 | + } |
|
| 239 | 243 | |
| 240 | 244 | // Show BBC buttons, smileys and textbox. |
| 241 | 245 | echo ' |
@@ -256,9 +260,10 @@ discard block |
||
| 256 | 260 | <input type="hidden" name="email_force" value="', $context['email_force'], '"> |
| 257 | 261 | <input type="hidden" name="total_emails" value="', $context['total_emails'], '">'; |
| 258 | 262 | |
| 259 | - foreach ($context['recipients'] as $key => $values) |
|
| 260 | - echo ' |
|
| 263 | + foreach ($context['recipients'] as $key => $values) { |
|
| 264 | + echo ' |
|
| 261 | 265 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
| 266 | + } |
|
| 262 | 267 | |
| 263 | 268 | echo ' |
| 264 | 269 | <script>'; |
@@ -413,9 +418,10 @@ discard block |
||
| 413 | 418 | <input type="hidden" name="parse_html" value="', $context['parse_html'], '">'; |
| 414 | 419 | |
| 415 | 420 | // All the things we must remember! |
| 416 | - foreach ($context['recipients'] as $key => $values) |
|
| 417 | - echo ' |
|
| 421 | + foreach ($context['recipients'] as $key => $values) { |
|
| 422 | + echo ' |
|
| 418 | 423 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
| 424 | + } |
|
| 419 | 425 | |
| 420 | 426 | echo ' |
| 421 | 427 | </div> |
@@ -448,9 +454,10 @@ discard block |
||
| 448 | 454 | { |
| 449 | 455 | global $context, $txt; |
| 450 | 456 | |
| 451 | - if (!empty($context['saved_successful'])) |
|
| 452 | - echo ' |
|
| 457 | + if (!empty($context['saved_successful'])) { |
|
| 458 | + echo ' |
|
| 453 | 459 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 460 | + } |
|
| 454 | 461 | |
| 455 | 462 | template_show_list('news_lists'); |
| 456 | 463 | } |
@@ -39,8 +39,9 @@ discard block |
||
| 39 | 39 | foreach ($section['areas'] as $i => $area) |
| 40 | 40 | { |
| 41 | 41 | // Not supposed to be printed? |
| 42 | - if (empty($area['label'])) |
|
| 43 | - continue; |
|
| 42 | + if (empty($area['label'])) { |
|
| 43 | + continue; |
|
| 44 | + } |
|
| 44 | 45 | |
| 45 | 46 | echo ' |
| 46 | 47 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '>'; |
@@ -49,8 +50,9 @@ discard block |
||
| 49 | 50 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
| 50 | 51 | |
| 51 | 52 | // Is this the current area, or just some area? |
| 52 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
| 53 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
| 53 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
| 54 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
| 55 | + } |
|
| 54 | 56 | |
| 55 | 57 | // Are there any subsections? |
| 56 | 58 | if (!empty($area['subsections'])) |
@@ -60,8 +62,9 @@ discard block |
||
| 60 | 62 | |
| 61 | 63 | foreach ($area['subsections'] as $sa => $sub) |
| 62 | 64 | { |
| 63 | - if (!empty($sub['disabled'])) |
|
| 64 | - continue; |
|
| 65 | + if (!empty($sub['disabled'])) { |
|
| 66 | + continue; |
|
| 67 | + } |
|
| 65 | 68 | |
| 66 | 69 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
| 67 | 70 | |
@@ -125,8 +128,9 @@ discard block |
||
| 125 | 128 | <h3 class="catbg">'; |
| 126 | 129 | |
| 127 | 130 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
| 128 | - if (function_exists('template_admin_quick_search')) |
|
| 129 | - template_admin_quick_search(); |
|
| 131 | + if (function_exists('template_admin_quick_search')) { |
|
| 132 | + template_admin_quick_search(); |
|
| 133 | + } |
|
| 130 | 134 | |
| 131 | 135 | // Exactly how many tabs do we have? |
| 132 | 136 | if (!empty($context['tabs'])) |
@@ -141,30 +145,36 @@ discard block |
||
| 141 | 145 | } |
| 142 | 146 | |
| 143 | 147 | // Did this not even exist - or do we not have a label? |
| 144 | - if (!isset($tab_context['tabs'][$id])) |
|
| 145 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
| 146 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
| 147 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
| 148 | + if (!isset($tab_context['tabs'][$id])) { |
|
| 149 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
| 150 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
| 151 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
| 152 | + } |
|
| 148 | 153 | |
| 149 | 154 | // Has a custom URL defined in the main admin structure? |
| 150 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
| 151 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
| 155 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
| 156 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
| 157 | + } |
|
| 152 | 158 | |
| 153 | 159 | // Any additional paramaters for the url? |
| 154 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
| 155 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
| 160 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
| 161 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
| 162 | + } |
|
| 156 | 163 | |
| 157 | 164 | // Has it been deemed selected? |
| 158 | - if (!empty($tab['is_selected'])) |
|
| 159 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
| 165 | + if (!empty($tab['is_selected'])) { |
|
| 166 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
| 167 | + } |
|
| 160 | 168 | |
| 161 | 169 | // Does it have its own help? |
| 162 | - if (!empty($tab['help'])) |
|
| 163 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
| 170 | + if (!empty($tab['help'])) { |
|
| 171 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
| 172 | + } |
|
| 164 | 173 | |
| 165 | 174 | // Is this the last one? |
| 166 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
| 167 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
| 175 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
| 176 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
| 177 | + } |
|
| 168 | 178 | } |
| 169 | 179 | |
| 170 | 180 | // Find the selected tab |
@@ -181,17 +191,18 @@ discard block |
||
| 181 | 191 | // Show an icon and/or a help item? |
| 182 | 192 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
| 183 | 193 | { |
| 184 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
| 185 | - echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
|
| 186 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
| 187 | - echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
|
| 194 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
| 195 | + echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
|
| 196 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
| 197 | + echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
|
| 198 | + } |
|
| 188 | 199 | |
| 189 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
| 190 | - echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>'; |
|
| 200 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
| 201 | + echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>'; |
|
| 202 | + } |
|
| 191 | 203 | |
| 192 | 204 | echo $tab_context['title']; |
| 193 | - } |
|
| 194 | - else |
|
| 205 | + } else |
|
| 195 | 206 | { |
| 196 | 207 | echo ' |
| 197 | 208 | ', $tab_context['title']; |
@@ -204,11 +215,12 @@ discard block |
||
| 204 | 215 | } |
| 205 | 216 | |
| 206 | 217 | // Shall we use the tabs? Yes, it's the only known way! |
| 207 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
| 208 | - echo ' |
|
| 218 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
| 219 | + echo ' |
|
| 209 | 220 | <p class="information"> |
| 210 | 221 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
| 211 | 222 | </p>'; |
| 223 | + } |
|
| 212 | 224 | |
| 213 | 225 | // Print out all the items in this tab (if any). |
| 214 | 226 | if (!empty($context['tabs'])) |
@@ -220,8 +232,9 @@ discard block |
||
| 220 | 232 | |
| 221 | 233 | foreach ($tab_context['tabs'] as $sa => $tab) |
| 222 | 234 | { |
| 223 | - if (!empty($tab['disabled'])) |
|
| 224 | - continue; |
|
| 235 | + if (!empty($tab['disabled'])) { |
|
| 236 | + continue; |
|
| 237 | + } |
|
| 225 | 238 | |
| 226 | 239 | if (!empty($tab['is_selected'])) |
| 227 | 240 | { |
@@ -229,12 +242,12 @@ discard block |
||
| 229 | 242 | <li> |
| 230 | 243 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
| 231 | 244 | </li>'; |
| 232 | - } |
|
| 233 | - else |
|
| 234 | - echo ' |
|
| 245 | + } else { |
|
| 246 | + echo ' |
|
| 235 | 247 | <li> |
| 236 | 248 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
| 237 | 249 | </li>'; |
| 250 | + } |
|
| 238 | 251 | } |
| 239 | 252 | |
| 240 | 253 | // the end of tabs |
@@ -54,8 +54,9 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | // Prepare the comments... |
| 56 | 56 | $comments = array(); |
| 57 | - foreach ($report['comments'] as $comment) |
|
| 58 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 57 | + foreach ($report['comments'] as $comment) { |
|
| 58 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | 61 | echo ' |
| 61 | 62 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -69,18 +70,21 @@ discard block |
||
| 69 | 70 | <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
| 70 | 71 | |
| 71 | 72 | // Delete message button. |
| 72 | - if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) |
|
| 73 | - echo ' |
|
| 73 | + if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) { |
|
| 74 | + echo ' |
|
| 74 | 75 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'] ,'.0;msg=', $report['topic']['id_msg'] ,';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'] ,'" class="you_sure">', $delete_button, '</a></li>'; |
| 76 | + } |
|
| 75 | 77 | |
| 76 | 78 | // Ban this user button. |
| 77 | - if (!$report['closed'] && !empty($context['report_manage_bans'])) |
|
| 78 | - echo ' |
|
| 79 | + if (!$report['closed'] && !empty($context['report_manage_bans'])) { |
|
| 80 | + echo ' |
|
| 79 | 81 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u='. $report['author']['id'] : ';msg='. $report['topic']['id_msg']) ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
| 82 | + } |
|
| 80 | 83 | |
| 81 | - if (!$context['view_closed']) |
|
| 82 | - echo ' |
|
| 84 | + if (!$context['view_closed']) { |
|
| 85 | + echo ' |
|
| 83 | 86 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check"></li>'; |
| 87 | + } |
|
| 84 | 88 | |
| 85 | 89 | echo ' |
| 86 | 90 | </ul> |
@@ -88,11 +92,12 @@ discard block |
||
| 88 | 92 | } |
| 89 | 93 | |
| 90 | 94 | // Were none found? |
| 91 | - if (empty($context['reports'])) |
|
| 92 | - echo ' |
|
| 95 | + if (empty($context['reports'])) { |
|
| 96 | + echo ' |
|
| 93 | 97 | <div class="windowbg2"> |
| 94 | 98 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
| 95 | 99 | </div>'; |
| 100 | + } |
|
| 96 | 101 | |
| 97 | 102 | echo ' |
| 98 | 103 | <div class="pagesection"> |
@@ -125,18 +130,20 @@ discard block |
||
| 125 | 130 | <div class="modbox"> |
| 126 | 131 | <ul>'; |
| 127 | 132 | |
| 128 | - foreach ($context['reported_posts'] as $report) |
|
| 129 | - echo ' |
|
| 133 | + foreach ($context['reported_posts'] as $report) { |
|
| 134 | + echo ' |
|
| 130 | 135 | <li class="smalltext"> |
| 131 | 136 | <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], ' |
| 132 | 137 | </li>'; |
| 138 | + } |
|
| 133 | 139 | |
| 134 | 140 | // Don't have any watched users right now? |
| 135 | - if (empty($context['reported_posts'])) |
|
| 136 | - echo ' |
|
| 141 | + if (empty($context['reported_posts'])) { |
|
| 142 | + echo ' |
|
| 137 | 143 | <li> |
| 138 | 144 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
| 139 | 145 | </li>'; |
| 146 | + } |
|
| 140 | 147 | |
| 141 | 148 | echo ' |
| 142 | 149 | </ul> |
@@ -226,12 +233,13 @@ discard block |
||
| 226 | 233 | <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3> |
| 227 | 234 | </div>'; |
| 228 | 235 | |
| 229 | - foreach ($context['report']['comments'] as $comment) |
|
| 230 | - echo ' |
|
| 236 | + foreach ($context['report']['comments'] as $comment) { |
|
| 237 | + echo ' |
|
| 231 | 238 | <div class="windowbg"> |
| 232 | 239 | <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p> |
| 233 | 240 | <p>', $comment['message'], '</p> |
| 234 | 241 | </div>'; |
| 242 | + } |
|
| 235 | 243 | |
| 236 | 244 | echo ' |
| 237 | 245 | <br> |
@@ -240,11 +248,12 @@ discard block |
||
| 240 | 248 | </div> |
| 241 | 249 | <div>'; |
| 242 | 250 | |
| 243 | - if (empty($context['report']['mod_comments'])) |
|
| 244 | - echo ' |
|
| 251 | + if (empty($context['report']['mod_comments'])) { |
|
| 252 | + echo ' |
|
| 245 | 253 | <div class="information"> |
| 246 | 254 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
| 247 | 255 | </div>'; |
| 256 | + } |
|
| 248 | 257 | |
| 249 | 258 | foreach ($context['report']['mod_comments'] as $comment) |
| 250 | 259 | { |
@@ -334,18 +343,20 @@ discard block |
||
| 334 | 343 | <div class="modbox"> |
| 335 | 344 | <ul>'; |
| 336 | 345 | |
| 337 | - foreach ($context['reported_members'] as $report) |
|
| 338 | - echo ' |
|
| 346 | + foreach ($context['reported_members'] as $report) { |
|
| 347 | + echo ' |
|
| 339 | 348 | <li class="smalltext"> |
| 340 | 349 | <a href="', $report['report_href'], '">', $report['user_name'], '</a> |
| 341 | 350 | </li>'; |
| 351 | + } |
|
| 342 | 352 | |
| 343 | 353 | // Don't have any reported members right now? |
| 344 | - if (empty($context['reported_members'])) |
|
| 345 | - echo ' |
|
| 354 | + if (empty($context['reported_members'])) { |
|
| 355 | + echo ' |
|
| 346 | 356 | <li> |
| 347 | 357 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
| 348 | 358 | </li>'; |
| 359 | + } |
|
| 349 | 360 | |
| 350 | 361 | echo ' |
| 351 | 362 | </ul> |
@@ -431,8 +442,9 @@ discard block |
||
| 431 | 442 | |
| 432 | 443 | // Prepare the comments... |
| 433 | 444 | $comments = array(); |
| 434 | - foreach ($report['comments'] as $comment) |
|
| 435 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 445 | + foreach ($report['comments'] as $comment) { |
|
| 446 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
| 447 | + } |
|
| 436 | 448 | |
| 437 | 449 | echo ' |
| 438 | 450 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -444,13 +456,15 @@ discard block |
||
| 444 | 456 | <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
| 445 | 457 | |
| 446 | 458 | // Ban this user button. |
| 447 | - if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) |
|
| 448 | - echo ' |
|
| 459 | + if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) { |
|
| 460 | + echo ' |
|
| 449 | 461 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'] ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
| 462 | + } |
|
| 450 | 463 | |
| 451 | - if (!$context['view_closed']) |
|
| 452 | - echo ' |
|
| 464 | + if (!$context['view_closed']) { |
|
| 465 | + echo ' |
|
| 453 | 466 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check"></li>'; |
| 467 | + } |
|
| 454 | 468 | |
| 455 | 469 | echo ' |
| 456 | 470 | </ul> |
@@ -458,11 +472,12 @@ discard block |
||
| 458 | 472 | } |
| 459 | 473 | |
| 460 | 474 | // Were none found? |
| 461 | - if (empty($context['reports'])) |
|
| 462 | - echo ' |
|
| 475 | + if (empty($context['reports'])) { |
|
| 476 | + echo ' |
|
| 463 | 477 | <div class="windowbg2"> |
| 464 | 478 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
| 465 | 479 | </div>'; |
| 480 | + } |
|
| 466 | 481 | |
| 467 | 482 | echo ' |
| 468 | 483 | <div class="pagesection"> |
@@ -522,12 +537,13 @@ discard block |
||
| 522 | 537 | <h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3> |
| 523 | 538 | </div>'; |
| 524 | 539 | |
| 525 | - foreach ($context['report']['comments'] as $comment) |
|
| 526 | - echo ' |
|
| 540 | + foreach ($context['report']['comments'] as $comment) { |
|
| 541 | + echo ' |
|
| 527 | 542 | <div class="windowbg"> |
| 528 | 543 | <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p> |
| 529 | 544 | <p>', $comment['message'], '</p> |
| 530 | 545 | </div>'; |
| 546 | + } |
|
| 531 | 547 | |
| 532 | 548 | echo ' |
| 533 | 549 | <br> |
@@ -536,11 +552,12 @@ discard block |
||
| 536 | 552 | </div> |
| 537 | 553 | <div>'; |
| 538 | 554 | |
| 539 | - if (empty($context['report']['mod_comments'])) |
|
| 540 | - echo ' |
|
| 555 | + if (empty($context['report']['mod_comments'])) { |
|
| 556 | + echo ' |
|
| 541 | 557 | <div class="information"> |
| 542 | 558 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
| 543 | 559 | </div>'; |
| 560 | + } |
|
| 544 | 561 | |
| 545 | 562 | foreach ($context['report']['mod_comments'] as $comment) |
| 546 | 563 | { |
@@ -21,26 +21,30 @@ discard block |
||
| 21 | 21 | |
| 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 | - if (empty($list_id) || empty($context[$list_id])) |
|
| 25 | - return; |
|
| 24 | + if (empty($list_id) || empty($context[$list_id])) { |
|
| 25 | + return; |
|
| 26 | + } |
|
| 26 | 27 | $cur_list = &$context[$list_id]; |
| 27 | 28 | |
| 28 | 29 | // These are the main tabs that is used all around the template. |
| 29 | - 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')) |
|
| 30 | - template_create_list_menu($cur_list['list_menu'], 'top'); |
|
| 30 | + 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')) { |
|
| 31 | + template_create_list_menu($cur_list['list_menu'], 'top'); |
|
| 32 | + } |
|
| 31 | 33 | |
| 32 | - if (isset($cur_list['form'])) |
|
| 33 | - echo ' |
|
| 34 | + if (isset($cur_list['form'])) { |
|
| 35 | + echo ' |
|
| 34 | 36 | <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'], '">'; |
| 37 | + } |
|
| 35 | 38 | |
| 36 | 39 | // Show the title of the table (if any). |
| 37 | - if (!empty($cur_list['title'])) |
|
| 38 | - echo ' |
|
| 40 | + if (!empty($cur_list['title'])) { |
|
| 41 | + echo ' |
|
| 39 | 42 | <div class="cat_bar clear_right"> |
| 40 | 43 | <h3 class="catbg"> |
| 41 | 44 | ', $cur_list['title'], ' |
| 42 | 45 | </h3> |
| 43 | 46 | </div>'; |
| 47 | + } |
|
| 44 | 48 | |
| 45 | 49 | if (isset($cur_list['additional_rows']['after_title'])) |
| 46 | 50 | { |
@@ -51,20 +55,23 @@ discard block |
||
| 51 | 55 | </div>'; |
| 52 | 56 | } |
| 53 | 57 | |
| 54 | - if (isset($cur_list['additional_rows']['top_of_list'])) |
|
| 55 | - template_additional_rows('top_of_list', $cur_list); |
|
| 58 | + if (isset($cur_list['additional_rows']['top_of_list'])) { |
|
| 59 | + template_additional_rows('top_of_list', $cur_list); |
|
| 60 | + } |
|
| 56 | 61 | |
| 57 | 62 | if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers'])) |
| 58 | 63 | { |
| 59 | 64 | // Show the page index (if this list doesn't intend to show all items). |
| 60 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
| 61 | - echo ' |
|
| 65 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
| 66 | + echo ' |
|
| 62 | 67 | <div class="floatleft"> |
| 63 | 68 | <div class="pagesection">', $cur_list['page_index'], '</div> |
| 64 | 69 | </div>'; |
| 70 | + } |
|
| 65 | 71 | |
| 66 | - if (isset($cur_list['additional_rows']['above_column_headers'])) |
|
| 67 | - template_additional_rows('above_column_headers', $cur_list); |
|
| 72 | + if (isset($cur_list['additional_rows']['above_column_headers'])) { |
|
| 73 | + template_additional_rows('above_column_headers', $cur_list); |
|
| 74 | + } |
|
| 68 | 75 | } |
| 69 | 76 | |
| 70 | 77 | echo ' |
@@ -94,11 +101,12 @@ discard block |
||
| 94 | 101 | <tbody>'; |
| 95 | 102 | |
| 96 | 103 | // Show a nice message informing there are no items in this list. |
| 97 | - if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) |
|
| 98 | - echo ' |
|
| 104 | + if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) { |
|
| 105 | + echo ' |
|
| 99 | 106 | <tr class="windowbg"> |
| 100 | 107 | <td colspan="', $cur_list['num_columns'], '" class="', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'centertext', '"><div class="padding">', $cur_list['no_items_label'], '</div></td> |
| 101 | 108 | </tr>'; |
| 109 | + } |
|
| 102 | 110 | |
| 103 | 111 | // Show the list rows. |
| 104 | 112 | elseif (!empty($cur_list['rows'])) |
@@ -108,10 +116,11 @@ discard block |
||
| 108 | 116 | echo ' |
| 109 | 117 | <tr class="windowbg', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', ' id="list_', $list_id, '_', $id, '">'; |
| 110 | 118 | |
| 111 | - if (!empty($row['data'])) |
|
| 112 | - foreach ($row['data'] as $row_data) |
|
| 119 | + if (!empty($row['data'])) { |
|
| 120 | + foreach ($row['data'] as $row_data) |
|
| 113 | 121 | echo ' |
| 114 | 122 | <td', empty($row_data['class']) ? '' : ' class="' . $row_data['class'] . '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '>', $row_data['value'], '</td>'; |
| 123 | + } |
|
| 115 | 124 | |
| 116 | 125 | echo ' |
| 117 | 126 | </tr>'; |
@@ -128,46 +137,53 @@ discard block |
||
| 128 | 137 | <div class="flow_auto">'; |
| 129 | 138 | |
| 130 | 139 | // Show the page index (if this list doesn't intend to show all items). |
| 131 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
| 132 | - echo ' |
|
| 140 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
| 141 | + echo ' |
|
| 133 | 142 | <div class="floatleft"> |
| 134 | 143 | <div class="pagesection">', $cur_list['page_index'], '</div> |
| 135 | 144 | </div>'; |
| 145 | + } |
|
| 136 | 146 | |
| 137 | - if (isset($cur_list['additional_rows']['below_table_data'])) |
|
| 138 | - template_additional_rows('below_table_data', $cur_list); |
|
| 147 | + if (isset($cur_list['additional_rows']['below_table_data'])) { |
|
| 148 | + template_additional_rows('below_table_data', $cur_list); |
|
| 149 | + } |
|
| 139 | 150 | |
| 140 | 151 | echo ' |
| 141 | 152 | </div>'; |
| 142 | 153 | } |
| 143 | 154 | |
| 144 | - if (isset($cur_list['additional_rows']['bottom_of_list'])) |
|
| 145 | - template_additional_rows('bottom_of_list', $cur_list); |
|
| 155 | + if (isset($cur_list['additional_rows']['bottom_of_list'])) { |
|
| 156 | + template_additional_rows('bottom_of_list', $cur_list); |
|
| 157 | + } |
|
| 146 | 158 | |
| 147 | 159 | if (isset($cur_list['form'])) |
| 148 | 160 | { |
| 149 | - foreach ($cur_list['form']['hidden_fields'] as $name => $value) |
|
| 150 | - echo ' |
|
| 161 | + foreach ($cur_list['form']['hidden_fields'] as $name => $value) { |
|
| 162 | + echo ' |
|
| 151 | 163 | <input type="hidden" name="', $name, '" value="', $value, '">'; |
| 164 | + } |
|
| 152 | 165 | |
| 153 | - if (isset($cur_list['form']['token'])) |
|
| 154 | - echo ' |
|
| 166 | + if (isset($cur_list['form']['token'])) { |
|
| 167 | + echo ' |
|
| 155 | 168 | <input type="hidden" name="', $context[$cur_list['form']['token'] . '_token_var'], '" value="', $context[$cur_list['form']['token'] . '_token'], '">'; |
| 169 | + } |
|
| 156 | 170 | |
| 157 | 171 | echo ' |
| 158 | 172 | </form>'; |
| 159 | 173 | } |
| 160 | 174 | |
| 161 | 175 | // Tabs at the bottom. Usually bottom aligned. |
| 162 | - 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')) |
|
| 163 | - template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
| 176 | + 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')) { |
|
| 177 | + template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
| 178 | + } |
|
| 164 | 179 | |
| 165 | - if (isset($cur_list['javascript'])) |
|
| 166 | - echo ' |
|
| 180 | + if (isset($cur_list['javascript'])) { |
|
| 181 | + echo ' |
|
| 167 | 182 | <script> |
| 168 | 183 | ', $cur_list['javascript'], ' |
| 169 | 184 | </script>'; |
| 170 | -} |
|
| 185 | + } |
|
| 186 | + } |
|
| 171 | 187 | |
| 172 | 188 | /** |
| 173 | 189 | * This template displays additional rows above or below the list. |
@@ -177,10 +193,11 @@ discard block |
||
| 177 | 193 | */ |
| 178 | 194 | function template_additional_rows($row_position, $cur_list) |
| 179 | 195 | { |
| 180 | - foreach ($cur_list['additional_rows'][$row_position] as $row) |
|
| 181 | - echo ' |
|
| 196 | + foreach ($cur_list['additional_rows'][$row_position] as $row) { |
|
| 197 | + echo ' |
|
| 182 | 198 | <div class="additional_row', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', '>', $row['value'], '</div>'; |
| 183 | -} |
|
| 199 | + } |
|
| 200 | + } |
|
| 184 | 201 | |
| 185 | 202 | /** |
| 186 | 203 | * This function creates a menu |
@@ -239,18 +256,19 @@ discard block |
||
| 239 | 256 | |
| 240 | 257 | foreach ($list_menu['links'] as $link) |
| 241 | 258 | { |
| 242 | - if ($link['is_selected']) |
|
| 243 | - echo ' |
|
| 259 | + if ($link['is_selected']) { |
|
| 260 | + echo ' |
|
| 244 | 261 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $first, '"> </td> |
| 245 | 262 | <td class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back"> |
| 246 | 263 | <a href="', $link['href'], '">', $link['label'], '</a> |
| 247 | 264 | </td> |
| 248 | 265 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $last, '"> </td>'; |
| 249 | - else |
|
| 250 | - echo ' |
|
| 266 | + } else { |
|
| 267 | + echo ' |
|
| 251 | 268 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back"> |
| 252 | 269 | <a href="', $link['href'], '">', $link['label'], '</a> |
| 253 | 270 | </td>'; |
| 271 | + } |
|
| 254 | 272 | } |
| 255 | 273 | |
| 256 | 274 | echo ' |
@@ -261,12 +279,12 @@ discard block |
||
| 261 | 279 | <td> </td>' : '', ' |
| 262 | 280 | </tr> |
| 263 | 281 | </table>'; |
| 264 | - } |
|
| 265 | - elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
| 282 | + } elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
| 266 | 283 | { |
| 267 | 284 | $links = array(); |
| 268 | - foreach ($list_menu['links'] as $link) |
|
| 269 | - $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
| 285 | + foreach ($list_menu['links'] as $link) { |
|
| 286 | + $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
| 287 | + } |
|
| 270 | 288 | |
| 271 | 289 | echo ' |
| 272 | 290 | <table style="margin-', $list_menu['position'], ': 10px; width: 100%;"> |
@@ -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> |
@@ -83,16 +84,18 @@ 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 | - if (!empty($item['icon_file'])) |
|
| 91 | - echo ' |
|
| 92 | + if (!empty($item['icon_file'])) { |
|
| 93 | + echo ' |
|
| 92 | 94 | <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>'; |
| 93 | - else |
|
| 94 | - echo ' |
|
| 95 | + } else { |
|
| 96 | + echo ' |
|
| 95 | 97 | <a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>'; |
| 98 | + } |
|
| 96 | 99 | } |
| 97 | 100 | |
| 98 | 101 | echo ' |
@@ -103,10 +106,11 @@ discard block |
||
| 103 | 106 | </div>'; |
| 104 | 107 | |
| 105 | 108 | // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization. |
| 106 | - if (empty($modSettings['disable_smf_js'])) |
|
| 107 | - echo ' |
|
| 109 | + if (empty($modSettings['disable_smf_js'])) { |
|
| 110 | + echo ' |
|
| 108 | 111 | <script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script> |
| 109 | 112 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
| 113 | + } |
|
| 110 | 114 | |
| 111 | 115 | // This sets the announcements and current versions themselves ;). |
| 112 | 116 | echo ' |
@@ -185,9 +189,10 @@ discard block |
||
| 185 | 189 | <em>', $version['version'], '</em>'; |
| 186 | 190 | |
| 187 | 191 | // more details for this item, show them a link |
| 188 | - if ($context['can_admin'] && isset($version['more'])) |
|
| 189 | - echo |
|
| 192 | + if ($context['can_admin'] && isset($version['more'])) { |
|
| 193 | + echo |
|
| 190 | 194 | ' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>'; |
| 195 | + } |
|
| 191 | 196 | echo ' |
| 192 | 197 | <br>'; |
| 193 | 198 | } |
@@ -218,20 +223,22 @@ discard block |
||
| 218 | 223 | |
| 219 | 224 | foreach ($context['credits'] as $section) |
| 220 | 225 | { |
| 221 | - if (isset($section['pretext'])) |
|
| 222 | - echo ' |
|
| 226 | + if (isset($section['pretext'])) { |
|
| 227 | + echo ' |
|
| 223 | 228 | <p>', $section['pretext'], '</p><hr>'; |
| 229 | + } |
|
| 224 | 230 | |
| 225 | 231 | echo ' |
| 226 | 232 | <dl>'; |
| 227 | 233 | |
| 228 | 234 | foreach ($section['groups'] as $group) |
| 229 | 235 | { |
| 230 | - if (isset($group['title'])) |
|
| 231 | - echo ' |
|
| 236 | + if (isset($group['title'])) { |
|
| 237 | + echo ' |
|
| 232 | 238 | <dt> |
| 233 | 239 | <strong>', $group['title'], ':</strong> |
| 234 | 240 | </dt>'; |
| 241 | + } |
|
| 235 | 242 | |
| 236 | 243 | echo ' |
| 237 | 244 | <dd>', implode(', ', $group['members']), '</dd>'; |
@@ -240,10 +247,11 @@ discard block |
||
| 240 | 247 | echo ' |
| 241 | 248 | </dl>'; |
| 242 | 249 | |
| 243 | - if (isset($section['posttext'])) |
|
| 244 | - echo ' |
|
| 250 | + if (isset($section['posttext'])) { |
|
| 251 | + echo ' |
|
| 245 | 252 | <hr> |
| 246 | 253 | <p>', $section['posttext'], '</p>'; |
| 254 | + } |
|
| 247 | 255 | } |
| 248 | 256 | |
| 249 | 257 | echo ' |
@@ -259,9 +267,10 @@ discard block |
||
| 259 | 267 | smfSupportVersions.forum = "', $context['forum_version'], '";'; |
| 260 | 268 | |
| 261 | 269 | // Don't worry, none of this is logged, it's just used to give information that might be of use. |
| 262 | - foreach ($context['current_versions'] as $variable => $version) |
|
| 263 | - echo ' |
|
| 270 | + foreach ($context['current_versions'] as $variable => $version) { |
|
| 271 | + echo ' |
|
| 264 | 272 | smfSupportVersions.', $variable, ' = "', $version['version'], '";'; |
| 273 | + } |
|
| 265 | 274 | |
| 266 | 275 | // Now we just have to include the script and wait ;). |
| 267 | 276 | echo ' |
@@ -358,8 +367,8 @@ discard block |
||
| 358 | 367 | <tbody>'; |
| 359 | 368 | |
| 360 | 369 | // Loop through every source file displaying its version - using javascript. |
| 361 | - foreach ($context['file_versions'] as $filename => $version) |
|
| 362 | - echo ' |
|
| 370 | + foreach ($context['file_versions'] as $filename => $version) { |
|
| 371 | + echo ' |
|
| 363 | 372 | <tr class="windowbg"> |
| 364 | 373 | <td class="half_table"> |
| 365 | 374 | ', $filename, ' |
@@ -371,6 +380,7 @@ discard block |
||
| 371 | 380 | <em id="currentSources', $filename, '">??</em> |
| 372 | 381 | </td> |
| 373 | 382 | </tr>'; |
| 383 | + } |
|
| 374 | 384 | |
| 375 | 385 | // Default template files. |
| 376 | 386 | echo ' |
@@ -396,8 +406,8 @@ discard block |
||
| 396 | 406 | <table id="Default" class="table_grid"> |
| 397 | 407 | <tbody>'; |
| 398 | 408 | |
| 399 | - foreach ($context['default_template_versions'] as $filename => $version) |
|
| 400 | - echo ' |
|
| 409 | + foreach ($context['default_template_versions'] as $filename => $version) { |
|
| 410 | + echo ' |
|
| 401 | 411 | <tr class="windowbg"> |
| 402 | 412 | <td class="half_table"> |
| 403 | 413 | ', $filename, ' |
@@ -409,6 +419,7 @@ discard block |
||
| 409 | 419 | <em id="currentDefault', $filename, '">??</em> |
| 410 | 420 | </td> |
| 411 | 421 | </tr>'; |
| 422 | + } |
|
| 412 | 423 | |
| 413 | 424 | // Now the language files... |
| 414 | 425 | echo ' |
@@ -436,8 +447,8 @@ discard block |
||
| 436 | 447 | |
| 437 | 448 | foreach ($context['default_language_versions'] as $language => $files) |
| 438 | 449 | { |
| 439 | - foreach ($files as $filename => $version) |
|
| 440 | - echo ' |
|
| 450 | + foreach ($files as $filename => $version) { |
|
| 451 | + echo ' |
|
| 441 | 452 | <tr class="windowbg"> |
| 442 | 453 | <td class="half_table"> |
| 443 | 454 | ', $filename, '.<em>', $language, '</em>.php |
@@ -449,6 +460,7 @@ discard block |
||
| 449 | 460 | <em id="current', $filename, '.', $language, '">??</em> |
| 450 | 461 | </td> |
| 451 | 462 | </tr>'; |
| 463 | + } |
|
| 452 | 464 | } |
| 453 | 465 | |
| 454 | 466 | echo ' |
@@ -478,8 +490,8 @@ discard block |
||
| 478 | 490 | <table id="Templates" class="table_grid"> |
| 479 | 491 | <tbody>'; |
| 480 | 492 | |
| 481 | - foreach ($context['template_versions'] as $filename => $version) |
|
| 482 | - echo ' |
|
| 493 | + foreach ($context['template_versions'] as $filename => $version) { |
|
| 494 | + echo ' |
|
| 483 | 495 | <tr class="windowbg"> |
| 484 | 496 | <td class="half_table"> |
| 485 | 497 | ', $filename, ' |
@@ -491,6 +503,7 @@ discard block |
||
| 491 | 503 | <em id="currentTemplates', $filename, '">??</em> |
| 492 | 504 | </td> |
| 493 | 505 | </tr>'; |
| 506 | + } |
|
| 494 | 507 | |
| 495 | 508 | echo ' |
| 496 | 509 | </tbody> |
@@ -520,8 +533,8 @@ discard block |
||
| 520 | 533 | <table id="Tasks" class="table_grid"> |
| 521 | 534 | <tbody>'; |
| 522 | 535 | |
| 523 | - foreach ($context['tasks_versions'] as $filename => $version) |
|
| 524 | - echo ' |
|
| 536 | + foreach ($context['tasks_versions'] as $filename => $version) { |
|
| 537 | + echo ' |
|
| 525 | 538 | <tr class="windowbg"> |
| 526 | 539 | <td class="half_table"> |
| 527 | 540 | ', $filename, ' |
@@ -533,6 +546,7 @@ discard block |
||
| 533 | 546 | <em id="currentTasks', $filename, '">??</em> |
| 534 | 547 | </td> |
| 535 | 548 | </tr>'; |
| 549 | + } |
|
| 536 | 550 | |
| 537 | 551 | echo ' |
| 538 | 552 | </tbody> |
@@ -574,9 +588,10 @@ discard block |
||
| 574 | 588 | { |
| 575 | 589 | global $context, $scripturl, $txt, $modSettings; |
| 576 | 590 | |
| 577 | - if (!empty($context['saved_successful'])) |
|
| 578 | - echo ' |
|
| 591 | + if (!empty($context['saved_successful'])) { |
|
| 592 | + echo ' |
|
| 579 | 593 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 594 | + } |
|
| 580 | 595 | |
| 581 | 596 | // First section is for adding/removing words from the censored list. |
| 582 | 597 | echo ' |
@@ -591,11 +606,12 @@ discard block |
||
| 591 | 606 | <p>', $txt['admin_censored_where'], '</p>'; |
| 592 | 607 | |
| 593 | 608 | // Show text boxes for censoring [bad ] => [good ]. |
| 594 | - foreach ($context['censored_words'] as $vulgar => $proper) |
|
| 595 | - echo ' |
|
| 609 | + foreach ($context['censored_words'] as $vulgar => $proper) { |
|
| 610 | + echo ' |
|
| 596 | 611 | <div class="block"> |
| 597 | 612 | <input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> => <input type="text" name="censor_proper[]" value="', $proper, '" size="30"> |
| 598 | 613 | </div>'; |
| 614 | + } |
|
| 599 | 615 | |
| 600 | 616 | // Now provide a way to censor more words. |
| 601 | 617 | echo ' |
@@ -670,19 +686,21 @@ discard block |
||
| 670 | 686 | <div class="windowbg"> |
| 671 | 687 | ', $txt['not_done_reason']; |
| 672 | 688 | |
| 673 | - if (!empty($context['continue_percent'])) |
|
| 674 | - echo ' |
|
| 689 | + if (!empty($context['continue_percent'])) { |
|
| 690 | + echo ' |
|
| 675 | 691 | <div class="progress_bar"> |
| 676 | 692 | <div class="full_bar">', $context['continue_percent'], '%</div> |
| 677 | 693 | <div class="green_percent" style="width: ', $context['continue_percent'], '%;"> </div> |
| 678 | 694 | </div>'; |
| 695 | + } |
|
| 679 | 696 | |
| 680 | - if (!empty($context['substep_enabled'])) |
|
| 681 | - echo ' |
|
| 697 | + if (!empty($context['substep_enabled'])) { |
|
| 698 | + echo ' |
|
| 682 | 699 | <div class="progress_bar"> |
| 683 | 700 | <div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div> |
| 684 | 701 | <div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;"> </div> |
| 685 | 702 | </div>'; |
| 703 | + } |
|
| 686 | 704 | |
| 687 | 705 | echo ' |
| 688 | 706 | <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit"> |
@@ -717,35 +735,40 @@ discard block |
||
| 717 | 735 | { |
| 718 | 736 | global $context, $txt, $settings, $scripturl; |
| 719 | 737 | |
| 720 | - if (!empty($context['saved_successful'])) |
|
| 721 | - echo ' |
|
| 738 | + if (!empty($context['saved_successful'])) { |
|
| 739 | + echo ' |
|
| 722 | 740 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 723 | - elseif (!empty($context['saved_failed'])) |
|
| 724 | - echo ' |
|
| 741 | + } elseif (!empty($context['saved_failed'])) { |
|
| 742 | + echo ' |
|
| 725 | 743 | <div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>'; |
| 744 | + } |
|
| 726 | 745 | |
| 727 | - if (!empty($context['settings_pre_javascript'])) |
|
| 728 | - echo ' |
|
| 746 | + if (!empty($context['settings_pre_javascript'])) { |
|
| 747 | + echo ' |
|
| 729 | 748 | <script>', $context['settings_pre_javascript'], '</script>'; |
| 749 | + } |
|
| 730 | 750 | |
| 731 | - if (!empty($context['settings_insert_above'])) |
|
| 732 | - echo $context['settings_insert_above']; |
|
| 751 | + if (!empty($context['settings_insert_above'])) { |
|
| 752 | + echo $context['settings_insert_above']; |
|
| 753 | + } |
|
| 733 | 754 | |
| 734 | 755 | echo ' |
| 735 | 756 | <div id="admincenter"> |
| 736 | 757 | <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'] . '"' : '', '>'; |
| 737 | 758 | |
| 738 | 759 | // Is there a custom title? |
| 739 | - if (isset($context['settings_title'])) |
|
| 740 | - echo ' |
|
| 760 | + if (isset($context['settings_title'])) { |
|
| 761 | + echo ' |
|
| 741 | 762 | <div class="cat_bar"> |
| 742 | 763 | <h3 class="catbg">', $context['settings_title'], '</h3> |
| 743 | 764 | </div>'; |
| 765 | + } |
|
| 744 | 766 | |
| 745 | 767 | // Have we got a message to display? |
| 746 | - if (!empty($context['settings_message'])) |
|
| 747 | - echo ' |
|
| 768 | + if (!empty($context['settings_message'])) { |
|
| 769 | + echo ' |
|
| 748 | 770 | <div class="information">', $context['settings_message'], '</div>'; |
| 771 | + } |
|
| 749 | 772 | |
| 750 | 773 | // Now actually loop through all the variables. |
| 751 | 774 | $is_open = false; |
@@ -798,8 +821,9 @@ discard block |
||
| 798 | 821 | // Hang about? Are you pulling my leg - a callback?! |
| 799 | 822 | if (is_array($config_var) && $config_var['type'] == 'callback') |
| 800 | 823 | { |
| 801 | - if (function_exists('template_callback_' . $config_var['name'])) |
|
| 802 | - call_user_func('template_callback_' . $config_var['name']); |
|
| 824 | + if (function_exists('template_callback_' . $config_var['name'])) { |
|
| 825 | + call_user_func('template_callback_' . $config_var['name']); |
|
| 826 | + } |
|
| 803 | 827 | |
| 804 | 828 | continue; |
| 805 | 829 | } |
@@ -829,9 +853,10 @@ discard block |
||
| 829 | 853 | $text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time'); |
| 830 | 854 | |
| 831 | 855 | // Show the [?] button. |
| 832 | - if ($config_var['help']) |
|
| 833 | - echo ' |
|
| 856 | + if ($config_var['help']) { |
|
| 857 | + echo ' |
|
| 834 | 858 | <a id="setting_', $config_var['name'], '" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'],'"></span></a> '; |
| 859 | + } |
|
| 835 | 860 | |
| 836 | 861 | echo ' |
| 837 | 862 | <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> |
@@ -840,22 +865,25 @@ discard block |
||
| 840 | 865 | $config_var['preinput']; |
| 841 | 866 | |
| 842 | 867 | // Show a check box. |
| 843 | - if ($config_var['type'] == 'check') |
|
| 844 | - echo ' |
|
| 868 | + if ($config_var['type'] == 'check') { |
|
| 869 | + echo ' |
|
| 845 | 870 | <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1" class="input_check">'; |
| 871 | + } |
|
| 846 | 872 | // Escape (via htmlspecialchars.) the text box. |
| 847 | - elseif ($config_var['type'] == 'password') |
|
| 848 | - echo ' |
|
| 873 | + elseif ($config_var['type'] == 'password') { |
|
| 874 | + echo ' |
|
| 849 | 875 | <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;" class="input_password"><br> |
| 850 | 876 | <input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' class="input_password">'; |
| 877 | + } |
|
| 851 | 878 | // Show a selection box. |
| 852 | 879 | elseif ($config_var['type'] == 'select') |
| 853 | 880 | { |
| 854 | 881 | echo ' |
| 855 | 882 | <select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), '>'; |
| 856 | - foreach ($config_var['data'] as $option) |
|
| 857 | - echo ' |
|
| 883 | + foreach ($config_var['data'] as $option) { |
|
| 884 | + echo ' |
|
| 858 | 885 | <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>'; |
| 886 | + } |
|
| 859 | 887 | echo ' |
| 860 | 888 | </select>'; |
| 861 | 889 | } |
@@ -870,15 +898,17 @@ discard block |
||
| 870 | 898 | <legend class="board_selector"><a href="#">', $txt['select_boards_from_list'], '</a></legend>'; |
| 871 | 899 | foreach ($context['board_list'] as $id_cat => $cat) |
| 872 | 900 | { |
| 873 | - if (!$first) |
|
| 874 | - echo ' |
|
| 901 | + if (!$first) { |
|
| 902 | + echo ' |
|
| 875 | 903 | <hr>'; |
| 904 | + } |
|
| 876 | 905 | echo ' |
| 877 | 906 | <strong>', $cat['name'], '</strong> |
| 878 | 907 | <ul>'; |
| 879 | - foreach ($cat['boards'] as $id_board => $brd) |
|
| 880 | - echo ' |
|
| 908 | + foreach ($cat['boards'] as $id_board => $brd) { |
|
| 909 | + echo ' |
|
| 881 | 910 | <li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1" class="input_check"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat(' ', $brd['child_level']) : '', $brd['name'], '</label></li>'; |
| 911 | + } |
|
| 882 | 912 | |
| 883 | 913 | echo ' |
| 884 | 914 | </ul>'; |
@@ -888,12 +918,14 @@ discard block |
||
| 888 | 918 | </fieldset>'; |
| 889 | 919 | } |
| 890 | 920 | // Text area? |
| 891 | - elseif ($config_var['type'] == 'large_text') |
|
| 892 | - echo ' |
|
| 921 | + elseif ($config_var['type'] == 'large_text') { |
|
| 922 | + echo ' |
|
| 893 | 923 | <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>'; |
| 924 | + } |
|
| 894 | 925 | // Permission group? |
| 895 | - elseif ($config_var['type'] == 'permissions') |
|
| 896 | - theme_inline_permissions($config_var['name']); |
|
| 926 | + elseif ($config_var['type'] == 'permissions') { |
|
| 927 | + theme_inline_permissions($config_var['name']); |
|
| 928 | + } |
|
| 897 | 929 | // BBC selection? |
| 898 | 930 | elseif ($config_var['type'] == 'bbc') |
| 899 | 931 | { |
@@ -904,20 +936,22 @@ discard block |
||
| 904 | 936 | |
| 905 | 937 | foreach ($context['bbc_columns'] as $bbcColumn) |
| 906 | 938 | { |
| 907 | - foreach ($bbcColumn as $bbcTag) |
|
| 908 | - echo ' |
|
| 939 | + foreach ($bbcColumn as $bbcTag) { |
|
| 940 | + echo ' |
|
| 909 | 941 | <li class="list_bbc floatleft"> |
| 910 | 942 | <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' : '', ' class="input_check"> <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>)' : '', ' |
| 911 | 943 | </li>'; |
| 944 | + } |
|
| 912 | 945 | } |
| 913 | 946 | echo ' </ul> |
| 914 | 947 | <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' : '', ' class="input_check"> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label> |
| 915 | 948 | </fieldset>'; |
| 916 | 949 | } |
| 917 | 950 | // A simple message? |
| 918 | - elseif ($config_var['type'] == 'var_message') |
|
| 919 | - echo ' |
|
| 951 | + elseif ($config_var['type'] == 'var_message') { |
|
| 952 | + echo ' |
|
| 920 | 953 | <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>'; |
| 954 | + } |
|
| 921 | 955 | // Assume it must be a text box |
| 922 | 956 | else |
| 923 | 957 | { |
@@ -942,63 +976,70 @@ discard block |
||
| 942 | 976 | ' . $config_var['postinput'] : '', |
| 943 | 977 | '</dd>'; |
| 944 | 978 | } |
| 945 | - } |
|
| 946 | - |
|
| 947 | - else |
|
| 979 | + } else |
|
| 948 | 980 | { |
| 949 | 981 | // Just show a separator. |
| 950 | - if ($config_var == '') |
|
| 951 | - echo ' |
|
| 982 | + if ($config_var == '') { |
|
| 983 | + echo ' |
|
| 952 | 984 | </dl> |
| 953 | 985 | <hr> |
| 954 | 986 | <dl class="settings">'; |
| 955 | - else |
|
| 956 | - echo ' |
|
| 987 | + } else { |
|
| 988 | + echo ' |
|
| 957 | 989 | <dd> |
| 958 | 990 | <strong>' . $config_var . '</strong> |
| 959 | 991 | </dd>'; |
| 992 | + } |
|
| 960 | 993 | } |
| 961 | 994 | } |
| 962 | 995 | |
| 963 | - if ($is_open) |
|
| 964 | - echo ' |
|
| 996 | + if ($is_open) { |
|
| 997 | + echo ' |
|
| 965 | 998 | </dl>'; |
| 999 | + } |
|
| 966 | 1000 | |
| 967 | - if (empty($context['settings_save_dont_show'])) |
|
| 968 | - echo ' |
|
| 1001 | + if (empty($context['settings_save_dont_show'])) { |
|
| 1002 | + echo ' |
|
| 969 | 1003 | <input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button_submit">'; |
| 1004 | + } |
|
| 970 | 1005 | |
| 971 | - if ($is_open) |
|
| 972 | - echo ' |
|
| 1006 | + if ($is_open) { |
|
| 1007 | + echo ' |
|
| 973 | 1008 | </div>'; |
| 1009 | + } |
|
| 974 | 1010 | |
| 975 | 1011 | |
| 976 | 1012 | // At least one token has to be used! |
| 977 | - if (isset($context['admin-ssc_token'])) |
|
| 978 | - echo ' |
|
| 1013 | + if (isset($context['admin-ssc_token'])) { |
|
| 1014 | + echo ' |
|
| 979 | 1015 | <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">'; |
| 1016 | + } |
|
| 980 | 1017 | |
| 981 | - if (isset($context['admin-dbsc_token'])) |
|
| 982 | - echo ' |
|
| 1018 | + if (isset($context['admin-dbsc_token'])) { |
|
| 1019 | + echo ' |
|
| 983 | 1020 | <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">'; |
| 1021 | + } |
|
| 984 | 1022 | |
| 985 | - if (isset($context['admin-mp_token'])) |
|
| 986 | - echo ' |
|
| 1023 | + if (isset($context['admin-mp_token'])) { |
|
| 1024 | + echo ' |
|
| 987 | 1025 | <input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">'; |
| 1026 | + } |
|
| 988 | 1027 | |
| 989 | 1028 | echo ' |
| 990 | 1029 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 991 | 1030 | </form> |
| 992 | 1031 | </div>'; |
| 993 | 1032 | |
| 994 | - if (!empty($context['settings_post_javascript'])) |
|
| 995 | - echo ' |
|
| 1033 | + if (!empty($context['settings_post_javascript'])) { |
|
| 1034 | + echo ' |
|
| 996 | 1035 | <script> |
| 997 | 1036 | ', $context['settings_post_javascript'], ' |
| 998 | 1037 | </script>'; |
| 1038 | + } |
|
| 999 | 1039 | |
| 1000 | - if (!empty($context['settings_insert_below'])) |
|
| 1001 | - echo $context['settings_insert_below']; |
|
| 1040 | + if (!empty($context['settings_insert_below'])) { |
|
| 1041 | + echo $context['settings_insert_below']; |
|
| 1042 | + } |
|
| 1002 | 1043 | |
| 1003 | 1044 | // We may have added a board listing. If we did, we need to make it work. |
| 1004 | 1045 | addInlineJavascript(' |
@@ -1021,9 +1062,10 @@ discard block |
||
| 1021 | 1062 | { |
| 1022 | 1063 | global $context, $txt; |
| 1023 | 1064 | |
| 1024 | - if (!empty($context['saved_successful'])) |
|
| 1025 | - echo ' |
|
| 1065 | + if (!empty($context['saved_successful'])) { |
|
| 1066 | + echo ' |
|
| 1026 | 1067 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 1068 | + } |
|
| 1027 | 1069 | |
| 1028 | 1070 | // Standard fields. |
| 1029 | 1071 | template_show_list('standard_profile_fields'); |
@@ -1055,11 +1097,12 @@ discard block |
||
| 1055 | 1097 | if (isset($_GET['msg'])) |
| 1056 | 1098 | { |
| 1057 | 1099 | loadLanguage('Errors'); |
| 1058 | - if (isset($txt['custom_option_' . $_GET['msg']])) |
|
| 1059 | - echo ' |
|
| 1100 | + if (isset($txt['custom_option_' . $_GET['msg']])) { |
|
| 1101 | + echo ' |
|
| 1060 | 1102 | <div class="errorbox">', |
| 1061 | 1103 | $txt['custom_option_' . $_GET['msg']], ' |
| 1062 | 1104 | </div>'; |
| 1105 | + } |
|
| 1063 | 1106 | } |
| 1064 | 1107 | |
| 1065 | 1108 | echo ' |
@@ -1125,9 +1168,10 @@ discard block |
||
| 1125 | 1168 | <dd> |
| 1126 | 1169 | <select name="placement" id="placement">'; |
| 1127 | 1170 | |
| 1128 | - foreach ($context['cust_profile_fields_placement'] as $order => $name) |
|
| 1129 | - echo ' |
|
| 1171 | + foreach ($context['cust_profile_fields_placement'] as $order => $name) { |
|
| 1172 | + echo ' |
|
| 1130 | 1173 | <option value="', $order ,'"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_'. $name], '</option>'; |
| 1174 | + } |
|
| 1131 | 1175 | |
| 1132 | 1176 | echo ' |
| 1133 | 1177 | </select> |
@@ -1150,9 +1194,10 @@ discard block |
||
| 1150 | 1194 | </dt> |
| 1151 | 1195 | <dd> |
| 1152 | 1196 | <select name="field_type" id="field_type" onchange="updateInputBoxes();">'; |
| 1153 | - foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) |
|
| 1154 | - echo ' |
|
| 1197 | + foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) { |
|
| 1198 | + echo ' |
|
| 1155 | 1199 | <option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>'; |
| 1200 | + } |
|
| 1156 | 1201 | |
| 1157 | 1202 | echo ' |
| 1158 | 1203 | </select> |
@@ -1253,9 +1298,10 @@ discard block |
||
| 1253 | 1298 | </fieldset> |
| 1254 | 1299 | <input type="submit" name="save" value="', $txt['save'], '" class="button_submit">'; |
| 1255 | 1300 | |
| 1256 | - if ($context['fid']) |
|
| 1257 | - echo ' |
|
| 1301 | + if ($context['fid']) { |
|
| 1302 | + echo ' |
|
| 1258 | 1303 | <input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button_submit you_sure">'; |
| 1304 | + } |
|
| 1259 | 1305 | |
| 1260 | 1306 | echo ' |
| 1261 | 1307 | </div> |
@@ -1298,8 +1344,7 @@ discard block |
||
| 1298 | 1344 | { |
| 1299 | 1345 | echo ' |
| 1300 | 1346 | <p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>'; |
| 1301 | - } |
|
| 1302 | - else |
|
| 1347 | + } else |
|
| 1303 | 1348 | { |
| 1304 | 1349 | echo ' |
| 1305 | 1350 | <ol class="search_results">'; |
@@ -1325,9 +1370,10 @@ discard block |
||
| 1325 | 1370 | <li> |
| 1326 | 1371 | <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'] , ']'; |
| 1327 | 1372 | |
| 1328 | - if ($result['help']) |
|
| 1329 | - echo ' |
|
| 1373 | + if ($result['help']) { |
|
| 1374 | + echo ' |
|
| 1330 | 1375 | <p class="double_height">', $result['help'], '</p>'; |
| 1376 | + } |
|
| 1331 | 1377 | |
| 1332 | 1378 | echo ' |
| 1333 | 1379 | </li>'; |
@@ -1367,18 +1413,20 @@ discard block |
||
| 1367 | 1413 | <strong>', $txt['setup_verification_answer'], '</strong> |
| 1368 | 1414 | </dd>'; |
| 1369 | 1415 | |
| 1370 | - if (!empty($context['qa_by_lang'][$lang_id])) |
|
| 1371 | - foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1416 | + if (!empty($context['qa_by_lang'][$lang_id])) { |
|
| 1417 | + foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1372 | 1418 | { |
| 1373 | 1419 | $question = $context['question_answers'][$q_id]; |
| 1420 | + } |
|
| 1374 | 1421 | echo ' |
| 1375 | 1422 | <dt> |
| 1376 | 1423 | <input type="text" name="question[', $lang_id, '][', $q_id, ']" value="', $question['question'], '" size="50" class="input_text verification_question"> |
| 1377 | 1424 | </dt> |
| 1378 | 1425 | <dd>'; |
| 1379 | - foreach ($question['answers'] as $answer) |
|
| 1380 | - echo ' |
|
| 1426 | + foreach ($question['answers'] as $answer) { |
|
| 1427 | + echo ' |
|
| 1381 | 1428 | <input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="input_text verification_answer">'; |
| 1429 | + } |
|
| 1382 | 1430 | |
| 1383 | 1431 | echo ' |
| 1384 | 1432 | <div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div> |
@@ -1417,11 +1465,12 @@ discard block |
||
| 1417 | 1465 | ', $txt['errors_found'], ': |
| 1418 | 1466 | <ul>'; |
| 1419 | 1467 | |
| 1420 | - foreach ($context['repair_errors'] as $error) |
|
| 1421 | - echo ' |
|
| 1468 | + foreach ($context['repair_errors'] as $error) { |
|
| 1469 | + echo ' |
|
| 1422 | 1470 | <li> |
| 1423 | 1471 | ', $error, ' |
| 1424 | 1472 | </li>'; |
| 1473 | + } |
|
| 1425 | 1474 | |
| 1426 | 1475 | echo ' |
| 1427 | 1476 | </ul> |
@@ -1431,16 +1480,15 @@ discard block |
||
| 1431 | 1480 | <p class="padding"> |
| 1432 | 1481 | <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> |
| 1433 | 1482 | </p>'; |
| 1434 | - } |
|
| 1435 | - else |
|
| 1436 | - echo ' |
|
| 1483 | + } else { |
|
| 1484 | + echo ' |
|
| 1437 | 1485 | <p>', $txt['maintain_no_errors'], '</p> |
| 1438 | 1486 | <p class="padding"> |
| 1439 | 1487 | <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a> |
| 1440 | 1488 | </p>'; |
| 1489 | + } |
|
| 1441 | 1490 | |
| 1442 | - } |
|
| 1443 | - else |
|
| 1491 | + } else |
|
| 1444 | 1492 | { |
| 1445 | 1493 | if (!empty($context['redirect_to_recount'])) |
| 1446 | 1494 | { |
@@ -1452,8 +1500,7 @@ discard block |
||
| 1452 | 1500 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1453 | 1501 | <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '"> |
| 1454 | 1502 | </form>'; |
| 1455 | - } |
|
| 1456 | - else |
|
| 1503 | + } else |
|
| 1457 | 1504 | { |
| 1458 | 1505 | echo ' |
| 1459 | 1506 | <p>', $txt['errors_fixed'], '</p> |
@@ -1605,8 +1652,8 @@ discard block |
||
| 1605 | 1652 | function template_admin_quick_search() |
| 1606 | 1653 | { |
| 1607 | 1654 | global $context, $txt, $scripturl; |
| 1608 | - if ($context['user']['is_admin']) |
|
| 1609 | - echo ' |
|
| 1655 | + if ($context['user']['is_admin']) { |
|
| 1656 | + echo ' |
|
| 1610 | 1657 | <span class="floatright"> |
| 1611 | 1658 | <span class="generic_icons filter centericon"></span> |
| 1612 | 1659 | <input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';" class="input_text"> |
@@ -1617,6 +1664,7 @@ discard block |
||
| 1617 | 1664 | </select> |
| 1618 | 1665 | <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button_submit"> |
| 1619 | 1666 | </span>'; |
| 1620 | -} |
|
| 1667 | + } |
|
| 1668 | + } |
|
| 1621 | 1669 | |
| 1622 | 1670 | ?> |
@@ -25,13 +25,15 @@ discard block |
||
| 25 | 25 | </h3> |
| 26 | 26 | </div>'; |
| 27 | 27 | |
| 28 | - if (!empty($context['search_errors'])) |
|
| 29 | - echo ' |
|
| 28 | + if (!empty($context['search_errors'])) { |
|
| 29 | + echo ' |
|
| 30 | 30 | <div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>'; |
| 31 | + } |
|
| 31 | 32 | |
| 32 | - if (!empty($context['search_ignored'])) |
|
| 33 | - echo ' |
|
| 33 | + if (!empty($context['search_ignored'])) { |
|
| 34 | + echo ' |
|
| 34 | 35 | <p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>'; |
| 36 | + } |
|
| 35 | 37 | |
| 36 | 38 | echo ' |
| 37 | 39 | <fieldset id="advanced_search"> |
@@ -43,9 +45,10 @@ discard block |
||
| 43 | 45 | <dd> |
| 44 | 46 | <input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text">'; |
| 45 | 47 | |
| 46 | - if (empty($modSettings['search_simple_fulltext'])) |
|
| 47 | - echo ' |
|
| 48 | + if (empty($modSettings['search_simple_fulltext'])) { |
|
| 49 | + echo ' |
|
| 48 | 50 | <em class="smalltext">', $txt['search_example'], '</em>'; |
| 51 | + } |
|
| 49 | 52 | |
| 50 | 53 | echo ' |
| 51 | 54 | </dd> |
@@ -112,11 +115,12 @@ discard block |
||
| 112 | 115 | } |
| 113 | 116 | |
| 114 | 117 | // If $context['search_params']['topic'] is set, that means we're searching just one topic. |
| 115 | - if (!empty($context['search_params']['topic'])) |
|
| 116 | - echo ' |
|
| 118 | + if (!empty($context['search_params']['topic'])) { |
|
| 119 | + echo ' |
|
| 117 | 120 | <p>', $txt['search_specific_topic'], ' "', $context['search_topic']['link'], '".</p> |
| 118 | 121 | <input type="hidden" name="topic" value="', $context['search_topic']['id'], '"> |
| 119 | 122 | <input type="submit" name="b_search" value="', $txt['search'], '" class="button_submit">'; |
| 123 | + } |
|
| 120 | 124 | |
| 121 | 125 | echo ' |
| 122 | 126 | </div> |
@@ -147,14 +151,15 @@ discard block |
||
| 147 | 151 | |
| 148 | 152 | foreach ($category['boards'] as $board) |
| 149 | 153 | { |
| 150 | - if ($i == $limit) |
|
| 151 | - echo ' |
|
| 154 | + if ($i == $limit) { |
|
| 155 | + echo ' |
|
| 152 | 156 | </ul> |
| 153 | 157 | </li> |
| 154 | 158 | </ul> |
| 155 | 159 | <ul class="ignoreboards floatright"> |
| 156 | 160 | <li class="category"> |
| 157 | 161 | <ul>'; |
| 162 | + } |
|
| 158 | 163 | |
| 159 | 164 | echo ' |
| 160 | 165 | <li class="board"> |
@@ -242,13 +247,15 @@ discard block |
||
| 242 | 247 | <div class="roundframe">'; |
| 243 | 248 | |
| 244 | 249 | // Did they make any typos or mistakes, perhaps? |
| 245 | - if (isset($context['did_you_mean'])) |
|
| 246 | - echo ' |
|
| 250 | + if (isset($context['did_you_mean'])) { |
|
| 251 | + echo ' |
|
| 247 | 252 | <p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>'; |
| 253 | + } |
|
| 248 | 254 | |
| 249 | - if (!empty($context['search_ignored'])) |
|
| 250 | - echo ' |
|
| 255 | + if (!empty($context['search_ignored'])) { |
|
| 256 | + echo ' |
|
| 251 | 257 | <p>', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>'; |
| 258 | + } |
|
| 252 | 259 | |
| 253 | 260 | echo ' |
| 254 | 261 | <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '"> |
@@ -270,10 +277,11 @@ discard block |
||
| 270 | 277 | <input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '"> |
| 271 | 278 | <input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '"> |
| 272 | 279 | </div>'; |
| 273 | - if (!empty($context['search_params']['brd'])) |
|
| 274 | - foreach ($context['search_params']['brd'] as $board_id) |
|
| 280 | + if (!empty($context['search_params']['brd'])) { |
|
| 281 | + foreach ($context['search_params']['brd'] as $board_id) |
|
| 275 | 282 | echo ' |
| 276 | 283 | <input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">'; |
| 284 | + } |
|
| 277 | 285 | |
| 278 | 286 | echo ' |
| 279 | 287 | </form> |
@@ -284,17 +292,19 @@ discard block |
||
| 284 | 292 | if ($context['compact']) |
| 285 | 293 | { |
| 286 | 294 | // Quick moderation set to checkboxes? Oh, how fun :/. |
| 287 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 288 | - echo ' |
|
| 295 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 296 | + echo ' |
|
| 289 | 297 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">'; |
| 298 | + } |
|
| 290 | 299 | |
| 291 | 300 | echo ' |
| 292 | 301 | <div class="cat_bar"> |
| 293 | 302 | <h3 class="catbg"> |
| 294 | 303 | <span class="floatright">'; |
| 295 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 296 | - echo ' |
|
| 304 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 305 | + echo ' |
|
| 297 | 306 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">'; |
| 307 | + } |
|
| 298 | 308 | echo ' |
| 299 | 309 | </span> |
| 300 | 310 | <span class="generic_icons filter"></span> ', $txt['mlist_search_results'],': ',$context['search_params']['search'],' |
@@ -302,14 +312,15 @@ discard block |
||
| 302 | 312 | </div>'; |
| 303 | 313 | |
| 304 | 314 | // was anything even found? |
| 305 | - if (!empty($context['topics'])) |
|
| 306 | - echo' |
|
| 315 | + if (!empty($context['topics'])) { |
|
| 316 | + echo' |
|
| 307 | 317 | <div class="pagesection"> |
| 308 | 318 | <span>', $context['page_index'], '</span> |
| 309 | 319 | </div>'; |
| 310 | - else |
|
| 311 | - echo ' |
|
| 320 | + } else { |
|
| 321 | + echo ' |
|
| 312 | 322 | <div class="roundframe">', $txt['find_no_results'], '</div>'; |
| 323 | + } |
|
| 313 | 324 | |
| 314 | 325 | // while we have results to show ... |
| 315 | 326 | while ($topic = $context['get_topics']()) |
@@ -337,38 +348,43 @@ discard block |
||
| 337 | 348 | { |
| 338 | 349 | echo ' |
| 339 | 350 | <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">'; |
| 340 | - } |
|
| 341 | - else |
|
| 351 | + } else |
|
| 342 | 352 | { |
| 343 | - if ($topic['quick_mod']['remove']) |
|
| 344 | - echo ' |
|
| 353 | + if ($topic['quick_mod']['remove']) { |
|
| 354 | + echo ' |
|
| 345 | 355 | <a href="', $scripturl, '?action=quickmod;board='. $topic['board']['id']. '.0;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
| 356 | + } |
|
| 346 | 357 | |
| 347 | - if ($topic['quick_mod']['lock']) |
|
| 348 | - echo ' |
|
| 358 | + if ($topic['quick_mod']['lock']) { |
|
| 359 | + echo ' |
|
| 349 | 360 | <a href="', $scripturl, '?action=quickmod;board='. $topic['board']['id']. '.0;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
| 361 | + } |
|
| 350 | 362 | |
| 351 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
| 352 | - echo ' |
|
| 363 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
| 364 | + echo ' |
|
| 353 | 365 | <br>'; |
| 366 | + } |
|
| 354 | 367 | |
| 355 | - if ($topic['quick_mod']['sticky']) |
|
| 356 | - echo ' |
|
| 368 | + if ($topic['quick_mod']['sticky']) { |
|
| 369 | + echo ' |
|
| 357 | 370 | <a href="', $scripturl, '?action=quickmod;board='. $topic['board']['id']. '.0;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
| 371 | + } |
|
| 358 | 372 | |
| 359 | - if ($topic['quick_mod']['move']) |
|
| 360 | - echo ' |
|
| 373 | + if ($topic['quick_mod']['move']) { |
|
| 374 | + echo ' |
|
| 361 | 375 | <a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
| 376 | + } |
|
| 362 | 377 | } |
| 363 | 378 | |
| 364 | 379 | echo ' |
| 365 | 380 | </div>'; |
| 366 | 381 | } |
| 367 | 382 | |
| 368 | - if ($message['body_highlighted'] != '') |
|
| 369 | - echo ' |
|
| 383 | + if ($message['body_highlighted'] != '') { |
|
| 384 | + echo ' |
|
| 370 | 385 | <br class="clear"> |
| 371 | 386 | <div class="list_posts double_height">', $message['body_highlighted'], '</div>'; |
| 387 | + } |
|
| 372 | 388 | } |
| 373 | 389 | |
| 374 | 390 | echo ' |
@@ -376,11 +392,12 @@ discard block |
||
| 376 | 392 | </div>'; |
| 377 | 393 | |
| 378 | 394 | } |
| 379 | - if (!empty($context['topics'])) |
|
| 380 | - echo ' |
|
| 395 | + if (!empty($context['topics'])) { |
|
| 396 | + echo ' |
|
| 381 | 397 | <div class="pagesection"> |
| 382 | 398 | <span>', $context['page_index'], '</span> |
| 383 | 399 | </div>'; |
| 400 | + } |
|
| 384 | 401 | |
| 385 | 402 | if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
| 386 | 403 | { |
@@ -390,17 +407,19 @@ discard block |
||
| 390 | 407 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
| 391 | 408 | <option value="">--------</option>'; |
| 392 | 409 | |
| 393 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
| 394 | - if ($context['can_' . $qmod_action]) |
|
| 410 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
| 411 | + if ($context['can_' . $qmod_action]) |
|
| 395 | 412 | echo ' |
| 396 | 413 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
| 414 | + } |
|
| 397 | 415 | |
| 398 | 416 | echo ' |
| 399 | 417 | </select>'; |
| 400 | 418 | |
| 401 | - if ($context['can_move']) |
|
| 402 | - echo ' |
|
| 419 | + if ($context['can_move']) { |
|
| 420 | + echo ' |
|
| 403 | 421 | <span id="quick_mod_jump_to"> </span>'; |
| 422 | + } |
|
| 404 | 423 | |
| 405 | 424 | echo ' |
| 406 | 425 | <input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '"> |
@@ -410,13 +429,13 @@ discard block |
||
| 410 | 429 | } |
| 411 | 430 | |
| 412 | 431 | |
| 413 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
|
| 414 | - echo ' |
|
| 432 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) { |
|
| 433 | + echo ' |
|
| 415 | 434 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
| 416 | 435 | </form>'; |
| 436 | + } |
|
| 417 | 437 | |
| 418 | - } |
|
| 419 | - else |
|
| 438 | + } else |
|
| 420 | 439 | { |
| 421 | 440 | echo ' |
| 422 | 441 | <div class="cat_bar"> |
@@ -428,9 +447,10 @@ discard block |
||
| 428 | 447 | <span>', $context['page_index'], '</span> |
| 429 | 448 | </div>'; |
| 430 | 449 | |
| 431 | - if (empty($context['topics'])) |
|
| 432 | - echo ' |
|
| 450 | + if (empty($context['topics'])) { |
|
| 451 | + echo ' |
|
| 433 | 452 | <div class="information">(', $txt['search_no_results'], ')</div>'; |
| 453 | + } |
|
| 434 | 454 | |
| 435 | 455 | while ($topic = $context['get_topics']()) |
| 436 | 456 | { |
@@ -445,23 +465,27 @@ discard block |
||
| 445 | 465 | </div> |
| 446 | 466 | <div class="list_posts">', $message['body_highlighted'], '</div>'; |
| 447 | 467 | |
| 448 | - if ($topic['can_reply']) |
|
| 449 | - echo ' |
|
| 468 | + if ($topic['can_reply']) { |
|
| 469 | + echo ' |
|
| 450 | 470 | <ul class="quickbuttons">'; |
| 471 | + } |
|
| 451 | 472 | |
| 452 | 473 | // If they *can* reply? |
| 453 | - if ($topic['can_reply']) |
|
| 454 | - echo ' |
|
| 474 | + if ($topic['can_reply']) { |
|
| 475 | + echo ' |
|
| 455 | 476 | <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
| 477 | + } |
|
| 456 | 478 | |
| 457 | 479 | // If they *can* quote? |
| 458 | - if ($topic['can_quote']) |
|
| 459 | - echo ' |
|
| 480 | + if ($topic['can_quote']) { |
|
| 481 | + echo ' |
|
| 460 | 482 | <li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
| 483 | + } |
|
| 461 | 484 | |
| 462 | - if ($topic['can_reply']) |
|
| 463 | - echo ' |
|
| 485 | + if ($topic['can_reply']) { |
|
| 486 | + echo ' |
|
| 464 | 487 | </ul>'; |
| 488 | + } |
|
| 465 | 489 | echo ' |
| 466 | 490 | <br class="clear"> |
| 467 | 491 | </div>'; |
@@ -480,8 +504,8 @@ discard block |
||
| 480 | 504 | <div class="smalltext righttext" id="search_jump_to"> </div> |
| 481 | 505 | <script>'; |
| 482 | 506 | |
| 483 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
| 484 | - echo ' |
|
| 507 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
| 508 | + echo ' |
|
| 485 | 509 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 486 | 510 | aJumpTo[aJumpTo.length] = new JumpTo({ |
| 487 | 511 | sContainerId: "quick_mod_jump_to", |
@@ -496,6 +520,7 @@ discard block |
||
| 496 | 520 | bDisabled: true, |
| 497 | 521 | sCustomName: "move_to" |
| 498 | 522 | });'; |
| 523 | + } |
|
| 499 | 524 | |
| 500 | 525 | echo ' |
| 501 | 526 | if (typeof(window.XMLHttpRequest) != "undefined") |
@@ -19,26 +19,28 @@ discard block |
||
| 19 | 19 | global $context, $settings, $scripturl, $txt, $modSettings; |
| 20 | 20 | |
| 21 | 21 | // Not allowed to edit? |
| 22 | - if (!$context['can_modify']) |
|
| 23 | - echo ' |
|
| 22 | + if (!$context['can_modify']) { |
|
| 23 | + echo ' |
|
| 24 | 24 | <div class="errorbox"> |
| 25 | 25 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
| 26 | 26 | </div>'; |
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | echo ' |
| 29 | 30 | <div id="admin_form_wrapper"> |
| 30 | 31 | <form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">'; |
| 31 | 32 | |
| 32 | - if (!empty($context['profile'])) |
|
| 33 | - echo ' |
|
| 33 | + if (!empty($context['profile'])) { |
|
| 34 | + echo ' |
|
| 34 | 35 | <div class="cat_bar"> |
| 35 | 36 | <h3 class="catbg">', $txt['permissions_for_profile'], ': "', $context['profile']['name'], '"</h3> |
| 36 | 37 | </div>'; |
| 37 | - else |
|
| 38 | - echo ' |
|
| 38 | + } else { |
|
| 39 | + echo ' |
|
| 39 | 40 | <div class="cat_bar"> |
| 40 | 41 | <h3 class="catbg">', $txt['permissions_title'], '</h3> |
| 41 | 42 | </div>'; |
| 43 | + } |
|
| 42 | 44 | |
| 43 | 45 | echo ' |
| 44 | 46 | <table class="table_grid"> |
@@ -47,13 +49,14 @@ discard block |
||
| 47 | 49 | <th>', $txt['membergroups_name'], '</th> |
| 48 | 50 | <th width="10%" style="text-align:center">', $txt['membergroups_members_top'], '</th>'; |
| 49 | 51 | |
| 50 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 51 | - echo ' |
|
| 52 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 53 | + echo ' |
|
| 52 | 54 | <th width="16%" style="text-align:center">', $txt['membergroups_permissions'], '</th>'; |
| 53 | - else |
|
| 54 | - echo ' |
|
| 55 | + } else { |
|
| 56 | + echo ' |
|
| 55 | 57 | <th width="8%" style="text-align:center">', $txt['permissions_allowed'], '</th> |
| 56 | 58 | <th width="8%" style="text-align:center">', $txt['permissions_denied'], '</th>'; |
| 59 | + } |
|
| 57 | 60 | |
| 58 | 61 | echo ' |
| 59 | 62 | <th width="10%" style="text-align:center">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th> |
@@ -71,22 +74,24 @@ discard block |
||
| 71 | 74 | <td> |
| 72 | 75 | ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', ' <span>', $group['name'], '</span>'; |
| 73 | 76 | |
| 74 | - if (!empty($group['children'])) |
|
| 75 | - echo ' |
|
| 77 | + if (!empty($group['children'])) { |
|
| 78 | + echo ' |
|
| 76 | 79 | <br> |
| 77 | 80 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
| 81 | + } |
|
| 78 | 82 | |
| 79 | 83 | echo ' |
| 80 | 84 | </td> |
| 81 | 85 | <td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>'; |
| 82 | 86 | |
| 83 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 84 | - echo ' |
|
| 87 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 88 | + echo ' |
|
| 85 | 89 | <td width="16%">', $group['num_permissions']['allowed'], '</td>'; |
| 86 | - else |
|
| 87 | - echo ' |
|
| 90 | + } else { |
|
| 91 | + echo ' |
|
| 88 | 92 | <td width="8%"', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '>', $group['num_permissions']['allowed'], '</td> |
| 89 | 93 | <td width="8%"', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>', $group['num_permissions']['denied'], '</td>'; |
| 94 | + } |
|
| 90 | 95 | |
| 91 | 96 | echo ' |
| 92 | 97 | <td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']). '</a>' : '', '</td> |
@@ -133,9 +138,10 @@ discard block |
||
| 133 | 138 | <option value="empty">(', $txt['permissions_select_membergroup'], ')</option>'; |
| 134 | 139 | foreach ($context['groups'] as $group) |
| 135 | 140 | { |
| 136 | - if ($group['id'] != 1) |
|
| 137 | - echo ' |
|
| 141 | + if ($group['id'] != 1) { |
|
| 142 | + echo ' |
|
| 138 | 143 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
| 144 | + } |
|
| 139 | 145 | } |
| 140 | 146 | |
| 141 | 147 | echo ' |
@@ -145,9 +151,10 @@ discard block |
||
| 145 | 151 | <select name="add_remove"> |
| 146 | 152 | <option value="add">', $txt['permissions_add'], '...</option> |
| 147 | 153 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
| 148 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 149 | - echo ' |
|
| 154 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 155 | + echo ' |
|
| 150 | 156 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
| 157 | + } |
|
| 151 | 158 | echo ' |
| 152 | 159 | </select> |
| 153 | 160 | </dt> |
@@ -156,30 +163,34 @@ discard block |
||
| 156 | 163 | <option value="">(', $txt['permissions_select_permission'], ')</option>'; |
| 157 | 164 | foreach ($context['permissions'] as $permissionType) |
| 158 | 165 | { |
| 159 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
| 160 | - continue; |
|
| 166 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
| 167 | + continue; |
|
| 168 | + } |
|
| 161 | 169 | |
| 162 | 170 | foreach ($permissionType['columns'] as $column) |
| 163 | 171 | { |
| 164 | 172 | foreach ($column as $permissionGroup) |
| 165 | 173 | { |
| 166 | - if ($permissionGroup['hidden']) |
|
| 167 | - continue; |
|
| 174 | + if ($permissionGroup['hidden']) { |
|
| 175 | + continue; |
|
| 176 | + } |
|
| 168 | 177 | |
| 169 | 178 | echo ' |
| 170 | 179 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
| 171 | 180 | foreach ($permissionGroup['permissions'] as $perm) |
| 172 | 181 | { |
| 173 | - if ($perm['hidden']) |
|
| 174 | - continue; |
|
| 182 | + if ($perm['hidden']) { |
|
| 183 | + continue; |
|
| 184 | + } |
|
| 175 | 185 | |
| 176 | - if ($perm['has_own_any']) |
|
| 177 | - echo ' |
|
| 186 | + if ($perm['has_own_any']) { |
|
| 187 | + echo ' |
|
| 178 | 188 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
| 179 | 189 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
| 180 | - else |
|
| 181 | - echo ' |
|
| 190 | + } else { |
|
| 191 | + echo ' |
|
| 182 | 192 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
| 193 | + } |
|
| 183 | 194 | } |
| 184 | 195 | } |
| 185 | 196 | } |
@@ -246,17 +257,18 @@ discard block |
||
| 246 | 257 | } |
| 247 | 258 | </script>'; |
| 248 | 259 | |
| 249 | - if (!empty($context['profile'])) |
|
| 250 | - echo ' |
|
| 260 | + if (!empty($context['profile'])) { |
|
| 261 | + echo ' |
|
| 251 | 262 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
| 263 | + } |
|
| 252 | 264 | |
| 253 | 265 | echo ' |
| 254 | 266 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 255 | 267 | <input type="hidden" name="', $context['admin-mpq_token_var'], '" value="', $context['admin-mpq_token'], '">'; |
| 256 | - } |
|
| 257 | - else |
|
| 258 | - echo ' |
|
| 268 | + } else { |
|
| 269 | + echo ' |
|
| 259 | 270 | </table>'; |
| 271 | + } |
|
| 260 | 272 | |
| 261 | 273 | echo ' |
| 262 | 274 | </form> |
@@ -296,9 +308,10 @@ discard block |
||
| 296 | 308 | <h3 class="subbg">', $category['name'], '</h3> |
| 297 | 309 | </div>'; |
| 298 | 310 | |
| 299 | - if (!empty($category['boards'])) |
|
| 300 | - echo ' |
|
| 311 | + if (!empty($category['boards'])) { |
|
| 312 | + echo ' |
|
| 301 | 313 | <ul class="perm_boards flow_hidden">'; |
| 314 | + } |
|
| 302 | 315 | |
| 303 | 316 | foreach ($category['boards'] as $board) |
| 304 | 317 | { |
@@ -315,33 +328,36 @@ discard block |
||
| 315 | 328 | echo ' |
| 316 | 329 | <select name="boardprofile[', $board['id'], ']">'; |
| 317 | 330 | |
| 318 | - foreach ($context['profiles'] as $id => $profile) |
|
| 319 | - echo ' |
|
| 331 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 332 | + echo ' |
|
| 320 | 333 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 334 | + } |
|
| 321 | 335 | |
| 322 | 336 | echo ' |
| 323 | 337 | </select>'; |
| 324 | - } |
|
| 325 | - else |
|
| 326 | - echo ' |
|
| 338 | + } else { |
|
| 339 | + echo ' |
|
| 327 | 340 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
| 341 | + } |
|
| 328 | 342 | |
| 329 | 343 | echo ' |
| 330 | 344 | </span> |
| 331 | 345 | </li>'; |
| 332 | 346 | } |
| 333 | 347 | |
| 334 | - if (!empty($category['boards'])) |
|
| 335 | - echo ' |
|
| 348 | + if (!empty($category['boards'])) { |
|
| 349 | + echo ' |
|
| 336 | 350 | </ul>'; |
| 351 | + } |
|
| 337 | 352 | } |
| 338 | 353 | |
| 339 | - if ($context['edit_all']) |
|
| 340 | - echo ' |
|
| 354 | + if ($context['edit_all']) { |
|
| 355 | + echo ' |
|
| 341 | 356 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button_submit">'; |
| 342 | - else |
|
| 343 | - echo ' |
|
| 357 | + } else { |
|
| 358 | + echo ' |
|
| 344 | 359 | <a class="button_link" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
| 360 | + } |
|
| 345 | 361 | |
| 346 | 362 | echo ' |
| 347 | 363 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -381,12 +397,13 @@ discard block |
||
| 381 | 397 | <tr class="windowbg"> |
| 382 | 398 | <td>'; |
| 383 | 399 | |
| 384 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
| 385 | - echo ' |
|
| 400 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
| 401 | + echo ' |
|
| 386 | 402 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '" class="input_text">'; |
| 387 | - else |
|
| 388 | - echo ' |
|
| 403 | + } else { |
|
| 404 | + echo ' |
|
| 389 | 405 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
| 406 | + } |
|
| 390 | 407 | |
| 391 | 408 | echo ' |
| 392 | 409 | </td> |
@@ -406,9 +423,10 @@ discard block |
||
| 406 | 423 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 407 | 424 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
| 408 | 425 | |
| 409 | - if ($context['can_edit_something']) |
|
| 410 | - echo ' |
|
| 426 | + if ($context['can_edit_something']) { |
|
| 427 | + echo ' |
|
| 411 | 428 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button_submit">'; |
| 429 | + } |
|
| 412 | 430 | |
| 413 | 431 | echo ' |
| 414 | 432 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button_submit" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '/> |
@@ -433,9 +451,10 @@ discard block |
||
| 433 | 451 | <dd> |
| 434 | 452 | <select name="copy_from">'; |
| 435 | 453 | |
| 436 | - foreach ($context['profiles'] as $id => $profile) |
|
| 437 | - echo ' |
|
| 454 | + foreach ($context['profiles'] as $id => $profile) { |
|
| 455 | + echo ' |
|
| 438 | 456 | <option value="', $id, '">', $profile['name'], '</option>'; |
| 457 | + } |
|
| 439 | 458 | |
| 440 | 459 | echo ' |
| 441 | 460 | </select> |
@@ -463,8 +482,7 @@ discard block |
||
| 463 | 482 | <div class="errorbox"> |
| 464 | 483 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
| 465 | 484 | </div>'; |
| 466 | - } |
|
| 467 | - else |
|
| 485 | + } else |
|
| 468 | 486 | { |
| 469 | 487 | echo ' |
| 470 | 488 | <script> |
@@ -484,21 +502,23 @@ discard block |
||
| 484 | 502 | <div id="admincenter"> |
| 485 | 503 | <form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">'; |
| 486 | 504 | |
| 487 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
| 488 | - echo ' |
|
| 505 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
| 506 | + echo ' |
|
| 489 | 507 | <div class="information"> |
| 490 | 508 | ', $txt['permissions_option_desc'], ' |
| 491 | 509 | </div>'; |
| 510 | + } |
|
| 492 | 511 | |
| 493 | 512 | echo ' |
| 494 | 513 | <div class="cat_bar"> |
| 495 | 514 | <h3 class="catbg">'; |
| 496 | - if ($context['permission_type'] == 'board') |
|
| 497 | - echo ' |
|
| 515 | + if ($context['permission_type'] == 'board') { |
|
| 516 | + echo ' |
|
| 498 | 517 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
| 499 | - else |
|
| 500 | - echo ' |
|
| 518 | + } else { |
|
| 519 | + echo ' |
|
| 501 | 520 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
| 521 | + } |
|
| 502 | 522 | echo ' |
| 503 | 523 | </h3> |
| 504 | 524 | </div>'; |
@@ -521,15 +541,17 @@ discard block |
||
| 521 | 541 | template_modify_group_display('board'); |
| 522 | 542 | } |
| 523 | 543 | |
| 524 | - if ($context['profile']['can_modify']) |
|
| 525 | - echo ' |
|
| 544 | + if ($context['profile']['can_modify']) { |
|
| 545 | + echo ' |
|
| 526 | 546 | <div class="padding"> |
| 527 | 547 | <input type="submit" value="', $txt['permissions_commit'], '" class="button_submit"> |
| 528 | 548 | </div>'; |
| 549 | + } |
|
| 529 | 550 | |
| 530 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
| 531 | - echo ' |
|
| 551 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
| 552 | + echo ' |
|
| 532 | 553 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
| 554 | + } |
|
| 533 | 555 | |
| 534 | 556 | echo ' |
| 535 | 557 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -557,17 +579,19 @@ discard block |
||
| 557 | 579 | |
| 558 | 580 | foreach ($column as $permissionGroup) |
| 559 | 581 | { |
| 560 | - if (empty($permissionGroup['permissions'])) |
|
| 561 | - continue; |
|
| 582 | + if (empty($permissionGroup['permissions'])) { |
|
| 583 | + continue; |
|
| 584 | + } |
|
| 562 | 585 | |
| 563 | 586 | // Are we likely to have something in this group to display or is it all hidden? |
| 564 | 587 | $has_display_content = false; |
| 565 | 588 | if (!$permissionGroup['hidden']) |
| 566 | 589 | { |
| 567 | 590 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
| 568 | - foreach ($permissionGroup['permissions'] as $permission) |
|
| 569 | - if (!$permission['hidden']) |
|
| 591 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
| 592 | + if (!$permission['hidden']) |
|
| 570 | 593 | $has_display_content = true; |
| 594 | + } |
|
| 571 | 595 | |
| 572 | 596 | if ($has_display_content) |
| 573 | 597 | { |
@@ -576,10 +600,11 @@ discard block |
||
| 576 | 600 | <th width="10"></th> |
| 577 | 601 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
| 578 | 602 | |
| 579 | - if ($context['group']['id'] != -1) |
|
| 580 | - echo ' |
|
| 603 | + if ($context['group']['id'] != -1) { |
|
| 604 | + echo ' |
|
| 581 | 605 | <th>', $txt['permissions_option_own'], '</th> |
| 582 | 606 | <th>', $txt['permissions_option_any'], '</th>'; |
| 607 | + } |
|
| 583 | 608 | |
| 584 | 609 | echo ' |
| 585 | 610 | </tr>'; |
@@ -602,17 +627,18 @@ discard block |
||
| 602 | 627 | // Guests can't do their own thing. |
| 603 | 628 | if ($context['group']['id'] != -1) |
| 604 | 629 | { |
| 605 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 606 | - echo ' |
|
| 630 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 631 | + echo ' |
|
| 607 | 632 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" class="input_check" ', $disable_field, '/>'; |
| 608 | - else |
|
| 633 | + } else |
|
| 609 | 634 | { |
| 610 | 635 | echo ' |
| 611 | 636 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
| 612 | 637 | |
| 613 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 614 | - echo ' |
|
| 638 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 639 | + echo ' |
|
| 615 | 640 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 641 | + } |
|
| 616 | 642 | echo ' |
| 617 | 643 | </select>'; |
| 618 | 644 | } |
@@ -622,39 +648,41 @@ discard block |
||
| 622 | 648 | <td>'; |
| 623 | 649 | } |
| 624 | 650 | |
| 625 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
| 626 | - echo ' |
|
| 651 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
| 652 | + echo ' |
|
| 627 | 653 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>'; |
| 628 | - else |
|
| 654 | + } else |
|
| 629 | 655 | { |
| 630 | 656 | echo ' |
| 631 | 657 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
| 632 | 658 | |
| 633 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 634 | - echo ' |
|
| 659 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 660 | + echo ' |
|
| 635 | 661 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 662 | + } |
|
| 636 | 663 | echo ' |
| 637 | 664 | </select>'; |
| 638 | 665 | } |
| 639 | - } |
|
| 640 | - else |
|
| 666 | + } else |
|
| 641 | 667 | { |
| 642 | - if ($context['group']['id'] != -1) |
|
| 643 | - echo ' |
|
| 668 | + if ($context['group']['id'] != -1) { |
|
| 669 | + echo ' |
|
| 644 | 670 | </td> |
| 645 | 671 | <td>'; |
| 672 | + } |
|
| 646 | 673 | |
| 647 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
| 648 | - echo ' |
|
| 674 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
| 675 | + echo ' |
|
| 649 | 676 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>'; |
| 650 | - else |
|
| 677 | + } else |
|
| 651 | 678 | { |
| 652 | 679 | echo ' |
| 653 | 680 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
| 654 | 681 | |
| 655 | - foreach (array('on', 'off', 'deny') as $c) |
|
| 656 | - echo ' |
|
| 682 | + foreach (array('on', 'off', 'deny') as $c) { |
|
| 683 | + echo ' |
|
| 657 | 684 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
| 685 | + } |
|
| 658 | 686 | echo ' |
| 659 | 687 | </select>'; |
| 660 | 688 | } |
@@ -684,11 +712,11 @@ discard block |
||
| 684 | 712 | echo ' |
| 685 | 713 | <fieldset id="', $context['current_permission'], '"> |
| 686 | 714 | <legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>'; |
| 687 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 688 | - echo ' |
|
| 715 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 716 | + echo ' |
|
| 689 | 717 | <ul>'; |
| 690 | - else |
|
| 691 | - echo ' |
|
| 718 | + } else { |
|
| 719 | + echo ' |
|
| 692 | 720 | <div class="information">', $txt['permissions_option_desc'], '</div> |
| 693 | 721 | <dl class="settings"> |
| 694 | 722 | <dt> |
@@ -698,46 +726,51 @@ discard block |
||
| 698 | 726 | </dt> |
| 699 | 727 | <dd> |
| 700 | 728 | </dd>'; |
| 729 | + } |
|
| 701 | 730 | foreach ($context['member_groups'] as $group) |
| 702 | 731 | { |
| 703 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 704 | - echo ' |
|
| 732 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 733 | + echo ' |
|
| 705 | 734 | <dt>'; |
| 706 | - else |
|
| 707 | - echo ' |
|
| 735 | + } else { |
|
| 736 | + echo ' |
|
| 708 | 737 | <li>'; |
| 738 | + } |
|
| 709 | 739 | |
| 710 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 711 | - echo ' |
|
| 740 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 741 | + echo ' |
|
| 712 | 742 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_check">'; |
| 713 | - else |
|
| 714 | - echo ' |
|
| 743 | + } else { |
|
| 744 | + echo ' |
|
| 715 | 745 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_radio"></span> |
| 716 | 746 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', ' class="input_radio"></span> |
| 717 | 747 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', ' class="input_radio"></span>'; |
| 748 | + } |
|
| 718 | 749 | |
| 719 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 720 | - echo ' |
|
| 750 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 751 | + echo ' |
|
| 721 | 752 | </dt> |
| 722 | 753 | <dd> |
| 723 | 754 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
| 724 | 755 | </dd>'; |
| 725 | - else |
|
| 726 | - echo ' |
|
| 756 | + } else { |
|
| 757 | + echo ' |
|
| 727 | 758 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
| 728 | 759 | </li>'; |
| 760 | + } |
|
| 729 | 761 | } |
| 730 | 762 | |
| 731 | - if (empty($modSettings['permission_enable_deny'])) |
|
| 732 | - echo ' |
|
| 763 | + if (empty($modSettings['permission_enable_deny'])) { |
|
| 764 | + echo ' |
|
| 733 | 765 | <li> |
| 734 | 766 | <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission']. '[\');"> |
| 735 | 767 | <span>', $txt['check_all'], '</span> |
| 736 | 768 | </li> |
| 737 | 769 | </ul>'; |
| 738 | - else |
|
| 739 | - echo ' |
|
| 770 | + } else { |
|
| 771 | + echo ' |
|
| 740 | 772 | </dl>'; |
| 773 | + } |
|
| 741 | 774 | |
| 742 | 775 | echo ' |
| 743 | 776 | </fieldset> |
@@ -777,9 +810,10 @@ discard block |
||
| 777 | 810 | if (!empty($modSettings['postmod_active'])) |
| 778 | 811 | { |
| 779 | 812 | // Got advanced permissions - if so warn! |
| 780 | - if (!empty($modSettings['permission_enable_deny'])) |
|
| 781 | - echo ' |
|
| 813 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
| 814 | + echo ' |
|
| 782 | 815 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
| 816 | + } |
|
| 783 | 817 | |
| 784 | 818 | echo ' |
| 785 | 819 | <div class="padding"> |
@@ -794,10 +828,11 @@ discard block |
||
| 794 | 828 | ', $txt['permissions_post_moderation_select'], ': |
| 795 | 829 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
| 796 | 830 | |
| 797 | - foreach ($context['profiles'] as $profile) |
|
| 798 | - if ($profile['can_modify']) |
|
| 831 | + foreach ($context['profiles'] as $profile) { |
|
| 832 | + if ($profile['can_modify']) |
|
| 799 | 833 | echo ' |
| 800 | 834 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
| 835 | + } |
|
| 801 | 836 | |
| 802 | 837 | echo ' |
| 803 | 838 | </select> |
@@ -818,11 +853,12 @@ discard block |
||
| 818 | 853 | ', $txt['permissions_post_moderation_replies_any'], ' |
| 819 | 854 | </th>'; |
| 820 | 855 | |
| 821 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 822 | - echo ' |
|
| 856 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 857 | + echo ' |
|
| 823 | 858 | <th class="centercol" colspan="3"> |
| 824 | 859 | ', $txt['permissions_post_moderation_attachments'], ' |
| 825 | 860 | </th>'; |
| 861 | + } |
|
| 826 | 862 | |
| 827 | 863 | echo ' |
| 828 | 864 | </tr> |
@@ -840,11 +876,12 @@ discard block |
||
| 840 | 876 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
| 841 | 877 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
| 842 | 878 | |
| 843 | - if ($modSettings['attachmentEnable'] == 1) |
|
| 844 | - echo ' |
|
| 879 | + if ($modSettings['attachmentEnable'] == 1) { |
|
| 880 | + echo ' |
|
| 845 | 881 | <th><span class="generic_icons post_moderation_allow"></span></th> |
| 846 | 882 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
| 847 | 883 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
| 884 | + } |
|
| 848 | 885 | |
| 849 | 886 | echo ' |
| 850 | 887 | </tr> |
@@ -857,9 +894,10 @@ discard block |
||
| 857 | 894 | <tr class="windowbg"> |
| 858 | 895 | <td width="40%"> |
| 859 | 896 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
| 860 | - if (!empty($group['children'])) |
|
| 861 | - echo ' |
|
| 897 | + if (!empty($group['children'])) { |
|
| 898 | + echo ' |
|
| 862 | 899 | <br><span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
| 900 | + } |
|
| 863 | 901 | |
| 864 | 902 | echo ' |
| 865 | 903 | </td> |
@@ -872,8 +910,7 @@ discard block |
||
| 872 | 910 | { |
| 873 | 911 | echo ' |
| 874 | 912 | <td colspan="3"></td>'; |
| 875 | - } |
|
| 876 | - else |
|
| 913 | + } else |
|
| 877 | 914 | { |
| 878 | 915 | echo ' |
| 879 | 916 | <td class="centercol"><input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', ' class="input_radio"></td> |