@@ -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 | } |
@@ -61,9 +61,10 @@ discard block |
||
61 | 61 | ', implode(', ', $context['administrators']); |
62 | 62 | |
63 | 63 | // If we have lots of admins... don't show them all. |
64 | - if (!empty($context['more_admins_link'])) |
|
65 | - echo ' |
|
64 | + if (!empty($context['more_admins_link'])) { |
|
65 | + echo ' |
|
66 | 66 | (', $context['more_admins_link'], ')'; |
67 | + } |
|
67 | 68 | |
68 | 69 | echo ' |
69 | 70 | </div><!-- #version_details --> |
@@ -80,17 +81,19 @@ discard block |
||
80 | 81 | foreach ($area['areas'] as $item_id => $item) |
81 | 82 | { |
82 | 83 | // No point showing the 'home' page here, we're already on it! |
83 | - if ($area_id == 'forum' && $item_id == 'index') |
|
84 | - continue; |
|
84 | + if ($area_id == 'forum' && $item_id == 'index') { |
|
85 | + continue; |
|
86 | + } |
|
85 | 87 | |
86 | 88 | $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'] : ''); |
87 | 89 | |
88 | - if (!empty($item['icon_file'])) |
|
89 | - echo ' |
|
90 | + if (!empty($item['icon_file'])) { |
|
91 | + echo ' |
|
90 | 92 | <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>'; |
91 | - else |
|
92 | - echo ' |
|
93 | + } else { |
|
94 | + echo ' |
|
93 | 95 | <a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>'; |
96 | + } |
|
94 | 97 | } |
95 | 98 | |
96 | 99 | echo ' |
@@ -98,10 +101,11 @@ discard block |
||
98 | 101 | } |
99 | 102 | |
100 | 103 | // The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization. |
101 | - if (empty($modSettings['disable_smf_js'])) |
|
102 | - echo ' |
|
104 | + if (empty($modSettings['disable_smf_js'])) { |
|
105 | + echo ' |
|
103 | 106 | <script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script> |
104 | 107 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
108 | + } |
|
105 | 109 | |
106 | 110 | // This sets the announcements and current versions themselves ;). |
107 | 111 | echo ' |
@@ -178,9 +182,10 @@ discard block |
||
178 | 182 | <em>', $version['version'], '</em>'; |
179 | 183 | |
180 | 184 | // more details for this item, show them a link |
181 | - if ($context['can_admin'] && isset($version['more'])) |
|
182 | - echo |
|
185 | + if ($context['can_admin'] && isset($version['more'])) { |
|
186 | + echo |
|
183 | 187 | ' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>'; |
188 | + } |
|
184 | 189 | echo ' |
185 | 190 | <br>'; |
186 | 191 | } |
@@ -211,21 +216,23 @@ discard block |
||
211 | 216 | |
212 | 217 | foreach ($context['credits'] as $section) |
213 | 218 | { |
214 | - if (isset($section['pretext'])) |
|
215 | - echo ' |
|
219 | + if (isset($section['pretext'])) { |
|
220 | + echo ' |
|
216 | 221 | <p>', $section['pretext'], '</p> |
217 | 222 | <hr>'; |
223 | + } |
|
218 | 224 | |
219 | 225 | echo ' |
220 | 226 | <dl>'; |
221 | 227 | |
222 | 228 | foreach ($section['groups'] as $group) |
223 | 229 | { |
224 | - if (isset($group['title'])) |
|
225 | - echo ' |
|
230 | + if (isset($group['title'])) { |
|
231 | + echo ' |
|
226 | 232 | <dt> |
227 | 233 | <strong>', $group['title'], ':</strong> |
228 | 234 | </dt>'; |
235 | + } |
|
229 | 236 | |
230 | 237 | echo ' |
231 | 238 | <dd>', implode(', ', $group['members']), '</dd>'; |
@@ -234,10 +241,11 @@ discard block |
||
234 | 241 | echo ' |
235 | 242 | </dl>'; |
236 | 243 | |
237 | - if (isset($section['posttext'])) |
|
238 | - echo ' |
|
244 | + if (isset($section['posttext'])) { |
|
245 | + echo ' |
|
239 | 246 | <hr> |
240 | 247 | <p>', $section['posttext'], '</p>'; |
248 | + } |
|
241 | 249 | } |
242 | 250 | |
243 | 251 | echo ' |
@@ -252,9 +260,10 @@ discard block |
||
252 | 260 | smfSupportVersions.forum = "', $context['forum_version'], '";'; |
253 | 261 | |
254 | 262 | // Don't worry, none of this is logged, it's just used to give information that might be of use. |
255 | - foreach ($context['current_versions'] as $variable => $version) |
|
256 | - echo ' |
|
263 | + foreach ($context['current_versions'] as $variable => $version) { |
|
264 | + echo ' |
|
257 | 265 | smfSupportVersions.', $variable, ' = "', $version['version'], '";'; |
266 | + } |
|
258 | 267 | |
259 | 268 | // Now we just have to include the script and wait ;). |
260 | 269 | echo ' |
@@ -350,8 +359,8 @@ discard block |
||
350 | 359 | <tbody>'; |
351 | 360 | |
352 | 361 | // Loop through every source file displaying its version - using javascript. |
353 | - foreach ($context['file_versions'] as $filename => $version) |
|
354 | - echo ' |
|
362 | + foreach ($context['file_versions'] as $filename => $version) { |
|
363 | + echo ' |
|
355 | 364 | <tr class="windowbg"> |
356 | 365 | <td class="half_table"> |
357 | 366 | ', $filename, ' |
@@ -363,6 +372,7 @@ discard block |
||
363 | 372 | <em id="currentSources', $filename, '">??</em> |
364 | 373 | </td> |
365 | 374 | </tr>'; |
375 | + } |
|
366 | 376 | |
367 | 377 | // Default template files. |
368 | 378 | echo ' |
@@ -388,8 +398,8 @@ discard block |
||
388 | 398 | <table id="Default" class="table_grid"> |
389 | 399 | <tbody>'; |
390 | 400 | |
391 | - foreach ($context['default_template_versions'] as $filename => $version) |
|
392 | - echo ' |
|
401 | + foreach ($context['default_template_versions'] as $filename => $version) { |
|
402 | + echo ' |
|
393 | 403 | <tr class="windowbg"> |
394 | 404 | <td class="half_table"> |
395 | 405 | ', $filename, ' |
@@ -401,6 +411,7 @@ discard block |
||
401 | 411 | <em id="currentDefault', $filename, '">??</em> |
402 | 412 | </td> |
403 | 413 | </tr>'; |
414 | + } |
|
404 | 415 | |
405 | 416 | // Now the language files... |
406 | 417 | echo ' |
@@ -428,8 +439,8 @@ discard block |
||
428 | 439 | |
429 | 440 | foreach ($context['default_language_versions'] as $language => $files) |
430 | 441 | { |
431 | - foreach ($files as $filename => $version) |
|
432 | - echo ' |
|
442 | + foreach ($files as $filename => $version) { |
|
443 | + echo ' |
|
433 | 444 | <tr class="windowbg"> |
434 | 445 | <td class="half_table"> |
435 | 446 | ', $filename, '.<em>', $language, '</em>.php |
@@ -441,6 +452,7 @@ discard block |
||
441 | 452 | <em id="current', $filename, '.', $language, '">??</em> |
442 | 453 | </td> |
443 | 454 | </tr>'; |
455 | + } |
|
444 | 456 | } |
445 | 457 | |
446 | 458 | echo ' |
@@ -470,8 +482,8 @@ discard block |
||
470 | 482 | <table id="Templates" class="table_grid"> |
471 | 483 | <tbody>'; |
472 | 484 | |
473 | - foreach ($context['template_versions'] as $filename => $version) |
|
474 | - echo ' |
|
485 | + foreach ($context['template_versions'] as $filename => $version) { |
|
486 | + echo ' |
|
475 | 487 | <tr class="windowbg"> |
476 | 488 | <td class="half_table"> |
477 | 489 | ', $filename, ' |
@@ -483,6 +495,7 @@ discard block |
||
483 | 495 | <em id="currentTemplates', $filename, '">??</em> |
484 | 496 | </td> |
485 | 497 | </tr>'; |
498 | + } |
|
486 | 499 | |
487 | 500 | echo ' |
488 | 501 | </tbody> |
@@ -512,8 +525,8 @@ discard block |
||
512 | 525 | <table id="Tasks" class="table_grid"> |
513 | 526 | <tbody>'; |
514 | 527 | |
515 | - foreach ($context['tasks_versions'] as $filename => $version) |
|
516 | - echo ' |
|
528 | + foreach ($context['tasks_versions'] as $filename => $version) { |
|
529 | + echo ' |
|
517 | 530 | <tr class="windowbg"> |
518 | 531 | <td class="half_table"> |
519 | 532 | ', $filename, ' |
@@ -525,6 +538,7 @@ discard block |
||
525 | 538 | <em id="currentTasks', $filename, '">??</em> |
526 | 539 | </td> |
527 | 540 | </tr>'; |
541 | + } |
|
528 | 542 | |
529 | 543 | echo ' |
530 | 544 | </tbody> |
@@ -565,9 +579,10 @@ discard block |
||
565 | 579 | { |
566 | 580 | global $context, $scripturl, $txt, $modSettings; |
567 | 581 | |
568 | - if (!empty($context['saved_successful'])) |
|
569 | - echo ' |
|
582 | + if (!empty($context['saved_successful'])) { |
|
583 | + echo ' |
|
570 | 584 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
585 | + } |
|
571 | 586 | |
572 | 587 | // First section is for adding/removing words from the censored list. |
573 | 588 | echo ' |
@@ -581,11 +596,12 @@ discard block |
||
581 | 596 | <p>', $txt['admin_censored_where'], '</p>'; |
582 | 597 | |
583 | 598 | // Show text boxes for censoring [bad ] => [good ]. |
584 | - foreach ($context['censored_words'] as $vulgar => $proper) |
|
585 | - echo ' |
|
599 | + foreach ($context['censored_words'] as $vulgar => $proper) { |
|
600 | + echo ' |
|
586 | 601 | <div class="block"> |
587 | 602 | <input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> => <input type="text" name="censor_proper[]" value="', $proper, '" size="30"> |
588 | 603 | </div>'; |
604 | + } |
|
589 | 605 | |
590 | 606 | // Now provide a way to censor more words. |
591 | 607 | echo ' |
@@ -658,27 +674,30 @@ discard block |
||
658 | 674 | <div class="windowbg"> |
659 | 675 | ', $txt['not_done_reason']; |
660 | 676 | |
661 | - if (!empty($context['continue_percent'])) |
|
662 | - echo ' |
|
677 | + if (!empty($context['continue_percent'])) { |
|
678 | + echo ' |
|
663 | 679 | <div class="progress_bar"> |
664 | 680 | <span>', $context['continue_percent'], '%</span> |
665 | 681 | <div class="bar" style="width: ', $context['continue_percent'], '%;"></div> |
666 | 682 | </div>'; |
683 | + } |
|
667 | 684 | |
668 | - if (!empty($context['substep_enabled'])) |
|
669 | - echo ' |
|
685 | + if (!empty($context['substep_enabled'])) { |
|
686 | + echo ' |
|
670 | 687 | <div class="progress_bar progress_blue"> |
671 | 688 | <span>', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</span> |
672 | 689 | <div class="bar" style="width: ', $context['substep_continue_percent'], '%;"></div> |
673 | 690 | </div>'; |
691 | + } |
|
674 | 692 | |
675 | 693 | echo ' |
676 | 694 | <form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">'; |
677 | 695 | |
678 | 696 | // Do we have a token? |
679 | - if (isset($context['not_done_token']) && isset($context[$context['not_done_token'] . '_token'], $context[$context['not_done_token'] . '_token_var'])) |
|
680 | - echo ' |
|
697 | + if (isset($context['not_done_token']) && isset($context[$context['not_done_token'] . '_token'], $context[$context['not_done_token'] . '_token_var'])) { |
|
698 | + echo ' |
|
681 | 699 | <input type="hidden" name="', $context[$context['not_done_token'] . '_token_var'], '" value="', $context[$context['not_done_token'] . '_token'], '">'; |
700 | + } |
|
682 | 701 | |
683 | 702 | echo ' |
684 | 703 | <input type="submit" name="cont" value="', $txt['not_done_continue'], '" class="button"> |
@@ -711,34 +730,39 @@ discard block |
||
711 | 730 | { |
712 | 731 | global $context, $txt, $scripturl; |
713 | 732 | |
714 | - if (!empty($context['saved_successful'])) |
|
715 | - echo ' |
|
733 | + if (!empty($context['saved_successful'])) { |
|
734 | + echo ' |
|
716 | 735 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
717 | - elseif (!empty($context['saved_failed'])) |
|
718 | - echo ' |
|
736 | + } elseif (!empty($context['saved_failed'])) { |
|
737 | + echo ' |
|
719 | 738 | <div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>'; |
739 | + } |
|
720 | 740 | |
721 | - if (!empty($context['settings_pre_javascript'])) |
|
722 | - echo ' |
|
741 | + if (!empty($context['settings_pre_javascript'])) { |
|
742 | + echo ' |
|
723 | 743 | <script>', $context['settings_pre_javascript'], '</script>'; |
744 | + } |
|
724 | 745 | |
725 | - if (!empty($context['settings_insert_above'])) |
|
726 | - echo $context['settings_insert_above']; |
|
746 | + if (!empty($context['settings_insert_above'])) { |
|
747 | + echo $context['settings_insert_above']; |
|
748 | + } |
|
727 | 749 | |
728 | 750 | echo ' |
729 | 751 | <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'] . '"' : '', '>'; |
730 | 752 | |
731 | 753 | // Is there a custom title? |
732 | - if (isset($context['settings_title'])) |
|
733 | - echo ' |
|
754 | + if (isset($context['settings_title'])) { |
|
755 | + echo ' |
|
734 | 756 | <div class="cat_bar"> |
735 | 757 | <h3 class="catbg">', $context['settings_title'], '</h3> |
736 | 758 | </div>'; |
759 | + } |
|
737 | 760 | |
738 | 761 | // Have we got a message to display? |
739 | - if (!empty($context['settings_message'])) |
|
740 | - echo ' |
|
762 | + if (!empty($context['settings_message'])) { |
|
763 | + echo ' |
|
741 | 764 | <div class="information">', $context['settings_message'], '</div>'; |
765 | + } |
|
742 | 766 | |
743 | 767 | // Now actually loop through all the variables. |
744 | 768 | $is_open = false; |
@@ -791,8 +815,9 @@ discard block |
||
791 | 815 | // Hang about? Are you pulling my leg - a callback?! |
792 | 816 | if (is_array($config_var) && $config_var['type'] == 'callback') |
793 | 817 | { |
794 | - if (function_exists('template_callback_' . $config_var['name'])) |
|
795 | - call_user_func('template_callback_' . $config_var['name']); |
|
818 | + if (function_exists('template_callback_' . $config_var['name'])) { |
|
819 | + call_user_func('template_callback_' . $config_var['name']); |
|
820 | + } |
|
796 | 821 | |
797 | 822 | continue; |
798 | 823 | } |
@@ -822,9 +847,10 @@ discard block |
||
822 | 847 | $text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time'); |
823 | 848 | |
824 | 849 | // Show the [?] button. |
825 | - if ($config_var['help']) |
|
826 | - echo ' |
|
850 | + if ($config_var['help']) { |
|
851 | + echo ' |
|
827 | 852 | <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> '; |
853 | + } |
|
828 | 854 | |
829 | 855 | echo ' |
830 | 856 | <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> |
@@ -833,23 +859,26 @@ discard block |
||
833 | 859 | $config_var['preinput']; |
834 | 860 | |
835 | 861 | // Show a check box. |
836 | - if ($config_var['type'] == 'check') |
|
837 | - echo ' |
|
862 | + if ($config_var['type'] == 'check') { |
|
863 | + echo ' |
|
838 | 864 | <input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">'; |
865 | + } |
|
839 | 866 | // Escape (via htmlspecialchars.) the text box. |
840 | - elseif ($config_var['type'] == 'password') |
|
841 | - echo ' |
|
867 | + elseif ($config_var['type'] == 'password') { |
|
868 | + echo ' |
|
842 | 869 | <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> |
843 | 870 | <input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>'; |
871 | + } |
|
844 | 872 | // Show a selection box. |
845 | 873 | elseif ($config_var['type'] == 'select') |
846 | 874 | { |
847 | 875 | echo ' |
848 | 876 | <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'] . '"' : ''), '>'; |
849 | 877 | |
850 | - foreach ($config_var['data'] as $option) |
|
851 | - echo ' |
|
878 | + foreach ($config_var['data'] as $option) { |
|
879 | + echo ' |
|
852 | 880 | <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>'; |
881 | + } |
|
853 | 882 | echo ' |
854 | 883 | </select>'; |
855 | 884 | } |
@@ -866,16 +895,18 @@ discard block |
||
866 | 895 | |
867 | 896 | foreach ($context['board_list'] as $id_cat => $cat) |
868 | 897 | { |
869 | - if (!$first) |
|
870 | - echo ' |
|
898 | + if (!$first) { |
|
899 | + echo ' |
|
871 | 900 | <hr>'; |
901 | + } |
|
872 | 902 | echo ' |
873 | 903 | <strong>', $cat['name'], '</strong> |
874 | 904 | <ul>'; |
875 | 905 | |
876 | - foreach ($cat['boards'] as $id_board => $brd) |
|
877 | - echo ' |
|
906 | + foreach ($cat['boards'] as $id_board => $brd) { |
|
907 | + echo ' |
|
878 | 908 | <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>'; |
909 | + } |
|
879 | 910 | |
880 | 911 | echo ' |
881 | 912 | </ul>'; |
@@ -885,12 +916,14 @@ discard block |
||
885 | 916 | </fieldset>'; |
886 | 917 | } |
887 | 918 | // Text area? |
888 | - elseif ($config_var['type'] == 'large_text') |
|
889 | - echo ' |
|
919 | + elseif ($config_var['type'] == 'large_text') { |
|
920 | + echo ' |
|
890 | 921 | <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>'; |
922 | + } |
|
891 | 923 | // Permission group? |
892 | - elseif ($config_var['type'] == 'permissions') |
|
893 | - theme_inline_permissions($config_var['name']); |
|
924 | + elseif ($config_var['type'] == 'permissions') { |
|
925 | + theme_inline_permissions($config_var['name']); |
|
926 | + } |
|
894 | 927 | |
895 | 928 | // BBC selection? |
896 | 929 | elseif ($config_var['type'] == 'bbc') |
@@ -902,22 +935,24 @@ discard block |
||
902 | 935 | |
903 | 936 | foreach ($context['bbc_columns'] as $bbcColumn) |
904 | 937 | { |
905 | - foreach ($bbcColumn as $bbcTag) |
|
906 | - echo ' |
|
938 | + foreach ($bbcColumn as $bbcTag) { |
|
939 | + echo ' |
|
907 | 940 | <li class="list_bbc floatleft"> |
908 | 941 | <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>)' : '', ' |
909 | 942 | </li>'; |
943 | + } |
|
910 | 944 | } |
911 | 945 | echo ' </ul> |
912 | 946 | <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> |
913 | 947 | </fieldset>'; |
914 | 948 | } |
915 | 949 | // A simple message? |
916 | - elseif ($config_var['type'] == 'var_message') |
|
917 | - echo ' |
|
950 | + elseif ($config_var['type'] == 'var_message') { |
|
951 | + echo ' |
|
918 | 952 | <div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '> |
919 | 953 | ', $config_var['var_message'], ' |
920 | 954 | </div>'; |
955 | + } |
|
921 | 956 | // Assume it must be a text box |
922 | 957 | else |
923 | 958 | { |
@@ -942,61 +977,69 @@ discard block |
||
942 | 977 | ' . $config_var['postinput'] : '',' |
943 | 978 | </dd>'; |
944 | 979 | } |
945 | - } |
|
946 | - else |
|
980 | + } else |
|
947 | 981 | { |
948 | 982 | // Just show a separator. |
949 | - if ($config_var == '') |
|
950 | - echo ' |
|
983 | + if ($config_var == '') { |
|
984 | + echo ' |
|
951 | 985 | </dl> |
952 | 986 | <hr> |
953 | 987 | <dl class="settings">'; |
954 | - else |
|
955 | - echo ' |
|
988 | + } else { |
|
989 | + echo ' |
|
956 | 990 | <dd> |
957 | 991 | <strong>' . $config_var . '</strong> |
958 | 992 | </dd>'; |
993 | + } |
|
959 | 994 | } |
960 | 995 | } |
961 | 996 | |
962 | - if ($is_open) |
|
963 | - echo ' |
|
997 | + if ($is_open) { |
|
998 | + echo ' |
|
964 | 999 | </dl>'; |
1000 | + } |
|
965 | 1001 | |
966 | - if (empty($context['settings_save_dont_show'])) |
|
967 | - echo ' |
|
1002 | + if (empty($context['settings_save_dont_show'])) { |
|
1003 | + echo ' |
|
968 | 1004 | <input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">'; |
1005 | + } |
|
969 | 1006 | |
970 | - if ($is_open) |
|
971 | - echo ' |
|
1007 | + if ($is_open) { |
|
1008 | + echo ' |
|
972 | 1009 | </div><!-- .windowbg -->'; |
1010 | + } |
|
973 | 1011 | |
974 | 1012 | |
975 | 1013 | // At least one token has to be used! |
976 | - if (isset($context['admin-ssc_token'])) |
|
977 | - echo ' |
|
1014 | + if (isset($context['admin-ssc_token'])) { |
|
1015 | + echo ' |
|
978 | 1016 | <input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">'; |
1017 | + } |
|
979 | 1018 | |
980 | - if (isset($context['admin-dbsc_token'])) |
|
981 | - echo ' |
|
1019 | + if (isset($context['admin-dbsc_token'])) { |
|
1020 | + echo ' |
|
982 | 1021 | <input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">'; |
1022 | + } |
|
983 | 1023 | |
984 | - if (isset($context['admin-mp_token'])) |
|
985 | - echo ' |
|
1024 | + if (isset($context['admin-mp_token'])) { |
|
1025 | + echo ' |
|
986 | 1026 | <input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">'; |
1027 | + } |
|
987 | 1028 | |
988 | 1029 | echo ' |
989 | 1030 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
990 | 1031 | </form>'; |
991 | 1032 | |
992 | - if (!empty($context['settings_post_javascript'])) |
|
993 | - echo ' |
|
1033 | + if (!empty($context['settings_post_javascript'])) { |
|
1034 | + echo ' |
|
994 | 1035 | <script> |
995 | 1036 | ', $context['settings_post_javascript'], ' |
996 | 1037 | </script>'; |
1038 | + } |
|
997 | 1039 | |
998 | - if (!empty($context['settings_insert_below'])) |
|
999 | - echo $context['settings_insert_below']; |
|
1040 | + if (!empty($context['settings_insert_below'])) { |
|
1041 | + echo $context['settings_insert_below']; |
|
1042 | + } |
|
1000 | 1043 | |
1001 | 1044 | // We may have added a board listing. If we did, we need to make it work. |
1002 | 1045 | addInlineJavascript(' |
@@ -1019,9 +1062,10 @@ discard block |
||
1019 | 1062 | { |
1020 | 1063 | global $context, $txt; |
1021 | 1064 | |
1022 | - if (!empty($context['saved_successful'])) |
|
1023 | - echo ' |
|
1065 | + if (!empty($context['saved_successful'])) { |
|
1066 | + echo ' |
|
1024 | 1067 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
1068 | + } |
|
1025 | 1069 | |
1026 | 1070 | // Standard fields. |
1027 | 1071 | template_show_list('standard_profile_fields'); |
@@ -1055,11 +1099,12 @@ discard block |
||
1055 | 1099 | { |
1056 | 1100 | loadLanguage('Errors'); |
1057 | 1101 | |
1058 | - if (isset($txt['custom_option_' . $_GET['msg']])) |
|
1059 | - echo ' |
|
1102 | + if (isset($txt['custom_option_' . $_GET['msg']])) { |
|
1103 | + echo ' |
|
1060 | 1104 | <div class="errorbox">', |
1061 | 1105 | $txt['custom_option_' . $_GET['msg']], ' |
1062 | 1106 | </div>'; |
1107 | + } |
|
1063 | 1108 | } |
1064 | 1109 | |
1065 | 1110 | echo ' |
@@ -1125,9 +1170,10 @@ discard block |
||
1125 | 1170 | <dd> |
1126 | 1171 | <select name="placement" id="placement">'; |
1127 | 1172 | |
1128 | - foreach ($context['cust_profile_fields_placement'] as $order => $name) |
|
1129 | - echo ' |
|
1173 | + foreach ($context['cust_profile_fields_placement'] as $order => $name) { |
|
1174 | + echo ' |
|
1130 | 1175 | <option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>'; |
1176 | + } |
|
1131 | 1177 | |
1132 | 1178 | echo ' |
1133 | 1179 | </select> |
@@ -1151,9 +1197,10 @@ discard block |
||
1151 | 1197 | <dd> |
1152 | 1198 | <select name="field_type" id="field_type" onchange="updateInputBoxes();">'; |
1153 | 1199 | |
1154 | - foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) |
|
1155 | - echo ' |
|
1200 | + foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) { |
|
1201 | + echo ' |
|
1156 | 1202 | <option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>'; |
1203 | + } |
|
1157 | 1204 | |
1158 | 1205 | echo ' |
1159 | 1206 | </select> |
@@ -1185,9 +1232,10 @@ discard block |
||
1185 | 1232 | </dt> |
1186 | 1233 | <dd id="options_dd">'; |
1187 | 1234 | |
1188 | - foreach ($context['field']['options'] as $k => $option) |
|
1189 | - echo ' |
|
1235 | + foreach ($context['field']['options'] as $k => $option) { |
|
1236 | + echo ' |
|
1190 | 1237 | ', $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, '">'; |
1238 | + } |
|
1191 | 1239 | |
1192 | 1240 | echo ' |
1193 | 1241 | <span id="addopt"></span> |
@@ -1251,9 +1299,10 @@ discard block |
||
1251 | 1299 | </fieldset> |
1252 | 1300 | <input type="submit" name="save" value="', $txt['save'], '" class="button">'; |
1253 | 1301 | |
1254 | - if ($context['fid']) |
|
1255 | - echo ' |
|
1302 | + if ($context['fid']) { |
|
1303 | + echo ' |
|
1256 | 1304 | <input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">'; |
1305 | + } |
|
1257 | 1306 | |
1258 | 1307 | echo ' |
1259 | 1308 | </div><!-- .windowbg --> |
@@ -1299,8 +1348,7 @@ discard block |
||
1299 | 1348 | <p class="centertext"> |
1300 | 1349 | <strong>', $txt['admin_search_results_none'], '</strong> |
1301 | 1350 | </p>'; |
1302 | - } |
|
1303 | - else |
|
1351 | + } else |
|
1304 | 1352 | { |
1305 | 1353 | echo ' |
1306 | 1354 | <ol class="search_results">'; |
@@ -1327,9 +1375,10 @@ discard block |
||
1327 | 1375 | <li> |
1328 | 1376 | <a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']'; |
1329 | 1377 | |
1330 | - if ($result['help']) |
|
1331 | - echo ' |
|
1378 | + if ($result['help']) { |
|
1379 | + echo ' |
|
1332 | 1380 | <p class="double_height">', $result['help'], '</p>'; |
1381 | + } |
|
1333 | 1382 | |
1334 | 1383 | echo ' |
1335 | 1384 | </li>'; |
@@ -1369,10 +1418,11 @@ discard block |
||
1369 | 1418 | <strong>', $txt['setup_verification_answer'], '</strong> |
1370 | 1419 | </dd>'; |
1371 | 1420 | |
1372 | - if (!empty($context['qa_by_lang'][$lang_id])) |
|
1373 | - foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
1421 | + if (!empty($context['qa_by_lang'][$lang_id])) { |
|
1422 | + foreach ($context['qa_by_lang'][$lang_id] as $q_id) |
|
1374 | 1423 | { |
1375 | 1424 | $question = $context['question_answers'][$q_id]; |
1425 | + } |
|
1376 | 1426 | |
1377 | 1427 | echo ' |
1378 | 1428 | <dt> |
@@ -1380,9 +1430,10 @@ discard block |
||
1380 | 1430 | </dt> |
1381 | 1431 | <dd>'; |
1382 | 1432 | |
1383 | - foreach ($question['answers'] as $answer) |
|
1384 | - echo ' |
|
1433 | + foreach ($question['answers'] as $answer) { |
|
1434 | + echo ' |
|
1385 | 1435 | <input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">'; |
1436 | + } |
|
1386 | 1437 | |
1387 | 1438 | echo ' |
1388 | 1439 | <div class="qa_add_answer"><a href="javascript:void(0);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div> |
@@ -1420,11 +1471,12 @@ discard block |
||
1420 | 1471 | ', $txt['errors_found'], ': |
1421 | 1472 | <ul>'; |
1422 | 1473 | |
1423 | - foreach ($context['repair_errors'] as $error) |
|
1424 | - echo ' |
|
1474 | + foreach ($context['repair_errors'] as $error) { |
|
1475 | + echo ' |
|
1425 | 1476 | <li> |
1426 | 1477 | ', $error, ' |
1427 | 1478 | </li>'; |
1479 | + } |
|
1428 | 1480 | |
1429 | 1481 | echo ' |
1430 | 1482 | </ul> |
@@ -1434,15 +1486,14 @@ discard block |
||
1434 | 1486 | <p class="padding"> |
1435 | 1487 | <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> |
1436 | 1488 | </p>'; |
1437 | - } |
|
1438 | - else |
|
1439 | - echo ' |
|
1489 | + } else { |
|
1490 | + echo ' |
|
1440 | 1491 | <p>', $txt['maintain_no_errors'], '</p> |
1441 | 1492 | <p class="padding"> |
1442 | 1493 | <a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a> |
1443 | 1494 | </p>'; |
1444 | - } |
|
1445 | - else |
|
1495 | + } |
|
1496 | + } else |
|
1446 | 1497 | { |
1447 | 1498 | if (!empty($context['redirect_to_recount'])) |
1448 | 1499 | { |
@@ -1454,8 +1505,7 @@ discard block |
||
1454 | 1505 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1455 | 1506 | <input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '"> |
1456 | 1507 | </form>'; |
1457 | - } |
|
1458 | - else |
|
1508 | + } else |
|
1459 | 1509 | { |
1460 | 1510 | echo ' |
1461 | 1511 | <p>', $txt['errors_fixed'], '</p> |
@@ -1545,9 +1595,10 @@ discard block |
||
1545 | 1595 | <tr class="windowbg"> |
1546 | 1596 | <td class="equal_table">', $key, '</td>'; |
1547 | 1597 | |
1548 | - foreach ($setting as $key_lm => $value) |
|
1549 | - echo ' |
|
1598 | + foreach ($setting as $key_lm => $value) { |
|
1599 | + echo ' |
|
1550 | 1600 | <td class="equal_table">', $value, '</td>'; |
1601 | + } |
|
1551 | 1602 | |
1552 | 1603 | echo ' |
1553 | 1604 | </tr>'; |
@@ -1607,8 +1658,8 @@ discard block |
||
1607 | 1658 | { |
1608 | 1659 | global $context, $txt; |
1609 | 1660 | |
1610 | - if ($context['user']['is_admin']) |
|
1611 | - echo ' |
|
1661 | + if ($context['user']['is_admin']) { |
|
1662 | + echo ' |
|
1612 | 1663 | <span class="floatright admin_search"> |
1613 | 1664 | <span class="generic_icons filter centericon"></span> |
1614 | 1665 | <input type="search" name="search_term" placeholder="', $txt['admin_search'], '"> |
@@ -1619,6 +1670,7 @@ discard block |
||
1619 | 1670 | </select> |
1620 | 1671 | <input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button"> |
1621 | 1672 | </span>'; |
1622 | -} |
|
1673 | + } |
|
1674 | + } |
|
1623 | 1675 | |
1624 | 1676 | ?> |
1625 | 1677 | \ 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>'; |
@@ -89,16 +89,18 @@ discard block |
||
89 | 89 | foreach ($section['areas'] as $i => $area) |
90 | 90 | { |
91 | 91 | // Not supposed to be printed? |
92 | - if (empty($area['label'])) |
|
93 | - continue; |
|
92 | + if (empty($area['label'])) { |
|
93 | + continue; |
|
94 | + } |
|
94 | 95 | |
95 | 96 | echo ' |
96 | 97 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '> |
97 | 98 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
98 | 99 | |
99 | 100 | // Is this the current area, or just some area? |
100 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
101 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
101 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
102 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
103 | + } |
|
102 | 104 | |
103 | 105 | // Are there any subsections? |
104 | 106 | if (!empty($area['subsections'])) |
@@ -108,8 +110,9 @@ discard block |
||
108 | 110 | |
109 | 111 | foreach ($area['subsections'] as $sa => $sub) |
110 | 112 | { |
111 | - if (!empty($sub['disabled'])) |
|
112 | - continue; |
|
113 | + if (!empty($sub['disabled'])) { |
|
114 | + continue; |
|
115 | + } |
|
113 | 116 | |
114 | 117 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
115 | 118 | |
@@ -156,8 +159,9 @@ discard block |
||
156 | 159 | <h3 class="catbg">'; |
157 | 160 | |
158 | 161 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
159 | - if (function_exists('template_admin_quick_search')) |
|
160 | - template_admin_quick_search(); |
|
162 | + if (function_exists('template_admin_quick_search')) { |
|
163 | + template_admin_quick_search(); |
|
164 | + } |
|
161 | 165 | |
162 | 166 | // Exactly how many tabs do we have? |
163 | 167 | if (!empty($context['tabs'])) |
@@ -172,30 +176,36 @@ discard block |
||
172 | 176 | } |
173 | 177 | |
174 | 178 | // Did this not even exist - or do we not have a label? |
175 | - if (!isset($tab_context['tabs'][$id])) |
|
176 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
177 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
178 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
179 | + if (!isset($tab_context['tabs'][$id])) { |
|
180 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
181 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
182 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
183 | + } |
|
179 | 184 | |
180 | 185 | // Has a custom URL defined in the main admin structure? |
181 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
182 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
186 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
187 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
188 | + } |
|
183 | 189 | |
184 | 190 | // Any additional paramaters for the url? |
185 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
186 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
191 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
192 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
193 | + } |
|
187 | 194 | |
188 | 195 | // Has it been deemed selected? |
189 | - if (!empty($tab['is_selected'])) |
|
190 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
196 | + if (!empty($tab['is_selected'])) { |
|
197 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
198 | + } |
|
191 | 199 | |
192 | 200 | // Does it have its own help? |
193 | - if (!empty($tab['help'])) |
|
194 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
201 | + if (!empty($tab['help'])) { |
|
202 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
203 | + } |
|
195 | 204 | |
196 | 205 | // Is this the last one? |
197 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
198 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
206 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
207 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
208 | + } |
|
199 | 209 | } |
200 | 210 | |
201 | 211 | // Find the selected tab |
@@ -212,22 +222,24 @@ discard block |
||
212 | 222 | // Show an icon and/or a help item? |
213 | 223 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
214 | 224 | { |
215 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
216 | - echo ' |
|
225 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
226 | + echo ' |
|
217 | 227 | <span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
218 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
219 | - echo ' |
|
228 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
229 | + echo ' |
|
220 | 230 | <img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
231 | + } |
|
221 | 232 | |
222 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
223 | - echo ' |
|
233 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
234 | + echo ' |
|
224 | 235 | <a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
236 | + } |
|
225 | 237 | |
226 | 238 | echo $tab_context['title']; |
227 | - } |
|
228 | - else |
|
229 | - echo ' |
|
239 | + } else { |
|
240 | + echo ' |
|
230 | 241 | ', $tab_context['title']; |
242 | + } |
|
231 | 243 | |
232 | 244 | echo ' |
233 | 245 | </h3>', (function_exists('template_admin_quick_search') ? ' |
@@ -236,11 +248,12 @@ discard block |
||
236 | 248 | } |
237 | 249 | |
238 | 250 | // Shall we use the tabs? Yes, it's the only known way! |
239 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
240 | - echo ' |
|
251 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
252 | + echo ' |
|
241 | 253 | <p class="information"> |
242 | 254 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
243 | 255 | </p>'; |
256 | + } |
|
244 | 257 | |
245 | 258 | // Print out all the items in this tab (if any). |
246 | 259 | if (!empty($context['tabs'])) |
@@ -252,19 +265,21 @@ discard block |
||
252 | 265 | |
253 | 266 | foreach ($tab_context['tabs'] as $sa => $tab) |
254 | 267 | { |
255 | - if (!empty($tab['disabled'])) |
|
256 | - continue; |
|
268 | + if (!empty($tab['disabled'])) { |
|
269 | + continue; |
|
270 | + } |
|
257 | 271 | |
258 | - if (!empty($tab['is_selected'])) |
|
259 | - echo ' |
|
272 | + if (!empty($tab['is_selected'])) { |
|
273 | + echo ' |
|
260 | 274 | <li> |
261 | 275 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
262 | 276 | </li>'; |
263 | - else |
|
264 | - echo ' |
|
277 | + } else { |
|
278 | + echo ' |
|
265 | 279 | <li> |
266 | 280 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
267 | 281 | </li>'; |
282 | + } |
|
268 | 283 | } |
269 | 284 | |
270 | 285 | // The end of tabs |
@@ -29,9 +29,10 @@ discard block |
||
29 | 29 | // Go through each type of report they can run. |
30 | 30 | foreach ($context['report_types'] as $type) |
31 | 31 | { |
32 | - if (isset($type['description'])) |
|
33 | - echo ' |
|
32 | + if (isset($type['description'])) { |
|
33 | + echo ' |
|
34 | 34 | <dt>', $type['description'], '</dt>'; |
35 | + } |
|
35 | 36 | |
36 | 37 | echo ' |
37 | 38 | <dd> |
@@ -62,8 +63,9 @@ discard block |
||
62 | 63 | </div> |
63 | 64 | <div id="report_buttons">'; |
64 | 65 | |
65 | - if (!empty($context['report_buttons'])) |
|
66 | - template_button_strip($context['report_buttons'], 'right'); |
|
66 | + if (!empty($context['report_buttons'])) { |
|
67 | + template_button_strip($context['report_buttons'], 'right'); |
|
68 | + } |
|
67 | 69 | |
68 | 70 | echo ' |
69 | 71 | </div>'; |
@@ -74,25 +76,27 @@ discard block |
||
74 | 76 | echo ' |
75 | 77 | <table class="table_grid report_results">'; |
76 | 78 | |
77 | - if (!empty($table['title'])) |
|
78 | - echo ' |
|
79 | + if (!empty($table['title'])) { |
|
80 | + echo ' |
|
79 | 81 | <thead> |
80 | 82 | <tr class="title_bar"> |
81 | 83 | <th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th> |
82 | 84 | </tr> |
83 | 85 | </thead> |
84 | 86 | <tbody>'; |
87 | + } |
|
85 | 88 | |
86 | 89 | // Now do each row! |
87 | 90 | $row_number = 0; |
88 | 91 | foreach ($table['data'] as $row) |
89 | 92 | { |
90 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
91 | - echo ' |
|
93 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
94 | + echo ' |
|
92 | 95 | <tr class="windowbg table_caption">'; |
93 | - else |
|
94 | - echo ' |
|
96 | + } else { |
|
97 | + echo ' |
|
95 | 98 | <tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">'; |
99 | + } |
|
96 | 100 | |
97 | 101 | // Now do each column. |
98 | 102 | $column_number = 0; |
@@ -110,16 +114,17 @@ discard block |
||
110 | 114 | } |
111 | 115 | |
112 | 116 | // Shaded? |
113 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
114 | - echo ' |
|
117 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
118 | + echo ' |
|
115 | 119 | <td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
116 | 120 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
117 | 121 | </td>'; |
118 | - else |
|
119 | - echo ' |
|
122 | + } else { |
|
123 | + echo ' |
|
120 | 124 | <td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
121 | 125 | ', $data['v'], ' |
122 | 126 | </td>'; |
127 | + } |
|
123 | 128 | |
124 | 129 | $column_number++; |
125 | 130 | } |
@@ -168,24 +173,26 @@ discard block |
||
168 | 173 | <div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '"> |
169 | 174 | <table class="bordercolor">'; |
170 | 175 | |
171 | - if (!empty($table['title'])) |
|
172 | - echo ' |
|
176 | + if (!empty($table['title'])) { |
|
177 | + echo ' |
|
173 | 178 | <tr class="title_bar"> |
174 | 179 | <td colspan="', $table['column_count'], '"> |
175 | 180 | ', $table['title'], ' |
176 | 181 | </td> |
177 | 182 | </tr>'; |
183 | + } |
|
178 | 184 | |
179 | 185 | // Now do each row! |
180 | 186 | $row_number = 0; |
181 | 187 | foreach ($table['data'] as $row) |
182 | 188 | { |
183 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
184 | - echo ' |
|
189 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
190 | + echo ' |
|
185 | 191 | <tr class="titlebg">'; |
186 | - else |
|
187 | - echo ' |
|
192 | + } else { |
|
193 | + echo ' |
|
188 | 194 | <tr class="windowbg">'; |
195 | + } |
|
189 | 196 | |
190 | 197 | // Now do each column!! |
191 | 198 | $column_number = 0; |
@@ -202,16 +209,17 @@ discard block |
||
202 | 209 | } |
203 | 210 | |
204 | 211 | // Shaded? |
205 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
206 | - echo ' |
|
212 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
213 | + echo ' |
|
207 | 214 | <td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
208 | 215 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
209 | 216 | </td>'; |
210 | - else |
|
211 | - echo ' |
|
217 | + } else { |
|
218 | + echo ' |
|
212 | 219 | <td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
213 | 220 | ', $data['v'], ' |
214 | 221 | </td>'; |
222 | + } |
|
215 | 223 | |
216 | 224 | $column_number++; |
217 | 225 | } |