@@ -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> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
| 46 | + } |
|
| 45 | 47 | |
| 46 | 48 | echo ' |
| 47 | 49 | <br> |
@@ -82,9 +84,10 @@ discard block |
||
| 82 | 84 | </dt> |
| 83 | 85 | <dd>'; |
| 84 | 86 | |
| 85 | - foreach ($context['groups'] as $group) |
|
| 86 | - echo ' |
|
| 87 | + foreach ($context['groups'] as $group) { |
|
| 88 | + echo ' |
|
| 87 | 89 | <label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
| 90 | + } |
|
| 88 | 91 | |
| 89 | 92 | echo ' |
| 90 | 93 | <br> |
@@ -230,9 +233,10 @@ discard block |
||
| 230 | 233 | <div id="bbcBox_message"></div>'; |
| 231 | 234 | |
| 232 | 235 | // What about smileys? |
| 233 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
| 234 | - echo ' |
|
| 236 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
| 237 | + echo ' |
|
| 235 | 238 | <div id="smileyBox_message"></div>'; |
| 239 | + } |
|
| 236 | 240 | |
| 237 | 241 | // Show BBC buttons, smileys and textbox. |
| 238 | 242 | echo ' |
@@ -253,9 +257,10 @@ discard block |
||
| 253 | 257 | <input type="hidden" name="email_force" value="', $context['email_force'], '"> |
| 254 | 258 | <input type="hidden" name="total_emails" value="', $context['total_emails'], '">'; |
| 255 | 259 | |
| 256 | - foreach ($context['recipients'] as $key => $values) |
|
| 257 | - echo ' |
|
| 260 | + foreach ($context['recipients'] as $key => $values) { |
|
| 261 | + echo ' |
|
| 258 | 262 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
| 263 | + } |
|
| 259 | 264 | |
| 260 | 265 | echo ' |
| 261 | 266 | <script>'; |
@@ -411,9 +416,10 @@ discard block |
||
| 411 | 416 | <input type="hidden" name="parse_html" value="', $context['parse_html'], '">'; |
| 412 | 417 | |
| 413 | 418 | // All the things we must remember! |
| 414 | - foreach ($context['recipients'] as $key => $values) |
|
| 415 | - echo ' |
|
| 419 | + foreach ($context['recipients'] as $key => $values) { |
|
| 420 | + echo ' |
|
| 416 | 421 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
| 422 | + } |
|
| 417 | 423 | |
| 418 | 424 | echo ' |
| 419 | 425 | </div><!-- .windowbg --> |
@@ -446,9 +452,10 @@ discard block |
||
| 446 | 452 | { |
| 447 | 453 | global $context, $txt; |
| 448 | 454 | |
| 449 | - if (!empty($context['saved_successful'])) |
|
| 450 | - echo ' |
|
| 455 | + if (!empty($context['saved_successful'])) { |
|
| 456 | + echo ' |
|
| 451 | 457 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 458 | + } |
|
| 452 | 459 | |
| 453 | 460 | template_show_list('news_lists'); |
| 454 | 461 | } |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | </thead> |
| 149 | 149 | <tbody>'; |
| 150 | 150 | |
| 151 | - foreach ($context['membergroups'] as $membergroup) |
|
| 152 | - echo ' |
|
| 151 | + foreach ($context['membergroups'] as $membergroup) { |
|
| 152 | + echo ' |
|
| 153 | 153 | <tr class="windowbg"> |
| 154 | 154 | <td>', $membergroup['name'], '</td> |
| 155 | 155 | <td class="centercol"> |
@@ -159,6 +159,7 @@ discard block |
||
| 159 | 159 | ', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked>' : '', ' |
| 160 | 160 | </td> |
| 161 | 161 | </tr>'; |
| 162 | + } |
|
| 162 | 163 | |
| 163 | 164 | echo ' |
| 164 | 165 | <tr class="windowbg"> |
@@ -185,8 +186,8 @@ discard block |
||
| 185 | 186 | </thead> |
| 186 | 187 | <tbody>'; |
| 187 | 188 | |
| 188 | - foreach ($context['postgroups'] as $postgroup) |
|
| 189 | - echo ' |
|
| 189 | + foreach ($context['postgroups'] as $postgroup) { |
|
| 190 | + echo ' |
|
| 190 | 191 | <tr class="windowbg"> |
| 191 | 192 | <td> |
| 192 | 193 | ', $postgroup['name'], ' |
@@ -195,6 +196,7 @@ discard block |
||
| 195 | 196 | <input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked> |
| 196 | 197 | </td> |
| 197 | 198 | </tr>'; |
| 199 | + } |
|
| 198 | 200 | |
| 199 | 201 | echo ' |
| 200 | 202 | <tr class="windowbg"> |
@@ -232,7 +232,7 @@ |
||
| 232 | 232 | // In maintenance mode, only login is allowed and don't show OverlayDiv |
| 233 | 233 | echo ' |
| 234 | 234 | <ul class="floatleft welcome"> |
| 235 | - <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li> |
|
| 235 | + <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl . '?action=login', 'return true;'), '</li> |
|
| 236 | 236 | </ul>'; |
| 237 | 237 | |
| 238 | 238 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
@@ -72,9 +72,10 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // Allow css/js files to be disabled for this specific theme. |
| 74 | 74 | // Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference. |
| 75 | - if (!isset($settings['disable_files'])) |
|
| 76 | - $settings['disable_files'] = array(); |
|
| 77 | -} |
|
| 75 | + if (!isset($settings['disable_files'])) { |
|
| 76 | + $settings['disable_files'] = array(); |
|
| 77 | + } |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | /** |
| 80 | 81 | * The main sub template above the content. |
@@ -112,8 +113,9 @@ discard block |
||
| 112 | 113 | echo ' |
| 113 | 114 | <meta'; |
| 114 | 115 | |
| 115 | - foreach ($meta_tag as $meta_key => $meta_value) |
|
| 116 | - echo ' ', $meta_key, '="', $meta_value, '"'; |
|
| 116 | + foreach ($meta_tag as $meta_key => $meta_value) { |
|
| 117 | + echo ' ', $meta_key, '="', $meta_value, '"'; |
|
| 118 | + } |
|
| 117 | 119 | |
| 118 | 120 | echo '>'; |
| 119 | 121 | } |
@@ -124,14 +126,16 @@ discard block |
||
| 124 | 126 | <meta name="theme-color" content="#557EA0">'; |
| 125 | 127 | |
| 126 | 128 | // Please don't index these Mr Robot. |
| 127 | - if (!empty($context['robot_no_index'])) |
|
| 128 | - echo ' |
|
| 129 | + if (!empty($context['robot_no_index'])) { |
|
| 130 | + echo ' |
|
| 129 | 131 | <meta name="robots" content="noindex">'; |
| 132 | + } |
|
| 130 | 133 | |
| 131 | 134 | // Present a canonical url for search engines to prevent duplicate content in their indices. |
| 132 | - if (!empty($context['canonical_url'])) |
|
| 133 | - echo ' |
|
| 135 | + if (!empty($context['canonical_url'])) { |
|
| 136 | + echo ' |
|
| 134 | 137 | <link rel="canonical" href="', $context['canonical_url'], '">'; |
| 138 | + } |
|
| 135 | 139 | |
| 136 | 140 | // Show all the relative links, such as help, search, contents, and the like. |
| 137 | 141 | echo ' |
@@ -140,24 +144,28 @@ discard block |
||
| 140 | 144 | <link rel="search" href="' . $scripturl . '?action=search">' : ''); |
| 141 | 145 | |
| 142 | 146 | // If RSS feeds are enabled, advertise the presence of one. |
| 143 | - if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) |
|
| 144 | - echo ' |
|
| 147 | + if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) { |
|
| 148 | + echo ' |
|
| 145 | 149 | <link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?action=.xml;type=rss2', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '"> |
| 146 | 150 | <link rel="alternate" type="application/atom+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?action=.xml;type=atom', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">'; |
| 151 | + } |
|
| 147 | 152 | |
| 148 | 153 | // If we're viewing a topic, these should be the previous and next topics, respectively. |
| 149 | - if (!empty($context['links']['next'])) |
|
| 150 | - echo ' |
|
| 154 | + if (!empty($context['links']['next'])) { |
|
| 155 | + echo ' |
|
| 151 | 156 | <link rel="next" href="', $context['links']['next'], '">'; |
| 157 | + } |
|
| 152 | 158 | |
| 153 | - if (!empty($context['links']['prev'])) |
|
| 154 | - echo ' |
|
| 159 | + if (!empty($context['links']['prev'])) { |
|
| 160 | + echo ' |
|
| 155 | 161 | <link rel="prev" href="', $context['links']['prev'], '">'; |
| 162 | + } |
|
| 156 | 163 | |
| 157 | 164 | // If we're in a board, or a topic for that matter, the index will be the board's index. |
| 158 | - if (!empty($context['current_board'])) |
|
| 159 | - echo ' |
|
| 165 | + if (!empty($context['current_board'])) { |
|
| 166 | + echo ' |
|
| 160 | 167 | <link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">'; |
| 168 | + } |
|
| 161 | 169 | |
| 162 | 170 | // Output any remaining HTML headers. (from mods, maybe?) |
| 163 | 171 | echo $context['html_headers']; |
@@ -190,20 +198,22 @@ discard block |
||
| 190 | 198 | <li> |
| 191 | 199 | <a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">'; |
| 192 | 200 | |
| 193 | - if (!empty($context['user']['avatar'])) |
|
| 194 | - echo $context['user']['avatar']['image']; |
|
| 201 | + if (!empty($context['user']['avatar'])) { |
|
| 202 | + echo $context['user']['avatar']['image']; |
|
| 203 | + } |
|
| 195 | 204 | |
| 196 | 205 | echo $context['user']['name'], '</a> |
| 197 | 206 | <div id="profile_menu" class="top_menu"></div> |
| 198 | 207 | </li>'; |
| 199 | 208 | |
| 200 | 209 | // Secondly, PMs if we're doing them |
| 201 | - if ($context['allow_pm']) |
|
| 202 | - echo ' |
|
| 210 | + if ($context['allow_pm']) { |
|
| 211 | + echo ' |
|
| 203 | 212 | <li> |
| 204 | 213 | <a href="', $scripturl, '?action=pm"', !empty($context['self_pm']) ? ' class="active"' : '', ' id="pm_menu_top">', $txt['pm_short'], !empty($context['user']['unread_messages']) ? ' <span class="amt">' . $context['user']['unread_messages'] . '</span>' : '', '</a> |
| 205 | 214 | <div id="pm_menu" class="top_menu scrollable"></div> |
| 206 | 215 | </li>'; |
| 216 | + } |
|
| 207 | 217 | |
| 208 | 218 | // Thirdly, alerts |
| 209 | 219 | echo ' |
@@ -218,17 +228,18 @@ discard block |
||
| 218 | 228 | } |
| 219 | 229 | // Otherwise they're a guest. Ask them to either register or login. |
| 220 | 230 | else |
| 221 | - if (empty($maintenance)) |
|
| 222 | - echo ' |
|
| 231 | + if (empty($maintenance)) { |
|
| 232 | + echo ' |
|
| 223 | 233 | <ul class="floatleft welcome"> |
| 224 | 234 | <li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li> |
| 225 | 235 | </ul>'; |
| 226 | - else |
|
| 227 | - // In maintenance mode, only login is allowed and don't show OverlayDiv |
|
| 236 | + } else { |
|
| 237 | + // In maintenance mode, only login is allowed and don't show OverlayDiv |
|
| 228 | 238 | echo ' |
| 229 | 239 | <ul class="floatleft welcome"> |
| 230 | 240 | <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li> |
| 231 | 241 | </ul>'; |
| 242 | + } |
|
| 232 | 243 | |
| 233 | 244 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
| 234 | 245 | { |
@@ -236,9 +247,10 @@ discard block |
||
| 236 | 247 | <form id="languages_form" method="get" class="floatright"> |
| 237 | 248 | <select id="language_select" name="language" onchange="this.form.submit()">'; |
| 238 | 249 | |
| 239 | - foreach ($context['languages'] as $language) |
|
| 240 | - echo ' |
|
| 250 | + foreach ($context['languages'] as $language) { |
|
| 251 | + echo ' |
|
| 241 | 252 | <option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>'; |
| 253 | + } |
|
| 242 | 254 | |
| 243 | 255 | echo ' |
| 244 | 256 | </select> |
@@ -262,32 +274,37 @@ discard block |
||
| 262 | 274 | <option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>'; |
| 263 | 275 | |
| 264 | 276 | // Can't limit it to a specific topic if we are not in one |
| 265 | - if (!empty($context['current_topic'])) |
|
| 266 | - echo ' |
|
| 277 | + if (!empty($context['current_topic'])) { |
|
| 278 | + echo ' |
|
| 267 | 279 | <option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>'; |
| 280 | + } |
|
| 268 | 281 | |
| 269 | 282 | // Can't limit it to a specific board if we are not in one |
| 270 | - if (!empty($context['current_board'])) |
|
| 271 | - echo ' |
|
| 283 | + if (!empty($context['current_board'])) { |
|
| 284 | + echo ' |
|
| 272 | 285 | <option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>'; |
| 286 | + } |
|
| 273 | 287 | |
| 274 | 288 | // Can't search for members if we can't see the memberlist |
| 275 | - if (!empty($context['allow_memberlist'])) |
|
| 276 | - echo ' |
|
| 289 | + if (!empty($context['allow_memberlist'])) { |
|
| 290 | + echo ' |
|
| 277 | 291 | <option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>'; |
| 292 | + } |
|
| 278 | 293 | |
| 279 | 294 | echo ' |
| 280 | 295 | </select>'; |
| 281 | 296 | |
| 282 | 297 | // Search within current topic? |
| 283 | - if (!empty($context['current_topic'])) |
|
| 284 | - echo ' |
|
| 298 | + if (!empty($context['current_topic'])) { |
|
| 299 | + echo ' |
|
| 285 | 300 | <input type="hidden" name="sd_topic" value="', $context['current_topic'], '">'; |
| 301 | + } |
|
| 286 | 302 | |
| 287 | 303 | // If we're on a certain board, limit it to this board ;). |
| 288 | - elseif (!empty($context['current_board'])) |
|
| 289 | - echo ' |
|
| 304 | + elseif (!empty($context['current_board'])) { |
|
| 305 | + echo ' |
|
| 290 | 306 | <input type="hidden" name="sd_brd" value="', $context['current_board'], '">'; |
| 307 | + } |
|
| 291 | 308 | |
| 292 | 309 | echo ' |
| 293 | 310 | <input type="submit" name="search2" value="', $txt['search'], '" class="button"> |
@@ -319,12 +336,13 @@ discard block |
||
| 319 | 336 | </div>'; |
| 320 | 337 | |
| 321 | 338 | // Show a random news item? (or you could pick one from news_lines...) |
| 322 | - if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) |
|
| 323 | - echo ' |
|
| 339 | + if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) { |
|
| 340 | + echo ' |
|
| 324 | 341 | <div class="news"> |
| 325 | 342 | <h2>', $txt['news'], ': </h2> |
| 326 | 343 | <p>', $context['random_news_line'], '</p> |
| 327 | 344 | </div>'; |
| 345 | + } |
|
| 328 | 346 | |
| 329 | 347 | echo ' |
| 330 | 348 | <hr class="clear"> |
@@ -385,9 +403,10 @@ discard block |
||
| 385 | 403 | </ul>'; |
| 386 | 404 | |
| 387 | 405 | // Show the load time? |
| 388 | - if ($context['show_load_time']) |
|
| 389 | - echo ' |
|
| 406 | + if ($context['show_load_time']) { |
|
| 407 | + echo ' |
|
| 390 | 408 | <p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>'; |
| 409 | + } |
|
| 391 | 410 | |
| 392 | 411 | echo ' |
| 393 | 412 | </div> |
@@ -418,18 +437,20 @@ discard block |
||
| 418 | 437 | global $context, $shown_linktree, $scripturl, $txt; |
| 419 | 438 | |
| 420 | 439 | // If linktree is empty, just return - also allow an override. |
| 421 | - if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) |
|
| 422 | - return; |
|
| 440 | + if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) { |
|
| 441 | + return; |
|
| 442 | + } |
|
| 423 | 443 | echo ' |
| 424 | 444 | <div class="navigate_section"> |
| 425 | 445 | <ul>'; |
| 426 | 446 | |
| 427 | - if ($context['user']['is_logged']) |
|
| 428 | - echo ' |
|
| 447 | + if ($context['user']['is_logged']) { |
|
| 448 | + echo ' |
|
| 429 | 449 | <li class="unread_links"> |
| 430 | 450 | <a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a> |
| 431 | 451 | <a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a> |
| 432 | 452 | </li>'; |
| 453 | + } |
|
| 433 | 454 | |
| 434 | 455 | // Each tree item has a URL and name. Some may have extra_before and extra_after. |
| 435 | 456 | foreach ($context['linktree'] as $link_num => $tree) |
@@ -440,25 +461,29 @@ discard block |
||
| 440 | 461 | // Don't show a separator for the first one. |
| 441 | 462 | // Better here. Always points to the next level when the linktree breaks to a second line. |
| 442 | 463 | // Picked a better looking HTML entity, and added support for RTL plus a span for styling. |
| 443 | - if ($link_num != 0) |
|
| 444 | - echo ' |
|
| 464 | + if ($link_num != 0) { |
|
| 465 | + echo ' |
|
| 445 | 466 | <span class="dividers">', $context['right_to_left'] ? ' ◄ ' : ' ► ', '</span>'; |
| 467 | + } |
|
| 446 | 468 | |
| 447 | 469 | // Show something before the link? |
| 448 | - if (isset($tree['extra_before'])) |
|
| 449 | - echo $tree['extra_before'], ' '; |
|
| 470 | + if (isset($tree['extra_before'])) { |
|
| 471 | + echo $tree['extra_before'], ' '; |
|
| 472 | + } |
|
| 450 | 473 | |
| 451 | 474 | // Show the link, including a URL if it should have one. |
| 452 | - if (isset($tree['url'])) |
|
| 453 | - echo ' |
|
| 475 | + if (isset($tree['url'])) { |
|
| 476 | + echo ' |
|
| 454 | 477 | <a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>'; |
| 455 | - else |
|
| 456 | - echo ' |
|
| 478 | + } else { |
|
| 479 | + echo ' |
|
| 457 | 480 | <span>' . $tree['name'] . '</span>'; |
| 481 | + } |
|
| 458 | 482 | |
| 459 | 483 | // Show something after the link...? |
| 460 | - if (isset($tree['extra_after'])) |
|
| 461 | - echo ' ', $tree['extra_after']; |
|
| 484 | + if (isset($tree['extra_after'])) { |
|
| 485 | + echo ' ', $tree['extra_after']; |
|
| 486 | + } |
|
| 462 | 487 | |
| 463 | 488 | echo ' |
| 464 | 489 | </li>'; |
@@ -509,13 +534,14 @@ discard block |
||
| 509 | 534 | echo ' |
| 510 | 535 | <ul>'; |
| 511 | 536 | |
| 512 | - foreach ($childbutton['sub_buttons'] as $grandchildbutton) |
|
| 513 | - echo ' |
|
| 537 | + foreach ($childbutton['sub_buttons'] as $grandchildbutton) { |
|
| 538 | + echo ' |
|
| 514 | 539 | <li> |
| 515 | 540 | <a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '> |
| 516 | 541 | ', $grandchildbutton['title'], ' |
| 517 | 542 | </a> |
| 518 | 543 | </li>'; |
| 544 | + } |
|
| 519 | 545 | |
| 520 | 546 | echo ' |
| 521 | 547 | </ul>'; |
@@ -546,8 +572,9 @@ discard block |
||
| 546 | 572 | { |
| 547 | 573 | global $context, $txt; |
| 548 | 574 | |
| 549 | - if (!is_array($strip_options)) |
|
| 550 | - $strip_options = array(); |
|
| 575 | + if (!is_array($strip_options)) { |
|
| 576 | + $strip_options = array(); |
|
| 577 | + } |
|
| 551 | 578 | |
| 552 | 579 | // Create the buttons... |
| 553 | 580 | $buttons = array(); |
@@ -556,8 +583,9 @@ discard block |
||
| 556 | 583 | // As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!) |
| 557 | 584 | if (!isset($value['test']) || !empty($context[$value['test']])) |
| 558 | 585 | { |
| 559 | - if (!isset($value['id'])) |
|
| 560 | - $value['id'] = $key; |
|
| 586 | + if (!isset($value['id'])) { |
|
| 587 | + $value['id'] = $key; |
|
| 588 | + } |
|
| 561 | 589 | |
| 562 | 590 | $button = ' |
| 563 | 591 | <a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>'; |
@@ -570,13 +598,15 @@ discard block |
||
| 570 | 598 | <div class="overview">'; |
| 571 | 599 | foreach ($value['sub_buttons'] as $element) |
| 572 | 600 | { |
| 573 | - if (isset($element['test']) && empty($context[$element['test']])) |
|
| 574 | - continue; |
|
| 601 | + if (isset($element['test']) && empty($context[$element['test']])) { |
|
| 602 | + continue; |
|
| 603 | + } |
|
| 575 | 604 | |
| 576 | 605 | $button .= ' |
| 577 | 606 | <a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>'; |
| 578 | - if (isset($txt[$element['text'] . '_desc'])) |
|
| 579 | - $button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
| 607 | + if (isset($txt[$element['text'] . '_desc'])) { |
|
| 608 | + $button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
| 609 | + } |
|
| 580 | 610 | $button .= '</a>'; |
| 581 | 611 | } |
| 582 | 612 | $button .= ' |
@@ -590,8 +620,9 @@ discard block |
||
| 590 | 620 | } |
| 591 | 621 | |
| 592 | 622 | // No buttons? No button strip either. |
| 593 | - if (empty($buttons)) |
|
| 594 | - return; |
|
| 623 | + if (empty($buttons)) { |
|
| 624 | + return; |
|
| 625 | + } |
|
| 595 | 626 | |
| 596 | 627 | echo ' |
| 597 | 628 | <div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"' : ''), '> |
@@ -945,7 +945,7 @@ |
||
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | echo isset($config_var['postinput']) ? ' |
| 948 | - ' . $config_var['postinput'] : '',' |
|
| 948 | + ' . $config_var['postinput'] : '', ' |
|
| 949 | 949 | </dd>'; |
| 950 | 950 | } |
| 951 | 951 | } |
@@ -65,9 +65,10 @@ discard block |
||
| 65 | 65 | ', implode(', ', $context['administrators']); |
| 66 | 66 | |
| 67 | 67 | // If we have lots of admins... don't show them all. |
| 68 | - if (!empty($context['more_admins_link'])) |
|
| 69 | - echo ' |
|
| 68 | + if (!empty($context['more_admins_link'])) { |
|
| 69 | + echo ' |
|
| 70 | 70 | (', $context['more_admins_link'], ')'; |
| 71 | + } |
|
| 71 | 72 | |
| 72 | 73 | echo ' |
| 73 | 74 | </div><!-- #version_details --> |
@@ -84,17 +85,19 @@ discard block |
||
| 84 | 85 | foreach ($area['areas'] as $item_id => $item) |
| 85 | 86 | { |
| 86 | 87 | // No point showing the 'home' page here, we're already on it! |
| 87 | - if ($area_id == 'forum' && $item_id == 'index') |
|
| 88 | - continue; |
|
| 88 | + if ($area_id == 'forum' && $item_id == 'index') { |
|
| 89 | + continue; |
|
| 90 | + } |
|
| 89 | 91 | |
| 90 | 92 | $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'] : ''); |
| 91 | 93 | |
| 92 | - if (!empty($item['icon_file'])) |
|
| 93 | - echo ' |
|
| 94 | + if (!empty($item['icon_file'])) { |
|
| 95 | + echo ' |
|
| 94 | 96 | <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>'; |
| 95 | - else |
|
| 96 | - echo ' |
|
| 97 | + } else { |
|
| 98 | + echo ' |
|
| 97 | 99 | <a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>'; |
| 100 | + } |
|
| 98 | 101 | } |
| 99 | 102 | |
| 100 | 103 | echo ' |
@@ -105,10 +108,11 @@ discard block |
||
| 105 | 108 | </div><!-- #admincenter -->'; |
| 106 | 109 | |
| 107 | 110 | // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization. |
| 108 | - if (empty($modSettings['disable_smf_js'])) |
|
| 109 | - echo ' |
|
| 111 | + if (empty($modSettings['disable_smf_js'])) { |
|
| 112 | + echo ' |
|
| 110 | 113 | <script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script> |
| 111 | 114 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
| 115 | + } |
|
| 112 | 116 | |
| 113 | 117 | // This sets the announcements and current versions themselves ;). |
| 114 | 118 | echo ' |
@@ -186,9 +190,10 @@ discard block |
||
| 186 | 190 | <em>', $version['version'], '</em>'; |
| 187 | 191 | |
| 188 | 192 | // more details for this item, show them a link |
| 189 | - if ($context['can_admin'] && isset($version['more'])) |
|
| 190 | - echo |
|
| 193 | + if ($context['can_admin'] && isset($version['more'])) { |
|
| 194 | + echo |
|
| 191 | 195 | ' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>'; |
| 196 | + } |
|
| 192 | 197 | echo ' |
| 193 | 198 | <br>'; |
| 194 | 199 | } |
@@ -219,21 +224,23 @@ discard block |
||
| 219 | 224 | |
| 220 | 225 | foreach ($context['credits'] as $section) |
| 221 | 226 | { |
| 222 | - if (isset($section['pretext'])) |
|
| 223 | - echo ' |
|
| 227 | + if (isset($section['pretext'])) { |
|
| 228 | + echo ' |
|
| 224 | 229 | <p>', $section['pretext'], '</p> |
| 225 | 230 | <hr>'; |
| 231 | + } |
|
| 226 | 232 | |
| 227 | 233 | echo ' |
| 228 | 234 | <dl>'; |
| 229 | 235 | |
| 230 | 236 | foreach ($section['groups'] as $group) |
| 231 | 237 | { |
| 232 | - if (isset($group['title'])) |
|
| 233 | - echo ' |
|
| 238 | + if (isset($group['title'])) { |
|
| 239 | + echo ' |
|
| 234 | 240 | <dt> |
| 235 | 241 | <strong>', $group['title'], ':</strong> |
| 236 | 242 | </dt>'; |
| 243 | + } |
|
| 237 | 244 | |
| 238 | 245 | echo ' |
| 239 | 246 | <dd>', implode(', ', $group['members']), '</dd>'; |
@@ -242,10 +249,11 @@ discard block |
||
| 242 | 249 | echo ' |
| 243 | 250 | </dl>'; |
| 244 | 251 | |
| 245 | - if (isset($section['posttext'])) |
|
| 246 | - echo ' |
|
| 252 | + if (isset($section['posttext'])) { |
|
| 253 | + echo ' |
|
| 247 | 254 | <hr> |
| 248 | 255 | <p>', $section['posttext'], '</p>'; |
| 256 | + } |
|
| 249 | 257 | } |
| 250 | 258 | |
| 251 | 259 | echo ' |
@@ -261,9 +269,10 @@ discard block |
||
| 261 | 269 | smfSupportVersions.forum = "', $context['forum_version'], '";'; |
| 262 | 270 | |
| 263 | 271 | // Don't worry, none of this is logged, it's just used to give information that might be of use. |
| 264 | - foreach ($context['current_versions'] as $variable => $version) |
|
| 265 | - echo ' |
|
| 272 | + foreach ($context['current_versions'] as $variable => $version) { |
|
| 273 | + echo ' |
|
| 266 | 274 | smfSupportVersions.', $variable, ' = "', $version['version'], '";'; |
| 275 | + } |
|
| 267 | 276 | |
| 268 | 277 | // Now we just have to include the script and wait ;). |
| 269 | 278 | echo ' |
@@ -360,8 +369,8 @@ discard block |
||
| 360 | 369 | <tbody>'; |
| 361 | 370 | |
| 362 | 371 | // Loop through every source file displaying its version - using javascript. |
| 363 | - foreach ($context['file_versions'] as $filename => $version) |
|
| 364 | - echo ' |
|
| 372 | + foreach ($context['file_versions'] as $filename => $version) { |
|
| 373 | + echo ' |
|
| 365 | 374 | <tr class="windowbg"> |
| 366 | 375 | <td class="half_table"> |
| 367 | 376 | ', $filename, ' |
@@ -373,6 +382,7 @@ discard block |
||
| 373 | 382 | <em id="currentSources', $filename, '">??</em> |
| 374 | 383 | </td> |
| 375 | 384 | </tr>'; |
| 385 | + } |
|
| 376 | 386 | |
| 377 | 387 | // Default template files. |
| 378 | 388 | echo ' |
@@ -398,8 +408,8 @@ discard block |
||
| 398 | 408 | <table id="Default" class="table_grid"> |
| 399 | 409 | <tbody>'; |
| 400 | 410 | |
| 401 | - foreach ($context['default_template_versions'] as $filename => $version) |
|
| 402 | - echo ' |
|
| 411 | + foreach ($context['default_template_versions'] as $filename => $version) { |
|
| 412 | + echo ' |
|
| 403 | 413 | <tr class="windowbg"> |
| 404 | 414 | <td class="half_table"> |
| 405 | 415 | ', $filename, ' |
@@ -411,6 +421,7 @@ discard block |
||
| 411 | 421 | <em id="currentDefault', $filename, '">??</em> |
| 412 | 422 | </td> |
| 413 | 423 | </tr>'; |
| 424 | + } |
|
| 414 | 425 | |
| 415 | 426 | // Now the language files... |
| 416 | 427 | echo ' |
@@ -438,8 +449,8 @@ discard block |
||
| 438 | 449 | |
| 439 | 450 | foreach ($context['default_language_versions'] as $language => $files) |
| 440 | 451 | { |
| 441 | - foreach ($files as $filename => $version) |
|
| 442 | - echo ' |
|
| 452 | + foreach ($files as $filename => $version) { |
|
| 453 | + echo ' |
|
| 443 | 454 | <tr class="windowbg"> |
| 444 | 455 | <td class="half_table"> |
| 445 | 456 | ', $filename, '.<em>', $language, '</em>.php |
@@ -451,6 +462,7 @@ discard block |
||
| 451 | 462 | <em id="current', $filename, '.', $language, '">??</em> |
| 452 | 463 | </td> |
| 453 | 464 | </tr>'; |
| 465 | + } |
|
| 454 | 466 | } |
| 455 | 467 | |
| 456 | 468 | echo ' |
@@ -480,8 +492,8 @@ discard block |
||
| 480 | 492 | <table id="Templates" class="table_grid"> |
| 481 | 493 | <tbody>'; |
| 482 | 494 | |
| 483 | - foreach ($context['template_versions'] as $filename => $version) |
|
| 484 | - echo ' |
|
| 495 | + foreach ($context['template_versions'] as $filename => $version) { |
|
| 496 | + echo ' |
|
| 485 | 497 | <tr class="windowbg"> |
| 486 | 498 | <td class="half_table"> |
| 487 | 499 | ', $filename, ' |
@@ -493,6 +505,7 @@ discard block |
||
| 493 | 505 | <em id="currentTemplates', $filename, '">??</em> |
| 494 | 506 | </td> |
| 495 | 507 | </tr>'; |
| 508 | + } |
|
| 496 | 509 | |
| 497 | 510 | echo ' |
| 498 | 511 | </tbody> |
@@ -522,8 +535,8 @@ discard block |
||
| 522 | 535 | <table id="Tasks" class="table_grid"> |
| 523 | 536 | <tbody>'; |
| 524 | 537 | |
| 525 | - foreach ($context['tasks_versions'] as $filename => $version) |
|
| 526 | - echo ' |
|
| 538 | + foreach ($context['tasks_versions'] as $filename => $version) { |
|
| 539 | + echo ' |
|
| 527 | 540 | <tr class="windowbg"> |
| 528 | 541 | <td class="half_table"> |
| 529 | 542 | ', $filename, ' |
@@ -535,6 +548,7 @@ discard block |
||
| 535 | 548 | <em id="currentTasks', $filename, '">??</em> |
| 536 | 549 | </td> |
| 537 | 550 | </tr>'; |
| 551 | + } |
|
| 538 | 552 | |
| 539 | 553 | echo ' |
| 540 | 554 | </tbody> |
@@ -576,9 +590,10 @@ discard block |
||
| 576 | 590 | { |
| 577 | 591 | global $context, $scripturl, $txt, $modSettings; |
| 578 | 592 | |
| 579 | - if (!empty($context['saved_successful'])) |
|
| 580 | - echo ' |
|
| 593 | + if (!empty($context['saved_successful'])) { |
|
| 594 | + echo ' |
|
| 581 | 595 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 596 | + } |
|
| 582 | 597 | |
| 583 | 598 | // First section is for adding/removing words from the censored list. |
| 584 | 599 | echo ' |
@@ -593,11 +608,12 @@ discard block |
||
| 593 | 608 | <p>', $txt['admin_censored_where'], '</p>'; |
| 594 | 609 | |
| 595 | 610 | // Show text boxes for censoring [bad ] => [good ]. |
| 596 | - foreach ($context['censored_words'] as $vulgar => $proper) |
|
| 597 | - echo ' |
|
| 611 | + foreach ($context['censored_words'] as $vulgar => $proper) { |
|
| 612 | + echo ' |
|
| 598 | 613 | <div class="block"> |
| 599 | 614 | <input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> => <input type="text" name="censor_proper[]" value="', $proper, '" size="30"> |
| 600 | 615 | </div>'; |
| 616 | + } |
|
| 601 | 617 | |
| 602 | 618 | // Now provide a way to censor more words. |
| 603 | 619 | echo ' |
@@ -672,27 +688,30 @@ discard block |
||
| 672 | 688 | <div class="windowbg"> |
| 673 | 689 | ', $txt['not_done_reason']; |
| 674 | 690 | |
| 675 | - if (!empty($context['continue_percent'])) |
|
| 676 | - echo ' |
|
| 691 | + if (!empty($context['continue_percent'])) { |
|
| 692 | + echo ' |
|
| 677 | 693 | <div class="progress_bar"> |
| 678 | 694 | <span>', $context['continue_percent'], '%</span> |
| 679 | 695 | <div class="bar" style="width: ', $context['continue_percent'], '%;"></div> |
| 680 | 696 | </div>'; |
| 697 | + } |
|
| 681 | 698 | |
| 682 | - if (!empty($context['substep_enabled'])) |
|
| 683 | - echo ' |
|
| 699 | + if (!empty($context['substep_enabled'])) { |
|
| 700 | + echo ' |
|
| 684 | 701 | <div class="progress_bar progress_blue"> |
| 685 | 702 | <span>', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</span> |
| 686 | 703 | <div class="bar" style="width: ', $context['substep_continue_percent'], '%;"></div> |
| 687 | 704 | </div>'; |
| 705 | + } |
|
| 688 | 706 | |
| 689 | 707 | echo ' |
| 690 | 708 | <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">'; |
| 691 | 709 | |
| 692 | 710 | // Do we have a token? |
| 693 | - if (isset($context['not_done_token']) && isset($context[$context['not_done_token'] . '_token'], $context[$context['not_done_token'] . '_token_var'])) |
|
| 694 | - echo ' |
|
| 711 | + if (isset($context['not_done_token']) && isset($context[$context['not_done_token'] . '_token'], $context[$context['not_done_token'] . '_token_var'])) { |
|
| 712 | + echo ' |
|
| 695 | 713 | <input type="hidden" name="', $context[$context['not_done_token'] . '_token_var'], '" value="', $context[$context['not_done_token'] . '_token'], '">'; |
| 714 | + } |
|
| 696 | 715 | |
| 697 | 716 | echo ' |
| 698 | 717 | <input type="submit" name="cont" value="', $txt['not_done_continue'], '" class="button"> |
@@ -726,35 +745,40 @@ discard block |
||
| 726 | 745 | { |
| 727 | 746 | global $context, $txt, $scripturl; |
| 728 | 747 | |
| 729 | - if (!empty($context['saved_successful'])) |
|
| 730 | - echo ' |
|
| 748 | + if (!empty($context['saved_successful'])) { |
|
| 749 | + echo ' |
|
| 731 | 750 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 732 | - elseif (!empty($context['saved_failed'])) |
|
| 733 | - echo ' |
|
| 751 | + } elseif (!empty($context['saved_failed'])) { |
|
| 752 | + echo ' |
|
| 734 | 753 | <div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>'; |
| 754 | + } |
|
| 735 | 755 | |
| 736 | - if (!empty($context['settings_pre_javascript'])) |
|
| 737 | - echo ' |
|
| 756 | + if (!empty($context['settings_pre_javascript'])) { |
|
| 757 | + echo ' |
|
| 738 | 758 | <script>', $context['settings_pre_javascript'], '</script>'; |
| 759 | + } |
|
| 739 | 760 | |
| 740 | - if (!empty($context['settings_insert_above'])) |
|
| 741 | - echo $context['settings_insert_above']; |
|
| 761 | + if (!empty($context['settings_insert_above'])) { |
|
| 762 | + echo $context['settings_insert_above']; |
|
| 763 | + } |
|
| 742 | 764 | |
| 743 | 765 | echo ' |
| 744 | 766 | <div id="admincenter"> |
| 745 | 767 | <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'] . '"' : '', '>'; |
| 746 | 768 | |
| 747 | 769 | // Is there a custom title? |
| 748 | - if (isset($context['settings_title'])) |
|
| 749 | - echo ' |
|
| 770 | + if (isset($context['settings_title'])) { |
|
| 771 | + echo ' |
|
| 750 | 772 | <div class="cat_bar"> |
| 751 | 773 | <h3 class="catbg">', $context['settings_title'], '</h3> |
| 752 | 774 | </div>'; |
| 775 | + } |
|
| 753 | 776 | |
| 754 | 777 | // Have we got a message to display? |
| 755 | - if (!empty($context['settings_message'])) |
|
| 756 | - echo ' |
|
| 778 | + if (!empty($context['settings_message'])) { |
|
| 779 | + echo ' |
|
| 757 | 780 | <div class="information">', $context['settings_message'], '</div>'; |
| 781 | + } |
|
| 758 | 782 | |
| 759 | 783 | // Now actually loop through all the variables. |
| 760 | 784 | $is_open = false; |
@@ -807,8 +831,9 @@ discard block |
||
| 807 | 831 | // Hang about? Are you pulling my leg - a callback?! |
| 808 | 832 | if (is_array($config_var) && $config_var['type'] == 'callback') |
| 809 | 833 | { |
| 810 | - if (function_exists('template_callback_' . $config_var['name'])) |
|
| 811 | - call_user_func('template_callback_' . $config_var['name']); |
|
| 834 | + if (function_exists('template_callback_' . $config_var['name'])) { |
|
| 835 | + call_user_func('template_callback_' . $config_var['name']); |
|
| 836 | + } |
|
| 812 | 837 | |
| 813 | 838 | continue; |
| 814 | 839 | } |
@@ -838,9 +863,10 @@ discard block |
||
| 838 | 863 | $text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time'); |
| 839 | 864 | |
| 840 | 865 | // Show the [?] button. |
| 841 | - if ($config_var['help']) |
|
| 842 | - echo ' |
|
| 866 | + if ($config_var['help']) { |
|
| 867 | + echo ' |
|
| 843 | 868 | <a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a> '; |
| 869 | + } |
|
| 844 | 870 | |
| 845 | 871 | echo ' |
| 846 | 872 | <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> |
@@ -849,23 +875,26 @@ discard block |
||
| 849 | 875 | $config_var['preinput']; |
| 850 | 876 | |
| 851 | 877 | // Show a check box. |
| 852 | - if ($config_var['type'] == 'check') |
|
| 853 | - echo ' |
|
| 878 | + if ($config_var['type'] == 'check') { |
|
| 879 | + echo ' |
|
| 854 | 880 | <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">'; |
| 881 | + } |
|
| 855 | 882 | // Escape (via htmlspecialchars.) the text box. |
| 856 | - elseif ($config_var['type'] == 'password') |
|
| 857 | - echo ' |
|
| 883 | + elseif ($config_var['type'] == 'password') { |
|
| 884 | + echo ' |
|
| 858 | 885 | <input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;"><br> |
| 859 | 886 | <input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
| 887 | + } |
|
| 860 | 888 | // Show a selection box. |
| 861 | 889 | elseif ($config_var['type'] == 'select') |
| 862 | 890 | { |
| 863 | 891 | echo ' |
| 864 | 892 | <select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), (!empty($config_var['multiple']) && !empty($config_var['size']) ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
| 865 | 893 | |
| 866 | - foreach ($config_var['data'] as $option) |
|
| 867 | - echo ' |
|
| 894 | + foreach ($config_var['data'] as $option) { |
|
| 895 | + echo ' |
|
| 868 | 896 | <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>'; |
| 897 | + } |
|
| 869 | 898 | echo ' |
| 870 | 899 | </select>'; |
| 871 | 900 | } |
@@ -882,16 +911,18 @@ discard block |
||
| 882 | 911 | |
| 883 | 912 | foreach ($context['board_list'] as $id_cat => $cat) |
| 884 | 913 | { |
| 885 | - if (!$first) |
|
| 886 | - echo ' |
|
| 914 | + if (!$first) { |
|
| 915 | + echo ' |
|
| 887 | 916 | <hr>'; |
| 917 | + } |
|
| 888 | 918 | echo ' |
| 889 | 919 | <strong>', $cat['name'], '</strong> |
| 890 | 920 | <ul>'; |
| 891 | 921 | |
| 892 | - foreach ($cat['boards'] as $id_board => $brd) |
|
| 893 | - echo ' |
|
| 922 | + foreach ($cat['boards'] as $id_board => $brd) { |
|
| 923 | + echo ' |
|
| 894 | 924 | <li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat(' ', $brd['child_level']) : '', $brd['name'], '</label></li>'; |
| 925 | + } |
|
| 895 | 926 | |
| 896 | 927 | echo ' |
| 897 | 928 | </ul>'; |
@@ -901,12 +932,14 @@ discard block |
||
| 901 | 932 | </fieldset>'; |
| 902 | 933 | } |
| 903 | 934 | // Text area? |
| 904 | - elseif ($config_var['type'] == 'large_text') |
|
| 905 | - echo ' |
|
| 935 | + elseif ($config_var['type'] == 'large_text') { |
|
| 936 | + echo ' |
|
| 906 | 937 | <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>'; |
| 938 | + } |
|
| 907 | 939 | // Permission group? |
| 908 | - elseif ($config_var['type'] == 'permissions') |
|
| 909 | - theme_inline_permissions($config_var['name']); |
|
| 940 | + elseif ($config_var['type'] == 'permissions') { |
|
| 941 | + theme_inline_permissions($config_var['name']); |
|
| 942 | + } |
|
| 910 | 943 | |
| 911 | 944 | // BBC selection? |
| 912 | 945 | elseif ($config_var['type'] == 'bbc') |
@@ -918,22 +951,24 @@ discard block |
||
| 918 | 951 | |
| 919 | 952 | foreach ($context['bbc_columns'] as $bbcColumn) |
| 920 | 953 | { |
| 921 | - foreach ($bbcColumn as $bbcTag) |
|
| 922 | - echo ' |
|
| 954 | + foreach ($bbcColumn as $bbcTag) { |
|
| 955 | + echo ' |
|
| 923 | 956 | <li class="list_bbc floatleft"> |
| 924 | 957 | <input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked' : '', '> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', ' |
| 925 | 958 | </li>'; |
| 959 | + } |
|
| 926 | 960 | } |
| 927 | 961 | echo ' </ul> |
| 928 | 962 | <input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked' : '', '> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label> |
| 929 | 963 | </fieldset>'; |
| 930 | 964 | } |
| 931 | 965 | // A simple message? |
| 932 | - elseif ($config_var['type'] == 'var_message') |
|
| 933 | - echo ' |
|
| 966 | + elseif ($config_var['type'] == 'var_message') { |
|
| 967 | + echo ' |
|
| 934 | 968 | <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '> |
| 935 | 969 | ', $config_var['var_message'], ' |
| 936 | 970 | </div>'; |
| 971 | + } |
|
| 937 | 972 | // Assume it must be a text box |
| 938 | 973 | else |
| 939 | 974 | { |
@@ -958,62 +993,70 @@ discard block |
||
| 958 | 993 | ' . $config_var['postinput'] : '',' |
| 959 | 994 | </dd>'; |
| 960 | 995 | } |
| 961 | - } |
|
| 962 | - else |
|
| 996 | + } else |
|
| 963 | 997 | { |
| 964 | 998 | // Just show a separator. |
| 965 | - if ($config_var == '') |
|
| 966 | - echo ' |
|
| 999 | + if ($config_var == '') { |
|
| 1000 | + echo ' |
|
| 967 | 1001 | </dl> |
| 968 | 1002 | <hr> |
| 969 | 1003 | <dl class="settings">'; |
| 970 | - else |
|
| 971 | - echo ' |
|
| 1004 | + } else { |
|
| 1005 | + echo ' |
|
| 972 | 1006 | <dd> |
| 973 | 1007 | <strong>' . $config_var . '</strong> |
| 974 | 1008 | </dd>'; |
| 1009 | + } |
|
| 975 | 1010 | } |
| 976 | 1011 | } |
| 977 | 1012 | |
| 978 | - if ($is_open) |
|
| 979 | - echo ' |
|
| 1013 | + if ($is_open) { |
|
| 1014 | + echo ' |
|
| 980 | 1015 | </dl>'; |
| 1016 | + } |
|
| 981 | 1017 | |
| 982 | - if (empty($context['settings_save_dont_show'])) |
|
| 983 | - echo ' |
|
| 1018 | + if (empty($context['settings_save_dont_show'])) { |
|
| 1019 | + echo ' |
|
| 984 | 1020 | <input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">'; |
| 1021 | + } |
|
| 985 | 1022 | |
| 986 | - if ($is_open) |
|
| 987 | - echo ' |
|
| 1023 | + if ($is_open) { |
|
| 1024 | + echo ' |
|
| 988 | 1025 | </div><!-- .windowbg -->'; |
| 1026 | + } |
|
| 989 | 1027 | |
| 990 | 1028 | |
| 991 | 1029 | // At least one token has to be used! |
| 992 | - if (isset($context['admin-ssc_token'])) |
|
| 993 | - echo ' |
|
| 1030 | + if (isset($context['admin-ssc_token'])) { |
|
| 1031 | + echo ' |
|
| 994 | 1032 | <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">'; |
| 1033 | + } |
|
| 995 | 1034 | |
| 996 | - if (isset($context['admin-dbsc_token'])) |
|
| 997 | - echo ' |
|
| 1035 | + if (isset($context['admin-dbsc_token'])) { |
|
| 1036 | + echo ' |
|
| 998 | 1037 | <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">'; |
| 1038 | + } |
|
| 999 | 1039 | |
| 1000 | - if (isset($context['admin-mp_token'])) |
|
| 1001 | - echo ' |
|
| 1040 | + if (isset($context['admin-mp_token'])) { |
|
| 1041 | + echo ' |
|
| 1002 | 1042 | <input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">'; |
| 1043 | + } |
|
| 1003 | 1044 | |
| 1004 | 1045 | echo ' |
| 1005 | 1046 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1006 | 1047 | </form> |
| 1007 | 1048 | </div><!-- #admincenter -->'; |
| 1008 | 1049 | |
| 1009 | - if (!empty($context['settings_post_javascript'])) |
|
| 1010 | - echo ' |
|
| 1050 | + if (!empty($context['settings_post_javascript'])) { |
|
| 1051 | + echo ' |
|
| 1011 | 1052 | <script> |
| 1012 | 1053 | ', $context['settings_post_javascript'], ' |
| 1013 | 1054 | </script>'; |
| 1055 | + } |
|
| 1014 | 1056 | |
| 1015 | - if (!empty($context['settings_insert_below'])) |
|
| 1016 | - echo $context['settings_insert_below']; |
|
| 1057 | + if (!empty($context['settings_insert_below'])) { |
|
| 1058 | + echo $context['settings_insert_below']; |
|
| 1059 | + } |
|
| 1017 | 1060 | |
| 1018 | 1061 | // We may have added a board listing. If we did, we need to make it work. |
| 1019 | 1062 | addInlineJavascript(' |
@@ -1036,9 +1079,10 @@ discard block |
||
| 1036 | 1079 | { |
| 1037 | 1080 | global $context, $txt; |
| 1038 | 1081 | |
| 1039 | - if (!empty($context['saved_successful'])) |
|
| 1040 | - echo ' |
|
| 1082 | + if (!empty($context['saved_successful'])) { |
|
| 1083 | + echo ' |
|
| 1041 | 1084 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 1085 | + } |
|
| 1042 | 1086 | |
| 1043 | 1087 | // Standard fields. |
| 1044 | 1088 | template_show_list('standard_profile_fields'); |
@@ -1072,11 +1116,12 @@ discard block |
||
| 1072 | 1116 | { |
| 1073 | 1117 | loadLanguage('Errors'); |
| 1074 | 1118 | |
| 1075 | - if (isset($txt['custom_option_' . $_GET['msg']])) |
|
| 1076 | - echo ' |
|
| 1119 | + if (isset($txt['custom_option_' . $_GET['msg']])) { |
|
| 1120 | + echo ' |
|
| 1077 | 1121 | <div class="errorbox">', |
| 1078 | 1122 | $txt['custom_option_' . $_GET['msg']], ' |
| 1079 | 1123 | </div>'; |
| 1124 | + } |
|
| 1080 | 1125 | } |
| 1081 | 1126 | |
| 1082 | 1127 | echo ' |
@@ -1143,9 +1188,10 @@ discard block |
||
| 1143 | 1188 | <dd> |
| 1144 | 1189 | <select name="placement" id="placement">'; |
| 1145 | 1190 | |
| 1146 | - foreach ($context['cust_profile_fields_placement'] as $order => $name) |
|
| 1147 | - echo ' |
|
| 1191 | + foreach ($context['cust_profile_fields_placement'] as $order => $name) { |
|
| 1192 | + echo ' |
|
| 1148 | 1193 | <option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>'; |
| 1194 | + } |
|
| 1149 | 1195 | |
| 1150 | 1196 | echo ' |
| 1151 | 1197 | </select> |
@@ -1169,9 +1215,10 @@ discard block |
||
| 1169 | 1215 | <dd> |
| 1170 | 1216 | <select name="field_type" id="field_type" onchange="updateInputBoxes();">'; |
| 1171 | 1217 | |
| 1172 | - foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) |
|
| 1173 | - echo ' |
|
| 1218 | + foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) { |
|
| 1219 | + echo ' |
|
| 1174 | 1220 | <option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>'; |
| 1221 | + } |
|
| 1175 | 1222 | |
| 1176 | 1223 | echo ' |
| 1177 | 1224 | </select> |
@@ -1203,9 +1250,10 @@ discard block |
||
| 1203 | 1250 | </dt> |
| 1204 | 1251 | <dd id="options_dd">'; |
| 1205 | 1252 | |
| 1206 | - foreach ($context['field']['options'] as $k => $option) |
|
| 1207 | - echo ' |
|
| 1253 | + foreach ($context['field']['options'] as $k => $option) { |
|
| 1254 | + echo ' |
|
| 1208 | 1255 | ', $k == 0 ? '' : '<br>', '<input type="radio" name="default_select" value="', $k, '"', $context['field']['default_select'] == $option ? ' checked' : '', '><input type="text" name="select_option[', $k, ']" value="', $option, '">'; |
| 1256 | + } |
|
| 1209 | 1257 | |
| 1210 | 1258 | echo ' |
| 1211 | 1259 | <span id="addopt"></span> |
@@ -1269,9 +1317,10 @@ discard block |
||
| 1269 | 1317 | </fieldset> |
| 1270 | 1318 | <input type="submit" name="save" value="', $txt['save'], '" class="button">'; |
| 1271 | 1319 | |
| 1272 | - if ($context['fid']) |
|
| 1273 | - echo ' |
|
| 1320 | + if ($context['fid']) { |
|
| 1321 | + echo ' |
|
| 1274 | 1322 | <input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">'; |
| 1323 | + } |
|
| 1275 | 1324 | |
| 1276 | 1325 | echo ' |
| 1277 | 1326 | </div><!-- .windowbg --> |
@@ -1318,8 +1367,7 @@ discard block |
||
| 1318 | 1367 | <p class="centertext"> |
| 1319 | 1368 | <strong>', $txt['admin_search_results_none'], '</strong> |
| 1320 | 1369 | </p>'; |
| 1321 | - } |
|
| 1322 | - else |
|
| 1370 | + } else |
|
| 1323 | 1371 | { |
| 1324 | 1372 | echo ' |
| 1325 | 1373 | <ol class="search_results">'; |
@@ -1346,9 +1394,10 @@ discard block |
||
| 1346 | 1394 | <li> |
| 1347 | 1395 | <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']'; |
| 1348 | 1396 | |
| 1349 | - if ($result['help']) |
|
| 1350 | - echo ' |
|
| 1397 | + if ($result['help']) { |
|
| 1398 | + echo ' |
|
| 1351 | 1399 | <p class="double_height">', $result['help'], '</p>'; |
| 1400 | + } |
|
| 1352 | 1401 | |
| 1353 | 1402 | echo ' |
| 1354 | 1403 | </li>'; |
@@ -1388,10 +1437,11 @@ discard block |
||
| 1388 | 1437 | <strong>', $txt['setup_verification_answer'], '</strong> |
| 1389 | 1438 | </dd>'; |
| 1390 | 1439 | |
| 1391 | - if (!empty($context['qa_by_lang'][$lang_id])) |
|
| 1392 | - foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1440 | + if (!empty($context['qa_by_lang'][$lang_id])) { |
|
| 1441 | + foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
| 1393 | 1442 | { |
| 1394 | 1443 | $question = $context['question_answers'][$q_id]; |
| 1444 | + } |
|
| 1395 | 1445 | |
| 1396 | 1446 | echo ' |
| 1397 | 1447 | <dt> |
@@ -1399,9 +1449,10 @@ discard block |
||
| 1399 | 1449 | </dt> |
| 1400 | 1450 | <dd>'; |
| 1401 | 1451 | |
| 1402 | - foreach ($question['answers'] as $answer) |
|
| 1403 | - echo ' |
|
| 1452 | + foreach ($question['answers'] as $answer) { |
|
| 1453 | + echo ' |
|
| 1404 | 1454 | <input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">'; |
| 1455 | + } |
|
| 1405 | 1456 | |
| 1406 | 1457 | echo ' |
| 1407 | 1458 | <div class="qa_add_answer"><a href="javascript:void(0);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div> |
@@ -1440,11 +1491,12 @@ discard block |
||
| 1440 | 1491 | ', $txt['errors_found'], ': |
| 1441 | 1492 | <ul>'; |
| 1442 | 1493 | |
| 1443 | - foreach ($context['repair_errors'] as $error) |
|
| 1444 | - echo ' |
|
| 1494 | + foreach ($context['repair_errors'] as $error) { |
|
| 1495 | + echo ' |
|
| 1445 | 1496 | <li> |
| 1446 | 1497 | ', $error, ' |
| 1447 | 1498 | </li>'; |
| 1499 | + } |
|
| 1448 | 1500 | |
| 1449 | 1501 | echo ' |
| 1450 | 1502 | </ul> |
@@ -1454,15 +1506,14 @@ discard block |
||
| 1454 | 1506 | <p class="padding"> |
| 1455 | 1507 | <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> |
| 1456 | 1508 | </p>'; |
| 1457 | - } |
|
| 1458 | - else |
|
| 1459 | - echo ' |
|
| 1509 | + } else { |
|
| 1510 | + echo ' |
|
| 1460 | 1511 | <p>', $txt['maintain_no_errors'], '</p> |
| 1461 | 1512 | <p class="padding"> |
| 1462 | 1513 | <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a> |
| 1463 | 1514 | </p>'; |
| 1464 | - } |
|
| 1465 | - else |
|
| 1515 | + } |
|
| 1516 | + } else |
|
| 1466 | 1517 | { |
| 1467 | 1518 | if (!empty($context['redirect_to_recount'])) |
| 1468 | 1519 | { |
@@ -1474,8 +1525,7 @@ discard block |
||
| 1474 | 1525 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1475 | 1526 | <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '"> |
| 1476 | 1527 | </form>'; |
| 1477 | - } |
|
| 1478 | - else |
|
| 1528 | + } else |
|
| 1479 | 1529 | { |
| 1480 | 1530 | echo ' |
| 1481 | 1531 | <p>', $txt['errors_fixed'], '</p> |
@@ -1566,9 +1616,10 @@ discard block |
||
| 1566 | 1616 | <tr class="windowbg"> |
| 1567 | 1617 | <td class="equal_table">', $key, '</td>'; |
| 1568 | 1618 | |
| 1569 | - foreach ($setting as $key_lm => $value) |
|
| 1570 | - echo ' |
|
| 1619 | + foreach ($setting as $key_lm => $value) { |
|
| 1620 | + echo ' |
|
| 1571 | 1621 | <td class="equal_table">', $value, '</td>'; |
| 1622 | + } |
|
| 1572 | 1623 | |
| 1573 | 1624 | echo ' |
| 1574 | 1625 | </tr>'; |
@@ -1628,8 +1679,8 @@ discard block |
||
| 1628 | 1679 | { |
| 1629 | 1680 | global $context, $txt; |
| 1630 | 1681 | |
| 1631 | - if ($context['user']['is_admin']) |
|
| 1632 | - echo ' |
|
| 1682 | + if ($context['user']['is_admin']) { |
|
| 1683 | + echo ' |
|
| 1633 | 1684 | <span class="floatright admin_search"> |
| 1634 | 1685 | <span class="generic_icons filter centericon"></span> |
| 1635 | 1686 | <input type="search" name="search_term" placeholder="', $txt['admin_search'], '"> |
@@ -1640,6 +1691,7 @@ discard block |
||
| 1640 | 1691 | </select> |
| 1641 | 1692 | <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button"> |
| 1642 | 1693 | </span>'; |
| 1643 | -} |
|
| 1694 | + } |
|
| 1695 | + } |
|
| 1644 | 1696 | |
| 1645 | 1697 | ?> |
| 1646 | 1698 | \ No newline at end of file |
@@ -144,11 +144,12 @@ discard block |
||
| 144 | 144 | <div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>'; |
| 145 | 145 | |
| 146 | 146 | $options = 1; |
| 147 | - foreach ($context['poll']['options'] as $option) |
|
| 148 | - echo ' |
|
| 147 | + foreach ($context['poll']['options'] as $option) { |
|
| 148 | + echo ' |
|
| 149 | 149 | <div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong> |
| 150 | 150 | ', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', ' |
| 151 | 151 | </div>'; |
| 152 | + } |
|
| 152 | 153 | |
| 153 | 154 | echo ' |
| 154 | 155 | </div>'; |
@@ -170,9 +171,10 @@ discard block |
||
| 170 | 171 | echo ' |
| 171 | 172 | <hr>'; |
| 172 | 173 | |
| 173 | - foreach ($context['printattach'][$post['id_msg']] as $attach) |
|
| 174 | - echo ' |
|
| 174 | + foreach ($context['printattach'][$post['id_msg']] as $attach) { |
|
| 175 | + echo ' |
|
| 175 | 176 | <img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">'; |
| 177 | + } |
|
| 176 | 178 | } |
| 177 | 179 | |
| 178 | 180 | echo ' |
@@ -207,12 +209,13 @@ discard block |
||
| 207 | 209 | <div class="print_options">'; |
| 208 | 210 | |
| 209 | 211 | // Which option is set, text or text&images |
| 210 | - if (isset($_REQUEST['images'])) |
|
| 211 | - echo ' |
|
| 212 | + if (isset($_REQUEST['images'])) { |
|
| 213 | + echo ' |
|
| 212 | 214 | <a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>'; |
| 213 | - else |
|
| 214 | - echo ' |
|
| 215 | + } else { |
|
| 216 | + echo ' |
|
| 215 | 217 | <strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>'; |
| 218 | + } |
|
| 216 | 219 | |
| 217 | 220 | echo ' |
| 218 | 221 | </div><!-- .print_options -->'; |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | <div class="windowbg"> |
| 32 | 32 | <ul id="likes">'; |
| 33 | 33 | |
| 34 | - foreach ($context['likers'] as $liker => $like_details) |
|
| 35 | - echo ' |
|
| 34 | + foreach ($context['likers'] as $liker => $like_details) { |
|
| 35 | + echo ' |
|
| 36 | 36 | <li> |
| 37 | 37 | ', $like_details['profile']['avatar']['image'], ' |
| 38 | 38 | <span> |
@@ -41,6 +41,7 @@ discard block |
||
| 41 | 41 | </span> |
| 42 | 42 | <span class="floatright">', $like_details['time'], '</span> |
| 43 | 43 | </li>'; |
| 44 | + } |
|
| 44 | 45 | |
| 45 | 46 | echo ' |
| 46 | 47 | </ul> |
@@ -61,11 +62,12 @@ discard block |
||
| 61 | 62 | echo ' |
| 62 | 63 | <ul class="floatleft">'; |
| 63 | 64 | |
| 64 | - if (!empty($context['data']['can_like'])) |
|
| 65 | - echo ' |
|
| 65 | + if (!empty($context['data']['can_like'])) { |
|
| 66 | + echo ' |
|
| 66 | 67 | <li class="like_button" id="', $context['data']['type'], '_', $context['data']['id_content'], '_likes"', '> |
| 67 | 68 | <a href="', $scripturl, '?action=likes;ltype=', $context['data']['type'], ';sa=like;like=', $context['data']['id_content'], ';', $context['session_var'], '=', $context['session_id'], '" class="', $context['data']['type'], '_like"><span class="generic_icons ', $context['data']['already_liked'] ? 'unlike' : 'like', '"></span> ', $context['data']['already_liked'] ? $txt['unlike'] : $txt['like'], '</a> |
| 68 | 69 | </li>'; |
| 70 | + } |
|
| 69 | 71 | |
| 70 | 72 | if (!empty($context['data']['count'])) |
| 71 | 73 | { |
@@ -20,13 +20,12 @@ discard block |
||
| 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 | - |
|
| 29 | - else |
|
| 28 | + } else |
|
| 30 | 29 | { |
| 31 | 30 | echo ' |
| 32 | 31 | <div class="errorbox" id="errors"> |
@@ -35,14 +34,15 @@ discard block |
||
| 35 | 34 | <strong id="error_serious">', $txt['scheduled_tasks_were_run_errors'], '</strong> |
| 36 | 35 | </dt>'; |
| 37 | 36 | |
| 38 | - foreach ($context['scheduled_errors'] as $task => $errors) |
|
| 39 | - echo ' |
|
| 37 | + foreach ($context['scheduled_errors'] as $task => $errors) { |
|
| 38 | + echo ' |
|
| 40 | 39 | <dd class="error"> |
| 41 | 40 | <strong>', isset($txt['scheduled_task_' . $task]) ? $txt['scheduled_task_' . $task] : $task, '</strong> |
| 42 | 41 | <ul> |
| 43 | 42 | <li>', implode('</li><li>', $errors), '</li> |
| 44 | 43 | </ul> |
| 45 | 44 | </dd>'; |
| 45 | + } |
|
| 46 | 46 | |
| 47 | 47 | echo ' |
| 48 | 48 | </dl> |
@@ -62,16 +62,17 @@ |
||
| 62 | 62 | <div id="error_box" class="errorbox"> |
| 63 | 63 | <ul id="error_list">'; |
| 64 | 64 | |
| 65 | - foreach ($context['post_errors'] as $key => $error) |
|
| 66 | - echo ' |
|
| 65 | + foreach ($context['post_errors'] as $key => $error) { |
|
| 66 | + echo ' |
|
| 67 | 67 | <li id="error_', $key, '" class="error">', $error, '</li>'; |
| 68 | + } |
|
| 68 | 69 | |
| 69 | 70 | echo ' |
| 70 | 71 | </ul>'; |
| 71 | - } |
|
| 72 | - else |
|
| 73 | - echo ' |
|
| 72 | + } else { |
|
| 73 | + echo ' |
|
| 74 | 74 | <div style="display:none" id="error_box" class="errorbox">'; |
| 75 | + } |
|
| 75 | 76 | |
| 76 | 77 | echo ' |
| 77 | 78 | </div>'; |
@@ -54,9 +54,10 @@ discard block |
||
| 54 | 54 | <dd> |
| 55 | 55 | <div id="known_themes_list">'; |
| 56 | 56 | |
| 57 | - foreach ($context['themes'] as $theme) |
|
| 58 | - echo ' |
|
| 57 | + foreach ($context['themes'] as $theme) { |
|
| 58 | + echo ' |
|
| 59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $theme['name'], '</label><br>'; |
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | echo ' |
| 62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
| 73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
| 74 | 75 | |
| 75 | 76 | // Put an option for each theme in the select box. |
| 76 | - foreach ($context['themes'] as $theme) |
|
| 77 | - echo ' |
|
| 77 | + foreach ($context['themes'] as $theme) { |
|
| 78 | + echo ' |
|
| 78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
| 80 | + } |
|
| 79 | 81 | |
| 80 | 82 | echo ' |
| 81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
| 90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
| 91 | 93 | |
| 92 | 94 | // Same thing, this time for changing the theme of everyone. |
| 93 | - foreach ($context['themes'] as $theme) |
|
| 94 | - echo ' |
|
| 95 | + foreach ($context['themes'] as $theme) { |
|
| 96 | + echo ' |
|
| 95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
| 98 | + } |
|
| 96 | 99 | |
| 97 | 100 | echo ' |
| 98 | 101 | </select> |
@@ -187,11 +190,12 @@ discard block |
||
| 187 | 190 | global $context, $scripturl, $txt; |
| 188 | 191 | |
| 189 | 192 | // Show a nice confirmation message. |
| 190 | - if (isset($_GET['done'])) |
|
| 191 | - echo ' |
|
| 193 | + if (isset($_GET['done'])) { |
|
| 194 | + echo ' |
|
| 192 | 195 | <div class="infobox"> |
| 193 | 196 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
| 194 | 197 | </div>'; |
| 198 | + } |
|
| 195 | 199 | |
| 196 | 200 | echo ' |
| 197 | 201 | <div id="admincenter"> |
@@ -354,11 +358,12 @@ discard block |
||
| 354 | 358 | if (empty($setting) || !is_array($setting)) |
| 355 | 359 | { |
| 356 | 360 | // Insert a separator (unless this is the first item in the list) |
| 357 | - if ($i !== $first_option_key) |
|
| 358 | - echo ' |
|
| 361 | + if ($i !== $first_option_key) { |
|
| 362 | + echo ' |
|
| 359 | 363 | </dl> |
| 360 | 364 | <hr> |
| 361 | 365 | <dl class="settings">'; |
| 366 | + } |
|
| 362 | 367 | |
| 363 | 368 | // Should we give a name to this section? |
| 364 | 369 | if (is_string($setting) && !empty($setting)) |
@@ -367,9 +372,9 @@ discard block |
||
| 367 | 372 | echo ' |
| 368 | 373 | <dt><strong>' . $setting . '</strong></dt> |
| 369 | 374 | <dd></dd>'; |
| 375 | + } else { |
|
| 376 | + $titled_section = false; |
|
| 370 | 377 | } |
| 371 | - else |
|
| 372 | - $titled_section = false; |
|
| 373 | 378 | |
| 374 | 379 | continue; |
| 375 | 380 | } |
@@ -378,8 +383,8 @@ discard block |
||
| 378 | 383 | <dt>'; |
| 379 | 384 | |
| 380 | 385 | // Show the change option box? |
| 381 | - if ($context['theme_options_reset']) |
|
| 382 | - echo ' |
|
| 386 | + if ($context['theme_options_reset']) { |
|
| 387 | + echo ' |
|
| 383 | 388 | <span class="floatleft"> |
| 384 | 389 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
| 385 | 390 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -387,23 +392,26 @@ discard block |
||
| 387 | 392 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
| 388 | 393 | </select> |
| 389 | 394 | </span>'; |
| 395 | + } |
|
| 390 | 396 | |
| 391 | 397 | echo ' |
| 392 | 398 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
| 393 | 399 | |
| 394 | - if (isset($setting['description'])) |
|
| 395 | - echo ' |
|
| 400 | + if (isset($setting['description'])) { |
|
| 401 | + echo ' |
|
| 396 | 402 | <br> |
| 397 | 403 | <span class="smalltext">', $setting['description'], '</span>'; |
| 404 | + } |
|
| 398 | 405 | echo ' |
| 399 | 406 | </dt>'; |
| 400 | 407 | |
| 401 | 408 | // Display checkbox options |
| 402 | - if ($setting['type'] == 'checkbox') |
|
| 403 | - echo ' |
|
| 409 | + if ($setting['type'] == 'checkbox') { |
|
| 410 | + echo ' |
|
| 404 | 411 | <dd> |
| 405 | 412 | <input type="hidden" name="' . (!empty($setting['default']) ? 'default_' : '') . 'options[' . $setting['id'] . ']" value="0"> |
| 406 | 413 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', $context['theme_options_reset'] ? ' disabled' : '', ' value="1" class="floatleft">'; |
| 414 | + } |
|
| 407 | 415 | |
| 408 | 416 | // How about selection lists, we all love them |
| 409 | 417 | elseif ($setting['type'] == 'list') |
@@ -412,9 +420,10 @@ discard block |
||
| 412 | 420 | <dd> |
| 413 | 421 | <select class="floatleft" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
| 414 | 422 | |
| 415 | - foreach ($setting['options'] as $value => $label) |
|
| 416 | - echo ' |
|
| 423 | + foreach ($setting['options'] as $value => $label) { |
|
| 424 | + echo ' |
|
| 417 | 425 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 426 | + } |
|
| 418 | 427 | |
| 419 | 428 | echo ' |
| 420 | 429 | </select>'; |
@@ -433,14 +442,13 @@ discard block |
||
| 433 | 442 | |
| 434 | 443 | echo ' |
| 435 | 444 | <input type="number"', $min . $max . $step; |
| 436 | - } |
|
| 437 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
| 438 | - echo' |
|
| 445 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
| 446 | + echo' |
|
| 439 | 447 | <input type="url"'; |
| 440 | - |
|
| 441 | - else |
|
| 442 | - echo ' |
|
| 448 | + } else { |
|
| 449 | + echo ' |
|
| 443 | 450 | <input type="text"'; |
| 451 | + } |
|
| 444 | 452 | |
| 445 | 453 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
| 446 | 454 | } |
@@ -479,8 +487,8 @@ discard block |
||
| 479 | 487 | <br>'; |
| 480 | 488 | |
| 481 | 489 | // @todo Why can't I edit the default theme popup. |
| 482 | - if ($context['theme_settings']['theme_id'] != 1) |
|
| 483 | - echo ' |
|
| 490 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
| 491 | + echo ' |
|
| 484 | 492 | <div class="cat_bar"> |
| 485 | 493 | <h3 class="catbg config_hd"> |
| 486 | 494 | ', $txt['theme_edit'], ' |
@@ -496,6 +504,7 @@ discard block |
||
| 496 | 504 | </li> |
| 497 | 505 | </ul> |
| 498 | 506 | </div>'; |
| 507 | + } |
|
| 499 | 508 | |
| 500 | 509 | echo ' |
| 501 | 510 | <div class="cat_bar"> |
@@ -549,9 +558,10 @@ discard block |
||
| 549 | 558 | <dd> |
| 550 | 559 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
| 551 | 560 | |
| 552 | - foreach ($context['theme_variants'] as $key => $variant) |
|
| 553 | - echo ' |
|
| 561 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
| 562 | + echo ' |
|
| 554 | 563 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 564 | + } |
|
| 555 | 565 | |
| 556 | 566 | echo ' |
| 557 | 567 | </select> |
@@ -587,11 +597,12 @@ discard block |
||
| 587 | 597 | if (empty($setting) || !is_array($setting)) |
| 588 | 598 | { |
| 589 | 599 | // We don't need a separator before the first list element |
| 590 | - if ($i !== $first_setting_key) |
|
| 591 | - echo ' |
|
| 600 | + if ($i !== $first_setting_key) { |
|
| 601 | + echo ' |
|
| 592 | 602 | </dl> |
| 593 | 603 | <hr> |
| 594 | 604 | <dl class="settings">'; |
| 605 | + } |
|
| 595 | 606 | |
| 596 | 607 | // Add a fake heading? |
| 597 | 608 | if (is_string($setting) && !empty($setting)) |
@@ -600,9 +611,9 @@ discard block |
||
| 600 | 611 | echo ' |
| 601 | 612 | <dt><strong>' . $setting . '</strong></dt> |
| 602 | 613 | <dd></dd>'; |
| 614 | + } else { |
|
| 615 | + $titled_section = false; |
|
| 603 | 616 | } |
| 604 | - else |
|
| 605 | - $titled_section = false; |
|
| 606 | 617 | |
| 607 | 618 | continue; |
| 608 | 619 | } |
@@ -611,20 +622,22 @@ discard block |
||
| 611 | 622 | <dt> |
| 612 | 623 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
| 613 | 624 | |
| 614 | - if (isset($setting['description'])) |
|
| 615 | - echo '<br> |
|
| 625 | + if (isset($setting['description'])) { |
|
| 626 | + echo '<br> |
|
| 616 | 627 | <span class="smalltext">', $setting['description'], '</span>'; |
| 628 | + } |
|
| 617 | 629 | |
| 618 | 630 | echo ' |
| 619 | 631 | </dt>'; |
| 620 | 632 | |
| 621 | 633 | // A checkbox? |
| 622 | - if ($setting['type'] == 'checkbox') |
|
| 623 | - echo ' |
|
| 634 | + if ($setting['type'] == 'checkbox') { |
|
| 635 | + echo ' |
|
| 624 | 636 | <dd> |
| 625 | 637 | <input type="hidden" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" value="0"> |
| 626 | 638 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', ' value="1"> |
| 627 | 639 | </dd>'; |
| 640 | + } |
|
| 628 | 641 | |
| 629 | 642 | // A list with options? |
| 630 | 643 | elseif ($setting['type'] == 'list') |
@@ -633,9 +646,10 @@ discard block |
||
| 633 | 646 | <dd> |
| 634 | 647 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
| 635 | 648 | |
| 636 | - foreach ($setting['options'] as $value => $label) |
|
| 637 | - echo ' |
|
| 649 | + foreach ($setting['options'] as $value => $label) { |
|
| 650 | + echo ' |
|
| 638 | 651 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 652 | + } |
|
| 639 | 653 | |
| 640 | 654 | echo ' |
| 641 | 655 | </select> |
@@ -663,14 +677,13 @@ discard block |
||
| 663 | 677 | |
| 664 | 678 | echo ' |
| 665 | 679 | <input type="number"', $min . $max . $step; |
| 666 | - } |
|
| 667 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
| 668 | - echo' |
|
| 680 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
| 681 | + echo' |
|
| 669 | 682 | <input type="url"'; |
| 670 | - |
|
| 671 | - else |
|
| 672 | - echo ' |
|
| 683 | + } else { |
|
| 684 | + echo ' |
|
| 673 | 685 | <input type="text"'; |
| 686 | + } |
|
| 674 | 687 | |
| 675 | 688 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : (empty($settings['size']) ? ' size="40"' : ' size="' . $setting['size'] . '"'), '> |
| 676 | 689 | </dd>'; |
@@ -742,9 +755,10 @@ discard block |
||
| 742 | 755 | <label for="variant', $theme['id'], '"><strong>', $theme['pick_label'], '</strong></label>: |
| 743 | 756 | <select id="variant', $theme['id'], '" name="vrt[', $theme['id'], ']" onchange="changeVariant', $theme['id'], '(this.value);">'; |
| 744 | 757 | |
| 745 | - foreach ($theme['variants'] as $key => $variant) |
|
| 746 | - echo ' |
|
| 758 | + foreach ($theme['variants'] as $key => $variant) { |
|
| 759 | + echo ' |
|
| 747 | 760 | <option value="', $key, '"', $theme['selected_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 761 | + } |
|
| 748 | 762 | |
| 749 | 763 | echo ' |
| 750 | 764 | </select> |
@@ -822,21 +836,23 @@ discard block |
||
| 822 | 836 | <div class="windowbg">'; |
| 823 | 837 | |
| 824 | 838 | // Oops! there was an error :( |
| 825 | - if (!empty($context['error_message'])) |
|
| 826 | - echo ' |
|
| 839 | + if (!empty($context['error_message'])) { |
|
| 840 | + echo ' |
|
| 827 | 841 | <p> |
| 828 | 842 | ', $context['error_message'], ' |
| 829 | 843 | </p>'; |
| 844 | + } |
|
| 830 | 845 | |
| 831 | 846 | // Not much to show except a link back... |
| 832 | - else |
|
| 833 | - echo ' |
|
| 847 | + else { |
|
| 848 | + echo ' |
|
| 834 | 849 | <p> |
| 835 | 850 | <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], ' |
| 836 | 851 | </p> |
| 837 | 852 | <p> |
| 838 | 853 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
| 839 | 854 | </p>'; |
| 855 | + } |
|
| 840 | 856 | |
| 841 | 857 | echo ' |
| 842 | 858 | </div><!-- .windowbg --> |
@@ -903,11 +919,12 @@ discard block |
||
| 903 | 919 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
| 904 | 920 | <span class="floatright">'; |
| 905 | 921 | |
| 906 | - if ($template['can_copy']) |
|
| 907 | - echo ' |
|
| 922 | + if ($template['can_copy']) { |
|
| 923 | + echo ' |
|
| 908 | 924 | <a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
| 909 | - else |
|
| 910 | - echo $txt['themeadmin_edit_no_copy']; |
|
| 925 | + } else { |
|
| 926 | + echo $txt['themeadmin_edit_no_copy']; |
|
| 927 | + } |
|
| 911 | 928 | |
| 912 | 929 | echo ' |
| 913 | 930 | </span> |
@@ -930,11 +947,12 @@ discard block |
||
| 930 | 947 | echo ' |
| 931 | 948 | <div id="admincenter">'; |
| 932 | 949 | |
| 933 | - if (!empty($context['browse_title'])) |
|
| 934 | - echo ' |
|
| 950 | + if (!empty($context['browse_title'])) { |
|
| 951 | + echo ' |
|
| 935 | 952 | <div class="cat_bar"> |
| 936 | 953 | <h3 class="catbg">', $context['browse_title'], '</h3> |
| 937 | 954 | </div>'; |
| 955 | + } |
|
| 938 | 956 | |
| 939 | 957 | echo ' |
| 940 | 958 | <table class="table_grid tborder"> |
@@ -954,16 +972,15 @@ discard block |
||
| 954 | 972 | <tr class="windowbg"> |
| 955 | 973 | <td>'; |
| 956 | 974 | |
| 957 | - if ($file['is_editable']) |
|
| 958 | - echo ' |
|
| 975 | + if ($file['is_editable']) { |
|
| 976 | + echo ' |
|
| 959 | 977 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
| 960 | - |
|
| 961 | - elseif ($file['is_directory']) |
|
| 962 | - echo ' |
|
| 978 | + } elseif ($file['is_directory']) { |
|
| 979 | + echo ' |
|
| 963 | 980 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
| 964 | - |
|
| 965 | - else |
|
| 966 | - echo $file['filename']; |
|
| 981 | + } else { |
|
| 982 | + echo $file['filename']; |
|
| 983 | + } |
|
| 967 | 984 | |
| 968 | 985 | echo ' |
| 969 | 986 | </td> |
@@ -985,11 +1002,12 @@ discard block |
||
| 985 | 1002 | { |
| 986 | 1003 | global $context, $settings, $scripturl, $txt; |
| 987 | 1004 | |
| 988 | - if ($context['session_error']) |
|
| 989 | - echo ' |
|
| 1005 | + if ($context['session_error']) { |
|
| 1006 | + echo ' |
|
| 990 | 1007 | <div class="errorbox"> |
| 991 | 1008 | ', $txt['error_session_timeout'], ' |
| 992 | 1009 | </div>'; |
| 1010 | + } |
|
| 993 | 1011 | |
| 994 | 1012 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
| 995 | 1013 | echo ' |
@@ -1053,17 +1071,18 @@ discard block |
||
| 1053 | 1071 | { |
| 1054 | 1072 | '; |
| 1055 | 1073 | |
| 1056 | - if (isBrowser('is_ie')) |
|
| 1057 | - echo ' |
|
| 1074 | + if (isBrowser('is_ie')) { |
|
| 1075 | + echo ' |
|
| 1058 | 1076 | var sheets = frames["css_preview_box"].document.styleSheets; |
| 1059 | 1077 | for (var j = 0; j < sheets.length; j++) |
| 1060 | 1078 | { |
| 1061 | 1079 | if (sheets[j].id == "css_preview_box") |
| 1062 | 1080 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
| 1063 | 1081 | }'; |
| 1064 | - else |
|
| 1065 | - echo ' |
|
| 1082 | + } else { |
|
| 1083 | + echo ' |
|
| 1066 | 1084 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
| 1085 | + } |
|
| 1067 | 1086 | echo ' |
| 1068 | 1087 | } |
| 1069 | 1088 | catch (e) |
@@ -1115,9 +1134,10 @@ discard block |
||
| 1115 | 1134 | </div> |
| 1116 | 1135 | <div class="windowbg">'; |
| 1117 | 1136 | |
| 1118 | - if (!$context['allow_save']) |
|
| 1119 | - echo ' |
|
| 1137 | + if (!$context['allow_save']) { |
|
| 1138 | + echo ' |
|
| 1120 | 1139 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1140 | + } |
|
| 1121 | 1141 | |
| 1122 | 1142 | echo ' |
| 1123 | 1143 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1131,9 +1151,10 @@ discard block |
||
| 1131 | 1151 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1132 | 1152 | |
| 1133 | 1153 | // Hopefully it exists. |
| 1134 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1135 | - echo ' |
|
| 1154 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1155 | + echo ' |
|
| 1136 | 1156 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1157 | + } |
|
| 1137 | 1158 | |
| 1138 | 1159 | echo ' |
| 1139 | 1160 | </form> |
@@ -1147,18 +1168,20 @@ discard block |
||
| 1147 | 1168 | { |
| 1148 | 1169 | global $context, $scripturl, $txt; |
| 1149 | 1170 | |
| 1150 | - if ($context['session_error']) |
|
| 1151 | - echo ' |
|
| 1171 | + if ($context['session_error']) { |
|
| 1172 | + echo ' |
|
| 1152 | 1173 | <div class="errorbox"> |
| 1153 | 1174 | ', $txt['error_session_timeout'], ' |
| 1154 | 1175 | </div>'; |
| 1176 | + } |
|
| 1155 | 1177 | |
| 1156 | - if (isset($context['parse_error'])) |
|
| 1157 | - echo ' |
|
| 1178 | + if (isset($context['parse_error'])) { |
|
| 1179 | + echo ' |
|
| 1158 | 1180 | <div class="errorbox"> |
| 1159 | 1181 | ', $txt['themeadmin_edit_error'], ' |
| 1160 | 1182 | <div><pre>', $context['parse_error'], '</pre></div> |
| 1161 | 1183 | </div>'; |
| 1184 | + } |
|
| 1162 | 1185 | |
| 1163 | 1186 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1164 | 1187 | echo ' |
@@ -1169,16 +1192,18 @@ discard block |
||
| 1169 | 1192 | </div> |
| 1170 | 1193 | <div class="windowbg">'; |
| 1171 | 1194 | |
| 1172 | - if (!$context['allow_save']) |
|
| 1173 | - echo ' |
|
| 1195 | + if (!$context['allow_save']) { |
|
| 1196 | + echo ' |
|
| 1174 | 1197 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1198 | + } |
|
| 1175 | 1199 | |
| 1176 | - foreach ($context['file_parts'] as $part) |
|
| 1177 | - echo ' |
|
| 1200 | + foreach ($context['file_parts'] as $part) { |
|
| 1201 | + echo ' |
|
| 1178 | 1202 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
| 1179 | 1203 | <div class="centertext"> |
| 1180 | 1204 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
| 1181 | 1205 | </div>'; |
| 1206 | + } |
|
| 1182 | 1207 | |
| 1183 | 1208 | echo ' |
| 1184 | 1209 | <div class="padding righttext"> |
@@ -1187,9 +1212,10 @@ discard block |
||
| 1187 | 1212 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1188 | 1213 | |
| 1189 | 1214 | // Hopefully it exists. |
| 1190 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1191 | - echo ' |
|
| 1215 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1216 | + echo ' |
|
| 1192 | 1217 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1218 | + } |
|
| 1193 | 1219 | |
| 1194 | 1220 | echo ' |
| 1195 | 1221 | </div><!-- .righttext --> |
@@ -1205,18 +1231,20 @@ discard block |
||
| 1205 | 1231 | { |
| 1206 | 1232 | global $context, $scripturl, $txt; |
| 1207 | 1233 | |
| 1208 | - if ($context['session_error']) |
|
| 1209 | - echo ' |
|
| 1234 | + if ($context['session_error']) { |
|
| 1235 | + echo ' |
|
| 1210 | 1236 | <div class="errorbox"> |
| 1211 | 1237 | ', $txt['error_session_timeout'], ' |
| 1212 | 1238 | </div>'; |
| 1239 | + } |
|
| 1213 | 1240 | |
| 1214 | 1241 | // Is this file writeable? |
| 1215 | - if (!$context['allow_save']) |
|
| 1216 | - echo ' |
|
| 1242 | + if (!$context['allow_save']) { |
|
| 1243 | + echo ' |
|
| 1217 | 1244 | <div class="errorbox"> |
| 1218 | 1245 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
| 1219 | 1246 | </div>'; |
| 1247 | + } |
|
| 1220 | 1248 | |
| 1221 | 1249 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1222 | 1250 | echo ' |
@@ -1232,9 +1260,10 @@ discard block |
||
| 1232 | 1260 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1233 | 1261 | |
| 1234 | 1262 | // Hopefully it exists. |
| 1235 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1236 | - echo ' |
|
| 1263 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1264 | + echo ' |
|
| 1237 | 1265 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
| 1266 | + } |
|
| 1238 | 1267 | |
| 1239 | 1268 | echo ' |
| 1240 | 1269 | </div><!-- .windowbg --> |