@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
151 | 151 | <span class="smalltext">', $field['desc'], '</span> |
152 | 152 | </dt> |
153 | - <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>'; |
|
153 | + <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>'; |
|
154 | 154 | |
155 | 155 | echo ' |
156 | 156 | </dl>'; |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | <meta charset="', $context['character_set'], '"> |
437 | 437 | <title>', $txt['visual_verification_sound'], '</title> |
438 | 438 | <meta name="robots" content="noindex"> |
439 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
439 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
440 | 440 | <style>'; |
441 | 441 | |
442 | 442 | // Just show the help text and a "close window" link. |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
543 | 543 | <span class="smalltext">', $field['desc'], '</span> |
544 | 544 | </dt> |
545 | - <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>'; |
|
545 | + <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>'; |
|
546 | 546 | |
547 | 547 | echo ' |
548 | 548 | <dt> |
@@ -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 noup">'; |
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 noup" 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> |
@@ -655,9 +674,10 @@ discard block |
||
655 | 674 | { |
656 | 675 | global $context, $scripturl, $txt; |
657 | 676 | |
658 | - if (!empty($context['saved_successful'])) |
|
659 | - echo ' |
|
677 | + if (!empty($context['saved_successful'])) { |
|
678 | + echo ' |
|
660 | 679 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
680 | + } |
|
661 | 681 | |
662 | 682 | echo ' |
663 | 683 | <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '"> |
@@ -20,12 +20,12 @@ |
||
20 | 20 | // We completed some tasks? |
21 | 21 | if (!empty($context['tasks_were_run'])) |
22 | 22 | { |
23 | - if (empty($context['scheduled_errors'])) |
|
24 | - echo ' |
|
23 | + if (empty($context['scheduled_errors'])) { |
|
24 | + echo ' |
|
25 | 25 | <div class="infobox"> |
26 | 26 | ', $txt['scheduled_tasks_were_run'], ' |
27 | 27 | </div>'; |
28 | - else |
|
28 | + } else |
|
29 | 29 | { |
30 | 30 | echo ' |
31 | 31 | <div class="errorbox" id="errors"> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | <smf> |
48 | 48 | <subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject> |
49 | 49 | <message id="msg_', $context['message']['id'], '"><![CDATA[', cleanXml($context['message']['body']), ']]></message> |
50 | - <reason time="', $context['message']['reason']['time'] ,'" name="', $context['message']['reason']['name'] ,'"><![CDATA[', cleanXml($context['message']['reason']['text']), ']]></reason> |
|
50 | + <reason time="', $context['message']['reason']['time'], '" name="', $context['message']['reason']['name'], '"><![CDATA[', cleanXml($context['message']['reason']['text']), ']]></reason> |
|
51 | 51 | </smf>'; |
52 | 52 | |
53 | 53 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | // Build our string of info about when and why it was modified |
68 | 68 | |
69 | 69 | $modified = empty($context['message']['modified']['time']) ? '' : sprintf($txt['last_edit_by'], $context['message']['modified']['time'], $context['message']['modified']['name']); |
70 | - $modified .= empty($context['message']['modified']['reason']) ? '' : ' '. sprintf($txt['last_edit_reason'], $context['message']['modified']['reason']); |
|
70 | + $modified .= empty($context['message']['modified']['reason']) ? '' : ' ' . sprintf($txt['last_edit_reason'], $context['message']['modified']['reason']); |
|
71 | 71 | |
72 | 72 | echo ' |
73 | 73 | <modified><![CDATA[', empty($modified) ? '' : cleanXml('« <em>' . $modified . '</em>»'), ']]></modified> |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | <subject is_first="', $context['message']['first_in_topic'] ? '1' : '0', '"><![CDATA[', cleanXml($context['message']['subject']), ']]></subject> |
75 | 75 | <body><![CDATA[', $context['message']['body'], ']]></body> |
76 | 76 | <success><![CDATA[', $txt['quick_modify_message'], ']]></success>'; |
77 | - } |
|
78 | - else |
|
79 | - echo ' |
|
77 | + } else { |
|
78 | + echo ' |
|
80 | 79 | <error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '" in_body="', cleanXml($context['message']['error_in_body']) ? '1' : '0', '"><![CDATA[', implode('<br />', $context['message']['errors']), ']]></error>'; |
80 | + } |
|
81 | 81 | echo ' |
82 | 82 | </message> |
83 | 83 | </smf>'; |
@@ -101,13 +101,14 @@ discard block |
||
101 | 101 | |
102 | 102 | echo ' |
103 | 103 | <modified><![CDATA[', empty($modified) ? '' : cleanXml('« <em>' . $modified . '</em>»'), ']]></modified>'; |
104 | - if (!empty($context['message']['subject'])) |
|
105 | - echo ' |
|
104 | + if (!empty($context['message']['subject'])) { |
|
105 | + echo ' |
|
106 | 106 | <subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>'; |
107 | - } |
|
108 | - else |
|
109 | - echo ' |
|
107 | + } |
|
108 | + } else { |
|
109 | + echo ' |
|
110 | 110 | <error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '"><![CDATA[', cleanXml(implode('<br />', $context['message']['errors'])), ']]></error>'; |
111 | + } |
|
111 | 112 | echo ' |
112 | 113 | </message> |
113 | 114 | </smf>'; |
@@ -127,10 +128,11 @@ discard block |
||
127 | 128 | <body><![CDATA[', $context['preview_message'], ']]></body> |
128 | 129 | </preview> |
129 | 130 | <errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '" topic_locked="', $context['locked'] ? '1' : '0', '">'; |
130 | - if (!empty($context['post_error'])) |
|
131 | - foreach ($context['post_error'] as $message) |
|
131 | + if (!empty($context['post_error'])) { |
|
132 | + foreach ($context['post_error'] as $message) |
|
132 | 133 | echo ' |
133 | 134 | <error><![CDATA[', cleanXml($message), ']]></error>'; |
135 | + } |
|
134 | 136 | echo ' |
135 | 137 | <caption name="guestname" class="', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? 'error' : '', '" /> |
136 | 138 | <caption name="email" class="', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? 'error' : '', '" /> |
@@ -145,14 +147,15 @@ discard block |
||
145 | 147 | { |
146 | 148 | echo ' |
147 | 149 | <new_posts>'; |
148 | - foreach ($context['previous_posts'] as $post) |
|
149 | - echo ' |
|
150 | + foreach ($context['previous_posts'] as $post) { |
|
151 | + echo ' |
|
150 | 152 | <post id="', $post['id'], '"> |
151 | 153 | <time><![CDATA[', $post['time'], ']]></time> |
152 | 154 | <poster><![CDATA[', cleanXml($post['poster']), ']]></poster> |
153 | 155 | <message><![CDATA[', cleanXml($post['message']), ']]></message> |
154 | 156 | <is_ignored>', $post['is_ignored'] ? '1' : '0', '</is_ignored> |
155 | 157 | </post>'; |
158 | + } |
|
156 | 159 | echo ' |
157 | 160 | </new_posts>'; |
158 | 161 | } |
@@ -176,10 +179,11 @@ discard block |
||
176 | 179 | <body><![CDATA[', $context['preview_message'], ']]></body> |
177 | 180 | </preview> |
178 | 181 | <errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">'; |
179 | - if (!empty($context['post_error']['messages'])) |
|
180 | - foreach ($context['post_error']['messages'] as $message) |
|
182 | + if (!empty($context['post_error']['messages'])) { |
|
183 | + foreach ($context['post_error']['messages'] as $message) |
|
181 | 184 | echo ' |
182 | 185 | <error><![CDATA[', cleanXml($message), ']]></error>'; |
186 | + } |
|
183 | 187 | |
184 | 188 | echo ' |
185 | 189 | <caption name="to" class="', isset($context['post_error']['no_to']) ? 'error' : '', '" /> |
@@ -208,10 +212,11 @@ discard block |
||
208 | 212 | <body><![CDATA[', $context['preview_message'], ']]></body> |
209 | 213 | </preview> |
210 | 214 | <errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">'; |
211 | - if (!empty($context['post_error']['messages'])) |
|
212 | - foreach ($context['post_error']['messages'] as $message) |
|
215 | + if (!empty($context['post_error']['messages'])) { |
|
216 | + foreach ($context['post_error']['messages'] as $message) |
|
213 | 217 | echo ' |
214 | 218 | <error><![CDATA[', cleanXml($message), ']]></error>'; |
219 | + } |
|
215 | 220 | |
216 | 221 | echo ' |
217 | 222 | </errors>'; |
@@ -227,19 +232,22 @@ discard block |
||
227 | 232 | { |
228 | 233 | global $context, $modSettings; |
229 | 234 | |
230 | - if (empty($context['yearly'])) |
|
231 | - return; |
|
235 | + if (empty($context['yearly'])) { |
|
236 | + return; |
|
237 | + } |
|
232 | 238 | |
233 | 239 | echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '> |
234 | 240 | <smf>'; |
235 | - foreach ($context['yearly'] as $year) |
|
236 | - foreach ($year['months'] as $month) |
|
241 | + foreach ($context['yearly'] as $year) { |
|
242 | + foreach ($year['months'] as $month) |
|
237 | 243 | { |
238 | 244 | echo ' |
239 | 245 | <month id="', $month['date']['year'], $month['date']['month'], '">'; |
240 | - foreach ($month['days'] as $day) |
|
241 | - echo ' |
|
246 | + } |
|
247 | + foreach ($month['days'] as $day) { |
|
248 | + echo ' |
|
242 | 249 | <day date="', $day['year'], '-', $day['month'], '-', $day['day'], '" new_topics="', $day['new_topics'], '" new_posts="', $day['new_posts'], '" new_members="', $day['new_members'], '" most_members_online="', $day['most_members_online'], '"', empty($modSettings['hitStats']) ? '' : ' hits="' . $day['hits'] . '"', ' />'; |
250 | + } |
|
243 | 251 | echo ' |
244 | 252 | </month>'; |
245 | 253 | } |
@@ -260,17 +268,18 @@ discard block |
||
260 | 268 | <pageIndex section="selected" startFrom="', $context['selected']['start'], '"><![CDATA[', $context['selected']['page_index'], ']]></pageIndex>'; |
261 | 269 | foreach ($context['changes'] as $change) |
262 | 270 | { |
263 | - if ($change['type'] == 'remove') |
|
264 | - echo ' |
|
271 | + if ($change['type'] == 'remove') { |
|
272 | + echo ' |
|
265 | 273 | <change id="', $change['id'], '" curAction="remove" section="', $change['section'], '" />'; |
266 | - else |
|
267 | - echo ' |
|
274 | + } else { |
|
275 | + echo ' |
|
268 | 276 | <change id="', $change['id'], '" curAction="insert" section="', $change['section'], '"> |
269 | 277 | <subject><![CDATA[', cleanXml($change['insert_value']['subject']), ']]></subject> |
270 | 278 | <time><![CDATA[', cleanXml($change['insert_value']['time']), ']]></time> |
271 | 279 | <body><![CDATA[', cleanXml($change['insert_value']['body']), ']]></body> |
272 | 280 | <poster><![CDATA[', cleanXml($change['insert_value']['poster']), ']]></poster> |
273 | 281 | </change>'; |
282 | + } |
|
274 | 283 | } |
275 | 284 | echo ' |
276 | 285 | </smf>'; |
@@ -301,10 +310,10 @@ discard block |
||
301 | 310 | echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '> |
302 | 311 | <smf>'; |
303 | 312 | |
304 | - if (empty($context['topics'])) |
|
305 | - echo ' |
|
313 | + if (empty($context['topics'])) { |
|
314 | + echo ' |
|
306 | 315 | <noresults>', $txt['search_no_results'], '</noresults>'; |
307 | - else |
|
316 | + } else |
|
308 | 317 | { |
309 | 318 | echo ' |
310 | 319 | <results>'; |
@@ -370,9 +379,10 @@ discard block |
||
370 | 379 | { |
371 | 380 | echo ' |
372 | 381 | <item type="category" id="', $category['id'], '"><![CDATA[', cleanXml($category['name']), ']]></item>'; |
373 | - foreach ($category['boards'] as $board) |
|
374 | - echo ' |
|
382 | + foreach ($category['boards'] as $board) { |
|
383 | + echo ' |
|
375 | 384 | <item type="board" id="', $board['id'], '" childlevel="', $board['child_level'], '"><![CDATA[', cleanXml($board['name']), ']]></item>'; |
385 | + } |
|
376 | 386 | } |
377 | 387 | echo ' |
378 | 388 | </smf>'; |
@@ -387,9 +397,10 @@ discard block |
||
387 | 397 | |
388 | 398 | echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '> |
389 | 399 | <smf>'; |
390 | - foreach ($context['icons'] as $icon) |
|
391 | - echo ' |
|
400 | + foreach ($context['icons'] as $icon) { |
|
401 | + echo ' |
|
392 | 402 | <icon value="', $icon['value'], '" url="', $icon['url'], '"><![CDATA[', cleanXml($icon['name']), ']]></icon>'; |
403 | + } |
|
393 | 404 | echo ' |
394 | 405 | </smf>'; |
395 | 406 | } |
@@ -438,16 +449,18 @@ discard block |
||
438 | 449 | foreach ($xml_data as $key => $data) |
439 | 450 | { |
440 | 451 | // A group? |
441 | - if (is_array($data) && isset($data['identifier'])) |
|
442 | - template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level); |
|
452 | + if (is_array($data) && isset($data['identifier'])) { |
|
453 | + template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level); |
|
454 | + } |
|
443 | 455 | // An item... |
444 | 456 | elseif (is_array($data) && isset($data['value'])) |
445 | 457 | { |
446 | 458 | echo "\n", str_repeat("\t", $level), '<', $child_ident; |
447 | 459 | |
448 | - if (!empty($data['attributes'])) |
|
449 | - foreach ($data['attributes'] as $k => $v) |
|
460 | + if (!empty($data['attributes'])) { |
|
461 | + foreach ($data['attributes'] as $k => $v) |
|
450 | 462 | echo ' ' . $k . '="' . $v . '"'; |
463 | + } |
|
451 | 464 | echo '><![CDATA[', cleanXml($data['value']), ']]></', $child_ident, '>'; |
452 | 465 | } |
453 | 466 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | // Are we done sending the newsletter? |
21 | 21 | if (!empty($context['newsletter_sent'])) |
22 | 22 | echo ' |
23 | - <div class="infobox">', $txt['admin_news_newsletter_'. $context['newsletter_sent']] ,'</div>'; |
|
23 | + <div class="infobox">', $txt['admin_news_newsletter_' . $context['newsletter_sent']], '</div>'; |
|
24 | 24 | |
25 | 25 | echo ' |
26 | 26 | <div id="admincenter"> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <form name="newsmodify" action="', $scripturl, '?action=admin;area=news;sa=mailingsend" method="post" accept-charset="', $context['character_set'], '"> |
201 | 201 | <div class="cat_bar"> |
202 | 202 | <h3 class="catbg"> |
203 | - <a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ', $txt['admin_newsletters'], ' |
|
203 | + <a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ', $txt['admin_newsletters'], ' |
|
204 | 204 | </h3> |
205 | 205 | </div> |
206 | 206 | <div class="information"> |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> |
211 | 211 | <dl> |
212 | 212 | <dt> |
213 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
213 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
214 | 214 | </dt> |
215 | 215 | <dd class="error" id="error_list"> |
216 | 216 | ', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), ' |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | <span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span> |
223 | 223 | </dt> |
224 | 224 | <dd id="pm_subject"> |
225 | - <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60"',isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/> |
|
225 | + <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60"', isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/> |
|
226 | 226 | </dd> |
227 | 227 | </dl><hr class="clear"> |
228 | 228 | <div id="bbcBox_message"></div>'; |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | <form action="', $scripturl, '?action=admin;area=news;sa=mailingsend" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit"> |
388 | 388 | <div class="cat_bar"> |
389 | 389 | <h3 class="catbg"> |
390 | - <a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ', $txt['admin_newsletters'], ' |
|
390 | + <a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ', $txt['admin_newsletters'], ' |
|
391 | 391 | </h3> |
392 | 392 | </div> |
393 | 393 | <div class="windowbg"> |
@@ -18,9 +18,10 @@ discard block |
||
18 | 18 | global $context, $txt, $scripturl; |
19 | 19 | |
20 | 20 | // Are we done sending the newsletter? |
21 | - if (!empty($context['newsletter_sent'])) |
|
22 | - echo ' |
|
21 | + if (!empty($context['newsletter_sent'])) { |
|
22 | + echo ' |
|
23 | 23 | <div class="infobox">', $txt['admin_news_newsletter_'. $context['newsletter_sent']] ,'</div>'; |
24 | + } |
|
24 | 25 | |
25 | 26 | echo ' |
26 | 27 | <div id="admincenter"> |
@@ -39,9 +40,10 @@ discard block |
||
39 | 40 | </dt> |
40 | 41 | <dd>'; |
41 | 42 | |
42 | - foreach ($context['groups'] as $group) |
|
43 | - echo ' |
|
43 | + foreach ($context['groups'] as $group) { |
|
44 | + echo ' |
|
44 | 45 | <label for="groups_', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
46 | + } |
|
45 | 47 | |
46 | 48 | echo ' |
47 | 49 | <br> |
@@ -82,9 +84,10 @@ discard block |
||
82 | 84 | </dt> |
83 | 85 | <dd>'; |
84 | 86 | |
85 | - foreach ($context['groups'] as $group) |
|
86 | - echo ' |
|
87 | + foreach ($context['groups'] as $group) { |
|
88 | + echo ' |
|
87 | 89 | <label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '" class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>'; |
90 | + } |
|
88 | 91 | |
89 | 92 | echo ' |
90 | 93 | <br> |
@@ -228,9 +231,10 @@ discard block |
||
228 | 231 | <div id="bbcBox_message"></div>'; |
229 | 232 | |
230 | 233 | // What about smileys? |
231 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
232 | - echo ' |
|
234 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
235 | + echo ' |
|
233 | 236 | <div id="smileyBox_message"></div>'; |
237 | + } |
|
234 | 238 | |
235 | 239 | // Show BBC buttons, smileys and textbox. |
236 | 240 | echo ' |
@@ -251,9 +255,10 @@ discard block |
||
251 | 255 | <input type="hidden" name="email_force" value="', $context['email_force'], '"> |
252 | 256 | <input type="hidden" name="total_emails" value="', $context['total_emails'], '">'; |
253 | 257 | |
254 | - foreach ($context['recipients'] as $key => $values) |
|
255 | - echo ' |
|
258 | + foreach ($context['recipients'] as $key => $values) { |
|
259 | + echo ' |
|
256 | 260 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
261 | + } |
|
257 | 262 | |
258 | 263 | echo ' |
259 | 264 | <script>'; |
@@ -408,9 +413,10 @@ discard block |
||
408 | 413 | <input type="hidden" name="parse_html" value="', $context['parse_html'], '">'; |
409 | 414 | |
410 | 415 | // All the things we must remember! |
411 | - foreach ($context['recipients'] as $key => $values) |
|
412 | - echo ' |
|
416 | + foreach ($context['recipients'] as $key => $values) { |
|
417 | + echo ' |
|
413 | 418 | <input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">'; |
419 | + } |
|
414 | 420 | |
415 | 421 | echo ' |
416 | 422 | </div> |
@@ -443,9 +449,10 @@ discard block |
||
443 | 449 | { |
444 | 450 | global $context, $txt; |
445 | 451 | |
446 | - if (!empty($context['saved_successful'])) |
|
447 | - echo ' |
|
452 | + if (!empty($context['saved_successful'])) { |
|
453 | + echo ' |
|
448 | 454 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
455 | + } |
|
449 | 456 | |
450 | 457 | template_show_list('news_lists'); |
451 | 458 | } |
@@ -39,9 +39,10 @@ discard block |
||
39 | 39 | <select name="year" id="year" onchange="generateDays();"> |
40 | 40 | <option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>'; |
41 | 41 | // Show a list of all the years we allow... |
42 | - for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) |
|
43 | - echo ' |
|
42 | + for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { |
|
43 | + echo ' |
|
44 | 44 | <option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>'; |
45 | + } |
|
45 | 46 | |
46 | 47 | echo ' |
47 | 48 | </select> |
@@ -49,9 +50,10 @@ discard block |
||
49 | 50 | <select name="month" id="month" onchange="generateDays();">'; |
50 | 51 | |
51 | 52 | // There are 12 months per year - ensure that they all get listed. |
52 | - for ($month = 1; $month <= 12; $month++) |
|
53 | - echo ' |
|
53 | + for ($month = 1; $month <= 12; $month++) { |
|
54 | + echo ' |
|
54 | 55 | <option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
56 | + } |
|
55 | 57 | |
56 | 58 | echo ' |
57 | 59 | </select> |
@@ -59,23 +61,25 @@ discard block |
||
59 | 61 | <select name="day" id="day" onchange="generateDays();">'; |
60 | 62 | |
61 | 63 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
62 | - for ($day = 1; $day <= $context['holiday']['last_day']; $day++) |
|
63 | - echo ' |
|
64 | + for ($day = 1; $day <= $context['holiday']['last_day']; $day++) { |
|
65 | + echo ' |
|
64 | 66 | <option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>'; |
67 | + } |
|
65 | 68 | |
66 | 69 | echo ' |
67 | 70 | </select> |
68 | 71 | </dd> |
69 | 72 | </dl>'; |
70 | 73 | |
71 | - if ($context['is_new']) |
|
72 | - echo ' |
|
74 | + if ($context['is_new']) { |
|
75 | + echo ' |
|
73 | 76 | <input type="submit" value="', $txt['holidays_button_add'], '" class="button_submit">'; |
74 | - else |
|
75 | - echo ' |
|
77 | + } else { |
|
78 | + echo ' |
|
76 | 79 | <input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button_submit"> |
77 | 80 | <input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button_submit"> |
78 | 81 | <input type="hidden" name="holiday" value="', $context['holiday']['id'], '">'; |
82 | + } |
|
79 | 83 | echo ' |
80 | 84 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
81 | 85 | </div> |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | </div> |
102 | 102 | <ul id="messages_not_selected" class="split_messages smalltext">'; |
103 | 103 | |
104 | - foreach ($context['not_selected']['messages'] as $message) |
|
105 | - echo ' |
|
104 | + foreach ($context['not_selected']['messages'] as $message) { |
|
105 | + echo ' |
|
106 | 106 | <li class="windowbg" id="not_selected_', $message['id'], '"> |
107 | 107 | <div class="message_header"> |
108 | 108 | <a class="split_icon floatright" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=down;msg=', $message['id'], '" onclick="return select(\'down\', ', $message['id'], ');"><span class="generic_icons split_sel" title="->"></span></a> |
@@ -111,6 +111,7 @@ discard block |
||
111 | 111 | </div> |
112 | 112 | <div class="post">', $message['body'], '</div> |
113 | 113 | </li>'; |
114 | + } |
|
114 | 115 | |
115 | 116 | echo ' |
116 | 117 | <li class="dummy"> |
@@ -130,8 +131,8 @@ discard block |
||
130 | 131 | </div> |
131 | 132 | <ul id="messages_selected" class="split_messages smalltext">'; |
132 | 133 | |
133 | - if (!empty($context['selected']['messages'])) |
|
134 | - foreach ($context['selected']['messages'] as $message) |
|
134 | + if (!empty($context['selected']['messages'])) { |
|
135 | + foreach ($context['selected']['messages'] as $message) |
|
135 | 136 | echo ' |
136 | 137 | <li class="windowbg" id="selected_', $message['id'], '"> |
137 | 138 | <div class="message_header"> |
@@ -141,6 +142,7 @@ discard block |
||
141 | 142 | </div> |
142 | 143 | <div class="post">', $message['body'], '</div> |
143 | 144 | </li>'; |
145 | + } |
|
144 | 146 | |
145 | 147 | echo ' |
146 | 148 | <li class="dummy"> |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | echo ' |
70 | 70 | <tr class="windowbg"> |
71 | 71 | <td> |
72 | - ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', ' <span>', $group['name'], '</span>'; |
|
72 | + ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', ' <span>', $group['name'], '</span>'; |
|
73 | 73 | |
74 | 74 | if (!empty($group['children'])) |
75 | 75 | echo ' |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | <td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>', $group['num_permissions']['denied'], '</td>'; |
90 | 90 | |
91 | 91 | echo ' |
92 | - <td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']). '</a>' : '', '</td> |
|
92 | + <td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']) . '</a>' : '', '</td> |
|
93 | 93 | <td class="centercol">', $group['allow_modify'] && $context['can_modify'] ? '<input type="checkbox" name="group[]" value="' . $group['id'] . '" class="input_check">' : '', '</td> |
94 | 94 | </tr>'; |
95 | 95 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | <legend>', $txt['permissions_with_selection'], '</legend> |
115 | 115 | <dl class="settings"> |
116 | 116 | <dt> |
117 | - <a class="help" href="', $scripturl, '?action=helpadmin;help=permissions_quickgroups" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'],'"></span></a>', $txt['permissions_apply_pre_defined'], ': |
|
117 | + <a class="help" href="', $scripturl, '?action=helpadmin;help=permissions_quickgroups" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a>', $txt['permissions_apply_pre_defined'], ': |
|
118 | 118 | </dt> |
119 | 119 | <dd> |
120 | 120 | <select name="predefined"> |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | echo ' |
594 | 594 | <tr class="windowbg"> |
595 | 595 | <td> |
596 | - ', $permission['show_help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=permissionhelp_' . $permission['id'] . '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : '', ' |
|
596 | + ', $permission['show_help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=permissionhelp_' . $permission['id'] . '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '', ' |
|
597 | 597 | </td> |
598 | 598 | <td class="lefttext full_width">', $permission['name'], '</td><td>'; |
599 | 599 | |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | if (empty($modSettings['permission_enable_deny'])) |
732 | 732 | echo ' |
733 | 733 | <li> |
734 | - <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission']. '[\');"> |
|
734 | + <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');"> |
|
735 | 735 | <span>', $txt['check_all'], '</span> |
736 | 736 | </li> |
737 | 737 | </ul>'; |
@@ -19,26 +19,28 @@ discard block |
||
19 | 19 | global $context, $settings, $scripturl, $txt, $modSettings; |
20 | 20 | |
21 | 21 | // Not allowed to edit? |
22 | - if (!$context['can_modify']) |
|
23 | - echo ' |
|
22 | + if (!$context['can_modify']) { |
|
23 | + echo ' |
|
24 | 24 | <div class="errorbox"> |
25 | 25 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
26 | 26 | </div>'; |
27 | + } |
|
27 | 28 | |
28 | 29 | echo ' |
29 | 30 | <div id="admin_form_wrapper"> |
30 | 31 | <form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">'; |
31 | 32 | |
32 | - if (!empty($context['profile'])) |
|
33 | - echo ' |
|
33 | + if (!empty($context['profile'])) { |
|
34 | + echo ' |
|
34 | 35 | <div class="cat_bar"> |
35 | 36 | <h3 class="catbg">', $txt['permissions_for_profile'], ': "', $context['profile']['name'], '"</h3> |
36 | 37 | </div>'; |
37 | - else |
|
38 | - echo ' |
|
38 | + } else { |
|
39 | + echo ' |
|
39 | 40 | <div class="cat_bar"> |
40 | 41 | <h3 class="catbg">', $txt['permissions_title'], '</h3> |
41 | 42 | </div>'; |
43 | + } |
|
42 | 44 | |
43 | 45 | echo ' |
44 | 46 | <table class="table_grid"> |
@@ -47,13 +49,14 @@ discard block |
||
47 | 49 | <th>', $txt['membergroups_name'], '</th> |
48 | 50 | <th class="small_table">', $txt['membergroups_members_top'], '</th>'; |
49 | 51 | |
50 | - if (empty($modSettings['permission_enable_deny'])) |
|
51 | - echo ' |
|
52 | + if (empty($modSettings['permission_enable_deny'])) { |
|
53 | + echo ' |
|
52 | 54 | <th class="small_table">', $txt['membergroups_permissions'], '</th>'; |
53 | - else |
|
54 | - echo ' |
|
55 | + } else { |
|
56 | + echo ' |
|
55 | 57 | <th class="small_table">', $txt['permissions_allowed'], '</th> |
56 | 58 | <th class="small_table">', $txt['permissions_denied'], '</th>'; |
59 | + } |
|
57 | 60 | |
58 | 61 | echo ' |
59 | 62 | <th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th> |
@@ -71,22 +74,24 @@ discard block |
||
71 | 74 | <td> |
72 | 75 | ', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', ' <span>', $group['name'], '</span>'; |
73 | 76 | |
74 | - if (!empty($group['children'])) |
|
75 | - echo ' |
|
77 | + if (!empty($group['children'])) { |
|
78 | + echo ' |
|
76 | 79 | <br> |
77 | 80 | <span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
81 | + } |
|
78 | 82 | |
79 | 83 | echo ' |
80 | 84 | </td> |
81 | 85 | <td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>'; |
82 | 86 | |
83 | - if (empty($modSettings['permission_enable_deny'])) |
|
84 | - echo ' |
|
87 | + if (empty($modSettings['permission_enable_deny'])) { |
|
88 | + echo ' |
|
85 | 89 | <td>', $group['num_permissions']['allowed'], '</td>'; |
86 | - else |
|
87 | - echo ' |
|
90 | + } else { |
|
91 | + echo ' |
|
88 | 92 | <td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '>', $group['num_permissions']['allowed'], '</td> |
89 | 93 | <td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>', $group['num_permissions']['denied'], '</td>'; |
94 | + } |
|
90 | 95 | |
91 | 96 | echo ' |
92 | 97 | <td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']). '</a>' : '', '</td> |
@@ -133,9 +138,10 @@ discard block |
||
133 | 138 | <option value="empty">(', $txt['permissions_select_membergroup'], ')</option>'; |
134 | 139 | foreach ($context['groups'] as $group) |
135 | 140 | { |
136 | - if ($group['id'] != 1) |
|
137 | - echo ' |
|
141 | + if ($group['id'] != 1) { |
|
142 | + echo ' |
|
138 | 143 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
144 | + } |
|
139 | 145 | } |
140 | 146 | |
141 | 147 | echo ' |
@@ -145,9 +151,10 @@ discard block |
||
145 | 151 | <select name="add_remove"> |
146 | 152 | <option value="add">', $txt['permissions_add'], '...</option> |
147 | 153 | <option value="clear">', $txt['permissions_remove'], '...</option>'; |
148 | - if (!empty($modSettings['permission_enable_deny'])) |
|
149 | - echo ' |
|
154 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
155 | + echo ' |
|
150 | 156 | <option value="deny">', $txt['permissions_deny'], '...</option>'; |
157 | + } |
|
151 | 158 | echo ' |
152 | 159 | </select> |
153 | 160 | </dt> |
@@ -156,30 +163,34 @@ discard block |
||
156 | 163 | <option value="">(', $txt['permissions_select_permission'], ')</option>'; |
157 | 164 | foreach ($context['permissions'] as $permissionType) |
158 | 165 | { |
159 | - if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) |
|
160 | - continue; |
|
166 | + if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) { |
|
167 | + continue; |
|
168 | + } |
|
161 | 169 | |
162 | 170 | foreach ($permissionType['columns'] as $column) |
163 | 171 | { |
164 | 172 | foreach ($column as $permissionGroup) |
165 | 173 | { |
166 | - if ($permissionGroup['hidden']) |
|
167 | - continue; |
|
174 | + if ($permissionGroup['hidden']) { |
|
175 | + continue; |
|
176 | + } |
|
168 | 177 | |
169 | 178 | echo ' |
170 | 179 | <option value="" disabled>[', $permissionGroup['name'], ']</option>'; |
171 | 180 | foreach ($permissionGroup['permissions'] as $perm) |
172 | 181 | { |
173 | - if ($perm['hidden']) |
|
174 | - continue; |
|
182 | + if ($perm['hidden']) { |
|
183 | + continue; |
|
184 | + } |
|
175 | 185 | |
176 | - if ($perm['has_own_any']) |
|
177 | - echo ' |
|
186 | + if ($perm['has_own_any']) { |
|
187 | + echo ' |
|
178 | 188 | <option value="', $permissionType['id'], '/', $perm['own']['id'], '"> ', $perm['name'], ' (', $perm['own']['name'], ')</option> |
179 | 189 | <option value="', $permissionType['id'], '/', $perm['any']['id'], '"> ', $perm['name'], ' (', $perm['any']['name'], ')</option>'; |
180 | - else |
|
181 | - echo ' |
|
190 | + } else { |
|
191 | + echo ' |
|
182 | 192 | <option value="', $permissionType['id'], '/', $perm['id'], '"> ', $perm['name'], '</option>'; |
193 | + } |
|
183 | 194 | } |
184 | 195 | } |
185 | 196 | } |
@@ -246,17 +257,18 @@ discard block |
||
246 | 257 | } |
247 | 258 | </script>'; |
248 | 259 | |
249 | - if (!empty($context['profile'])) |
|
250 | - echo ' |
|
260 | + if (!empty($context['profile'])) { |
|
261 | + echo ' |
|
251 | 262 | <input type="hidden" name="pid" value="', $context['profile']['id'], '">'; |
263 | + } |
|
252 | 264 | |
253 | 265 | echo ' |
254 | 266 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
255 | 267 | <input type="hidden" name="', $context['admin-mpq_token_var'], '" value="', $context['admin-mpq_token'], '">'; |
256 | - } |
|
257 | - else |
|
258 | - echo ' |
|
268 | + } else { |
|
269 | + echo ' |
|
259 | 270 | </table>'; |
271 | + } |
|
260 | 272 | |
261 | 273 | echo ' |
262 | 274 | </form> |
@@ -296,9 +308,10 @@ discard block |
||
296 | 308 | <h3 class="subbg">', $category['name'], '</h3> |
297 | 309 | </div>'; |
298 | 310 | |
299 | - if (!empty($category['boards'])) |
|
300 | - echo ' |
|
311 | + if (!empty($category['boards'])) { |
|
312 | + echo ' |
|
301 | 313 | <ul class="perm_boards flow_hidden">'; |
314 | + } |
|
302 | 315 | |
303 | 316 | foreach ($category['boards'] as $board) |
304 | 317 | { |
@@ -315,33 +328,36 @@ discard block |
||
315 | 328 | echo ' |
316 | 329 | <select name="boardprofile[', $board['id'], ']">'; |
317 | 330 | |
318 | - foreach ($context['profiles'] as $id => $profile) |
|
319 | - echo ' |
|
331 | + foreach ($context['profiles'] as $id => $profile) { |
|
332 | + echo ' |
|
320 | 333 | <option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
334 | + } |
|
321 | 335 | |
322 | 336 | echo ' |
323 | 337 | </select>'; |
324 | - } |
|
325 | - else |
|
326 | - echo ' |
|
338 | + } else { |
|
339 | + echo ' |
|
327 | 340 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>'; |
341 | + } |
|
328 | 342 | |
329 | 343 | echo ' |
330 | 344 | </span> |
331 | 345 | </li>'; |
332 | 346 | } |
333 | 347 | |
334 | - if (!empty($category['boards'])) |
|
335 | - echo ' |
|
348 | + if (!empty($category['boards'])) { |
|
349 | + echo ' |
|
336 | 350 | </ul>'; |
351 | + } |
|
337 | 352 | } |
338 | 353 | |
339 | - if ($context['edit_all']) |
|
340 | - echo ' |
|
354 | + if ($context['edit_all']) { |
|
355 | + echo ' |
|
341 | 356 | <input type="submit" name="save_changes" value="', $txt['save'], '" class="button_submit">'; |
342 | - else |
|
343 | - echo ' |
|
357 | + } else { |
|
358 | + echo ' |
|
344 | 359 | <a class="button_link" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>'; |
360 | + } |
|
345 | 361 | |
346 | 362 | echo ' |
347 | 363 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -381,12 +397,13 @@ discard block |
||
381 | 397 | <tr class="windowbg"> |
382 | 398 | <td>'; |
383 | 399 | |
384 | - if (!empty($context['show_rename_boxes']) && $profile['can_edit']) |
|
385 | - echo ' |
|
400 | + if (!empty($context['show_rename_boxes']) && $profile['can_edit']) { |
|
401 | + echo ' |
|
386 | 402 | <input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '" class="input_text">'; |
387 | - else |
|
388 | - echo ' |
|
403 | + } else { |
|
404 | + echo ' |
|
389 | 405 | <a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>'; |
406 | + } |
|
390 | 407 | |
391 | 408 | echo ' |
392 | 409 | </td> |
@@ -406,9 +423,10 @@ discard block |
||
406 | 423 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
407 | 424 | <input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">'; |
408 | 425 | |
409 | - if ($context['can_edit_something']) |
|
410 | - echo ' |
|
426 | + if ($context['can_edit_something']) { |
|
427 | + echo ' |
|
411 | 428 | <input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button_submit">'; |
429 | + } |
|
412 | 430 | |
413 | 431 | echo ' |
414 | 432 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button_submit" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '/> |
@@ -433,9 +451,10 @@ discard block |
||
433 | 451 | <dd> |
434 | 452 | <select name="copy_from">'; |
435 | 453 | |
436 | - foreach ($context['profiles'] as $id => $profile) |
|
437 | - echo ' |
|
454 | + foreach ($context['profiles'] as $id => $profile) { |
|
455 | + echo ' |
|
438 | 456 | <option value="', $id, '">', $profile['name'], '</option>'; |
457 | + } |
|
439 | 458 | |
440 | 459 | echo ' |
441 | 460 | </select> |
@@ -463,8 +482,7 @@ discard block |
||
463 | 482 | <div class="errorbox"> |
464 | 483 | ', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' |
465 | 484 | </div>'; |
466 | - } |
|
467 | - else |
|
485 | + } else |
|
468 | 486 | { |
469 | 487 | echo ' |
470 | 488 | <script> |
@@ -484,21 +502,23 @@ discard block |
||
484 | 502 | <div id="admincenter"> |
485 | 503 | <form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">'; |
486 | 504 | |
487 | - if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) |
|
488 | - echo ' |
|
505 | + if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) { |
|
506 | + echo ' |
|
489 | 507 | <div class="information"> |
490 | 508 | ', $txt['permissions_option_desc'], ' |
491 | 509 | </div>'; |
510 | + } |
|
492 | 511 | |
493 | 512 | echo ' |
494 | 513 | <div class="cat_bar"> |
495 | 514 | <h3 class="catbg">'; |
496 | - if ($context['permission_type'] == 'board') |
|
497 | - echo ' |
|
515 | + if ($context['permission_type'] == 'board') { |
|
516 | + echo ' |
|
498 | 517 | ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; |
499 | - else |
|
500 | - echo ' |
|
518 | + } else { |
|
519 | + echo ' |
|
501 | 520 | ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; |
521 | + } |
|
502 | 522 | echo ' |
503 | 523 | </h3> |
504 | 524 | </div>'; |
@@ -521,15 +541,17 @@ discard block |
||
521 | 541 | template_modify_group_display('board'); |
522 | 542 | } |
523 | 543 | |
524 | - if ($context['profile']['can_modify']) |
|
525 | - echo ' |
|
544 | + if ($context['profile']['can_modify']) { |
|
545 | + echo ' |
|
526 | 546 | <div class="padding"> |
527 | 547 | <input type="submit" value="', $txt['permissions_commit'], '" class="button_submit"> |
528 | 548 | </div>'; |
549 | + } |
|
529 | 550 | |
530 | - foreach ($context['hidden_perms'] as $hidden_perm) |
|
531 | - echo ' |
|
551 | + foreach ($context['hidden_perms'] as $hidden_perm) { |
|
552 | + echo ' |
|
532 | 553 | <input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">'; |
554 | + } |
|
533 | 555 | |
534 | 556 | echo ' |
535 | 557 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -557,17 +579,19 @@ discard block |
||
557 | 579 | |
558 | 580 | foreach ($column as $permissionGroup) |
559 | 581 | { |
560 | - if (empty($permissionGroup['permissions'])) |
|
561 | - continue; |
|
582 | + if (empty($permissionGroup['permissions'])) { |
|
583 | + continue; |
|
584 | + } |
|
562 | 585 | |
563 | 586 | // Are we likely to have something in this group to display or is it all hidden? |
564 | 587 | $has_display_content = false; |
565 | 588 | if (!$permissionGroup['hidden']) |
566 | 589 | { |
567 | 590 | // Before we go any further check we are going to have some data to print otherwise we just have a silly heading. |
568 | - foreach ($permissionGroup['permissions'] as $permission) |
|
569 | - if (!$permission['hidden']) |
|
591 | + foreach ($permissionGroup['permissions'] as $permission) { |
|
592 | + if (!$permission['hidden']) |
|
570 | 593 | $has_display_content = true; |
594 | + } |
|
571 | 595 | |
572 | 596 | if ($has_display_content) |
573 | 597 | { |
@@ -576,10 +600,11 @@ discard block |
||
576 | 600 | <th></th> |
577 | 601 | <th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>'; |
578 | 602 | |
579 | - if ($context['group']['id'] != -1) |
|
580 | - echo ' |
|
603 | + if ($context['group']['id'] != -1) { |
|
604 | + echo ' |
|
581 | 605 | <th>', $txt['permissions_option_own'], '</th> |
582 | 606 | <th>', $txt['permissions_option_any'], '</th>'; |
607 | + } |
|
583 | 608 | |
584 | 609 | echo ' |
585 | 610 | </tr>'; |
@@ -602,17 +627,18 @@ discard block |
||
602 | 627 | // Guests can't do their own thing. |
603 | 628 | if ($context['group']['id'] != -1) |
604 | 629 | { |
605 | - if (empty($modSettings['permission_enable_deny'])) |
|
606 | - echo ' |
|
630 | + if (empty($modSettings['permission_enable_deny'])) { |
|
631 | + echo ' |
|
607 | 632 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" class="input_check" ', $disable_field, '/>'; |
608 | - else |
|
633 | + } else |
|
609 | 634 | { |
610 | 635 | echo ' |
611 | 636 | <select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>'; |
612 | 637 | |
613 | - foreach (array('on', 'off', 'deny') as $c) |
|
614 | - echo ' |
|
638 | + foreach (array('on', 'off', 'deny') as $c) { |
|
639 | + echo ' |
|
615 | 640 | <option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
641 | + } |
|
616 | 642 | echo ' |
617 | 643 | </select>'; |
618 | 644 | } |
@@ -622,39 +648,41 @@ discard block |
||
622 | 648 | <td>'; |
623 | 649 | } |
624 | 650 | |
625 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
626 | - echo ' |
|
651 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
652 | + echo ' |
|
627 | 653 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>'; |
628 | - else |
|
654 | + } else |
|
629 | 655 | { |
630 | 656 | echo ' |
631 | 657 | <select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>'; |
632 | 658 | |
633 | - foreach (array('on', 'off', 'deny') as $c) |
|
634 | - echo ' |
|
659 | + foreach (array('on', 'off', 'deny') as $c) { |
|
660 | + echo ' |
|
635 | 661 | <option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
662 | + } |
|
636 | 663 | echo ' |
637 | 664 | </select>'; |
638 | 665 | } |
639 | - } |
|
640 | - else |
|
666 | + } else |
|
641 | 667 | { |
642 | - if ($context['group']['id'] != -1) |
|
643 | - echo ' |
|
668 | + if ($context['group']['id'] != -1) { |
|
669 | + echo ' |
|
644 | 670 | </td> |
645 | 671 | <td>'; |
672 | + } |
|
646 | 673 | |
647 | - if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) |
|
648 | - echo ' |
|
674 | + if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) { |
|
675 | + echo ' |
|
649 | 676 | <input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>'; |
650 | - else |
|
677 | + } else |
|
651 | 678 | { |
652 | 679 | echo ' |
653 | 680 | <select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>'; |
654 | 681 | |
655 | - foreach (array('on', 'off', 'deny') as $c) |
|
656 | - echo ' |
|
682 | + foreach (array('on', 'off', 'deny') as $c) { |
|
683 | + echo ' |
|
657 | 684 | <option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>'; |
685 | + } |
|
658 | 686 | echo ' |
659 | 687 | </select>'; |
660 | 688 | } |
@@ -684,11 +712,11 @@ discard block |
||
684 | 712 | echo ' |
685 | 713 | <fieldset id="', $context['current_permission'], '"> |
686 | 714 | <legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>'; |
687 | - if (empty($modSettings['permission_enable_deny'])) |
|
688 | - echo ' |
|
715 | + if (empty($modSettings['permission_enable_deny'])) { |
|
716 | + echo ' |
|
689 | 717 | <ul>'; |
690 | - else |
|
691 | - echo ' |
|
718 | + } else { |
|
719 | + echo ' |
|
692 | 720 | <div class="information">', $txt['permissions_option_desc'], '</div> |
693 | 721 | <dl class="settings"> |
694 | 722 | <dt> |
@@ -698,46 +726,51 @@ discard block |
||
698 | 726 | </dt> |
699 | 727 | <dd> |
700 | 728 | </dd>'; |
729 | + } |
|
701 | 730 | foreach ($context['member_groups'] as $group) |
702 | 731 | { |
703 | - if (!empty($modSettings['permission_enable_deny'])) |
|
704 | - echo ' |
|
732 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
733 | + echo ' |
|
705 | 734 | <dt>'; |
706 | - else |
|
707 | - echo ' |
|
735 | + } else { |
|
736 | + echo ' |
|
708 | 737 | <li>'; |
738 | + } |
|
709 | 739 | |
710 | - if (empty($modSettings['permission_enable_deny'])) |
|
711 | - echo ' |
|
740 | + if (empty($modSettings['permission_enable_deny'])) { |
|
741 | + echo ' |
|
712 | 742 | <input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_check">'; |
713 | - else |
|
714 | - echo ' |
|
743 | + } else { |
|
744 | + echo ' |
|
715 | 745 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_radio"></span> |
716 | 746 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', ' class="input_radio"></span> |
717 | 747 | <span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', ' class="input_radio"></span>'; |
748 | + } |
|
718 | 749 | |
719 | - if (!empty($modSettings['permission_enable_deny'])) |
|
720 | - echo ' |
|
750 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
751 | + echo ' |
|
721 | 752 | </dt> |
722 | 753 | <dd> |
723 | 754 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
724 | 755 | </dd>'; |
725 | - else |
|
726 | - echo ' |
|
756 | + } else { |
|
757 | + echo ' |
|
727 | 758 | <span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span> |
728 | 759 | </li>'; |
760 | + } |
|
729 | 761 | } |
730 | 762 | |
731 | - if (empty($modSettings['permission_enable_deny'])) |
|
732 | - echo ' |
|
763 | + if (empty($modSettings['permission_enable_deny'])) { |
|
764 | + echo ' |
|
733 | 765 | <li> |
734 | 766 | <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission']. '[\');"> |
735 | 767 | <span>', $txt['check_all'], '</span> |
736 | 768 | </li> |
737 | 769 | </ul>'; |
738 | - else |
|
739 | - echo ' |
|
770 | + } else { |
|
771 | + echo ' |
|
740 | 772 | </dl>'; |
773 | + } |
|
741 | 774 | |
742 | 775 | echo ' |
743 | 776 | </fieldset> |
@@ -777,9 +810,10 @@ discard block |
||
777 | 810 | if (!empty($modSettings['postmod_active'])) |
778 | 811 | { |
779 | 812 | // Got advanced permissions - if so warn! |
780 | - if (!empty($modSettings['permission_enable_deny'])) |
|
781 | - echo ' |
|
813 | + if (!empty($modSettings['permission_enable_deny'])) { |
|
814 | + echo ' |
|
782 | 815 | <div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>'; |
816 | + } |
|
783 | 817 | |
784 | 818 | echo ' |
785 | 819 | <div class="padding"> |
@@ -794,10 +828,11 @@ discard block |
||
794 | 828 | ', $txt['permissions_post_moderation_select'], ': |
795 | 829 | <select name="pid" onchange="document.forms.postmodForm.submit();">'; |
796 | 830 | |
797 | - foreach ($context['profiles'] as $profile) |
|
798 | - if ($profile['can_modify']) |
|
831 | + foreach ($context['profiles'] as $profile) { |
|
832 | + if ($profile['can_modify']) |
|
799 | 833 | echo ' |
800 | 834 | <option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
835 | + } |
|
801 | 836 | |
802 | 837 | echo ' |
803 | 838 | </select> |
@@ -818,11 +853,12 @@ discard block |
||
818 | 853 | ', $txt['permissions_post_moderation_replies_any'], ' |
819 | 854 | </th>'; |
820 | 855 | |
821 | - if ($modSettings['attachmentEnable'] == 1) |
|
822 | - echo ' |
|
856 | + if ($modSettings['attachmentEnable'] == 1) { |
|
857 | + echo ' |
|
823 | 858 | <th class="centercol" colspan="3"> |
824 | 859 | ', $txt['permissions_post_moderation_attachments'], ' |
825 | 860 | </th>'; |
861 | + } |
|
826 | 862 | |
827 | 863 | echo ' |
828 | 864 | </tr> |
@@ -840,11 +876,12 @@ discard block |
||
840 | 876 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
841 | 877 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
842 | 878 | |
843 | - if ($modSettings['attachmentEnable'] == 1) |
|
844 | - echo ' |
|
879 | + if ($modSettings['attachmentEnable'] == 1) { |
|
880 | + echo ' |
|
845 | 881 | <th><span class="generic_icons post_moderation_allow"></span></th> |
846 | 882 | <th><span class="generic_icons post_moderation_moderate"></span></th> |
847 | 883 | <th><span class="generic_icons post_moderation_deny"></span></th>'; |
884 | + } |
|
848 | 885 | |
849 | 886 | echo ' |
850 | 887 | </tr> |
@@ -857,9 +894,10 @@ discard block |
||
857 | 894 | <tr class="windowbg"> |
858 | 895 | <td class="half_table"> |
859 | 896 | <span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>'; |
860 | - if (!empty($group['children'])) |
|
861 | - echo ' |
|
897 | + if (!empty($group['children'])) { |
|
898 | + echo ' |
|
862 | 899 | <br><span class="smalltext">', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"</span>'; |
900 | + } |
|
863 | 901 | |
864 | 902 | echo ' |
865 | 903 | </td> |
@@ -872,8 +910,7 @@ discard block |
||
872 | 910 | { |
873 | 911 | echo ' |
874 | 912 | <td colspan="3"></td>'; |
875 | - } |
|
876 | - else |
|
913 | + } else |
|
877 | 914 | { |
878 | 915 | echo ' |
879 | 916 | <td class="centercol"><input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', ' class="input_radio"></td> |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | <h3 class="catbg">', $context['page_title'], '</h3> |
47 | 47 | </div>'; |
48 | 48 | |
49 | - if (!empty($context['poll_error']['messages'])) |
|
50 | - echo ' |
|
49 | + if (!empty($context['poll_error']['messages'])) { |
|
50 | + echo ' |
|
51 | 51 | <div class="errorbox"> |
52 | 52 | <dl class="poll_error"> |
53 | 53 | <dt> |
@@ -58,6 +58,7 @@ discard block |
||
58 | 58 | </dt> |
59 | 59 | </dl> |
60 | 60 | </div>'; |
61 | + } |
|
61 | 62 | |
62 | 63 | echo ' |
63 | 64 | <div> |
@@ -79,8 +80,9 @@ discard block |
||
79 | 80 | <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" class="input_text" size="80" maxlength="255">'; |
80 | 81 | |
81 | 82 | // Does this option have a vote count yet, or is it new? |
82 | - if ($choice['votes'] != -1) |
|
83 | - echo ' (', $choice['votes'], ' ', $txt['votes'], ')'; |
|
83 | + if ($choice['votes'] != -1) { |
|
84 | + echo ' (', $choice['votes'], ' ', $txt['votes'], ')'; |
|
85 | + } |
|
84 | 86 | |
85 | 87 | echo ' |
86 | 88 | </dd>'; |
@@ -118,14 +120,15 @@ discard block |
||
118 | 120 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check"> |
119 | 121 | </dd>'; |
120 | 122 | |
121 | - if ($context['poll']['guest_vote_allowed']) |
|
122 | - echo ' |
|
123 | + if ($context['poll']['guest_vote_allowed']) { |
|
124 | + echo ' |
|
123 | 125 | <dt> |
124 | 126 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
125 | 127 | </dt> |
126 | 128 | <dd> |
127 | 129 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', ' class="input_check"> |
128 | 130 | </dd>'; |
131 | + } |
|
129 | 132 | } |
130 | 133 | |
131 | 134 | echo ' |
@@ -140,12 +143,13 @@ discard block |
||
140 | 143 | </dl> |
141 | 144 | </fieldset>'; |
142 | 145 | // If this is an edit, we can allow them to reset the vote counts. |
143 | - if ($context['is_edit']) |
|
144 | - echo ' |
|
146 | + if ($context['is_edit']) { |
|
147 | + echo ' |
|
145 | 148 | <fieldset id="poll_reset"> |
146 | 149 | <legend>', $txt['reset_votes'], '</legend> |
147 | 150 | <input type="checkbox" name="resetVoteCount" value="on" class="input_check"> ' . $txt['reset_votes_check'] . ' |
148 | 151 | </fieldset>'; |
152 | + } |
|
149 | 153 | echo ' |
150 | 154 | <input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit"> |
151 | 155 | </div> |
@@ -145,11 +145,12 @@ discard block |
||
145 | 145 | <div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>'; |
146 | 146 | |
147 | 147 | $options = 1; |
148 | - foreach ($context['poll']['options'] as $option) |
|
149 | - echo ' |
|
148 | + foreach ($context['poll']['options'] as $option) { |
|
149 | + echo ' |
|
150 | 150 | <div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong> |
151 | 151 | ', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', ' |
152 | 152 | </div>'; |
153 | + } |
|
153 | 154 | |
154 | 155 | echo ' |
155 | 156 | </div>'; |
@@ -171,9 +172,10 @@ discard block |
||
171 | 172 | echo ' |
172 | 173 | <hr>'; |
173 | 174 | |
174 | - foreach ($context['printattach'][$post['id_msg']] as $attach) |
|
175 | - echo ' |
|
175 | + foreach ($context['printattach'][$post['id_msg']] as $attach) { |
|
176 | + echo ' |
|
176 | 177 | <img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">'; |
178 | + } |
|
177 | 179 | } |
178 | 180 | |
179 | 181 | echo ' |
@@ -213,11 +215,12 @@ discard block |
||
213 | 215 | <div class="print_options">'; |
214 | 216 | |
215 | 217 | // which option is set, text or text&images |
216 | - if (isset($_REQUEST['images'])) |
|
217 | - echo ' |
|
218 | + if (isset($_REQUEST['images'])) { |
|
219 | + echo ' |
|
218 | 220 | <a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>'; |
219 | - else |
|
220 | - echo ' |
|
221 | + } else { |
|
222 | + echo ' |
|
221 | 223 | <strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>'; |
222 | -} |
|
224 | + } |
|
225 | + } |
|
223 | 226 | ?> |
224 | 227 | \ No newline at end of file |