@@ -28,14 +28,16 @@ discard block |
||
| 28 | 28 | <form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">'; |
| 29 | 29 | |
| 30 | 30 | // Did they make a mistake last time? |
| 31 | - if (!empty($context['login_errors'])) |
|
| 32 | - echo ' |
|
| 31 | + if (!empty($context['login_errors'])) { |
|
| 32 | + echo ' |
|
| 33 | 33 | <div class="errorbox">', implode('<br>', $context['login_errors']), '</div><br>'; |
| 34 | + } |
|
| 34 | 35 | |
| 35 | 36 | // Or perhaps there's some special description for this time? |
| 36 | - if (isset($context['description'])) |
|
| 37 | - echo ' |
|
| 37 | + if (isset($context['description'])) { |
|
| 38 | + echo ' |
|
| 38 | 39 | <p class="information">', $context['description'], '</p>'; |
| 40 | + } |
|
| 39 | 41 | |
| 40 | 42 | // Now just get the basic information - username, password, etc. |
| 41 | 43 | echo ' |
@@ -51,10 +53,11 @@ discard block |
||
| 51 | 53 | <dt>', $txt['always_logged_in'], ':</dt> |
| 52 | 54 | <dd><input type="checkbox" name="cookieneverexp"', $context['never_expire'] ? ' checked' : '', ' class="input_check" onclick="this.form.cookielength.disabled = this.checked;"></dd>'; |
| 53 | 55 | // If they have deleted their account, give them a chance to change their mind. |
| 54 | - if (isset($context['login_show_undelete'])) |
|
| 55 | - echo ' |
|
| 56 | + if (isset($context['login_show_undelete'])) { |
|
| 57 | + echo ' |
|
| 56 | 58 | <dt class="alert">', $txt['undelete_account'], ':</dt> |
| 57 | 59 | <dd><input type="checkbox" name="undelete" class="input_check"></dd>'; |
| 60 | + } |
|
| 58 | 61 | echo ' |
| 59 | 62 | </dl> |
| 60 | 63 | <p><input type="submit" value="', $txt['login'], '" class="button_submit"></p> |
@@ -66,8 +69,8 @@ discard block |
||
| 66 | 69 | setTimeout(function() { |
| 67 | 70 | document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus(); |
| 68 | 71 | }, 150);'; |
| 69 | - if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) |
|
| 70 | - echo ' |
|
| 72 | + if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) { |
|
| 73 | + echo ' |
|
| 71 | 74 | form = $("#frmLogin"); |
| 72 | 75 | form.submit(function(e) { |
| 73 | 76 | e.preventDefault(); |
@@ -91,16 +94,18 @@ discard block |
||
| 91 | 94 | |
| 92 | 95 | return false; |
| 93 | 96 | });'; |
| 97 | + } |
|
| 94 | 98 | |
| 95 | 99 | echo ' |
| 96 | 100 | </script> |
| 97 | 101 | </form>'; |
| 98 | 102 | |
| 99 | 103 | // It is a long story as to why we have this when we're clearly not going to use it. |
| 100 | - if (!empty($context['from_ajax'])) |
|
| 101 | - echo ' |
|
| 104 | + if (!empty($context['from_ajax'])) { |
|
| 105 | + echo ' |
|
| 102 | 106 | <br> |
| 103 | 107 | <a href="javascript:self.close();"></a>'; |
| 108 | + } |
|
| 104 | 109 | echo ' |
| 105 | 110 | </div> |
| 106 | 111 | </div>'; |
@@ -121,9 +126,10 @@ discard block |
||
| 121 | 126 | </h3> |
| 122 | 127 | </div> |
| 123 | 128 | <div class="roundframe">'; |
| 124 | - if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) |
|
| 125 | - echo ' |
|
| 129 | + if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) { |
|
| 130 | + echo ' |
|
| 126 | 131 | <div class="error">', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], '</div>'; |
| 132 | + } |
|
| 127 | 133 | echo ' |
| 128 | 134 | <form action="', $context['tfa_url'], '" method="post" id="frmTfa"> |
| 129 | 135 | <div id="tfaCode"> |
@@ -146,8 +152,8 @@ discard block |
||
| 146 | 152 | </form> |
| 147 | 153 | <script> |
| 148 | 154 | form = $("#frmTfa");'; |
| 149 | - if (!empty($context['from_ajax'])) |
|
| 150 | - echo ' |
|
| 155 | + if (!empty($context['from_ajax'])) { |
|
| 156 | + echo ' |
|
| 151 | 157 | form.submit(function(e) { |
| 152 | 158 | // If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page |
| 153 | 159 | if (form.find("input[name=tfa_backup]:first").val().length > 0) |
@@ -166,6 +172,7 @@ discard block |
||
| 166 | 172 | |
| 167 | 173 | return false; |
| 168 | 174 | });'; |
| 175 | + } |
|
| 169 | 176 | echo ' |
| 170 | 177 | form.find("input[name=backup]").click(function(e) { |
| 171 | 178 | $("#tfaBackup").show(); |
@@ -197,10 +204,11 @@ discard block |
||
| 197 | 204 | ', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>'; |
| 198 | 205 | |
| 199 | 206 | |
| 200 | - if ($context['can_register']) |
|
| 201 | - echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
| 202 | - else |
|
| 203 | - echo $txt['login_below']; |
|
| 207 | + if ($context['can_register']) { |
|
| 208 | + echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']); |
|
| 209 | + } else { |
|
| 210 | + echo $txt['login_below']; |
|
| 211 | + } |
|
| 204 | 212 | |
| 205 | 213 | // And now the login information. |
| 206 | 214 | echo ' |
@@ -296,9 +304,10 @@ discard block |
||
| 296 | 304 | </div> |
| 297 | 305 | <div class="roundframe centertext">'; |
| 298 | 306 | |
| 299 | - if (!empty($context['incorrect_password'])) |
|
| 300 | - echo ' |
|
| 307 | + if (!empty($context['incorrect_password'])) { |
|
| 308 | + echo ' |
|
| 301 | 309 | <div class="error">', $txt['admin_incorrect_password'], '</div>'; |
| 310 | + } |
|
| 302 | 311 | |
| 303 | 312 | echo ' |
| 304 | 313 | <strong>', $txt['password'], ':</strong> |
@@ -338,11 +347,12 @@ discard block |
||
| 338 | 347 | <div class="roundframe">'; |
| 339 | 348 | |
| 340 | 349 | // You didn't even have an ID? |
| 341 | - if (empty($context['member_id'])) |
|
| 342 | - echo ' |
|
| 350 | + if (empty($context['member_id'])) { |
|
| 351 | + echo ' |
|
| 343 | 352 | <dl> |
| 344 | 353 | <dt>', $txt['invalid_activation_username'], ':</dt> |
| 345 | 354 | <dd><input type="text" name="user" size="30" class="input_text"></dd>'; |
| 355 | + } |
|
| 346 | 356 | |
| 347 | 357 | echo ' |
| 348 | 358 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
@@ -379,13 +389,14 @@ discard block |
||
| 379 | 389 | <dd><input type="password" name="passwd" size="30" class="input_password"></dd> |
| 380 | 390 | </dl>'; |
| 381 | 391 | |
| 382 | - if ($context['can_activate']) |
|
| 383 | - echo ' |
|
| 392 | + if ($context['can_activate']) { |
|
| 393 | + echo ' |
|
| 384 | 394 | <p>', $txt['invalid_activation_known'], '</p> |
| 385 | 395 | <dl> |
| 386 | 396 | <dt>', $txt['invalid_activation_retry'], ':</dt> |
| 387 | 397 | <dd><input type="text" name="code" size="30" class="input_text"></dd> |
| 388 | 398 | </dl>'; |
| 399 | + } |
|
| 389 | 400 | |
| 390 | 401 | echo ' |
| 391 | 402 | <p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button_submit"></p> |
@@ -28,13 +28,14 @@ discard block |
||
| 28 | 28 | <div id="confirm_buttons">'; |
| 29 | 29 | |
| 30 | 30 | // Age restriction in effect? |
| 31 | - if ($context['show_coppa']) |
|
| 32 | - echo ' |
|
| 31 | + if ($context['show_coppa']) { |
|
| 32 | + echo ' |
|
| 33 | 33 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br> |
| 34 | 34 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">'; |
| 35 | - else |
|
| 36 | - echo ' |
|
| 35 | + } else { |
|
| 36 | + echo ' |
|
| 37 | 37 | <input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button_submit">'; |
| 38 | + } |
|
| 38 | 39 | |
| 39 | 40 | echo ' |
| 40 | 41 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -77,9 +78,10 @@ discard block |
||
| 77 | 78 | <ul>'; |
| 78 | 79 | |
| 79 | 80 | // Cycle through each error and display an error message. |
| 80 | - foreach ($context['registration_errors'] as $error) |
|
| 81 | - echo ' |
|
| 81 | + foreach ($context['registration_errors'] as $error) { |
|
| 82 | + echo ' |
|
| 82 | 83 | <li>', $error, '</li>'; |
| 84 | + } |
|
| 83 | 85 | |
| 84 | 86 | echo ' |
| 85 | 87 | </ul> |
@@ -143,14 +145,15 @@ discard block |
||
| 143 | 145 | |
| 144 | 146 | <dl class="register_form">'; |
| 145 | 147 | |
| 146 | - foreach ($context['custom_fields'] as $field) |
|
| 147 | - if ($field['show_reg'] > 1) |
|
| 148 | + foreach ($context['custom_fields'] as $field) { |
|
| 149 | + if ($field['show_reg'] > 1) |
|
| 148 | 150 | echo ' |
| 149 | 151 | <dt> |
| 150 | 152 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
| 151 | 153 | <span class="smalltext">', $field['desc'], '</span> |
| 152 | 154 | </dt> |
| 153 | 155 | <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>'; |
| 156 | + } |
|
| 154 | 157 | |
| 155 | 158 | echo ' |
| 156 | 159 | </dl>'; |
@@ -184,41 +187,45 @@ discard block |
||
| 184 | 187 | $callback_func = 'template_profile_' . $field['callback_func']; |
| 185 | 188 | $callback_func(); |
| 186 | 189 | } |
| 187 | - } |
|
| 188 | - else |
|
| 190 | + } else |
|
| 189 | 191 | { |
| 190 | 192 | echo ' |
| 191 | 193 | <dt> |
| 192 | 194 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>'; |
| 193 | 195 | |
| 194 | 196 | // Does it have any subtext to show? |
| 195 | - if (!empty($field['subtext'])) |
|
| 196 | - echo ' |
|
| 197 | + if (!empty($field['subtext'])) { |
|
| 198 | + echo ' |
|
| 197 | 199 | <span class="smalltext">', $field['subtext'], '</span>'; |
| 200 | + } |
|
| 198 | 201 | |
| 199 | 202 | echo ' |
| 200 | 203 | </dt> |
| 201 | 204 | <dd>'; |
| 202 | 205 | |
| 203 | 206 | // Want to put something infront of the box? |
| 204 | - if (!empty($field['preinput'])) |
|
| 205 | - echo ' |
|
| 207 | + if (!empty($field['preinput'])) { |
|
| 208 | + echo ' |
|
| 206 | 209 | ', $field['preinput']; |
| 210 | + } |
|
| 207 | 211 | |
| 208 | 212 | // What type of data are we showing? |
| 209 | - if ($field['type'] == 'label') |
|
| 210 | - echo ' |
|
| 213 | + if ($field['type'] == 'label') { |
|
| 214 | + echo ' |
|
| 211 | 215 | ', $field['value']; |
| 216 | + } |
|
| 212 | 217 | |
| 213 | 218 | // Maybe it's a text box - very likely! |
| 214 | - elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) |
|
| 215 | - echo ' |
|
| 219 | + elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) { |
|
| 220 | + echo ' |
|
| 216 | 221 | <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '">'; |
| 222 | + } |
|
| 217 | 223 | |
| 218 | 224 | // You "checking" me out? ;) |
| 219 | - elseif ($field['type'] == 'check') |
|
| 220 | - echo ' |
|
| 225 | + elseif ($field['type'] == 'check') { |
|
| 226 | + echo ' |
|
| 221 | 227 | <input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" class="input_check" ', $field['input_attr'], '>'; |
| 228 | + } |
|
| 222 | 229 | |
| 223 | 230 | // Always fun - select boxes! |
| 224 | 231 | elseif ($field['type'] == 'select') |
@@ -229,13 +236,15 @@ discard block |
||
| 229 | 236 | if (isset($field['options'])) |
| 230 | 237 | { |
| 231 | 238 | // Is this some code to generate the options? |
| 232 | - if (!is_array($field['options'])) |
|
| 233 | - $field['options'] = eval($field['options']); |
|
| 239 | + if (!is_array($field['options'])) { |
|
| 240 | + $field['options'] = eval($field['options']); |
|
| 241 | + } |
|
| 234 | 242 | // Assuming we now have some! |
| 235 | - if (is_array($field['options'])) |
|
| 236 | - foreach ($field['options'] as $value => $name) |
|
| 243 | + if (is_array($field['options'])) { |
|
| 244 | + foreach ($field['options'] as $value => $name) |
|
| 237 | 245 | echo ' |
| 238 | 246 | <option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
| 247 | + } |
|
| 239 | 248 | } |
| 240 | 249 | |
| 241 | 250 | echo ' |
@@ -243,9 +252,10 @@ discard block |
||
| 243 | 252 | } |
| 244 | 253 | |
| 245 | 254 | // Something to end with? |
| 246 | - if (!empty($field['postinput'])) |
|
| 247 | - echo ' |
|
| 255 | + if (!empty($field['postinput'])) { |
|
| 256 | + echo ' |
|
| 248 | 257 | ', $field['postinput']; |
| 258 | + } |
|
| 249 | 259 | |
| 250 | 260 | echo ' |
| 251 | 261 | </dd>'; |
@@ -258,13 +268,14 @@ discard block |
||
| 258 | 268 | { |
| 259 | 269 | foreach ($context['custom_fields'] as $field) |
| 260 | 270 | { |
| 261 | - if ($field['show_reg'] < 2) |
|
| 262 | - echo ' |
|
| 271 | + if ($field['show_reg'] < 2) { |
|
| 272 | + echo ' |
|
| 263 | 273 | <dt> |
| 264 | 274 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
| 265 | 275 | <span class="smalltext">', $field['desc'], '</span> |
| 266 | 276 | </dt> |
| 267 | 277 | <dd>', $field['input_html'], '</dd>'; |
| 278 | + } |
|
| 268 | 279 | } |
| 269 | 280 | } |
| 270 | 281 | |
@@ -294,13 +305,14 @@ discard block |
||
| 294 | 305 | <div id="confirm_buttons" class="flow_auto">'; |
| 295 | 306 | |
| 296 | 307 | // Age restriction in effect? |
| 297 | - if (!$context['require_agreement'] && $context['show_coppa']) |
|
| 298 | - echo ' |
|
| 308 | + if (!$context['require_agreement'] && $context['show_coppa']) { |
|
| 309 | + echo ' |
|
| 299 | 310 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br> |
| 300 | 311 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">'; |
| 301 | - else |
|
| 302 | - echo ' |
|
| 312 | + } else { |
|
| 313 | + echo ' |
|
| 303 | 314 | <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit">'; |
| 315 | + } |
|
| 304 | 316 | echo ' |
| 305 | 317 | </div> |
| 306 | 318 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -445,19 +457,20 @@ discard block |
||
| 445 | 457 | </head> |
| 446 | 458 | <body style="margin: 1ex;"> |
| 447 | 459 | <div class="windowbg description" style="text-align: center;">'; |
| 448 | - if (isBrowser('is_ie') || isBrowser('is_ie11')) |
|
| 449 | - echo ' |
|
| 460 | + if (isBrowser('is_ie') || isBrowser('is_ie11')) { |
|
| 461 | + echo ' |
|
| 450 | 462 | <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav"> |
| 451 | 463 | <param name="AutoStart" value="1"> |
| 452 | 464 | <param name="FileName" value="', $context['verification_sound_href'], '"> |
| 453 | 465 | </object>'; |
| 454 | - else |
|
| 455 | - echo ' |
|
| 466 | + } else { |
|
| 467 | + echo ' |
|
| 456 | 468 | <audio src="', $context['verification_sound_href'], '" controls> |
| 457 | 469 | <object type="audio/x-wav" data="', $context['verification_sound_href'], '"> |
| 458 | 470 | <a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a> |
| 459 | 471 | </object> |
| 460 | 472 | </audio>'; |
| 473 | + } |
|
| 461 | 474 | echo ' |
| 462 | 475 | <br> |
| 463 | 476 | <a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br> |
@@ -484,11 +497,12 @@ discard block |
||
| 484 | 497 | </div> |
| 485 | 498 | <div id="register_screen" class="windowbg2">'; |
| 486 | 499 | |
| 487 | - if (!empty($context['registration_done'])) |
|
| 488 | - echo ' |
|
| 500 | + if (!empty($context['registration_done'])) { |
|
| 501 | + echo ' |
|
| 489 | 502 | <div class="infobox"> |
| 490 | 503 | ', $context['registration_done'], ' |
| 491 | 504 | </div>'; |
| 505 | + } |
|
| 492 | 506 | |
| 493 | 507 | echo ' |
| 494 | 508 | <dl class="register_form" id="admin_register_form"> |
@@ -524,9 +538,10 @@ discard block |
||
| 524 | 538 | <dd> |
| 525 | 539 | <select name="group" id="group_select" tabindex="', $context['tabindex']++, '">'; |
| 526 | 540 | |
| 527 | - foreach ($context['member_groups'] as $id => $name) |
|
| 528 | - echo ' |
|
| 541 | + foreach ($context['member_groups'] as $id => $name) { |
|
| 542 | + echo ' |
|
| 529 | 543 | <option value="', $id, '">', $name, '</option>'; |
| 544 | + } |
|
| 530 | 545 | |
| 531 | 546 | echo ' |
| 532 | 547 | </select> |
@@ -534,8 +549,8 @@ discard block |
||
| 534 | 549 | } |
| 535 | 550 | |
| 536 | 551 | // If there is any field marked as required, show it here! |
| 537 | - if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) |
|
| 538 | - foreach ($context['custom_fields'] as $field) |
|
| 552 | + if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) { |
|
| 553 | + foreach ($context['custom_fields'] as $field) |
|
| 539 | 554 | if ($field['show_reg'] > 1) |
| 540 | 555 | echo ' |
| 541 | 556 | <dt> |
@@ -543,6 +558,7 @@ discard block |
||
| 543 | 558 | <span class="smalltext">', $field['desc'], '</span> |
| 544 | 559 | </dt> |
| 545 | 560 | <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>'; |
| 561 | + } |
|
| 546 | 562 | |
| 547 | 563 | echo ' |
| 548 | 564 | <dt> |
@@ -579,12 +595,13 @@ discard block |
||
| 579 | 595 | { |
| 580 | 596 | global $context, $scripturl, $txt; |
| 581 | 597 | |
| 582 | - if (!empty($context['saved_successful'])) |
|
| 583 | - echo ' |
|
| 598 | + if (!empty($context['saved_successful'])) { |
|
| 599 | + echo ' |
|
| 584 | 600 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 585 | - elseif (!empty($context['could_not_save'])) |
|
| 586 | - echo ' |
|
| 601 | + } elseif (!empty($context['could_not_save'])) { |
|
| 602 | + echo ' |
|
| 587 | 603 | <div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>'; |
| 604 | + } |
|
| 588 | 605 | |
| 589 | 606 | // Just a big box to edit the text file ;). |
| 590 | 607 | echo ' |
@@ -594,9 +611,10 @@ discard block |
||
| 594 | 611 | </div>'; |
| 595 | 612 | |
| 596 | 613 | // Warning for if the file isn't writable. |
| 597 | - if (!empty($context['warning'])) |
|
| 598 | - echo ' |
|
| 614 | + if (!empty($context['warning'])) { |
|
| 615 | + echo ' |
|
| 599 | 616 | <p class="error">', $context['warning'], '</p>'; |
| 617 | + } |
|
| 600 | 618 | |
| 601 | 619 | echo ' |
| 602 | 620 | <div class="windowbg2" id="registration_agreement">'; |
@@ -613,9 +631,10 @@ discard block |
||
| 613 | 631 | <strong>', $txt['admin_agreement_select_language'], ':</strong> |
| 614 | 632 | <select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">'; |
| 615 | 633 | |
| 616 | - foreach ($context['editable_agreements'] as $file => $name) |
|
| 617 | - echo ' |
|
| 634 | + foreach ($context['editable_agreements'] as $file => $name) { |
|
| 635 | + echo ' |
|
| 618 | 636 | <option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>'; |
| 637 | + } |
|
| 619 | 638 | |
| 620 | 639 | echo ' |
| 621 | 640 | </select> |
@@ -659,9 +678,10 @@ discard block |
||
| 659 | 678 | { |
| 660 | 679 | global $context, $scripturl, $txt; |
| 661 | 680 | |
| 662 | - if (!empty($context['saved_successful'])) |
|
| 663 | - echo ' |
|
| 681 | + if (!empty($context['saved_successful'])) { |
|
| 682 | + echo ' |
|
| 664 | 683 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 684 | + } |
|
| 665 | 685 | |
| 666 | 686 | echo ' |
| 667 | 687 | <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '"> |
@@ -45,17 +45,19 @@ discard block |
||
| 45 | 45 | <a class="subject" href="', $board['href'], '" id="b', $board['id'], '">', $board['name'], '</a>'; |
| 46 | 46 | |
| 47 | 47 | // Has it outstanding posts for approval? |
| 48 | - if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
|
| 49 | - echo ' |
|
| 48 | + if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) { |
|
| 49 | + echo ' |
|
| 50 | 50 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>'; |
| 51 | + } |
|
| 51 | 52 | |
| 52 | 53 | echo ' |
| 53 | 54 | <p class="board_description">', $board['description'] , '</p>'; |
| 54 | 55 | |
| 55 | 56 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
| 56 | - if (!empty($board['moderators']) || !empty($board['moderator_groups'])) |
|
| 57 | - echo ' |
|
| 57 | + if (!empty($board['moderators']) || !empty($board['moderator_groups'])) { |
|
| 58 | + echo ' |
|
| 58 | 59 | <p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
| 60 | + } |
|
| 59 | 61 | |
| 60 | 62 | // Show some basic information about the number of posts, etc. |
| 61 | 63 | echo ' |
@@ -67,9 +69,10 @@ discard block |
||
| 67 | 69 | </div> |
| 68 | 70 | <div class="lastpost">'; |
| 69 | 71 | |
| 70 | - if (!empty($board['last_post']['id'])) |
|
| 71 | - echo ' |
|
| 72 | + if (!empty($board['last_post']['id'])) { |
|
| 73 | + echo ' |
|
| 72 | 74 | <p>', $board['last_post']['last_post_message'], '</p>'; |
| 75 | + } |
|
| 73 | 76 | echo ' |
| 74 | 77 | </div>'; |
| 75 | 78 | |
@@ -82,14 +85,16 @@ discard block |
||
| 82 | 85 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
| 83 | 86 | foreach ($board['children'] as $child) |
| 84 | 87 | { |
| 85 | - if (!$child['is_redirect']) |
|
| 86 | - $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a ' . ($child['new'] ? 'class="new_posts" ' : '') . 'href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>'; |
|
| 87 | - else |
|
| 88 | - $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
| 88 | + if (!$child['is_redirect']) { |
|
| 89 | + $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a ' . ($child['new'] ? 'class="new_posts" ' : '') . 'href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>'; |
|
| 90 | + } else { |
|
| 91 | + $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>'; |
|
| 92 | + } |
|
| 89 | 93 | |
| 90 | 94 | // Has it posts awaiting approval? |
| 91 | - if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) |
|
| 92 | - $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 95 | + if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) { |
|
| 96 | + $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>'; |
|
| 97 | + } |
|
| 93 | 98 | |
| 94 | 99 | $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link']; |
| 95 | 100 | } |
@@ -108,8 +113,9 @@ discard block |
||
| 108 | 113 | } |
| 109 | 114 | |
| 110 | 115 | // They can only mark read if they are logged in and it's enabled! |
| 111 | - if (!$context['user']['is_logged']) |
|
| 112 | - unset($context['normal_buttons']['markread']); |
|
| 116 | + if (!$context['user']['is_logged']) { |
|
| 117 | + unset($context['normal_buttons']['markread']); |
|
| 118 | + } |
|
| 113 | 119 | |
| 114 | 120 | if (!$context['no_topic_listing']) |
| 115 | 121 | { |
@@ -132,13 +138,15 @@ discard block |
||
| 132 | 138 | <div id="description_board" class="generic_list_wrapper"> |
| 133 | 139 | <h3>', $context['name'], '</h3> |
| 134 | 140 | <p>'; |
| 135 | - if ($context['description'] != '') |
|
| 136 | - echo ' |
|
| 141 | + if ($context['description'] != '') { |
|
| 142 | + echo ' |
|
| 137 | 143 | ', $context['description'], ' '; |
| 144 | + } |
|
| 138 | 145 | |
| 139 | - if (!empty($context['moderators'])) |
|
| 140 | - echo ' |
|
| 146 | + if (!empty($context['moderators'])) { |
|
| 147 | + echo ' |
|
| 141 | 148 | ', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.'; |
| 149 | + } |
|
| 142 | 150 | |
| 143 | 151 | echo ' |
| 144 | 152 | </p> |
@@ -146,9 +154,10 @@ discard block |
||
| 146 | 154 | } |
| 147 | 155 | |
| 148 | 156 | // If Quick Moderation is enabled start the form. |
| 149 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
| 150 | - echo ' |
|
| 157 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
| 158 | + echo ' |
|
| 151 | 159 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
| 160 | + } |
|
| 152 | 161 | |
| 153 | 162 | echo ' |
| 154 | 163 | <div id="messageindex">'; |
@@ -156,10 +165,11 @@ discard block |
||
| 156 | 165 | { |
| 157 | 166 | echo ' |
| 158 | 167 | <div class="information">'; |
| 159 | - if ($settings['display_who_viewing'] == 1) |
|
| 160 | - echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
| 161 | - else |
|
| 162 | - echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
| 168 | + if ($settings['display_who_viewing'] == 1) { |
|
| 169 | + echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members']; |
|
| 170 | + } else { |
|
| 171 | + echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
|
| 172 | + } |
|
| 163 | 173 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board']; |
| 164 | 174 | |
| 165 | 175 | echo ' |
@@ -178,19 +188,22 @@ discard block |
||
| 178 | 188 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
| 179 | 189 | |
| 180 | 190 | // Show a "select all" box for quick moderation? |
| 181 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
|
| 182 | - echo ' |
|
| 191 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
| 192 | + echo ' |
|
| 183 | 193 | <div class="moderation"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check"></div>'; |
| 194 | + } |
|
| 184 | 195 | |
| 185 | 196 | // If it's on in "image" mode, don't show anything but the column. |
| 186 | - elseif (!empty($context['can_quick_mod'])) |
|
| 187 | - echo ' |
|
| 197 | + elseif (!empty($context['can_quick_mod'])) { |
|
| 198 | + echo ' |
|
| 188 | 199 | <div class="moderation"> </div>'; |
| 200 | + } |
|
| 189 | 201 | } |
| 190 | 202 | // No topics.... just say, "sorry bub". |
| 191 | - else |
|
| 192 | - echo ' |
|
| 203 | + else { |
|
| 204 | + echo ' |
|
| 193 | 205 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
| 206 | + } |
|
| 194 | 207 | |
| 195 | 208 | echo ' |
| 196 | 209 | </div>'; |
@@ -222,21 +235,26 @@ discard block |
||
| 222 | 235 | // Now we handle the icons |
| 223 | 236 | echo ' |
| 224 | 237 | <div class="icons floatright">'; |
| 225 | - if ($topic['is_watched']) |
|
| 226 | - echo ' |
|
| 238 | + if ($topic['is_watched']) { |
|
| 239 | + echo ' |
|
| 227 | 240 | <span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
| 228 | - if ($topic['is_locked']) |
|
| 229 | - echo ' |
|
| 241 | + } |
|
| 242 | + if ($topic['is_locked']) { |
|
| 243 | + echo ' |
|
| 230 | 244 | <span class="generic_icons lock"></span>'; |
| 231 | - if ($topic['is_sticky']) |
|
| 232 | - echo ' |
|
| 245 | + } |
|
| 246 | + if ($topic['is_sticky']) { |
|
| 247 | + echo ' |
|
| 233 | 248 | <span class="generic_icons sticky"></span>'; |
| 234 | - if ($topic['is_redirect']) |
|
| 235 | - echo ' |
|
| 249 | + } |
|
| 250 | + if ($topic['is_redirect']) { |
|
| 251 | + echo ' |
|
| 236 | 252 | <span class="generic_icons move"></span>'; |
| 237 | - if ($topic['is_poll']) |
|
| 238 | - echo ' |
|
| 253 | + } |
|
| 254 | + if ($topic['is_poll']) { |
|
| 255 | + echo ' |
|
| 239 | 256 | <span class="generic_icons poll"></span>'; |
| 257 | + } |
|
| 240 | 258 | echo ' |
| 241 | 259 | </div>'; |
| 242 | 260 | |
@@ -262,26 +280,31 @@ discard block |
||
| 262 | 280 | { |
| 263 | 281 | echo ' |
| 264 | 282 | <div class="moderation">'; |
| 265 | - if ($options['display_quick_mod'] == 1) |
|
| 266 | - echo ' |
|
| 283 | + if ($options['display_quick_mod'] == 1) { |
|
| 284 | + echo ' |
|
| 267 | 285 | <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">'; |
| 268 | - else |
|
| 286 | + } else |
|
| 269 | 287 | { |
| 270 | 288 | // Check permissions on each and show only the ones they are allowed to use. |
| 271 | - if ($topic['quick_mod']['remove']) |
|
| 272 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
|
| 289 | + if ($topic['quick_mod']['remove']) { |
|
| 290 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
|
| 291 | + } |
|
| 273 | 292 | |
| 274 | - if ($topic['quick_mod']['lock']) |
|
| 275 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
|
| 293 | + if ($topic['quick_mod']['lock']) { |
|
| 294 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
|
| 295 | + } |
|
| 276 | 296 | |
| 277 | - if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
|
| 278 | - echo '<br>'; |
|
| 297 | + if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) { |
|
| 298 | + echo '<br>'; |
|
| 299 | + } |
|
| 279 | 300 | |
| 280 | - if ($topic['quick_mod']['sticky']) |
|
| 281 | - echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
|
| 301 | + if ($topic['quick_mod']['sticky']) { |
|
| 302 | + echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
|
| 303 | + } |
|
| 282 | 304 | |
| 283 | - if ($topic['quick_mod']['move']) |
|
| 284 | - echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
| 305 | + if ($topic['quick_mod']['move']) { |
|
| 306 | + echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>'; |
|
| 307 | + } |
|
| 285 | 308 | } |
| 286 | 309 | echo ' |
| 287 | 310 | </div>'; |
@@ -299,18 +322,20 @@ discard block |
||
| 299 | 322 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
| 300 | 323 | <option value="">--------</option>'; |
| 301 | 324 | |
| 302 | - foreach ($context['qmod_actions'] as $qmod_action) |
|
| 303 | - if ($context['can_' . $qmod_action]) |
|
| 325 | + foreach ($context['qmod_actions'] as $qmod_action) { |
|
| 326 | + if ($context['can_' . $qmod_action]) |
|
| 304 | 327 | echo ' |
| 305 | 328 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
| 329 | + } |
|
| 306 | 330 | |
| 307 | 331 | echo ' |
| 308 | 332 | </select>'; |
| 309 | 333 | |
| 310 | 334 | // Show a list of boards they can move the topic to. |
| 311 | - if ($context['can_move']) |
|
| 312 | - echo ' |
|
| 335 | + if ($context['can_move']) { |
|
| 336 | + echo ' |
|
| 313 | 337 | <span id="quick_mod_jump_to"> </span>'; |
| 338 | + } |
|
| 314 | 339 | |
| 315 | 340 | echo ' |
| 316 | 341 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction"> |
@@ -321,10 +346,11 @@ discard block |
||
| 321 | 346 | </div>'; |
| 322 | 347 | |
| 323 | 348 | // Finish off the form - again. |
| 324 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
|
| 325 | - echo ' |
|
| 349 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { |
|
| 350 | + echo ' |
|
| 326 | 351 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
| 327 | 352 | </form>'; |
| 353 | + } |
|
| 328 | 354 | |
| 329 | 355 | // Mobile action buttons (bottom) |
| 330 | 356 | echo ' |
@@ -343,8 +369,8 @@ discard block |
||
| 343 | 369 | // Show breadcrumbs at the bottom too. |
| 344 | 370 | theme_linktree(); |
| 345 | 371 | |
| 346 | - if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
|
| 347 | - echo ' |
|
| 372 | + if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) { |
|
| 373 | + echo ' |
|
| 348 | 374 | <script> |
| 349 | 375 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 350 | 376 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -363,6 +389,7 @@ discard block |
||
| 363 | 389 | sCustomName: "move_to" |
| 364 | 390 | }); |
| 365 | 391 | </script>'; |
| 392 | + } |
|
| 366 | 393 | |
| 367 | 394 | // Javascript for inline editing. |
| 368 | 395 | echo ' |
@@ -398,8 +425,8 @@ discard block |
||
| 398 | 425 | <div class="information"> |
| 399 | 426 | <p class="floatright" id="message_index_jump_to"> </p>'; |
| 400 | 427 | |
| 401 | - if (empty($context['no_topic_listing'])) |
|
| 402 | - echo ' |
|
| 428 | + if (empty($context['no_topic_listing'])) { |
|
| 429 | + echo ' |
|
| 403 | 430 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
| 404 | 431 | <img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', ' |
| 405 | 432 | '. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br> |
@@ -409,9 +436,10 @@ discard block |
||
| 409 | 436 | <span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br> |
| 410 | 437 | <span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br> |
| 411 | 438 | </p>'; |
| 439 | + } |
|
| 412 | 440 | |
| 413 | - if (!empty($context['jump_to'])) |
|
| 414 | - echo ' |
|
| 441 | + if (!empty($context['jump_to'])) { |
|
| 442 | + echo ' |
|
| 415 | 443 | <script> |
| 416 | 444 | if (typeof(window.XMLHttpRequest) != "undefined") |
| 417 | 445 | aJumpTo[aJumpTo.length] = new JumpTo({ |
@@ -427,6 +455,7 @@ discard block |
||
| 427 | 455 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
| 428 | 456 | }); |
| 429 | 457 | </script>'; |
| 458 | + } |
|
| 430 | 459 | |
| 431 | 460 | echo ' |
| 432 | 461 | <br class="clear"> |
@@ -40,8 +40,7 @@ discard block |
||
| 40 | 40 | ', template_show_week_grid('main'), ' |
| 41 | 41 | </div> |
| 42 | 42 | '; |
| 43 | - } |
|
| 44 | - else |
|
| 43 | + } else |
|
| 45 | 44 | { |
| 46 | 45 | echo ' |
| 47 | 46 | <div id="main_grid"> |
@@ -67,17 +66,19 @@ discard block |
||
| 67 | 66 | global $context, $settings, $txt, $scripturl, $modSettings; |
| 68 | 67 | |
| 69 | 68 | // If the grid doesn't exist, no point in proceeding. |
| 70 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 71 | - return false; |
|
| 69 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 70 | + return false; |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | 73 | // A handy little pointer variable. |
| 74 | 74 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
| 75 | 75 | |
| 76 | 76 | // Some conditions for whether or not we should show the week links *here*. |
| 77 | - if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) |
|
| 78 | - $show_week_links = true; |
|
| 79 | - else |
|
| 80 | - $show_week_links = false; |
|
| 77 | + if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) { |
|
| 78 | + $show_week_links = true; |
|
| 79 | + } else { |
|
| 80 | + $show_week_links = false; |
|
| 81 | + } |
|
| 81 | 82 | |
| 82 | 83 | // Assuming that we've not disabled it, show the title block! |
| 83 | 84 | if (empty($calendar_data['disable_title'])) |
@@ -124,8 +125,9 @@ discard block |
||
| 124 | 125 | echo '<tr>'; |
| 125 | 126 | |
| 126 | 127 | // If we're showing week links, there's an extra column ahead of the week links, so let's think ahead and be prepared! |
| 127 | - if ($show_week_links === true) |
|
| 128 | - echo '<th> </th>'; |
|
| 128 | + if ($show_week_links === true) { |
|
| 129 | + echo '<th> </th>'; |
|
| 130 | + } |
|
| 129 | 131 | |
| 130 | 132 | // Now, loop through each actual day of the week. |
| 131 | 133 | foreach ($calendar_data['week_days'] as $day) |
@@ -172,29 +174,32 @@ discard block |
||
| 172 | 174 | // Additional classes are given for events, holidays, and birthdays. |
| 173 | 175 | if (!empty($day['events']) && !empty($calendar_data['highlight']['events'])) |
| 174 | 176 | { |
| 175 | - if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1,3))) |
|
| 176 | - $classes[] = 'events'; |
|
| 177 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2,3))) |
|
| 178 | - $classes[] = 'events'; |
|
| 177 | + if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1,3))) { |
|
| 178 | + $classes[] = 'events'; |
|
| 179 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2,3))) { |
|
| 180 | + $classes[] = 'events'; |
|
| 181 | + } |
|
| 179 | 182 | } |
| 180 | 183 | if (!empty($day['holidays']) && !empty($calendar_data['highlight']['holidays'])) |
| 181 | 184 | { |
| 182 | - if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1,3))) |
|
| 183 | - $classes[] = 'holidays'; |
|
| 184 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2,3))) |
|
| 185 | - $classes[] = 'holidays'; |
|
| 185 | + if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1,3))) { |
|
| 186 | + $classes[] = 'holidays'; |
|
| 187 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2,3))) { |
|
| 188 | + $classes[] = 'holidays'; |
|
| 189 | + } |
|
| 186 | 190 | } |
| 187 | 191 | if (!empty($day['birthdays']) && !empty($calendar_data['highlight']['birthdays'])) |
| 188 | 192 | { |
| 189 | - if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1,3))) |
|
| 190 | - $classes[] = 'birthdays'; |
|
| 191 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2,3))) |
|
| 192 | - $classes[] = 'birthdays'; |
|
| 193 | + if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1,3))) { |
|
| 194 | + $classes[] = 'birthdays'; |
|
| 195 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2,3))) { |
|
| 196 | + $classes[] = 'birthdays'; |
|
| 197 | + } |
|
| 193 | 198 | } |
| 194 | - } |
|
| 195 | - else |
|
| 196 | - // Default Classes (either compact or comfortable and disabled). |
|
| 199 | + } else { |
|
| 200 | + // Default Classes (either compact or comfortable and disabled). |
|
| 197 | 201 | $classes[] = !empty($calendar_data['size']) && $calendar_data['size'] == 'small' ? 'compact' : 'comfortable'; |
| 202 | + } |
|
| 198 | 203 | $classes[] = 'disabled'; |
| 199 | 204 | |
| 200 | 205 | // Now, implode the classes for each day. |
@@ -208,17 +213,19 @@ discard block |
||
| 208 | 213 | $title_prefix = !empty($day['is_first_of_month']) && $context['current_month'] == $calendar_data['current_month'] && $is_mini === false ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$calendar_data['current_month']] . ' ' : $txt['months_titles'][$calendar_data['current_month']] . ' ') : ''; |
| 209 | 214 | |
| 210 | 215 | // The actual day number - be it a link, or just plain old text! |
| 211 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
| 212 | - echo '<a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
|
| 213 | - else |
|
| 214 | - echo '<span class="day_text">', $title_prefix, $day['day'], '</span>'; |
|
| 216 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
| 217 | + echo '<a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
|
| 218 | + } else { |
|
| 219 | + echo '<span class="day_text">', $title_prefix, $day['day'], '</span>'; |
|
| 220 | + } |
|
| 215 | 221 | |
| 216 | 222 | // A lot of stuff, we're not showing on mini-calendars to conserve space. |
| 217 | 223 | if ($is_mini === false) |
| 218 | 224 | { |
| 219 | 225 | // Holidays are always fun, let's show them! |
| 220 | - if (!empty($day['holidays'])) |
|
| 221 | - echo '<div class="smalltext holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), '</div>'; |
|
| 226 | + if (!empty($day['holidays'])) { |
|
| 227 | + echo '<div class="smalltext holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), '</div>'; |
|
| 228 | + } |
|
| 222 | 229 | |
| 223 | 230 | // Happy Birthday Dear, Member! |
| 224 | 231 | if (!empty($day['birthdays'])) |
@@ -236,14 +243,16 @@ discard block |
||
| 236 | 243 | echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '"><span class="fix_rtl_names">', $member['name'], '</span>', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', '; |
| 237 | 244 | |
| 238 | 245 | // 9...10! Let's stop there. |
| 239 | - if ($birthday_count == 10 && $use_js_hide) |
|
| 240 | - // !!TODO - Inline CSS and JavaScript should be moved. |
|
| 246 | + if ($birthday_count == 10 && $use_js_hide) { |
|
| 247 | + // !!TODO - Inline CSS and JavaScript should be moved. |
|
| 241 | 248 | echo '<span class="hidelink" id="bdhidelink_', $day['day'], '">...<br><a href="', $scripturl, '?action=calendar;month=', $calendar_data['current_month'], ';year=', $calendar_data['current_year'], ';showbd" onclick="document.getElementById(\'bdhide_', $day['day'], '\').style.display = \'\'; document.getElementById(\'bdhidelink_', $day['day'], '\').style.display = \'none\'; return false;">(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ')</a></span><span id="bdhide_', $day['day'], '" style="display: none;">, '; |
| 249 | + } |
|
| 242 | 250 | |
| 243 | 251 | ++$birthday_count; |
| 244 | 252 | } |
| 245 | - if ($use_js_hide) |
|
| 246 | - echo '</span>'; |
|
| 253 | + if ($use_js_hide) { |
|
| 254 | + echo '</span>'; |
|
| 255 | + } |
|
| 247 | 256 | |
| 248 | 257 | echo '</div>'; |
| 249 | 258 | } |
@@ -286,10 +295,11 @@ discard block |
||
| 286 | 295 | // Otherwise, assuming it's not a mini-calendar, we can show previous / next month days! |
| 287 | 296 | elseif ($is_mini === false) |
| 288 | 297 | { |
| 289 | - if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) |
|
| 290 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- + 1, '</a>'; |
|
| 291 | - elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) |
|
| 292 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
| 298 | + if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) { |
|
| 299 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- + 1, '</a>'; |
|
| 300 | + } elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) { |
|
| 301 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
| 302 | + } |
|
| 293 | 303 | } |
| 294 | 304 | |
| 295 | 305 | // Close this day and increase var count. |
@@ -301,8 +311,9 @@ discard block |
||
| 301 | 311 | } |
| 302 | 312 | |
| 303 | 313 | // Quick Month Navigation + Post Event Link on Main Grids! |
| 304 | - if ($is_mini === false) |
|
| 305 | - template_calendar_base($show_week_links === true ? 8 : 7); |
|
| 314 | + if ($is_mini === false) { |
|
| 315 | + template_calendar_base($show_week_links === true ? 8 : 7); |
|
| 316 | + } |
|
| 306 | 317 | |
| 307 | 318 | // The end of our main table. |
| 308 | 319 | echo '</table>'; |
@@ -319,8 +330,9 @@ discard block |
||
| 319 | 330 | global $context, $settings, $txt, $scripturl, $modSettings; |
| 320 | 331 | |
| 321 | 332 | // We might have no reason to proceed, if the variable isn't there. |
| 322 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 323 | - return false; |
|
| 333 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 334 | + return false; |
|
| 335 | + } |
|
| 324 | 336 | |
| 325 | 337 | // Handy pointer. |
| 326 | 338 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
@@ -356,8 +368,9 @@ discard block |
||
| 356 | 368 | } |
| 357 | 369 | |
| 358 | 370 | // The Month Title + Week Number... |
| 359 | - if (!empty($calendar_data['week_title'])) |
|
| 360 | - echo $calendar_data['week_title']; |
|
| 371 | + if (!empty($calendar_data['week_title'])) { |
|
| 372 | + echo $calendar_data['week_title']; |
|
| 373 | + } |
|
| 361 | 374 | |
| 362 | 375 | echo ' |
| 363 | 376 | </h3> |
@@ -393,10 +406,11 @@ discard block |
||
| 393 | 406 | <tr class="days_wrapper"> |
| 394 | 407 | <td class="', implode(' ', $classes), ' act_day">'; |
| 395 | 408 | // Should the day number be a link? |
| 396 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
| 397 | - echo '<a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>'; |
|
| 398 | - else |
|
| 399 | - echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
| 409 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
| 410 | + echo '<a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>'; |
|
| 411 | + } else { |
|
| 412 | + echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
| 413 | + } |
|
| 400 | 414 | |
| 401 | 415 | echo '</td> |
| 402 | 416 | <td class="', implode(' ', $classes), '', empty($day['events']) ? (' disabled' . ($context['can_post'] ? ' week_post' : '')) : ' events', ' event_col">'; |
@@ -432,8 +446,7 @@ discard block |
||
| 432 | 446 | </a> |
| 433 | 447 | </div> |
| 434 | 448 | <br class="clear">'; |
| 435 | - } |
|
| 436 | - else |
|
| 449 | + } else |
|
| 437 | 450 | { |
| 438 | 451 | if (!empty($context['can_post'])) |
| 439 | 452 | { |
@@ -446,8 +459,9 @@ discard block |
||
| 446 | 459 | echo '</td> |
| 447 | 460 | <td class="', implode(' ', $classes), !empty($day['holidays']) ? ' holidays' : ' disabled', ' holiday_col">'; |
| 448 | 461 | // Show any holidays! |
| 449 | - if (!empty($day['holidays'])) |
|
| 450 | - echo implode('<br>', $day['holidays']); |
|
| 462 | + if (!empty($day['holidays'])) { |
|
| 463 | + echo implode('<br>', $day['holidays']); |
|
| 464 | + } |
|
| 451 | 465 | |
| 452 | 466 | echo '</td> |
| 453 | 467 | <td class="', implode(' ', $classes), '', !empty($day['birthdays']) ? ' birthdays' : ' disabled', ' birthday_col">'; |
@@ -467,8 +481,9 @@ discard block |
||
| 467 | 481 | } |
| 468 | 482 | |
| 469 | 483 | // We'll show the lower column after our last month is shown. |
| 470 | - if ($iteration == $num_months) |
|
| 471 | - template_calendar_base(4); |
|
| 484 | + if ($iteration == $num_months) { |
|
| 485 | + template_calendar_base(4); |
|
| 486 | + } |
|
| 472 | 487 | |
| 473 | 488 | // Increase iteration for loop counting. |
| 474 | 489 | ++$iteration; |
@@ -524,8 +539,9 @@ discard block |
||
| 524 | 539 | echo ' |
| 525 | 540 | <form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);smc_saveEntities(\'postevent\', [\'evtitle\']);" style="margin: 0;">'; |
| 526 | 541 | |
| 527 | - if (!empty($context['event']['new'])) |
|
| 528 | - echo '<input type="hidden" name="eventid" value="', $context['event']['eventid'], '">'; |
|
| 542 | + if (!empty($context['event']['new'])) { |
|
| 543 | + echo '<input type="hidden" name="eventid" value="', $context['event']['eventid'], '">'; |
|
| 544 | + } |
|
| 529 | 545 | |
| 530 | 546 | // Start the main table. |
| 531 | 547 | echo ' |
@@ -561,9 +577,10 @@ discard block |
||
| 561 | 577 | <select name="year" id="year" onchange="generateDays();">'; |
| 562 | 578 | |
| 563 | 579 | // Show a list of all the years we allow... |
| 564 | - for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) |
|
| 565 | - echo ' |
|
| 580 | + for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) { |
|
| 581 | + echo ' |
|
| 566 | 582 | <option value="', $year, '"', $year == $context['event']['year'] ? ' selected' : '', '>', $year, ' </option>'; |
| 583 | + } |
|
| 567 | 584 | |
| 568 | 585 | echo ' |
| 569 | 586 | </select> |
@@ -571,9 +588,10 @@ discard block |
||
| 571 | 588 | <select name="month" id="month" onchange="generateDays();">'; |
| 572 | 589 | |
| 573 | 590 | // There are 12 months per year - ensure that they all get listed. |
| 574 | - for ($month = 1; $month <= 12; $month++) |
|
| 575 | - echo ' |
|
| 591 | + for ($month = 1; $month <= 12; $month++) { |
|
| 592 | + echo ' |
|
| 576 | 593 | <option value="', $month, '"', $month == $context['event']['month'] ? ' selected' : '', '>', $txt['months'][$month], ' </option>'; |
| 594 | + } |
|
| 577 | 595 | |
| 578 | 596 | echo ' |
| 579 | 597 | </select> |
@@ -581,21 +599,23 @@ discard block |
||
| 581 | 599 | <select name="day" id="day">'; |
| 582 | 600 | |
| 583 | 601 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 584 | - for ($day = 1; $day <= $context['event']['last_day']; $day++) |
|
| 585 | - echo ' |
|
| 602 | + for ($day = 1; $day <= $context['event']['last_day']; $day++) { |
|
| 603 | + echo ' |
|
| 586 | 604 | <option value="', $day, '"', $day == $context['event']['day'] ? ' selected' : '', '>', $day, ' </option>'; |
| 605 | + } |
|
| 587 | 606 | |
| 588 | 607 | echo ' |
| 589 | 608 | </select> |
| 590 | 609 | </div> |
| 591 | 610 | </fieldset>'; |
| 592 | 611 | |
| 593 | - if (!empty($modSettings['cal_allowspan']) || $context['event']['new']) |
|
| 594 | - echo ' |
|
| 612 | + if (!empty($modSettings['cal_allowspan']) || $context['event']['new']) { |
|
| 613 | + echo ' |
|
| 595 | 614 | <fieldset id="event_options"> |
| 596 | 615 | <legend>', $txt['calendar_event_options'], '</legend> |
| 597 | 616 | <div class="event_options smalltext"> |
| 598 | 617 | <ul class="event_options">'; |
| 618 | + } |
|
| 599 | 619 | |
| 600 | 620 | // If events can span more than one day then allow the user to select how long it should last. |
| 601 | 621 | if (!empty($modSettings['cal_allowspan'])) |
@@ -605,9 +625,10 @@ discard block |
||
| 605 | 625 | ', $txt['calendar_numb_days'], ' |
| 606 | 626 | <select name="span">'; |
| 607 | 627 | |
| 608 | - for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) |
|
| 609 | - echo ' |
|
| 628 | + for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) { |
|
| 629 | + echo ' |
|
| 610 | 630 | <option value="', $days, '"', $context['event']['span'] == $days ? ' selected' : '', '>', $days, ' </option>'; |
| 631 | + } |
|
| 611 | 632 | |
| 612 | 633 | echo ' |
| 613 | 634 | </select> |
@@ -629,9 +650,10 @@ discard block |
||
| 629 | 650 | { |
| 630 | 651 | echo ' |
| 631 | 652 | <optgroup label="', $category['name'], '">'; |
| 632 | - foreach ($category['boards'] as $board) |
|
| 633 | - echo ' |
|
| 653 | + foreach ($category['boards'] as $board) { |
|
| 654 | + echo ' |
|
| 634 | 655 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], ' </option>'; |
| 656 | + } |
|
| 635 | 657 | echo ' |
| 636 | 658 | </optgroup>'; |
| 637 | 659 | } |
@@ -640,18 +662,20 @@ discard block |
||
| 640 | 662 | </li>'; |
| 641 | 663 | } |
| 642 | 664 | |
| 643 | - if (!empty($modSettings['cal_allowspan']) || $context['event']['new']) |
|
| 644 | - echo ' |
|
| 665 | + if (!empty($modSettings['cal_allowspan']) || $context['event']['new']) { |
|
| 666 | + echo ' |
|
| 645 | 667 | </ul> |
| 646 | 668 | </div> |
| 647 | 669 | </fieldset>'; |
| 670 | + } |
|
| 648 | 671 | |
| 649 | 672 | echo ' |
| 650 | 673 | <input type="submit" value="', empty($context['event']['new']) ? $txt['save'] : $txt['post'], '" class="button_submit">'; |
| 651 | 674 | // Delete button? |
| 652 | - if (empty($context['event']['new'])) |
|
| 653 | - echo ' |
|
| 675 | + if (empty($context['event']['new'])) { |
|
| 676 | + echo ' |
|
| 654 | 677 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['calendar_confirm_delete'], '" class="button_submit you_sure">'; |
| 678 | + } |
|
| 655 | 679 | |
| 656 | 680 | echo ' |
| 657 | 681 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -695,9 +719,10 @@ discard block |
||
| 695 | 719 | |
| 696 | 720 | foreach ($context['clockicons'] as $t => $v) |
| 697 | 721 | { |
| 698 | - foreach ($v as $i) |
|
| 699 | - echo ' |
|
| 722 | + foreach ($v as $i) { |
|
| 723 | + echo ' |
|
| 700 | 724 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 725 | + } |
|
| 701 | 726 | } |
| 702 | 727 | |
| 703 | 728 | echo ' |
@@ -722,13 +747,14 @@ discard block |
||
| 722 | 747 | |
| 723 | 748 | foreach ($context['clockicons'] as $t => $v) |
| 724 | 749 | { |
| 725 | - foreach ($v as $i) |
|
| 726 | - echo ' |
|
| 750 | + foreach ($v as $i) { |
|
| 751 | + echo ' |
|
| 727 | 752 | if (', $t, ' >= ', $i, ') |
| 728 | 753 | { |
| 729 | 754 | turnon.push("', $t, '_', $i, '"); |
| 730 | 755 | ', $t, ' -= ', $i, '; |
| 731 | 756 | }'; |
| 757 | + } |
|
| 732 | 758 | } |
| 733 | 759 | |
| 734 | 760 | echo ' |
@@ -792,9 +818,10 @@ discard block |
||
| 792 | 818 | |
| 793 | 819 | foreach ($context['clockicons'] as $t => $v) |
| 794 | 820 | { |
| 795 | - foreach ($v as $i) |
|
| 796 | - echo ' |
|
| 821 | + foreach ($v as $i) { |
|
| 822 | + echo ' |
|
| 797 | 823 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 824 | + } |
|
| 798 | 825 | } |
| 799 | 826 | |
| 800 | 827 | echo ' |
@@ -811,13 +838,14 @@ discard block |
||
| 811 | 838 | |
| 812 | 839 | foreach ($context['clockicons'] as $t => $v) |
| 813 | 840 | { |
| 814 | - foreach ($v as $i) |
|
| 815 | - echo ' |
|
| 841 | + foreach ($v as $i) { |
|
| 842 | + echo ' |
|
| 816 | 843 | if (', $t, ' >= ', $i, ') |
| 817 | 844 | { |
| 818 | 845 | turnon.push("', $t, '_', $i, '"); |
| 819 | 846 | ', $t, ' -= ', $i, '; |
| 820 | 847 | }'; |
| 848 | + } |
|
| 821 | 849 | } |
| 822 | 850 | |
| 823 | 851 | echo ' |
@@ -876,9 +904,10 @@ discard block |
||
| 876 | 904 | |
| 877 | 905 | foreach ($context['clockicons'] as $t => $v) |
| 878 | 906 | { |
| 879 | - foreach ($v as $i) |
|
| 880 | - echo ' |
|
| 907 | + foreach ($v as $i) { |
|
| 908 | + echo ' |
|
| 881 | 909 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 910 | + } |
|
| 882 | 911 | } |
| 883 | 912 | |
| 884 | 913 | echo ' |
@@ -899,13 +928,14 @@ discard block |
||
| 899 | 928 | |
| 900 | 929 | foreach ($context['clockicons'] as $t => $v) |
| 901 | 930 | { |
| 902 | - foreach ($v as $i) |
|
| 903 | - echo ' |
|
| 931 | + foreach ($v as $i) { |
|
| 932 | + echo ' |
|
| 904 | 933 | if (', $t, ' >= ', $i, ') |
| 905 | 934 | { |
| 906 | 935 | turnon.push("', $t, '_', $i, '"); |
| 907 | 936 | ', $t, ' -= ', $i, '; |
| 908 | 937 | }'; |
| 938 | + } |
|
| 909 | 939 | } |
| 910 | 940 | |
| 911 | 941 | echo ' |
@@ -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 | echo ' |
| 36 | 37 | <dd> |
| 37 | 38 | <input type="radio" id="rt_', $type['id'], '" name="rt" value="', $type['id'], '"', $type['is_first'] ? ' checked' : '', ' class="input_radio"> |
@@ -61,8 +62,9 @@ discard block |
||
| 61 | 62 | </div> |
| 62 | 63 | <div id="report_buttons">'; |
| 63 | 64 | |
| 64 | - if (!empty($context['report_buttons'])) |
|
| 65 | - template_button_strip($context['report_buttons'], 'right'); |
|
| 65 | + if (!empty($context['report_buttons'])) { |
|
| 66 | + template_button_strip($context['report_buttons'], 'right'); |
|
| 67 | + } |
|
| 66 | 68 | |
| 67 | 69 | echo ' |
| 68 | 70 | </div>'; |
@@ -73,25 +75,27 @@ discard block |
||
| 73 | 75 | echo ' |
| 74 | 76 | <table class="table_grid report_results">'; |
| 75 | 77 | |
| 76 | - if (!empty($table['title'])) |
|
| 77 | - echo ' |
|
| 78 | + if (!empty($table['title'])) { |
|
| 79 | + echo ' |
|
| 78 | 80 | <thead> |
| 79 | 81 | <tr class="title_bar"> |
| 80 | 82 | <th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th> |
| 81 | 83 | </tr> |
| 82 | 84 | </thead> |
| 83 | 85 | <tbody>'; |
| 86 | + } |
|
| 84 | 87 | |
| 85 | 88 | // Now do each row! |
| 86 | 89 | $row_number = 0; |
| 87 | 90 | foreach ($table['data'] as $row) |
| 88 | 91 | { |
| 89 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
| 90 | - echo ' |
|
| 92 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
| 93 | + echo ' |
|
| 91 | 94 | <tr class="windowbg table_caption">'; |
| 92 | - else |
|
| 93 | - echo ' |
|
| 95 | + } else { |
|
| 96 | + echo ' |
|
| 94 | 97 | <tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">'; |
| 98 | + } |
|
| 95 | 99 | |
| 96 | 100 | // Now do each column. |
| 97 | 101 | $column_number = 0; |
@@ -109,16 +113,17 @@ discard block |
||
| 109 | 113 | } |
| 110 | 114 | |
| 111 | 115 | // Shaded? |
| 112 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
| 113 | - echo ' |
|
| 116 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
| 117 | + echo ' |
|
| 114 | 118 | <td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width'].'shaded'] . '"' : '', '> |
| 115 | 119 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
| 116 | 120 | </td>'; |
| 117 | - else |
|
| 118 | - echo ' |
|
| 121 | + } else { |
|
| 122 | + echo ' |
|
| 119 | 123 | <td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
| 120 | 124 | ', $data['v'], ' |
| 121 | 125 | </td>'; |
| 126 | + } |
|
| 122 | 127 | |
| 123 | 128 | $column_number++; |
| 124 | 129 | } |
@@ -167,24 +172,26 @@ discard block |
||
| 167 | 172 | <div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '"> |
| 168 | 173 | <table class="bordercolor">'; |
| 169 | 174 | |
| 170 | - if (!empty($table['title'])) |
|
| 171 | - echo ' |
|
| 175 | + if (!empty($table['title'])) { |
|
| 176 | + echo ' |
|
| 172 | 177 | <tr class="title_bar"> |
| 173 | 178 | <td colspan="', $table['column_count'], '"> |
| 174 | 179 | ', $table['title'], ' |
| 175 | 180 | </td> |
| 176 | 181 | </tr>'; |
| 182 | + } |
|
| 177 | 183 | |
| 178 | 184 | // Now do each row! |
| 179 | 185 | $row_number = 0; |
| 180 | 186 | foreach ($table['data'] as $row) |
| 181 | 187 | { |
| 182 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
| 183 | - echo ' |
|
| 188 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
| 189 | + echo ' |
|
| 184 | 190 | <tr class="titlebg">'; |
| 185 | - else |
|
| 186 | - echo ' |
|
| 191 | + } else { |
|
| 192 | + echo ' |
|
| 187 | 193 | <tr class="windowbg">'; |
| 194 | + } |
|
| 188 | 195 | |
| 189 | 196 | // Now do each column!! |
| 190 | 197 | $column_number = 0; |
@@ -201,16 +208,17 @@ discard block |
||
| 201 | 208 | } |
| 202 | 209 | |
| 203 | 210 | // Shaded? |
| 204 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
| 205 | - echo ' |
|
| 211 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
| 212 | + echo ' |
|
| 206 | 213 | <td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
| 207 | 214 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
| 208 | 215 | </td>'; |
| 209 | - else |
|
| 210 | - echo ' |
|
| 216 | + } else { |
|
| 217 | + echo ' |
|
| 211 | 218 | <td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
| 212 | 219 | ', $data['v'], ' |
| 213 | 220 | </td>'; |
| 221 | + } |
|
| 214 | 222 | |
| 215 | 223 | $column_number++; |
| 216 | 224 | } |
@@ -31,12 +31,13 @@ discard block |
||
| 31 | 31 | </div> |
| 32 | 32 | <div class="information">'; |
| 33 | 33 | |
| 34 | - if ($context['is_installed']) |
|
| 35 | - echo ' |
|
| 34 | + if ($context['is_installed']) { |
|
| 35 | + echo ' |
|
| 36 | 36 | <strong>', $txt['package_installed_warning1'], '</strong><br> |
| 37 | 37 | <br> |
| 38 | 38 | ', $txt['package_installed_warning2'], '<br> |
| 39 | 39 | <br>'; |
| 40 | + } |
|
| 40 | 41 | |
| 41 | 42 | echo $txt['package_installed_warning3'], ' |
| 42 | 43 | </div><br>'; |
@@ -63,8 +64,9 @@ discard block |
||
| 63 | 64 | ', $context['package_readme'], ' |
| 64 | 65 | <span class="floatright">', $txt['package_available_readme_language'], ' |
| 65 | 66 | <select name="readme_language" id="readme_language" onchange="if (this.options[this.selectedIndex].value) window.location.href = smf_prepareScriptUrl(smf_scripturl + \'', '?action=admin;area=packages;sa=', $context['uninstalling'] ? 'uninstall' : 'install', ';package=', $context['filename'], ';readme=\' + this.options[this.selectedIndex].value + \';license=\' + get_selected(\'license_language\'));">'; |
| 66 | - foreach ($context['readmes'] as $a => $b) |
|
| 67 | - echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), '</option>'; |
|
| 67 | + foreach ($context['readmes'] as $a => $b) { |
|
| 68 | + echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), '</option>'; |
|
| 69 | + } |
|
| 68 | 70 | echo ' |
| 69 | 71 | </select> |
| 70 | 72 | </span> |
@@ -83,8 +85,9 @@ discard block |
||
| 83 | 85 | ', $context['package_license'], ' |
| 84 | 86 | <span class="floatright">', $txt['package_available_license_language'], ' |
| 85 | 87 | <select name="license_language" id="license_language" onchange="if (this.options[this.selectedIndex].value) window.location.href = smf_prepareScriptUrl(smf_scripturl + \'', '?action=admin;area=packages;sa=install', ';package=', $context['filename'], ';license=\' + this.options[this.selectedIndex].value + \';readme=\' + get_selected(\'readme_language\'));">'; |
| 86 | - foreach ($context['licenses'] as $a => $b) |
|
| 87 | - echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_license_default'] : ucfirst($b), '</option>'; |
|
| 88 | + foreach ($context['licenses'] as $a => $b) { |
|
| 89 | + echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_license_default'] : ucfirst($b), '</option>'; |
|
| 90 | + } |
|
| 88 | 91 | echo ' |
| 89 | 92 | </select> |
| 90 | 93 | </span> |
@@ -110,9 +113,10 @@ discard block |
||
| 110 | 113 | ', $txt['package_db_uninstall_actions'], ': |
| 111 | 114 | <ul>'; |
| 112 | 115 | |
| 113 | - foreach ($context['database_changes'] as $change) |
|
| 114 | - echo ' |
|
| 116 | + foreach ($context['database_changes'] as $change) { |
|
| 117 | + echo ' |
|
| 115 | 118 | <li>', $change, '</li>'; |
| 119 | + } |
|
| 116 | 120 | echo ' |
| 117 | 121 | </ul> |
| 118 | 122 | </div> |
@@ -122,14 +126,14 @@ discard block |
||
| 122 | 126 | echo ' |
| 123 | 127 | <div class="information">'; |
| 124 | 128 | |
| 125 | - if (empty($context['actions']) && empty($context['database_changes'])) |
|
| 126 | - echo ' |
|
| 129 | + if (empty($context['actions']) && empty($context['database_changes'])) { |
|
| 130 | + echo ' |
|
| 127 | 131 | <br> |
| 128 | 132 | <div class="errorbox"> |
| 129 | 133 | ', $txt['corrupt_compatible'], ' |
| 130 | 134 | </div> |
| 131 | 135 | </div>'; |
| 132 | - else |
|
| 136 | + } else |
|
| 133 | 137 | { |
| 134 | 138 | echo ' |
| 135 | 139 | ', $txt['perform_actions'], ' |
@@ -230,9 +234,10 @@ discard block |
||
| 230 | 234 | <tr class="title_bar"> |
| 231 | 235 | <td></td> |
| 232 | 236 | <td>'; |
| 233 | - if (!empty($context['themes_locked'])) |
|
| 234 | - echo ' |
|
| 237 | + if (!empty($context['themes_locked'])) { |
|
| 238 | + echo ' |
|
| 235 | 239 | <input type="hidden" name="custom_theme[]" value="', $id, '">'; |
| 240 | + } |
|
| 236 | 241 | echo ' |
| 237 | 242 | <input type="checkbox" name="custom_theme[]" id="custom_theme_', $id, '" value="', $id, '" class="input_check" onclick="', (!empty($theme['has_failure']) ? 'if (this.form.custom_theme_' . $id . '.checked && !confirm(\'' . $txt['package_theme_failure_warning'] . '\')) return false;' : ''), 'invertAll(this, this.form, \'dummy_theme_', $id, '\', true);"', !empty($context['themes_locked']) ? ' disabled checked' : '', '> |
| 238 | 243 | </td> |
@@ -373,14 +378,15 @@ discard block |
||
| 373 | 378 | </script>'; |
| 374 | 379 | |
| 375 | 380 | // And a bit more for database changes. |
| 376 | - if (!empty($context['database_changes'])) |
|
| 377 | - echo ' |
|
| 381 | + if (!empty($context['database_changes'])) { |
|
| 382 | + echo ' |
|
| 378 | 383 | <script> |
| 379 | 384 | var database_changes_area = document.getElementById(\'db_changes_div\'); |
| 380 | 385 | var db_vis = false; |
| 381 | 386 | database_changes_area.style.display = "none"; |
| 382 | 387 | </script>'; |
| 383 | -} |
|
| 388 | + } |
|
| 389 | + } |
|
| 384 | 390 | |
| 385 | 391 | /** |
| 386 | 392 | * Extract package contents |
@@ -412,12 +418,12 @@ discard block |
||
| 412 | 418 | <h3 class="catbg">', $context['uninstalling'] ? $txt['uninstall'] : $txt['extracting'], '</h3> |
| 413 | 419 | </div> |
| 414 | 420 | <div class="information">', $txt['package_installed_extract'], '</div>'; |
| 415 | - } |
|
| 416 | - else |
|
| 417 | - echo ' |
|
| 421 | + } else { |
|
| 422 | + echo ' |
|
| 418 | 423 | <div class="cat_bar"> |
| 419 | 424 | <h3 class="catbg">', $txt['package_installed_redirecting'], '</h3> |
| 420 | 425 | </div>'; |
| 426 | + } |
|
| 421 | 427 | |
| 422 | 428 | echo ' |
| 423 | 429 | <div class="windowbg">'; |
@@ -428,25 +434,25 @@ discard block |
||
| 428 | 434 | echo ' |
| 429 | 435 | ', $context['redirect_text'], '<br><br> |
| 430 | 436 | <a href="', $context['redirect_url'], '">', $txt['package_installed_redirect_go_now'], '</a> | <a href="', $scripturl, '?action=admin;area=packages;sa=browse">', $txt['package_installed_redirect_cancel'], '</a>'; |
| 431 | - } |
|
| 432 | - elseif ($context['uninstalling']) |
|
| 433 | - echo ' |
|
| 437 | + } elseif ($context['uninstalling']) { |
|
| 438 | + echo ' |
|
| 434 | 439 | ', $txt['package_uninstall_done']; |
| 435 | - elseif ($context['install_finished']) |
|
| 440 | + } elseif ($context['install_finished']) |
|
| 436 | 441 | { |
| 437 | - if ($context['extract_type'] == 'avatar') |
|
| 438 | - echo ' |
|
| 442 | + if ($context['extract_type'] == 'avatar') { |
|
| 443 | + echo ' |
|
| 439 | 444 | ', $txt['avatars_extracted']; |
| 440 | - elseif ($context['extract_type'] == 'language') |
|
| 441 | - echo ' |
|
| 445 | + } elseif ($context['extract_type'] == 'language') { |
|
| 446 | + echo ' |
|
| 442 | 447 | ', $txt['language_extracted']; |
| 443 | - else |
|
| 444 | - echo ' |
|
| 448 | + } else { |
|
| 449 | + echo ' |
|
| 445 | 450 | ', $txt['package_installed_done']; |
| 446 | - } |
|
| 447 | - else |
|
| 448 | - echo ' |
|
| 451 | + } |
|
| 452 | + } else { |
|
| 453 | + echo ' |
|
| 449 | 454 | ', $txt['corrupt_compatible']; |
| 455 | + } |
|
| 450 | 456 | |
| 451 | 457 | echo ' |
| 452 | 458 | </div>'; |
@@ -480,9 +486,10 @@ discard block |
||
| 480 | 486 | <div class="windowbg"> |
| 481 | 487 | <ol>'; |
| 482 | 488 | |
| 483 | - foreach ($context['files'] as $fileinfo) |
|
| 484 | - echo ' |
|
| 489 | + foreach ($context['files'] as $fileinfo) { |
|
| 490 | + echo ' |
|
| 485 | 491 | <li><a href="', $scripturl, '?action=admin;area=packages;sa=examine;package=', $context['filename'], ';file=', $fileinfo['filename'], '" title="', $txt['view'], '">', $fileinfo['filename'], '</a> (', $fileinfo['size'], ' ', $txt['package_bytes'], ')</li>'; |
| 492 | + } |
|
| 486 | 493 | |
| 487 | 494 | echo ' |
| 488 | 495 | </ol> |
@@ -546,9 +553,10 @@ discard block |
||
| 546 | 553 | </script> |
| 547 | 554 | <div id="yourVersion" style="display:none">', $context['forum_version'], '</div>'; |
| 548 | 555 | |
| 549 | - if (empty($modSettings['disable_smf_js'])) |
|
| 550 | - echo ' |
|
| 556 | + if (empty($modSettings['disable_smf_js'])) { |
|
| 557 | + echo ' |
|
| 551 | 558 | <script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>'; |
| 559 | + } |
|
| 552 | 560 | |
| 553 | 561 | // This sets the announcements and current versions themselves ;). |
| 554 | 562 | echo ' |
@@ -587,12 +595,13 @@ discard block |
||
| 587 | 595 | } |
| 588 | 596 | } |
| 589 | 597 | |
| 590 | - if (!$mods_available) |
|
| 591 | - echo ' |
|
| 598 | + if (!$mods_available) { |
|
| 599 | + echo ' |
|
| 592 | 600 | <div class="noticebox">', $txt['no_packages'], '</div>'; |
| 593 | - else |
|
| 594 | - echo ' |
|
| 601 | + } else { |
|
| 602 | + echo ' |
|
| 595 | 603 | <br>'; |
| 604 | + } |
|
| 596 | 605 | |
| 597 | 606 | // the advanced (emulation) box, collapsed by default |
| 598 | 607 | echo ' |
@@ -681,11 +690,12 @@ discard block |
||
| 681 | 690 | { |
| 682 | 691 | global $context, $txt, $scripturl; |
| 683 | 692 | |
| 684 | - if (!empty($context['package_ftp']['error'])) |
|
| 685 | - echo ' |
|
| 693 | + if (!empty($context['package_ftp']['error'])) { |
|
| 694 | + echo ' |
|
| 686 | 695 | <div class="errorbox"> |
| 687 | 696 | <pre>', $context['package_ftp']['error'], '</pre> |
| 688 | 697 | </div>'; |
| 698 | + } |
|
| 689 | 699 | |
| 690 | 700 | echo ' |
| 691 | 701 | <div id="admin_form_wrapper"> |
@@ -767,13 +777,14 @@ discard block |
||
| 767 | 777 | <fieldset> |
| 768 | 778 | <legend>' . $txt['package_servers'] . '</legend> |
| 769 | 779 | <ul class="package_servers">'; |
| 770 | - foreach ($context['servers'] as $server) |
|
| 771 | - echo ' |
|
| 780 | + foreach ($context['servers'] as $server) { |
|
| 781 | + echo ' |
|
| 772 | 782 | <li class="flow_auto"> |
| 773 | 783 | <span class="floatleft">' . $server['name'] . '</span> |
| 774 | 784 | <span class="package_server floatright"><a href="' . $scripturl . '?action=admin;area=packages;get;sa=remove;server=' . $server['id'] . ';', $context['session_var'], '=', $context['session_id'], '">[ ' . $txt['delete'] . ' ]</a></span> |
| 775 | 785 | <span class="package_server floatright"><a href="' . $scripturl . '?action=admin;area=packages;get;sa=browse;server=' . $server['id'] . '">[ ' . $txt['package_browse'] . ' ]</a></span> |
| 776 | 786 | </li>'; |
| 787 | + } |
|
| 777 | 788 | echo ' |
| 778 | 789 | </ul> |
| 779 | 790 | </fieldset> |
@@ -862,11 +873,12 @@ discard block |
||
| 862 | 873 | <div class="windowbg2">'; |
| 863 | 874 | |
| 864 | 875 | // No packages, as yet. |
| 865 | - if (empty($context['package_list'])) |
|
| 866 | - echo ' |
|
| 876 | + if (empty($context['package_list'])) { |
|
| 877 | + echo ' |
|
| 867 | 878 | <ul> |
| 868 | 879 | <li>', $txt['no_packages'], '</li> |
| 869 | 880 | </ul>'; |
| 881 | + } |
|
| 870 | 882 | // List out the packages... |
| 871 | 883 | else |
| 872 | 884 | { |
@@ -878,11 +890,12 @@ discard block |
||
| 878 | 890 | <li> |
| 879 | 891 | <strong><span id="ps_img_', $i, '" class="toggle_up" alt="*" style="display: none;"></span> ', $packageSection['title'], '</strong>'; |
| 880 | 892 | |
| 881 | - if (!empty($packageSection['text'])) |
|
| 882 | - echo ' |
|
| 893 | + if (!empty($packageSection['text'])) { |
|
| 894 | + echo ' |
|
| 883 | 895 | <div class="sub_bar"> |
| 884 | 896 | <h3 class="subbg">', $packageSection['text'], '</h3> |
| 885 | 897 | </div>'; |
| 898 | + } |
|
| 886 | 899 | |
| 887 | 900 | echo ' |
| 888 | 901 | <', $context['list_type'], ' id="package_section_', $i, '" class="packages">'; |
@@ -892,13 +905,15 @@ discard block |
||
| 892 | 905 | echo ' |
| 893 | 906 | <li>'; |
| 894 | 907 | // Textual message. Could be empty just for a blank line... |
| 895 | - if ($package['is_text']) |
|
| 896 | - echo ' |
|
| 908 | + if ($package['is_text']) { |
|
| 909 | + echo ' |
|
| 897 | 910 | ', empty($package['name']) ? ' ' : $package['name']; |
| 911 | + } |
|
| 898 | 912 | // This is supposed to be a rule.. |
| 899 | - elseif ($package['is_line']) |
|
| 900 | - echo ' |
|
| 913 | + elseif ($package['is_line']) { |
|
| 914 | + echo ' |
|
| 901 | 915 | <hr>'; |
| 916 | + } |
|
| 902 | 917 | // A remote link. |
| 903 | 918 | elseif ($package['is_remote']) |
| 904 | 919 | { |
@@ -920,21 +935,25 @@ discard block |
||
| 920 | 935 | <ul id="package_section_', $i, '_pkg_', $id, '" class="package_section">'; |
| 921 | 936 | |
| 922 | 937 | // Show the mod type? |
| 923 | - if ($package['type'] != '') |
|
| 924 | - echo ' |
|
| 938 | + if ($package['type'] != '') { |
|
| 939 | + echo ' |
|
| 925 | 940 | <li class="package_section">', $txt['package_type'], ': ', $smcFunc['ucwords']($smcFunc['strtolower']($package['type'])), '</li>'; |
| 941 | + } |
|
| 926 | 942 | // Show the version number? |
| 927 | - if ($package['version'] != '') |
|
| 928 | - echo ' |
|
| 943 | + if ($package['version'] != '') { |
|
| 944 | + echo ' |
|
| 929 | 945 | <li class="package_section">', $txt['mod_version'], ': ', $package['version'], '</li>'; |
| 946 | + } |
|
| 930 | 947 | // How 'bout the author? |
| 931 | - if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) |
|
| 932 | - echo ' |
|
| 948 | + if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) { |
|
| 949 | + echo ' |
|
| 933 | 950 | <li class="package_section">', $txt['mod_author'], ': ', $package['author']['link'], '</li>'; |
| 951 | + } |
|
| 934 | 952 | // The homepage.... |
| 935 | - if ($package['author']['website']['link'] != '') |
|
| 936 | - echo ' |
|
| 953 | + if ($package['author']['website']['link'] != '') { |
|
| 954 | + echo ' |
|
| 937 | 955 | <li class="package_section">', $txt['author_website'], ': ', $package['author']['website']['link'], '</li>'; |
| 956 | + } |
|
| 938 | 957 | |
| 939 | 958 | // Desciption: bleh bleh! |
| 940 | 959 | // Location of file: http://someplace/. |
@@ -987,8 +1006,8 @@ discard block |
||
| 987 | 1006 | |
| 988 | 1007 | foreach ($ps['items'] as $id => $package) |
| 989 | 1008 | { |
| 990 | - if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) |
|
| 991 | - echo ' |
|
| 1009 | + if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) { |
|
| 1010 | + echo ' |
|
| 992 | 1011 | var oPackageToggle_', $section, '_pkg_', $id, ' = new smc_Toggle({ |
| 993 | 1012 | bToggleEnabled: true, |
| 994 | 1013 | bCurrentlyCollapsed: true, |
@@ -1003,6 +1022,7 @@ discard block |
||
| 1003 | 1022 | } |
| 1004 | 1023 | ] |
| 1005 | 1024 | });'; |
| 1025 | + } |
|
| 1006 | 1026 | } |
| 1007 | 1027 | } |
| 1008 | 1028 | echo ' |
@@ -1043,9 +1063,10 @@ discard block |
||
| 1043 | 1063 | { |
| 1044 | 1064 | global $context, $txt, $scripturl; |
| 1045 | 1065 | |
| 1046 | - if (!empty($context['saved_successful'])) |
|
| 1047 | - echo ' |
|
| 1066 | + if (!empty($context['saved_successful'])) { |
|
| 1067 | + echo ' |
|
| 1048 | 1068 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
| 1069 | + } |
|
| 1049 | 1070 | |
| 1050 | 1071 | echo ' |
| 1051 | 1072 | <div id="admincenter"> |
@@ -1108,8 +1129,9 @@ discard block |
||
| 1108 | 1129 | global $context, $txt; |
| 1109 | 1130 | |
| 1110 | 1131 | // Nothing to do? Brilliant! |
| 1111 | - if (empty($context['package_ftp'])) |
|
| 1112 | - return false; |
|
| 1132 | + if (empty($context['package_ftp'])) { |
|
| 1133 | + return false; |
|
| 1134 | + } |
|
| 1113 | 1135 | |
| 1114 | 1136 | if (empty($context['package_ftp']['form_elements_only'])) |
| 1115 | 1137 | { |
@@ -1118,19 +1140,21 @@ discard block |
||
| 1118 | 1140 | <div id="need_writable_list" class="smalltext"> |
| 1119 | 1141 | ', $txt['package_ftp_why_file_list'], ' |
| 1120 | 1142 | <ul style="display: inline;">'; |
| 1121 | - if (!empty($context['notwritable_files'])) |
|
| 1122 | - foreach ($context['notwritable_files'] as $file) |
|
| 1143 | + if (!empty($context['notwritable_files'])) { |
|
| 1144 | + foreach ($context['notwritable_files'] as $file) |
|
| 1123 | 1145 | echo ' |
| 1124 | 1146 | <li>', $file, '</li>'; |
| 1147 | + } |
|
| 1125 | 1148 | |
| 1126 | 1149 | echo ' |
| 1127 | 1150 | </ul>'; |
| 1128 | 1151 | |
| 1129 | - if (!$context['server']['is_windows']) |
|
| 1130 | - echo ' |
|
| 1152 | + if (!$context['server']['is_windows']) { |
|
| 1153 | + echo ' |
|
| 1131 | 1154 | <hr /> |
| 1132 | 1155 | ', $txt['package_chmod_linux'], '<br /> |
| 1133 | 1156 | <tt># chmod a+w ', implode(' ', $context['notwritable_files']), '</tt>'; |
| 1157 | + } |
|
| 1134 | 1158 | |
| 1135 | 1159 | echo ' |
| 1136 | 1160 | </div>'; |
@@ -1141,9 +1165,10 @@ discard block |
||
| 1141 | 1165 | <tt id="ftp_error_message">', !empty($context['package_ftp']['error']) ? $context['package_ftp']['error'] : '', '</tt> |
| 1142 | 1166 | </div></div>'; |
| 1143 | 1167 | |
| 1144 | - if (!empty($context['package_ftp']['destination'])) |
|
| 1145 | - echo ' |
|
| 1168 | + if (!empty($context['package_ftp']['destination'])) { |
|
| 1169 | + echo ' |
|
| 1146 | 1170 | <form action="', $context['package_ftp']['destination'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">'; |
| 1171 | + } |
|
| 1147 | 1172 | |
| 1148 | 1173 | echo ' |
| 1149 | 1174 | <fieldset> |
@@ -1176,25 +1201,28 @@ discard block |
||
| 1176 | 1201 | </dl> |
| 1177 | 1202 | </fieldset>'; |
| 1178 | 1203 | |
| 1179 | - if (empty($context['package_ftp']['form_elements_only'])) |
|
| 1180 | - echo ' |
|
| 1204 | + if (empty($context['package_ftp']['form_elements_only'])) { |
|
| 1205 | + echo ' |
|
| 1181 | 1206 | |
| 1182 | 1207 | <div class="righttext" style="margin: 1ex;"> |
| 1183 | 1208 | <span id="test_ftp_placeholder_full"></span> |
| 1184 | 1209 | <input type="submit" value="', $txt['package_proceed'], '" class="button_submit"> |
| 1185 | 1210 | </div>'; |
| 1211 | + } |
|
| 1186 | 1212 | |
| 1187 | - if (!empty($context['package_ftp']['destination'])) |
|
| 1188 | - echo ' |
|
| 1213 | + if (!empty($context['package_ftp']['destination'])) { |
|
| 1214 | + echo ' |
|
| 1189 | 1215 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 1190 | 1216 | </form>'; |
| 1217 | + } |
|
| 1191 | 1218 | |
| 1192 | 1219 | // Hide the details of the list. |
| 1193 | - if (empty($context['package_ftp']['form_elements_only'])) |
|
| 1194 | - echo ' |
|
| 1220 | + if (empty($context['package_ftp']['form_elements_only'])) { |
|
| 1221 | + echo ' |
|
| 1195 | 1222 | <script> |
| 1196 | 1223 | document.getElementById(\'need_writable_list\').style.display = \'none\'; |
| 1197 | 1224 | </script>'; |
| 1225 | + } |
|
| 1198 | 1226 | |
| 1199 | 1227 | // Quick generate the test button. |
| 1200 | 1228 | echo ' |
@@ -1550,9 +1578,10 @@ discard block |
||
| 1550 | 1578 | <tr class="windowbg"> |
| 1551 | 1579 | <td width="30%"><strong>'; |
| 1552 | 1580 | |
| 1553 | - if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) |
|
| 1554 | - echo ' |
|
| 1581 | + if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) { |
|
| 1582 | + echo ' |
|
| 1555 | 1583 | <span class="generic_icons folder"></span>'; |
| 1584 | + } |
|
| 1556 | 1585 | |
| 1557 | 1586 | echo ' |
| 1558 | 1587 | ', $name, ' |
@@ -1569,8 +1598,9 @@ discard block |
||
| 1569 | 1598 | </tr> |
| 1570 | 1599 | '; |
| 1571 | 1600 | |
| 1572 | - if (!empty($dir['contents'])) |
|
| 1573 | - template_permission_show_contents($name, $dir['contents'], 1); |
|
| 1601 | + if (!empty($dir['contents'])) { |
|
| 1602 | + template_permission_show_contents($name, $dir['contents'], 1); |
|
| 1603 | + } |
|
| 1574 | 1604 | } |
| 1575 | 1605 | |
| 1576 | 1606 | echo ' |
@@ -1606,13 +1636,14 @@ discard block |
||
| 1606 | 1636 | </fieldset>'; |
| 1607 | 1637 | |
| 1608 | 1638 | // Likely to need FTP? |
| 1609 | - if (empty($context['ftp_connected'])) |
|
| 1610 | - echo ' |
|
| 1639 | + if (empty($context['ftp_connected'])) { |
|
| 1640 | + echo ' |
|
| 1611 | 1641 | <p> |
| 1612 | 1642 | ', $txt['package_file_perms_ftp_details'], ': |
| 1613 | 1643 | </p> |
| 1614 | 1644 | ', template_control_chmod(), ' |
| 1615 | 1645 | <div class="noticebox">', $txt['package_file_perms_ftp_retain'], '</div>'; |
| 1646 | + } |
|
| 1616 | 1647 | |
| 1617 | 1648 | echo ' |
| 1618 | 1649 | <span id="test_ftp_placeholder_full"></span> |
@@ -1621,9 +1652,10 @@ discard block |
||
| 1621 | 1652 | </div>'; |
| 1622 | 1653 | |
| 1623 | 1654 | // Any looks fors we've already done? |
| 1624 | - foreach ($context['look_for'] as $path) |
|
| 1625 | - echo ' |
|
| 1655 | + foreach ($context['look_for'] as $path) { |
|
| 1656 | + echo ' |
|
| 1626 | 1657 | <input type="hidden" name="back_look[]" value="', $path, '">'; |
| 1658 | + } |
|
| 1627 | 1659 | echo ' |
| 1628 | 1660 | </form><br>'; |
| 1629 | 1661 | } |
@@ -1662,9 +1694,10 @@ discard block |
||
| 1662 | 1694 | <td class="smalltext" width="30%">' . str_repeat(' ', $level * 5), ' |
| 1663 | 1695 | ', (!empty($dir['type']) && $dir['type'] == 'dir_recursive') || !empty($dir['list_contents']) ? '<a id="link_' . $cur_ident . '" href="' . $scripturl . '?action=admin;area=packages;sa=perms;find=' . base64_encode($ident . '/' . $name) . ';back_look=' . $context['back_look_data'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '#fol_' . $cur_ident . '" onclick="return expandFolder(\'' . $cur_ident . '\', \'' . addcslashes($ident . '/' . $name, "'\\") . '\');">' : ''; |
| 1664 | 1696 | |
| 1665 | - if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) |
|
| 1666 | - echo ' |
|
| 1697 | + if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) { |
|
| 1698 | + echo ' |
|
| 1667 | 1699 | <span class="generic_icons folder"></span>'; |
| 1700 | + } |
|
| 1668 | 1701 | |
| 1669 | 1702 | echo ' |
| 1670 | 1703 | ', $name, ' |
@@ -1690,14 +1723,15 @@ discard block |
||
| 1690 | 1723 | } |
| 1691 | 1724 | |
| 1692 | 1725 | // We have more files to show? |
| 1693 | - if ($has_more) |
|
| 1694 | - echo ' |
|
| 1726 | + if ($has_more) { |
|
| 1727 | + echo ' |
|
| 1695 | 1728 | <tr class="windowbg" id="content_', $js_ident, '_more"> |
| 1696 | 1729 | <td class="smalltext" width="40%">' . str_repeat(' ', $level * 5), ' |
| 1697 | 1730 | « <a href="' . $scripturl . '?action=admin;area=packages;sa=perms;find=' . base64_encode($ident) . ';fileoffset=', ($context['file_offset'] + $context['file_limit']), ';' . $context['session_var'] . '=' . $context['session_id'] . '#fol_' . preg_replace('~[^A-Za-z0-9_\-=:]~', ':-:', $ident) . '">', $txt['package_file_perms_more_files'], '</a> » |
| 1698 | 1731 | </td> |
| 1699 | 1732 | <td colspan="6"></td> |
| 1700 | 1733 | </tr>'; |
| 1734 | + } |
|
| 1701 | 1735 | |
| 1702 | 1736 | if ($drawn_div) |
| 1703 | 1737 | { |
@@ -1705,15 +1739,17 @@ discard block |
||
| 1705 | 1739 | $isFound = false; |
| 1706 | 1740 | foreach ($context['look_for'] as $tree) |
| 1707 | 1741 | { |
| 1708 | - if (substr($tree, 0, strlen($ident)) == $ident) |
|
| 1709 | - $isFound = true; |
|
| 1742 | + if (substr($tree, 0, strlen($ident)) == $ident) { |
|
| 1743 | + $isFound = true; |
|
| 1744 | + } |
|
| 1710 | 1745 | } |
| 1711 | 1746 | |
| 1712 | - if ($level > 1 && !$isFound) |
|
| 1713 | - echo ' |
|
| 1747 | + if ($level > 1 && !$isFound) { |
|
| 1748 | + echo ' |
|
| 1714 | 1749 | <script> |
| 1715 | 1750 | expandFolder(\'', $js_ident, '\', \'\'); |
| 1716 | 1751 | </script>'; |
| 1752 | + } |
|
| 1717 | 1753 | } |
| 1718 | 1754 | } |
| 1719 | 1755 | |
@@ -1733,11 +1769,12 @@ discard block |
||
| 1733 | 1769 | <h3 class="catbg">', $txt['package_file_perms_applying'], '</h3> |
| 1734 | 1770 | </div>'; |
| 1735 | 1771 | |
| 1736 | - if (!empty($context['skip_ftp'])) |
|
| 1737 | - echo ' |
|
| 1772 | + if (!empty($context['skip_ftp'])) { |
|
| 1773 | + echo ' |
|
| 1738 | 1774 | <div class="errorbox"> |
| 1739 | 1775 | ', $txt['package_file_perms_skipping_ftp'], ' |
| 1740 | 1776 | </div>'; |
| 1777 | + } |
|
| 1741 | 1778 | |
| 1742 | 1779 | // How many have we done? |
| 1743 | 1780 | $remaining_items = count($context['method'] == 'individual' ? $context['to_process'] : $context['directory_list']); |
@@ -1775,28 +1812,31 @@ discard block |
||
| 1775 | 1812 | <br>'; |
| 1776 | 1813 | |
| 1777 | 1814 | // Put out the right hidden data. |
| 1778 | - if ($context['method'] == 'individual') |
|
| 1779 | - echo ' |
|
| 1815 | + if ($context['method'] == 'individual') { |
|
| 1816 | + echo ' |
|
| 1780 | 1817 | <input type="hidden" name="custom_value" value="', $context['custom_value'], '"> |
| 1781 | 1818 | <input type="hidden" name="totalItems" value="', $context['total_items'], '"> |
| 1782 | 1819 | <input type="hidden" name="toProcess" value="', base64_encode(json_encode($context['to_process'])), '">'; |
| 1783 | - else |
|
| 1784 | - echo ' |
|
| 1820 | + } else { |
|
| 1821 | + echo ' |
|
| 1785 | 1822 | <input type="hidden" name="predefined" value="', $context['predefined_type'], '"> |
| 1786 | 1823 | <input type="hidden" name="fileOffset" value="', $context['file_offset'], '"> |
| 1787 | 1824 | <input type="hidden" name="totalItems" value="', $context['total_items'], '"> |
| 1788 | 1825 | <input type="hidden" name="dirList" value="', base64_encode(json_encode($context['directory_list'])), '"> |
| 1789 | 1826 | <input type="hidden" name="specialFiles" value="', base64_encode(json_encode($context['special_files'])), '">'; |
| 1827 | + } |
|
| 1790 | 1828 | |
| 1791 | 1829 | // Are we not using FTP for whatever reason. |
| 1792 | - if (!empty($context['skip_ftp'])) |
|
| 1793 | - echo ' |
|
| 1830 | + if (!empty($context['skip_ftp'])) { |
|
| 1831 | + echo ' |
|
| 1794 | 1832 | <input type="hidden" name="skip_ftp" value="1">'; |
| 1833 | + } |
|
| 1795 | 1834 | |
| 1796 | 1835 | // Retain state. |
| 1797 | - foreach ($context['back_look_data'] as $path) |
|
| 1798 | - echo ' |
|
| 1836 | + foreach ($context['back_look_data'] as $path) { |
|
| 1837 | + echo ' |
|
| 1799 | 1838 | <input type="hidden" name="back_look[]" value="', $path, '">'; |
| 1839 | + } |
|
| 1800 | 1840 | |
| 1801 | 1841 | echo ' |
| 1802 | 1842 | <input type="hidden" name="method" value="', $context['method'], '"> |
@@ -86,9 +86,10 @@ discard block |
||
| 86 | 86 | <span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br>'; |
| 87 | 87 | |
| 88 | 88 | // Only offer to search for buddies if we have some! |
| 89 | - if (!empty($context['show_buddies'])) |
|
| 90 | - echo ' |
|
| 89 | + if (!empty($context['show_buddies'])) { |
|
| 90 | + echo ' |
|
| 91 | 91 | <span class="smalltext"><label for="buddies"><input type="checkbox" class="input_check" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked' : '', '> ', $txt['find_buddies'], '</label></span><br>'; |
| 92 | + } |
|
| 92 | 93 | |
| 93 | 94 | echo ' |
| 94 | 95 | <div class="padding righttext"> |
@@ -103,10 +104,10 @@ discard block |
||
| 103 | 104 | <h3 class="catbg">', $txt['find_results'], '</h3> |
| 104 | 105 | </div>'; |
| 105 | 106 | |
| 106 | - if (empty($context['results'])) |
|
| 107 | - echo ' |
|
| 107 | + if (empty($context['results'])) { |
|
| 108 | + echo ' |
|
| 108 | 109 | <p class="error">', $txt['find_no_results'], '</p>'; |
| 109 | - else |
|
| 110 | + } else |
|
| 110 | 111 | { |
| 111 | 112 | echo ' |
| 112 | 113 | <ul class="padding">'; |
@@ -135,11 +136,12 @@ discard block |
||
| 135 | 136 | <input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '"> |
| 136 | 137 | </form>'; |
| 137 | 138 | |
| 138 | - if (empty($context['results'])) |
|
| 139 | - echo ' |
|
| 139 | + if (empty($context['results'])) { |
|
| 140 | + echo ' |
|
| 140 | 141 | <script> |
| 141 | 142 | document.getElementById("search").focus(); |
| 142 | 143 | </script>'; |
| 144 | + } |
|
| 143 | 145 | |
| 144 | 146 | echo ' |
| 145 | 147 | </body> |
@@ -183,8 +185,8 @@ discard block |
||
| 183 | 185 | { |
| 184 | 186 | global $txt, $context, $modSettings; |
| 185 | 187 | |
| 186 | - if (!empty($modSettings['requireAgreement'])) |
|
| 187 | - echo ' |
|
| 188 | + if (!empty($modSettings['requireAgreement'])) { |
|
| 189 | + echo ' |
|
| 188 | 190 | <div class="cat_bar"> |
| 189 | 191 | <h3 class="catbg"> |
| 190 | 192 | ', $txt['terms_and_rules'], ' - ', $context['forum_name_html_safe'], ' |
@@ -193,11 +195,12 @@ discard block |
||
| 193 | 195 | <div class="roundframe"> |
| 194 | 196 | ', $context['agreement'], ' |
| 195 | 197 | </div>'; |
| 196 | - else |
|
| 197 | - echo ' |
|
| 198 | + } else { |
|
| 199 | + echo ' |
|
| 198 | 200 | <div class="noticebox"> |
| 199 | 201 | ', $txt['agreement_disabled'], ' |
| 200 | 202 | </div>'; |
| 201 | -} |
|
| 203 | + } |
|
| 204 | + } |
|
| 202 | 205 | |
| 203 | 206 | ?> |
| 204 | 207 | \ No newline at end of file |
@@ -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>'; |
@@ -43,28 +43,33 @@ discard block |
||
| 43 | 43 | </div> |
| 44 | 44 | <div class="list_posts">', $post['message'], '</div>'; |
| 45 | 45 | |
| 46 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 47 | - echo ' |
|
| 46 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 47 | + echo ' |
|
| 48 | 48 | <ul class="quickbuttons">'; |
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | // If they *can* reply? |
| 51 | - if ($post['can_reply']) |
|
| 52 | - echo ' |
|
| 52 | + if ($post['can_reply']) { |
|
| 53 | + echo ' |
|
| 53 | 54 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
| 55 | + } |
|
| 54 | 56 | |
| 55 | 57 | // If they *can* quote? |
| 56 | - if ($post['can_quote']) |
|
| 57 | - echo ' |
|
| 58 | + if ($post['can_quote']) { |
|
| 59 | + echo ' |
|
| 58 | 60 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
| 61 | + } |
|
| 59 | 62 | |
| 60 | 63 | // How about... even... remove it entirely?! |
| 61 | - if ($post['can_delete']) |
|
| 62 | - echo ' |
|
| 64 | + if ($post['can_delete']) { |
|
| 65 | + echo ' |
|
| 63 | 66 | <li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
| 67 | + } |
|
| 64 | 68 | |
| 65 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 66 | - echo ' |
|
| 69 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 70 | + echo ' |
|
| 67 | 71 | </ul>'; |
| 72 | + } |
|
| 68 | 73 | |
| 69 | 74 | echo ' |
| 70 | 75 | </div>'; |
@@ -86,12 +91,13 @@ discard block |
||
| 86 | 91 | echo ' |
| 87 | 92 | <div id="recent" class="main_content">'; |
| 88 | 93 | |
| 89 | - if ($context['showCheckboxes']) |
|
| 90 | - echo ' |
|
| 94 | + if ($context['showCheckboxes']) { |
|
| 95 | + echo ' |
|
| 91 | 96 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;"> |
| 92 | 97 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 93 | 98 | <input type="hidden" name="qaction" value="markread"> |
| 94 | 99 | <input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
| 100 | + } |
|
| 95 | 101 | |
| 96 | 102 | if (!empty($context['topics'])) |
| 97 | 103 | { |
@@ -117,11 +123,12 @@ discard block |
||
| 117 | 123 | </div>'; |
| 118 | 124 | |
| 119 | 125 | // Show a "select all" box for quick moderation? |
| 120 | - if ($context['showCheckboxes']) |
|
| 121 | - echo ' |
|
| 126 | + if ($context['showCheckboxes']) { |
|
| 127 | + echo ' |
|
| 122 | 128 | <div class="moderation"> |
| 123 | 129 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check"> |
| 124 | 130 | </div>'; |
| 131 | + } |
|
| 125 | 132 | |
| 126 | 133 | echo ' |
| 127 | 134 | </div> |
@@ -140,15 +147,18 @@ discard block |
||
| 140 | 147 | // Now we handle the icons |
| 141 | 148 | echo ' |
| 142 | 149 | <div class="icons floatright">'; |
| 143 | - if ($topic['is_locked']) |
|
| 144 | - echo ' |
|
| 150 | + if ($topic['is_locked']) { |
|
| 151 | + echo ' |
|
| 145 | 152 | <span class="generic_icons lock"></span>'; |
| 146 | - if ($topic['is_sticky']) |
|
| 147 | - echo ' |
|
| 153 | + } |
|
| 154 | + if ($topic['is_sticky']) { |
|
| 155 | + echo ' |
|
| 148 | 156 | <span class="generic_icons sticky"></span>'; |
| 149 | - if ($topic['is_poll']) |
|
| 150 | - echo ' |
|
| 157 | + } |
|
| 158 | + if ($topic['is_poll']) { |
|
| 159 | + echo ' |
|
| 151 | 160 | <span class="generic_icons poll"></span>'; |
| 161 | + } |
|
| 152 | 162 | echo ' |
| 153 | 163 | </div>'; |
| 154 | 164 | |
@@ -173,19 +183,21 @@ discard block |
||
| 173 | 183 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
| 174 | 184 | </div>'; |
| 175 | 185 | |
| 176 | - if ($context['showCheckboxes']) |
|
| 177 | - echo ' |
|
| 186 | + if ($context['showCheckboxes']) { |
|
| 187 | + echo ' |
|
| 178 | 188 | <div class="moderation"> |
| 179 | 189 | <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check"> |
| 180 | 190 | </div>'; |
| 191 | + } |
|
| 181 | 192 | |
| 182 | 193 | echo ' |
| 183 | 194 | </div>'; |
| 184 | 195 | } |
| 185 | 196 | |
| 186 | - if (empty($context['topics'])) |
|
| 187 | - echo ' |
|
| 197 | + if (empty($context['topics'])) { |
|
| 198 | + echo ' |
|
| 188 | 199 | <div style="display: none;"></div>'; |
| 200 | + } |
|
| 189 | 201 | |
| 190 | 202 | echo ' |
| 191 | 203 | </div> |
@@ -197,25 +209,27 @@ discard block |
||
| 197 | 209 | ', $context['menu_separator'], '<a href="#recent" class="topbottom floatleft">', $txt['go_up'], '</a> |
| 198 | 210 | <div class="pagelinks">', $context['page_index'], '</div> |
| 199 | 211 | </div>'; |
| 200 | - } |
|
| 201 | - else |
|
| 202 | - echo ' |
|
| 212 | + } else { |
|
| 213 | + echo ' |
|
| 203 | 214 | <div class="cat_bar"> |
| 204 | 215 | <h3 class="catbg centertext"> |
| 205 | 216 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
| 206 | 217 | </h3> |
| 207 | 218 | </div>'; |
| 219 | + } |
|
| 208 | 220 | |
| 209 | - if ($context['showCheckboxes']) |
|
| 210 | - echo ' |
|
| 221 | + if ($context['showCheckboxes']) { |
|
| 222 | + echo ' |
|
| 211 | 223 | </form>'; |
| 224 | + } |
|
| 212 | 225 | |
| 213 | 226 | echo ' |
| 214 | 227 | </div>'; |
| 215 | 228 | |
| 216 | - if (empty($context['no_topic_listing'])) |
|
| 217 | - template_topic_legend(); |
|
| 218 | -} |
|
| 229 | + if (empty($context['no_topic_listing'])) { |
|
| 230 | + template_topic_legend(); |
|
| 231 | + } |
|
| 232 | + } |
|
| 219 | 233 | |
| 220 | 234 | /** |
| 221 | 235 | * Template for showing unread replies (eg new replies to topics you've posted in) |
@@ -227,12 +241,13 @@ discard block |
||
| 227 | 241 | echo ' |
| 228 | 242 | <div id="recent">'; |
| 229 | 243 | |
| 230 | - if ($context['showCheckboxes']) |
|
| 231 | - echo ' |
|
| 244 | + if ($context['showCheckboxes']) { |
|
| 245 | + echo ' |
|
| 232 | 246 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;"> |
| 233 | 247 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 234 | 248 | <input type="hidden" name="qaction" value="markread"> |
| 235 | 249 | <input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
| 250 | + } |
|
| 236 | 251 | |
| 237 | 252 | if (!empty($context['topics'])) |
| 238 | 253 | { |
@@ -258,11 +273,12 @@ discard block |
||
| 258 | 273 | </div>'; |
| 259 | 274 | |
| 260 | 275 | // Show a "select all" box for quick moderation? |
| 261 | - if ($context['showCheckboxes']) |
|
| 262 | - echo ' |
|
| 276 | + if ($context['showCheckboxes']) { |
|
| 277 | + echo ' |
|
| 263 | 278 | <div class="moderation"> |
| 264 | 279 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check"> |
| 265 | 280 | </div>'; |
| 281 | + } |
|
| 266 | 282 | |
| 267 | 283 | echo ' |
| 268 | 284 | </div> |
@@ -281,15 +297,18 @@ discard block |
||
| 281 | 297 | // Now we handle the icons |
| 282 | 298 | echo ' |
| 283 | 299 | <div class="icons floatright">'; |
| 284 | - if ($topic['is_locked']) |
|
| 285 | - echo ' |
|
| 300 | + if ($topic['is_locked']) { |
|
| 301 | + echo ' |
|
| 286 | 302 | <span class="generic_icons lock"></span>'; |
| 287 | - if ($topic['is_sticky']) |
|
| 288 | - echo ' |
|
| 303 | + } |
|
| 304 | + if ($topic['is_sticky']) { |
|
| 305 | + echo ' |
|
| 289 | 306 | <span class="generic_icons sticky"></span>'; |
| 290 | - if ($topic['is_poll']) |
|
| 291 | - echo ' |
|
| 307 | + } |
|
| 308 | + if ($topic['is_poll']) { |
|
| 309 | + echo ' |
|
| 292 | 310 | <span class="generic_icons poll"></span>'; |
| 311 | + } |
|
| 293 | 312 | echo ' |
| 294 | 313 | </div>'; |
| 295 | 314 | |
@@ -314,11 +333,12 @@ discard block |
||
| 314 | 333 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
| 315 | 334 | </div>'; |
| 316 | 335 | |
| 317 | - if ($context['showCheckboxes']) |
|
| 318 | - echo ' |
|
| 336 | + if ($context['showCheckboxes']) { |
|
| 337 | + echo ' |
|
| 319 | 338 | <div class="moderation"> |
| 320 | 339 | <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check"> |
| 321 | 340 | </div>'; |
| 341 | + } |
|
| 322 | 342 | echo ' |
| 323 | 343 | </div>'; |
| 324 | 344 | } |
@@ -331,24 +351,26 @@ discard block |
||
| 331 | 351 | ', $context['menu_separator'], '<a href="#recent" class="topbottom floatleft">', $txt['go_up'], '</a> |
| 332 | 352 | <div class="pagelinks">', $context['page_index'], '</div> |
| 333 | 353 | </div>'; |
| 334 | - } |
|
| 335 | - else |
|
| 336 | - echo ' |
|
| 354 | + } else { |
|
| 355 | + echo ' |
|
| 337 | 356 | <div class="cat_bar"> |
| 338 | 357 | <h3 class="catbg centertext"> |
| 339 | 358 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
| 340 | 359 | </h3> |
| 341 | 360 | </div>'; |
| 361 | + } |
|
| 342 | 362 | |
| 343 | - if ($context['showCheckboxes']) |
|
| 344 | - echo ' |
|
| 363 | + if ($context['showCheckboxes']) { |
|
| 364 | + echo ' |
|
| 345 | 365 | </form>'; |
| 366 | + } |
|
| 346 | 367 | |
| 347 | 368 | echo ' |
| 348 | 369 | </div>'; |
| 349 | 370 | |
| 350 | - if (empty($context['no_topic_listing'])) |
|
| 351 | - template_topic_legend(); |
|
| 352 | -} |
|
| 371 | + if (empty($context['no_topic_listing'])) { |
|
| 372 | + template_topic_legend(); |
|
| 373 | + } |
|
| 374 | + } |
|
| 353 | 375 | |
| 354 | 376 | ?> |
| 355 | 377 | \ No newline at end of file |