@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | <div id="recent" class="main_section"> |
22 | 22 | <div class="cat_bar"> |
23 | 23 | <h3 class="catbg"> |
24 | - <span class="xx"></span>',$txt['recent_posts'],' |
|
24 | + <span class="xx"></span>',$txt['recent_posts'], ' |
|
25 | 25 | </h3> |
26 | 26 | </div> |
27 | 27 | <div class="pagesection">', $context['page_index'], '</div>'; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | foreach ($context['posts'] as $post) |
36 | 36 | { |
37 | 37 | echo ' |
38 | - <div class="', $post['css_class'] ,'"> |
|
38 | + <div class="', $post['css_class'], '"> |
|
39 | 39 | <div class="counter">', $post['counter'], '</div> |
40 | 40 | <div class="topic_details"> |
41 | 41 | <h5>', $post['board']['link'], ' / ', $post['link'], '</h5> |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // How about... even... remove it entirely?! |
61 | 61 | if ($post['can_delete']) |
62 | 62 | echo ' |
63 | - <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>'; |
|
63 | + <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>'; |
|
64 | 64 | |
65 | 65 | if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
66 | 66 | echo ' |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | <div class="', $topic['css_class'], '"> |
275 | 275 | <div class="board_icon"> |
276 | 276 | <img src="', $topic['first_post']['icon_url'], '" alt=""> |
277 | - ', $topic['is_posted_in'] ? '<img class="posted" src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="">' : '',' |
|
277 | + ', $topic['is_posted_in'] ? '<img class="posted" src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="">' : '', ' |
|
278 | 278 | </div> |
279 | 279 | <div class="info">'; |
280 | 280 |
@@ -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 |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | { |
326 | 326 | echo ' |
327 | 327 | <div class="infobox"> |
328 | - ', $txt['report_action_'. $context['report_post_action']], ' |
|
328 | + ', $txt['report_action_' . $context['report_post_action']], ' |
|
329 | 329 | </div>'; |
330 | 330 | } |
331 | 331 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | // Cycle through the notes. |
347 | 347 | foreach ($context['notes'] as $note) |
348 | 348 | echo ' |
349 | - <li class="smalltext">', ($note['can_delete'] ? '<a href="'. $note['delete_href'] .';'. $context['mod-modnote-del_token_var'] .'='. $context['mod-modnote-del_token'] .'" data-confirm="'. $txt['mc_reportedp_delete_confirm'] .'" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'] ,' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>'; |
|
349 | + <li class="smalltext">', ($note['can_delete'] ? '<a href="' . $note['delete_href'] . ';' . $context['mod-modnote-del_token_var'] . '=' . $context['mod-modnote-del_token'] . '" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'], ' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>'; |
|
350 | 350 | |
351 | 351 | echo ' |
352 | 352 | </ul> |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | |
480 | 480 | if ($post['can_delete']) |
481 | 481 | $output_html .= ' |
482 | - <a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="'. $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a> |
|
482 | + <a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="' . $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a> |
|
483 | 483 | <input type="checkbox" name="delete[]" value="' . $post['id'] . '" class="input_check">'; |
484 | 484 | |
485 | 485 | $output_html .= ' |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | <head> |
547 | 547 | <meta charset="', $context['character_set'], '"> |
548 | 548 | <title>', $context['page_title'], '</title> |
549 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
549 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
550 | 550 | </head> |
551 | 551 | <body> |
552 | 552 | <div class="cat_bar"> |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | <div class="errorbox"', empty($context['warning_errors']) ? ' style="display: none"' : '', ' id="errors"> |
591 | 591 | <dl> |
592 | 592 | <dt> |
593 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
593 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
594 | 594 | </dt> |
595 | 595 | <dd class="error" id="error_list"> |
596 | 596 | ', empty($context['warning_errors']) ? '' : implode('<br>', $context['warning_errors']), ' |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | <div id="box_preview"', !empty($context['template_preview']) ? '' : ' style="display:none"', '> |
601 | 601 | <dl class="settings"> |
602 | 602 | <dt> |
603 | - <strong>', $txt['preview'] , '</strong> |
|
603 | + <strong>', $txt['preview'], '</strong> |
|
604 | 604 | </dt> |
605 | 605 | <dd id="template_preview"> |
606 | 606 | ', !empty($context['template_preview']) ? $context['template_preview'] : '', ' |
@@ -55,18 +55,20 @@ discard block |
||
55 | 55 | <div class="modbox"> |
56 | 56 | <ul>'; |
57 | 57 | |
58 | - foreach ($context['group_requests'] as $request) |
|
59 | - echo ' |
|
58 | + foreach ($context['group_requests'] as $request) { |
|
59 | + echo ' |
|
60 | 60 | <li class="smalltext"> |
61 | 61 | <a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], ' |
62 | 62 | </li>'; |
63 | + } |
|
63 | 64 | |
64 | 65 | // Don't have any watched users right now? |
65 | - if (empty($context['group_requests'])) |
|
66 | - echo ' |
|
66 | + if (empty($context['group_requests'])) { |
|
67 | + echo ' |
|
67 | 68 | <li> |
68 | 69 | <strong class="smalltext">', $txt['mc_group_requests_none'], '</strong> |
69 | 70 | </li>'; |
71 | + } |
|
70 | 72 | |
71 | 73 | echo ' |
72 | 74 | </ul> |
@@ -124,18 +126,20 @@ discard block |
||
124 | 126 | <div class="modbox"> |
125 | 127 | <ul>'; |
126 | 128 | |
127 | - foreach ($context['watched_users'] as $user) |
|
128 | - echo ' |
|
129 | + foreach ($context['watched_users'] as $user) { |
|
130 | + echo ' |
|
129 | 131 | <li> |
130 | 132 | <span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span> |
131 | 133 | </li>'; |
134 | + } |
|
132 | 135 | |
133 | 136 | // Don't have any watched users right now? |
134 | - if (empty($context['watched_users'])) |
|
135 | - echo ' |
|
137 | + if (empty($context['watched_users'])) { |
|
138 | + echo ' |
|
136 | 139 | <li> |
137 | 140 | <strong class="smalltext">', $txt['mc_watched_users_none'], '</strong> |
138 | 141 | </li>'; |
142 | + } |
|
139 | 143 | |
140 | 144 | echo ' |
141 | 145 | </ul> |
@@ -193,18 +197,20 @@ discard block |
||
193 | 197 | <div class="modbox"> |
194 | 198 | <ul>'; |
195 | 199 | |
196 | - foreach ($context['reported_posts'] as $post) |
|
197 | - echo ' |
|
200 | + foreach ($context['reported_posts'] as $post) { |
|
201 | + echo ' |
|
198 | 202 | <li> |
199 | 203 | <span class="smalltext">', sprintf($txt['mc_post_report'], $post['report_link'], $post['author']['link']), '</span> |
200 | 204 | </li>'; |
205 | + } |
|
201 | 206 | |
202 | 207 | // Don't have any watched users right now? |
203 | - if (empty($context['reported_posts'])) |
|
204 | - echo ' |
|
208 | + if (empty($context['reported_posts'])) { |
|
209 | + echo ' |
|
205 | 210 | <li> |
206 | 211 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
207 | 212 | </li>'; |
213 | + } |
|
208 | 214 | |
209 | 215 | echo ' |
210 | 216 | </ul> |
@@ -262,18 +268,20 @@ discard block |
||
262 | 268 | <div class="modbox"> |
263 | 269 | <ul>'; |
264 | 270 | |
265 | - foreach ($context['reported_users'] as $user) |
|
266 | - echo ' |
|
271 | + foreach ($context['reported_users'] as $user) { |
|
272 | + echo ' |
|
267 | 273 | <li> |
268 | 274 | <span class="smalltext">', $user['user']['link'], '</span> |
269 | 275 | </li>'; |
276 | + } |
|
270 | 277 | |
271 | 278 | // Don't have any watched users right now? |
272 | - if (empty($context['reported_users'])) |
|
273 | - echo ' |
|
279 | + if (empty($context['reported_users'])) { |
|
280 | + echo ' |
|
274 | 281 | <li> |
275 | 282 | <strong class="smalltext">', $txt['mc_reported_users_none'], '</strong> |
276 | 283 | </li>'; |
284 | + } |
|
277 | 285 | |
278 | 286 | echo ' |
279 | 287 | </ul> |
@@ -344,9 +352,10 @@ discard block |
||
344 | 352 | <ul class="moderation_notes">'; |
345 | 353 | |
346 | 354 | // Cycle through the notes. |
347 | - foreach ($context['notes'] as $note) |
|
348 | - echo ' |
|
355 | + foreach ($context['notes'] as $note) { |
|
356 | + echo ' |
|
349 | 357 | <li class="smalltext">', ($note['can_delete'] ? '<a href="'. $note['delete_href'] .';'. $context['mod-modnote-del_token_var'] .'='. $context['mod-modnote-del_token'] .'" data-confirm="'. $txt['mc_reportedp_delete_confirm'] .'" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'] ,' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>'; |
358 | + } |
|
350 | 359 | |
351 | 360 | echo ' |
352 | 361 | </ul> |
@@ -388,16 +397,17 @@ discard block |
||
388 | 397 | $remove_button = create_button('delete', 'remove_message', 'remove'); |
389 | 398 | |
390 | 399 | // No posts? |
391 | - if (empty($context['unapproved_items'])) |
|
392 | - echo ' |
|
400 | + if (empty($context['unapproved_items'])) { |
|
401 | + echo ' |
|
393 | 402 | <div class="windowbg2"> |
394 | 403 | <p class="centertext">', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '</p> |
395 | 404 | </div>'; |
396 | - else |
|
397 | - echo ' |
|
405 | + } else { |
|
406 | + echo ' |
|
398 | 407 | <div class="pagesection floatleft"> |
399 | 408 | ', $context['page_index'], ' |
400 | 409 | </div>'; |
410 | + } |
|
401 | 411 | |
402 | 412 | foreach ($context['unapproved_items'] as $item) |
403 | 413 | { |
@@ -414,14 +424,16 @@ discard block |
||
414 | 424 | <span class="floatright"> |
415 | 425 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';approve=', $item['id'], '">', $approve_button, '</a>'; |
416 | 426 | |
417 | - if ($item['can_delete']) |
|
418 | - echo ' |
|
427 | + if ($item['can_delete']) { |
|
428 | + echo ' |
|
419 | 429 | ', $context['menu_separator'], ' |
420 | 430 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';delete=', $item['id'], '">', $remove_button, '</a>'; |
431 | + } |
|
421 | 432 | |
422 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
423 | - echo ' |
|
433 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
434 | + echo ' |
|
424 | 435 | <input type="checkbox" name="item[]" value="', $item['id'], '" checked class="input_check"> '; |
436 | + } |
|
425 | 437 | |
426 | 438 | echo ' |
427 | 439 | </span> |
@@ -431,8 +443,8 @@ discard block |
||
431 | 443 | echo ' |
432 | 444 | <div class="pagesection">'; |
433 | 445 | |
434 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
435 | - echo ' |
|
446 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
447 | + echo ' |
|
436 | 448 | <div class="floatright"> |
437 | 449 | <select name="do" onchange="if (this.value != 0 && confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();"> |
438 | 450 | <option value="0">', $txt['with_selected'], ':</option> |
@@ -442,12 +454,14 @@ discard block |
||
442 | 454 | </select> |
443 | 455 | <noscript><input type="submit" name="mc_go" value="', $txt['go'], '" class="button_submit"></noscript> |
444 | 456 | </div>'; |
457 | + } |
|
445 | 458 | |
446 | - if (!empty($context['unapproved_items'])) |
|
447 | - echo ' |
|
459 | + if (!empty($context['unapproved_items'])) { |
|
460 | + echo ' |
|
448 | 461 | <div class="floatleft"> |
449 | 462 | <div class="pagelinks">', $context['page_index'], '</div> |
450 | 463 | </div>'; |
464 | + } |
|
451 | 465 | |
452 | 466 | echo ' |
453 | 467 | </div> |
@@ -467,8 +481,9 @@ discard block |
||
467 | 481 | global $scripturl, $context, $txt, $delete_button; |
468 | 482 | |
469 | 483 | // We'll have a delete please bob. |
470 | - if (empty($delete_button)) |
|
471 | - $delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"'); |
|
484 | + if (empty($delete_button)) { |
|
485 | + $delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"'); |
|
486 | + } |
|
472 | 487 | |
473 | 488 | $output_html = ' |
474 | 489 | <div> |
@@ -477,10 +492,11 @@ discard block |
||
477 | 492 | </div> |
478 | 493 | <div class="floatright">'; |
479 | 494 | |
480 | - if ($post['can_delete']) |
|
481 | - $output_html .= ' |
|
495 | + if ($post['can_delete']) { |
|
496 | + $output_html .= ' |
|
482 | 497 | <a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="'. $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a> |
483 | 498 | <input type="checkbox" name="delete[]" value="' . $post['id'] . '" class="input_check">'; |
499 | + } |
|
484 | 500 | |
485 | 501 | $output_html .= ' |
486 | 502 | </div> |
@@ -522,12 +538,12 @@ discard block |
||
522 | 538 | <input type="submit" name="save" value="', $txt['save'], '" class="button_submit"> |
523 | 539 | </div> |
524 | 540 | </form>'; |
525 | - } |
|
526 | - else |
|
527 | - echo ' |
|
541 | + } else { |
|
542 | + echo ' |
|
528 | 543 | <div class="windowbg"> |
529 | 544 | <div class="centertext">', $txt['mc_no_settings'], '</div> |
530 | 545 | </div>'; |
546 | + } |
|
531 | 547 | |
532 | 548 | echo ' |
533 | 549 | </div>'; |
@@ -623,8 +639,8 @@ discard block |
||
623 | 639 | </dd> |
624 | 640 | </dl>'; |
625 | 641 | |
626 | - if ($context['template_data']['can_edit_personal']) |
|
627 | - echo ' |
|
642 | + if ($context['template_data']['can_edit_personal']) { |
|
643 | + echo ' |
|
628 | 644 | <input type="checkbox" name="make_personal" id="make_personal"', $context['template_data']['personal'] ? ' checked' : '', ' class="input_check"> |
629 | 645 | <label for="make_personal"> |
630 | 646 | <strong>', $txt['mc_warning_template_personal'], '</strong> |
@@ -632,6 +648,7 @@ discard block |
||
632 | 648 | <br> |
633 | 649 | <span class="smalltext">', $txt['mc_warning_template_personal_desc'], '</span> |
634 | 650 | <br>'; |
651 | + } |
|
635 | 652 | |
636 | 653 | echo ' |
637 | 654 | <hr> |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | foreach ($context['posting_fields'] as $pf) |
140 | 140 | echo ' |
141 | 141 | <dt> |
142 | - ', $pf['dt'] ,' |
|
142 | + ', $pf['dt'], ' |
|
143 | 143 | </dt> |
144 | 144 | <dd> |
145 | - ', $pf['dd'] ,' |
|
145 | + ', $pf['dd'], ' |
|
146 | 146 | </dd>'; |
147 | 147 | |
148 | 148 | |
@@ -459,13 +459,13 @@ discard block |
||
459 | 459 | <p class="message" data-dz-message></p> |
460 | 460 | <p class="attached_BBC"> |
461 | 461 | <input type="text" name="attachBBC" value="" readonly> |
462 | - <a class="button_submit insertBBC">', $txt['attached_insertBBC'] ,'</a> |
|
462 | + <a class="button_submit insertBBC">', $txt['attached_insertBBC'], '</a> |
|
463 | 463 | </p> |
464 | 464 | <p class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></p> |
465 | 465 | </div> |
466 | 466 | <div class="attach-ui"> |
467 | - <a data-dz-remove class="button_submit delete">', $txt['modify_cancel'] ,'</a> |
|
468 | - <a class="button_submit start">', $txt['upload'] ,'</a> |
|
467 | + <a data-dz-remove class="button_submit delete">', $txt['modify_cancel'], '</a> |
|
468 | + <a class="button_submit start">', $txt['upload'], '</a> |
|
469 | 469 | </div> |
470 | 470 | </div> |
471 | 471 | </div> |
@@ -482,10 +482,10 @@ discard block |
||
482 | 482 | </dt> |
483 | 483 | <dd class="smalltext fallback"> |
484 | 484 | <div id="attachUpload" class="descbox"> |
485 | - <h5>', $txt['attach_drop_zone'] ,'</h5> |
|
486 | - <a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a> |
|
487 | - <a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a> |
|
488 | - <a class="button_submit fileinput-button">', $txt['attach_add'] ,'</a> |
|
485 | + <h5>', $txt['attach_drop_zone'], '</h5> |
|
486 | + <a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a> |
|
487 | + <a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a> |
|
488 | + <a class="button_submit fileinput-button">', $txt['attach_add'], '</a> |
|
489 | 489 | <div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
490 | 490 | <div class="fallback"> |
491 | 491 | <input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="input_file fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | // Option to delete an event if user is editing one. |
593 | 593 | if ($context['make_event'] && !$context['event']['new']) |
594 | 594 | echo ' |
595 | - <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">'; |
|
595 | + <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button_submit you_sure">'; |
|
596 | 596 | |
597 | 597 | echo ' |
598 | 598 | </span> |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | });'; |
847 | 847 | |
848 | 848 | echo ' |
849 | - var oEditorID = "', $context['post_box_name'] ,'"; |
|
849 | + var oEditorID = "', $context['post_box_name'], '"; |
|
850 | 850 | var oEditorObject = oEditorHandle_', $context['post_box_name'], '; |
851 | 851 | </script>'; |
852 | 852 | |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | { |
879 | 879 | echo ' |
880 | 880 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
881 | - <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li> |
|
881 | + <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li> |
|
882 | 882 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
883 | 883 | </ul>'; |
884 | 884 | } |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | <head> |
966 | 966 | <meta charset="', $context['character_set'], '"> |
967 | 967 | <title>', $txt['spell_check'], '</title> |
968 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
968 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
969 | 969 | <style> |
970 | 970 | body, td |
971 | 971 | { |
@@ -998,8 +998,8 @@ discard block |
||
998 | 998 | var spell_formname = window.opener.spell_formname; |
999 | 999 | var spell_fieldname = window.opener.spell_fieldname; |
1000 | 1000 | </script> |
1001 | - <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script> |
|
1002 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
1001 | + <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script> |
|
1002 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
1003 | 1003 | <script> |
1004 | 1004 | ', $context['spell_js'], ' |
1005 | 1005 | </script> |
@@ -1041,7 +1041,7 @@ discard block |
||
1041 | 1041 | <head> |
1042 | 1042 | <meta charset="', $context['character_set'], '"> |
1043 | 1043 | <title>', $txt['retrieving_quote'], '</title> |
1044 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
1044 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
1045 | 1045 | </head> |
1046 | 1046 | <body> |
1047 | 1047 | ', $txt['retrieving_quote'], ' |
@@ -22,22 +22,24 @@ discard block |
||
22 | 22 | <script>'; |
23 | 23 | |
24 | 24 | // When using Go Back due to fatal_error, allow the form to be re-submitted with changes. |
25 | - if (isBrowser('is_firefox')) |
|
26 | - echo ' |
|
25 | + if (isBrowser('is_firefox')) { |
|
26 | + echo ' |
|
27 | 27 | window.addEventListener("pageshow", reActivate, false);'; |
28 | + } |
|
28 | 29 | |
29 | 30 | // Start with message icons - and any missing from this theme. |
30 | 31 | echo ' |
31 | 32 | var icon_urls = {'; |
32 | - foreach ($context['icons'] as $icon) |
|
33 | - echo ' |
|
33 | + foreach ($context['icons'] as $icon) { |
|
34 | + echo ' |
|
34 | 35 | \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; |
36 | + } |
|
35 | 37 | echo ' |
36 | 38 | };'; |
37 | 39 | |
38 | 40 | // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. |
39 | - if ($context['make_poll']) |
|
40 | - echo ' |
|
41 | + if ($context['make_poll']) { |
|
42 | + echo ' |
|
41 | 43 | var pollOptionNum = 0, pollTabIndex; |
42 | 44 | var pollOptionId = ', $context['last_choice_id'], '; |
43 | 45 | function addPollOption() |
@@ -56,11 +58,13 @@ discard block |
||
56 | 58 | |
57 | 59 | setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('" class="input_text"></dd><p id="pollMoreOptions"></p>'), '); |
58 | 60 | }'; |
61 | + } |
|
59 | 62 | |
60 | 63 | // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. |
61 | - if ($context['make_event']) |
|
62 | - echo ' |
|
64 | + if ($context['make_event']) { |
|
65 | + echo ' |
|
63 | 66 | var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; |
67 | + } |
|
64 | 68 | |
65 | 69 | // End of the javascript, start the form and display the link tree. |
66 | 70 | echo ' |
@@ -80,9 +84,10 @@ discard block |
||
80 | 84 | </div> |
81 | 85 | </div><br>'; |
82 | 86 | |
83 | - if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) |
|
84 | - echo ' |
|
87 | + if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { |
|
88 | + echo ' |
|
85 | 89 | <input type="hidden" name="eventid" value="', $context['event']['id'], '">'; |
90 | + } |
|
86 | 91 | |
87 | 92 | // Start the main table. |
88 | 93 | echo ' |
@@ -117,26 +122,28 @@ discard block |
||
117 | 122 | } |
118 | 123 | |
119 | 124 | // If it's locked, show a message to warn the replier. |
120 | - if (!empty($context['locked'])) |
|
121 | - echo ' |
|
125 | + if (!empty($context['locked'])) { |
|
126 | + echo ' |
|
122 | 127 | <p class="errorbox"> |
123 | 128 | ', $txt['topic_locked_no_reply'], ' |
124 | 129 | </p>'; |
130 | + } |
|
125 | 131 | |
126 | - if (!empty($modSettings['drafts_post_enabled'])) |
|
127 | - echo ' |
|
132 | + if (!empty($modSettings['drafts_post_enabled'])) { |
|
133 | + echo ' |
|
128 | 134 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
129 | 135 | sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), ' |
130 | 136 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
131 | 137 | </div>'; |
138 | + } |
|
132 | 139 | |
133 | 140 | // The post header... important stuff |
134 | 141 | echo ' |
135 | 142 | <dl id="post_header">'; |
136 | 143 | |
137 | 144 | // Custom posting fields. |
138 | - if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) |
|
139 | - foreach ($context['posting_fields'] as $pf) |
|
145 | + if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) { |
|
146 | + foreach ($context['posting_fields'] as $pf) |
|
140 | 147 | echo ' |
141 | 148 | <dt> |
142 | 149 | ', $pf['dt'] ,' |
@@ -144,6 +151,7 @@ discard block |
||
144 | 151 | <dd> |
145 | 152 | ', $pf['dd'] ,' |
146 | 153 | </dd>'; |
154 | + } |
|
147 | 155 | |
148 | 156 | |
149 | 157 | // Guests have to put in their name and email... |
@@ -157,14 +165,15 @@ discard block |
||
157 | 165 | <input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text"> |
158 | 166 | </dd>'; |
159 | 167 | |
160 | - if (empty($modSettings['guest_post_no_email'])) |
|
161 | - echo ' |
|
168 | + if (empty($modSettings['guest_post_no_email'])) { |
|
169 | + echo ' |
|
162 | 170 | <dt> |
163 | 171 | <span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span> |
164 | 172 | </dt> |
165 | 173 | <dd> |
166 | 174 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required> |
167 | 175 | </dd>'; |
176 | + } |
|
168 | 177 | } |
169 | 178 | |
170 | 179 | // Now show the subject box for this post. |
@@ -182,9 +191,10 @@ discard block |
||
182 | 191 | <select name="icon" id="icon" onchange="showimage()">'; |
183 | 192 | |
184 | 193 | // Loop through each message icon allowed, adding it to the drop down list. |
185 | - foreach ($context['icons'] as $icon) |
|
186 | - echo ' |
|
194 | + foreach ($context['icons'] as $icon) { |
|
195 | + echo ' |
|
187 | 196 | <option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected' : '', '>', $icon['name'], '</option>'; |
197 | + } |
|
188 | 198 | |
189 | 199 | echo ' |
190 | 200 | </select> |
@@ -206,9 +216,10 @@ discard block |
||
206 | 216 | <select name="year" id="year" tabindex="', $context['tabindex']++, '" onchange="generateDays();">'; |
207 | 217 | |
208 | 218 | // Show a list of all the years we allow... |
209 | - for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) |
|
210 | - echo ' |
|
219 | + for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { |
|
220 | + echo ' |
|
211 | 221 | <option value="', $year, '"', $year == $context['event']['year'] ? ' selected' : '', '>', $year, ' </option>'; |
222 | + } |
|
212 | 223 | |
213 | 224 | echo ' |
214 | 225 | </select> |
@@ -216,9 +227,10 @@ discard block |
||
216 | 227 | <select name="month" id="month" onchange="generateDays();">'; |
217 | 228 | |
218 | 229 | // There are 12 months per year - ensure that they all get listed. |
219 | - for ($month = 1; $month <= 12; $month++) |
|
220 | - echo ' |
|
230 | + for ($month = 1; $month <= 12; $month++) { |
|
231 | + echo ' |
|
221 | 232 | <option value="', $month, '"', $month == $context['event']['month'] ? ' selected' : '', '>', $txt['months'][$month], ' </option>'; |
233 | + } |
|
222 | 234 | |
223 | 235 | echo ' |
224 | 236 | </select> |
@@ -226,9 +238,10 @@ discard block |
||
226 | 238 | <select name="day" id="day">'; |
227 | 239 | |
228 | 240 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
229 | - for ($day = 1; $day <= $context['event']['last_day']; $day++) |
|
230 | - echo ' |
|
241 | + for ($day = 1; $day <= $context['event']['last_day']; $day++) { |
|
242 | + echo ' |
|
231 | 243 | <option value="', $day, '"', $day == $context['event']['day'] ? ' selected' : '', '>', $day, ' </option>'; |
244 | + } |
|
232 | 245 | |
233 | 246 | echo ' |
234 | 247 | </select> |
@@ -251,9 +264,10 @@ discard block |
||
251 | 264 | ', $txt['calendar_numb_days'], ' |
252 | 265 | <select name="span">'; |
253 | 266 | |
254 | - for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) |
|
255 | - echo ' |
|
267 | + for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) { |
|
268 | + echo ' |
|
256 | 269 | <option value="', $days, '"', $days == $context['event']['span'] ? ' selected' : '', '>', $days, ' </option>'; |
270 | + } |
|
257 | 271 | |
258 | 272 | echo ' |
259 | 273 | </select> |
@@ -271,9 +285,10 @@ discard block |
||
271 | 285 | { |
272 | 286 | echo ' |
273 | 287 | <optgroup label="', $category['name'], '">'; |
274 | - foreach ($category['boards'] as $board) |
|
275 | - echo ' |
|
288 | + foreach ($category['boards'] as $board) { |
|
289 | + echo ' |
|
276 | 290 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], ' </option>'; |
291 | + } |
|
277 | 292 | echo ' |
278 | 293 | </optgroup>'; |
279 | 294 | } |
@@ -344,14 +359,15 @@ discard block |
||
344 | 359 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check"> |
345 | 360 | </dd>'; |
346 | 361 | |
347 | - if ($context['poll_options']['guest_vote_enabled']) |
|
348 | - echo ' |
|
362 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
363 | + echo ' |
|
349 | 364 | <dt> |
350 | 365 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
351 | 366 | </dt> |
352 | 367 | <dd> |
353 | 368 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', ' class="input_check"> |
354 | 369 | </dd>'; |
370 | + } |
|
355 | 371 | |
356 | 372 | echo ' |
357 | 373 | <dt> |
@@ -372,8 +388,8 @@ discard block |
||
372 | 388 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
373 | 389 | |
374 | 390 | // If we're editing and displaying edit details, show a box where they can say why |
375 | - if (isset($context['editing']) && $modSettings['show_modify']) |
|
376 | - echo ' |
|
391 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
392 | + echo ' |
|
377 | 393 | <dl> |
378 | 394 | <dt class="clear"> |
379 | 395 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -382,20 +398,23 @@ discard block |
||
382 | 398 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text"> |
383 | 399 | </dd> |
384 | 400 | </dl>'; |
401 | + } |
|
385 | 402 | |
386 | 403 | // If this message has been edited in the past - display when it was. |
387 | - if (isset($context['last_modified'])) |
|
388 | - echo ' |
|
404 | + if (isset($context['last_modified'])) { |
|
405 | + echo ' |
|
389 | 406 | <div class="padding smalltext"> |
390 | 407 | ', $context['last_modified_text'], ' |
391 | 408 | </div>'; |
409 | + } |
|
392 | 410 | |
393 | 411 | // If the admin has enabled the hiding of the additional options - show a link and image for it. |
394 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
395 | - echo ' |
|
412 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
413 | + echo ' |
|
396 | 414 | <div id="postAdditionalOptionsHeader"> |
397 | 415 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
398 | 416 | </div>'; |
417 | + } |
|
399 | 418 | |
400 | 419 | echo ' |
401 | 420 | <div id="postAdditionalOptions">'; |
@@ -427,19 +446,21 @@ discard block |
||
427 | 446 | <input type="hidden" name="attach_del[]" value="0"> |
428 | 447 | ', $txt['uncheck_unwatchd_attach'], ': |
429 | 448 | </dd>'; |
430 | - foreach ($context['current_attachments'] as $attachment) |
|
431 | - echo ' |
|
449 | + foreach ($context['current_attachments'] as $attachment) { |
|
450 | + echo ' |
|
432 | 451 | <dd class="smalltext"> |
433 | 452 | <label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', ' class="input_check"> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), |
434 | 453 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label> |
435 | 454 | </dd>'; |
455 | + } |
|
436 | 456 | |
437 | 457 | echo ' |
438 | 458 | </dl>'; |
439 | 459 | |
440 | - if (!empty($context['files_in_session_warning'])) |
|
441 | - echo ' |
|
460 | + if (!empty($context['files_in_session_warning'])) { |
|
461 | + echo ' |
|
442 | 462 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
463 | + } |
|
443 | 464 | } |
444 | 465 | |
445 | 466 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -492,8 +513,8 @@ discard block |
||
492 | 513 | ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '">'); |
493 | 514 | |
494 | 515 | // Show more boxes if they aren't approaching that limit. |
495 | - if ($context['num_allowed_attachments'] > 1) |
|
496 | - echo ' |
|
516 | + if ($context['num_allowed_attachments'] > 1) { |
|
517 | + echo ' |
|
497 | 518 | <script> |
498 | 519 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
499 | 520 | var current_attachment = 1; |
@@ -514,9 +535,10 @@ discard block |
||
514 | 535 | </div> |
515 | 536 | </div> |
516 | 537 | </dd>'; |
517 | - else |
|
518 | - echo ' |
|
538 | + } else { |
|
539 | + echo ' |
|
519 | 540 | </dd>'; |
541 | + } |
|
520 | 542 | |
521 | 543 | // Add any template changes for an alternative upload system here. |
522 | 544 | call_integration_hook('integrate_upload_template'); |
@@ -525,21 +547,25 @@ discard block |
||
525 | 547 | <dd class="smalltext">'; |
526 | 548 | |
527 | 549 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
528 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
529 | - echo ' |
|
550 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
551 | + echo ' |
|
530 | 552 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
553 | + } |
|
531 | 554 | |
532 | - if (!empty($context['attachment_restrictions'])) |
|
533 | - echo ' |
|
555 | + if (!empty($context['attachment_restrictions'])) { |
|
556 | + echo ' |
|
534 | 557 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
558 | + } |
|
535 | 559 | |
536 | - if ($context['num_allowed_attachments'] == 0) |
|
537 | - echo ' |
|
560 | + if ($context['num_allowed_attachments'] == 0) { |
|
561 | + echo ' |
|
538 | 562 | ', $txt['attach_limit_nag'], '<br>'; |
563 | + } |
|
539 | 564 | |
540 | - if (!$context['can_post_attachment_unapproved']) |
|
541 | - echo ' |
|
565 | + if (!$context['can_post_attachment_unapproved']) { |
|
566 | + echo ' |
|
542 | 567 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
568 | + } |
|
543 | 569 | |
544 | 570 | echo ' |
545 | 571 | </dd> |
@@ -562,10 +588,11 @@ discard block |
||
562 | 588 | <dt><strong>', $txt['subject'], '</strong></dt> |
563 | 589 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
564 | 590 | |
565 | - foreach ($context['drafts'] as $draft) |
|
566 | - echo ' |
|
591 | + foreach ($context['drafts'] as $draft) { |
|
592 | + echo ' |
|
567 | 593 | <dt>', $draft['link'], '</dt> |
568 | 594 | <dd>', $draft['poster_time'], '</dd>'; |
595 | + } |
|
569 | 596 | echo ' |
570 | 597 | </dl> |
571 | 598 | </div>'; |
@@ -590,9 +617,10 @@ discard block |
||
590 | 617 | ', template_control_richedit_buttons($context['post_box_name']); |
591 | 618 | |
592 | 619 | // Option to delete an event if user is editing one. |
593 | - if ($context['make_event'] && !$context['event']['new']) |
|
594 | - echo ' |
|
620 | + if ($context['make_event'] && !$context['event']['new']) { |
|
621 | + echo ' |
|
595 | 622 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">'; |
623 | + } |
|
596 | 624 | |
597 | 625 | echo ' |
598 | 626 | </span> |
@@ -601,9 +629,10 @@ discard block |
||
601 | 629 | <br class="clear">'; |
602 | 630 | |
603 | 631 | // Assuming this isn't a new topic pass across the last message id. |
604 | - if (isset($context['topic_last_message'])) |
|
605 | - echo ' |
|
632 | + if (isset($context['topic_last_message'])) { |
|
633 | + echo ' |
|
606 | 634 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
635 | + } |
|
607 | 636 | |
608 | 637 | echo ' |
609 | 638 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -745,9 +774,10 @@ discard block |
||
745 | 774 | |
746 | 775 | newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">« <strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \' »</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';'; |
747 | 776 | |
748 | - if ($context['can_quote']) |
|
749 | - echo ' |
|
777 | + if ($context['can_quote']) { |
|
778 | + echo ' |
|
750 | 779 | newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';'; |
780 | + } |
|
751 | 781 | |
752 | 782 | echo ' |
753 | 783 | newPostsHTML += \'<br class="clear">\'; |
@@ -790,8 +820,8 @@ discard block |
||
790 | 820 | }'; |
791 | 821 | |
792 | 822 | // Code for showing and hiding additional options. |
793 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
794 | - echo ' |
|
823 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
824 | + echo ' |
|
795 | 825 | var oSwapAdditionalOptions = new smc_Toggle({ |
796 | 826 | bToggleEnabled: true, |
797 | 827 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -819,10 +849,11 @@ discard block |
||
819 | 849 | } |
820 | 850 | ] |
821 | 851 | });'; |
852 | + } |
|
822 | 853 | |
823 | 854 | // Code for showing and hiding drafts |
824 | - if (!empty($context['drafts'])) |
|
825 | - echo ' |
|
855 | + if (!empty($context['drafts'])) { |
|
856 | + echo ' |
|
826 | 857 | var oSwapDraftOptions = new smc_Toggle({ |
827 | 858 | bToggleEnabled: true, |
828 | 859 | bCurrentlyCollapsed: true, |
@@ -844,6 +875,7 @@ discard block |
||
844 | 875 | } |
845 | 876 | ] |
846 | 877 | });'; |
878 | + } |
|
847 | 879 | |
848 | 880 | echo ' |
849 | 881 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -864,8 +896,9 @@ discard block |
||
864 | 896 | foreach ($context['previous_posts'] as $post) |
865 | 897 | { |
866 | 898 | $ignoring = false; |
867 | - if (!empty($post['is_ignored'])) |
|
868 | - $ignored_posts[] = $ignoring = $post['id']; |
|
899 | + if (!empty($post['is_ignored'])) { |
|
900 | + $ignored_posts[] = $ignoring = $post['id']; |
|
901 | + } |
|
869 | 902 | |
870 | 903 | echo ' |
871 | 904 | <div class="windowbg"> |
@@ -1048,10 +1081,10 @@ discard block |
||
1048 | 1081 | <div id="temporary_posting_area" style="display: none;"></div> |
1049 | 1082 | <script>'; |
1050 | 1083 | |
1051 | - if ($context['close_window']) |
|
1052 | - echo ' |
|
1084 | + if ($context['close_window']) { |
|
1085 | + echo ' |
|
1053 | 1086 | window.close();'; |
1054 | - else |
|
1087 | + } else |
|
1055 | 1088 | { |
1056 | 1089 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;). |
1057 | 1090 | echo ' |
@@ -1105,11 +1138,12 @@ discard block |
||
1105 | 1138 | </p> |
1106 | 1139 | <ul>'; |
1107 | 1140 | |
1108 | - foreach ($context['groups'] as $group) |
|
1109 | - echo ' |
|
1141 | + foreach ($context['groups'] as $group) { |
|
1142 | + echo ' |
|
1110 | 1143 | <li> |
1111 | 1144 | <label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em> |
1112 | 1145 | </li>'; |
1146 | + } |
|
1113 | 1147 | |
1114 | 1148 | echo ' |
1115 | 1149 | <li> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | echo ' |
40 | 40 | <div id="display_head" class="information"> |
41 | 41 | <h2 class="display_title"><span id="top_subject">', $context['subject'], '</span>', ($context['is_locked']) ? ' <span class="generic_icons lock"></span>' : '', ($context['is_sticky']) ? ' <span class="generic_icons sticky"></span>' : '', '</h2> |
42 | - <p>',$txt['started_by'],' ', $context['topic_poster_name'],', ', $context['topic_started_time'],'</p>'; |
|
42 | + <p>',$txt['started_by'], ' ', $context['topic_poster_name'], ', ', $context['topic_started_time'], '</p>'; |
|
43 | 43 | |
44 | 44 | // Next - Prev |
45 | 45 | echo ' |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | <div id="poll"> |
75 | 75 | <div class="cat_bar"> |
76 | 76 | <h3 class="catbg"> |
77 | - <span class="generic_icons poll"></span>', $context['poll']['is_locked'] ? '<span class="generic_icons lock"></span>' : '' ,' ', $context['poll']['question'], ' |
|
77 | + <span class="generic_icons poll"></span>', $context['poll']['is_locked'] ? '<span class="generic_icons lock"></span>' : '', ' ', $context['poll']['question'], ' |
|
78 | 78 | </h3> |
79 | 79 | </div> |
80 | 80 | <div class="windowbg noup"> |
@@ -188,8 +188,8 @@ discard block |
||
188 | 188 | // Mobile action - moderation buttons (top) |
189 | 189 | echo ' |
190 | 190 | <div class="mobile_buttons floatright"> |
191 | - <a class="button mobile_act">', $txt['mobile_action'],'</a> |
|
192 | - ', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">'. $txt['mobile_moderation'].'</a>' : '',' |
|
191 | + <a class="button mobile_act">', $txt['mobile_action'], '</a> |
|
192 | + ', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', ' |
|
193 | 193 | </div>'; |
194 | 194 | |
195 | 195 | // Show the topic information - icon, subject, etc. |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | // Mobile action - moderation buttons (bottom) |
214 | 214 | echo ' |
215 | 215 | <div class="mobile_buttons floatright"> |
216 | - <a class="button mobile_act">', $txt['mobile_action'],'</a> |
|
217 | - ', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">'. $txt['mobile_moderation'].'</a>' : '',' |
|
216 | + <a class="button mobile_act">', $txt['mobile_action'], '</a> |
|
217 | + ', ($context['can_moderate_forum'] || $context['user']['is_mod']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', ' |
|
218 | 218 | </div>'; |
219 | 219 | |
220 | 220 | // Show the page index... "Pages: [1]". |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | echo ' |
249 | 249 | <div id="mobile_action" class="popup_container"> |
250 | 250 | <div class="popup_window description"> |
251 | - <div class="popup_heading">', $txt['mobile_action'],' |
|
251 | + <div class="popup_heading">', $txt['mobile_action'], ' |
|
252 | 252 | <a href="javascript:void(0);" class="generic_icons hide_popup"></a></div> |
253 | 253 | ', template_button_strip($context['normal_buttons']), ' |
254 | 254 | </div> |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | echo ' |
260 | 260 | <div id="mobile_moderation" class="popup_container"> |
261 | 261 | <div class="popup_window description"> |
262 | - <div class="popup_heading">', $txt['mobile_moderation'],' |
|
262 | + <div class="popup_heading">', $txt['mobile_moderation'], ' |
|
263 | 263 | <a href="javascript:void(0);" class="generic_icons hide_popup"></a></div> |
264 | 264 | <div id="moderationbuttons_mobile"> |
265 | 265 | ', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip_mobile')), ' |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ', |
348 | 348 | sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ', |
349 | 349 | sTemplateTopSubject: ', JavaScriptEscape('%subject%'), ', |
350 | - sTemplateReasonEdit: ', JavaScriptEscape($txt['reason_for_edit'] .': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text quickModifyMargin">'), ', |
|
350 | + sTemplateReasonEdit: ', JavaScriptEscape($txt['reason_for_edit'] . ': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text quickModifyMargin">'), ', |
|
351 | 351 | sTemplateReasonNormal: ', JavaScriptEscape('%modify_text'), ', |
352 | 352 | sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ($context['can_reply']) ? ', |
353 | 353 | sFormRemoveAccessKeys: \'postmodify\'' : '', ' |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | // Show the message anchor and a "new" anchor if this message is new. |
422 | 422 | echo ' |
423 | - <div class="', $message['css_class'] ,'">', $message['id'] != $context['first_message'] ? ' |
|
423 | + <div class="', $message['css_class'], '">', $message['id'] != $context['first_message'] ? ' |
|
424 | 424 | <a id="msg' . $message['id'] . '"></a>' . ($message['first_new'] ? '<a id="new"></a>' : '') : '', ' |
425 | 425 | <div class="post_wrapper">'; |
426 | 426 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | |
438 | 438 | foreach ($message['custom_fields']['above_member'] as $custom) |
439 | 439 | echo ' |
440 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
440 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
441 | 441 | |
442 | 442 | echo ' |
443 | 443 | </ul> |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | if (!empty($message['custom_fields']['below_avatar'])) |
474 | 474 | foreach ($message['custom_fields']['below_avatar'] as $custom) |
475 | 475 | echo ' |
476 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
476 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
477 | 477 | |
478 | 478 | // Show the post group icons, but not for guests. |
479 | 479 | if (!$message['member']['is_guest']) |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | |
519 | 519 | foreach ($message['custom_fields']['icons'] as $custom) |
520 | 520 | echo ' |
521 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
521 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
522 | 522 | |
523 | 523 | echo ' |
524 | 524 | </ol> |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | if (!empty($message['custom_fields']['standard'])) |
557 | 557 | foreach ($message['custom_fields']['standard'] as $custom) |
558 | 558 | echo ' |
559 | - <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
559 | + <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
560 | 560 | |
561 | 561 | } |
562 | 562 | // Otherwise, show the guest's email. |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | if (!empty($message['custom_fields']['bottom_poster'])) |
595 | 595 | foreach ($message['custom_fields']['bottom_poster'] as $custom) |
596 | 596 | echo ' |
597 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
597 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
598 | 598 | |
599 | 599 | // Poster info ends. |
600 | 600 | echo ' |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | $base .= (isset($txt[$base . $count])) ? $count : 'n'; |
782 | 782 | |
783 | 783 | echo ' |
784 | - <li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] .';'. $context['session_var'] .'='. $context['session_id'], comma_format($count)), '</li>'; |
|
784 | + <li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], comma_format($count)), '</li>'; |
|
785 | 785 | } |
786 | 786 | |
787 | 787 | echo ' |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | if ($context['can_quote']) |
799 | 799 | echo ' |
800 | 800 | <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li> |
801 | - <li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>'; |
|
801 | + <li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>'; |
|
802 | 802 | |
803 | 803 | // Can the user modify the contents of this post? Show the modify inline image. |
804 | 804 | if ($message['can_modify']) |
@@ -820,10 +820,10 @@ discard block |
||
820 | 820 | // How about... even... remove it entirely?! |
821 | 821 | if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) |
822 | 822 | echo ' |
823 | - <li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'],'</a></li>'; |
|
823 | + <li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'], '</a></li>'; |
|
824 | 824 | elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) |
825 | 825 | echo ' |
826 | - <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
|
826 | + <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
|
827 | 827 | |
828 | 828 | // What about splitting it off the rest of the topic? |
829 | 829 | if ($context['can_split'] && !empty($context['real_num_replies'])) |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | |
882 | 882 | foreach ($message['custom_fields']['above_signature'] as $custom) |
883 | 883 | echo ' |
884 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
884 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
885 | 885 | |
886 | 886 | echo ' |
887 | 887 | </ul> |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | |
904 | 904 | foreach ($message['custom_fields']['below_signature'] as $custom) |
905 | 905 | echo ' |
906 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
906 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
907 | 907 | |
908 | 908 | echo ' |
909 | 909 | </ul> |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | echo ' |
1005 | 1005 | <br class="clear_right"> |
1006 | 1006 | <span id="post_confirm_buttons"> |
1007 | - ', template_control_richedit_buttons($context['post_box_name']) ,' |
|
1007 | + ', template_control_richedit_buttons($context['post_box_name']), ' |
|
1008 | 1008 | </span>'; |
1009 | 1009 | echo ' |
1010 | 1010 | </form> |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | sJumpAnchor: "quickreply", |
1048 | 1048 | bIsFull: true |
1049 | 1049 | }); |
1050 | - var oEditorID = "', $context['post_box_name'] ,'"; |
|
1050 | + var oEditorID = "', $context['post_box_name'], '"; |
|
1051 | 1051 | var oEditorObject = oEditorHandle_', $context['post_box_name'], '; |
1052 | 1052 | var oJumpAnchor = "quickreply"; |
1053 | 1053 | </script>'; |
@@ -51,11 +51,13 @@ discard block |
||
51 | 51 | <p>'; |
52 | 52 | |
53 | 53 | // Show just numbers...? |
54 | - if ($settings['display_who_viewing'] == 1) |
|
55 | - echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
54 | + if ($settings['display_who_viewing'] == 1) { |
|
55 | + echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
|
56 | + } |
|
56 | 57 | // Or show the actual people viewing the topic? |
57 | - else |
|
58 | - 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'] . ')'); |
|
58 | + else { |
|
59 | + 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'] . ')'); |
|
60 | + } |
|
59 | 61 | |
60 | 62 | // Now show how many guests are here too. |
61 | 63 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' |
@@ -93,10 +95,11 @@ discard block |
||
93 | 95 | <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> |
94 | 96 | <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; |
95 | 97 | |
96 | - if ($context['allow_results_view']) |
|
97 | - echo ' |
|
98 | + if ($context['allow_results_view']) { |
|
99 | + echo ' |
|
98 | 100 | ', $option['bar_ndt'], ' |
99 | 101 | <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; |
102 | + } |
|
100 | 103 | |
101 | 104 | echo ' |
102 | 105 | </dd>'; |
@@ -105,9 +108,10 @@ discard block |
||
105 | 108 | echo ' |
106 | 109 | </dl>'; |
107 | 110 | |
108 | - if ($context['allow_results_view']) |
|
109 | - echo ' |
|
111 | + if ($context['allow_results_view']) { |
|
112 | + echo ' |
|
110 | 113 | <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; |
114 | + } |
|
111 | 115 | } |
112 | 116 | // They are allowed to vote! Go to it! |
113 | 117 | else |
@@ -116,17 +120,19 @@ discard block |
||
116 | 120 | <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; |
117 | 121 | |
118 | 122 | // Show a warning if they are allowed more than one option. |
119 | - if ($context['poll']['allowed_warning']) |
|
120 | - echo ' |
|
123 | + if ($context['poll']['allowed_warning']) { |
|
124 | + echo ' |
|
121 | 125 | <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; |
126 | + } |
|
122 | 127 | |
123 | 128 | echo ' |
124 | 129 | <ul class="options">'; |
125 | 130 | |
126 | 131 | // Show each option with its button - a radio likely. |
127 | - foreach ($context['poll']['options'] as $option) |
|
128 | - echo ' |
|
132 | + foreach ($context['poll']['options'] as $option) { |
|
133 | + echo ' |
|
129 | 134 | <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; |
135 | + } |
|
130 | 136 | |
131 | 137 | echo ' |
132 | 138 | </ul> |
@@ -138,9 +144,10 @@ discard block |
||
138 | 144 | } |
139 | 145 | |
140 | 146 | // Is the clock ticking? |
141 | - if (!empty($context['poll']['expire_time'])) |
|
142 | - echo ' |
|
147 | + if (!empty($context['poll']['expire_time'])) { |
|
148 | + echo ' |
|
143 | 149 | <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>'; |
150 | + } |
|
144 | 151 | |
145 | 152 | echo ' |
146 | 153 | </div> |
@@ -164,11 +171,12 @@ discard block |
||
164 | 171 | <div class="information"> |
165 | 172 | <ul>'; |
166 | 173 | |
167 | - foreach ($context['linked_calendar_events'] as $event) |
|
168 | - echo ' |
|
174 | + foreach ($context['linked_calendar_events'] as $event) { |
|
175 | + echo ' |
|
169 | 176 | <li> |
170 | 177 | ', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify"></span></a> ' : ''), '<strong>', $event['title'], '</strong>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), ' |
171 | 178 | </li>'; |
179 | + } |
|
172 | 180 | |
173 | 181 | echo ' |
174 | 182 | </ul> |
@@ -203,8 +211,9 @@ discard block |
||
203 | 211 | $context['removableMessageIDs'] = array(); |
204 | 212 | |
205 | 213 | // Get all the messages... |
206 | - while ($message = $context['get_message']()) |
|
207 | - template_single_post($message); |
|
214 | + while ($message = $context['get_message']()) { |
|
215 | + template_single_post($message); |
|
216 | + } |
|
208 | 217 | |
209 | 218 | echo ' |
210 | 219 | </form> |
@@ -241,8 +250,9 @@ discard block |
||
241 | 250 | <div id="display_jump_to"> </div>'; |
242 | 251 | |
243 | 252 | // Show quickreply |
244 | - if ($context['can_reply']) |
|
245 | - template_quickreply(); |
|
253 | + if ($context['can_reply']) { |
|
254 | + template_quickreply(); |
|
255 | + } |
|
246 | 256 | |
247 | 257 | // User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device. |
248 | 258 | echo ' |
@@ -255,8 +265,8 @@ discard block |
||
255 | 265 | </div>'; |
256 | 266 | |
257 | 267 | // Show the moderation button & pop only if user can moderate |
258 | - if ($context['can_moderate_forum'] || $context['user']['is_mod']) |
|
259 | - echo ' |
|
268 | + if ($context['can_moderate_forum'] || $context['user']['is_mod']) { |
|
269 | + echo ' |
|
260 | 270 | <div id="mobile_moderation" class="popup_container"> |
261 | 271 | <div class="popup_window description"> |
262 | 272 | <div class="popup_heading">', $txt['mobile_moderation'],' |
@@ -266,6 +276,7 @@ discard block |
||
266 | 276 | </div> |
267 | 277 | </div> |
268 | 278 | </div>'; |
279 | + } |
|
269 | 280 | |
270 | 281 | echo ' |
271 | 282 | <script>'; |
@@ -389,9 +400,10 @@ discard block |
||
389 | 400 | }); |
390 | 401 | }'; |
391 | 402 | |
392 | - if (!empty($context['ignoredMsgs'])) |
|
393 | - echo ' |
|
403 | + if (!empty($context['ignoredMsgs'])) { |
|
404 | + echo ' |
|
394 | 405 | ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; |
406 | + } |
|
395 | 407 | |
396 | 408 | echo ' |
397 | 409 | </script>'; |
@@ -408,8 +420,9 @@ discard block |
||
408 | 420 | |
409 | 421 | $ignoring = false; |
410 | 422 | |
411 | - if ($message['can_remove']) |
|
412 | - $context['removableMessageIDs'][] = $message['id']; |
|
423 | + if ($message['can_remove']) { |
|
424 | + $context['removableMessageIDs'][] = $message['id']; |
|
425 | + } |
|
413 | 426 | |
414 | 427 | // Are we ignoring this message? |
415 | 428 | if (!empty($message['is_ignored'])) |
@@ -435,9 +448,10 @@ discard block |
||
435 | 448 | <div class="custom_fields_above_member"> |
436 | 449 | <ul class="nolist">'; |
437 | 450 | |
438 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
439 | - echo ' |
|
451 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
452 | + echo ' |
|
440 | 453 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
454 | + } |
|
441 | 455 | |
442 | 456 | echo ' |
443 | 457 | </ul> |
@@ -448,9 +462,10 @@ discard block |
||
448 | 462 | <h4>'; |
449 | 463 | |
450 | 464 | // Show online and offline buttons? |
451 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
452 | - echo ' |
|
465 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
466 | + echo ' |
|
453 | 467 | ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : ''; |
468 | + } |
|
454 | 469 | |
455 | 470 | |
456 | 471 | // Show a link to the member's profile. |
@@ -463,51 +478,59 @@ discard block |
||
463 | 478 | |
464 | 479 | |
465 | 480 | // Show the user's avatar. |
466 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
467 | - echo ' |
|
481 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
482 | + echo ' |
|
468 | 483 | <li class="avatar"> |
469 | 484 | <a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a> |
470 | 485 | </li>'; |
486 | + } |
|
471 | 487 | |
472 | 488 | // Are there any custom fields below the avatar? |
473 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
474 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
489 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
490 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
475 | 491 | echo ' |
476 | 492 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
493 | + } |
|
477 | 494 | |
478 | 495 | // Show the post group icons, but not for guests. |
479 | - if (!$message['member']['is_guest']) |
|
480 | - echo ' |
|
496 | + if (!$message['member']['is_guest']) { |
|
497 | + echo ' |
|
481 | 498 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
499 | + } |
|
482 | 500 | |
483 | 501 | // Show the member's primary group (like 'Administrator') if they have one. |
484 | - if (!empty($message['member']['group'])) |
|
485 | - echo ' |
|
502 | + if (!empty($message['member']['group'])) { |
|
503 | + echo ' |
|
486 | 504 | <li class="membergroup">', $message['member']['group'], '</li>'; |
505 | + } |
|
487 | 506 | |
488 | 507 | // Show the member's custom title, if they have one. |
489 | - if (!empty($message['member']['title'])) |
|
490 | - echo ' |
|
508 | + if (!empty($message['member']['title'])) { |
|
509 | + echo ' |
|
491 | 510 | <li class="title">', $message['member']['title'], '</li>'; |
511 | + } |
|
492 | 512 | |
493 | 513 | // Don't show these things for guests. |
494 | 514 | if (!$message['member']['is_guest']) |
495 | 515 | { |
496 | 516 | |
497 | 517 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
498 | - if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) |
|
499 | - echo ' |
|
518 | + if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) { |
|
519 | + echo ' |
|
500 | 520 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
521 | + } |
|
501 | 522 | |
502 | 523 | // Show how many posts they have made. |
503 | - if (!isset($context['disabled_fields']['posts'])) |
|
504 | - echo ' |
|
524 | + if (!isset($context['disabled_fields']['posts'])) { |
|
525 | + echo ' |
|
505 | 526 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
527 | + } |
|
506 | 528 | |
507 | 529 | // Show their personal text? |
508 | - if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) |
|
509 | - echo ' |
|
530 | + if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) { |
|
531 | + echo ' |
|
510 | 532 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
533 | + } |
|
511 | 534 | |
512 | 535 | // Any custom fields to show as icons? |
513 | 536 | if (!empty($message['custom_fields']['icons'])) |
@@ -516,9 +539,10 @@ discard block |
||
516 | 539 | <li class="im_icons"> |
517 | 540 | <ol>'; |
518 | 541 | |
519 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
520 | - echo ' |
|
542 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
543 | + echo ' |
|
521 | 544 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
545 | + } |
|
522 | 546 | |
523 | 547 | echo ' |
524 | 548 | </ol> |
@@ -533,19 +557,22 @@ discard block |
||
533 | 557 | <ol class="profile_icons">'; |
534 | 558 | |
535 | 559 | // Don't show an icon if they haven't specified a website. |
536 | - if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) |
|
537 | - echo ' |
|
560 | + if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) { |
|
561 | + echo ' |
|
538 | 562 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
563 | + } |
|
539 | 564 | |
540 | 565 | // Since we know this person isn't a guest, you *can* message them. |
541 | - if ($context['can_send_pm']) |
|
542 | - echo ' |
|
566 | + if ($context['can_send_pm']) { |
|
567 | + echo ' |
|
543 | 568 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
569 | + } |
|
544 | 570 | |
545 | 571 | // Show the email if necessary |
546 | - if (!empty($message['member']['email']) && $message['member']['show_email']) |
|
547 | - echo ' |
|
572 | + if (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
573 | + echo ' |
|
548 | 574 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
575 | + } |
|
549 | 576 | |
550 | 577 | echo ' |
551 | 578 | </ol> |
@@ -553,48 +580,56 @@ discard block |
||
553 | 580 | } |
554 | 581 | |
555 | 582 | // Any custom fields for standard placement? |
556 | - if (!empty($message['custom_fields']['standard'])) |
|
557 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
583 | + if (!empty($message['custom_fields']['standard'])) { |
|
584 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
558 | 585 | echo ' |
559 | 586 | <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
587 | + } |
|
560 | 588 | |
561 | 589 | } |
562 | 590 | // Otherwise, show the guest's email. |
563 | - elseif (!empty($message['member']['email']) && $message['member']['show_email']) |
|
564 | - echo ' |
|
591 | + elseif (!empty($message['member']['email']) && $message['member']['show_email']) { |
|
592 | + echo ' |
|
565 | 593 | <li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
594 | + } |
|
566 | 595 | |
567 | 596 | // Show the IP to this user for this post - because you can moderate? |
568 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
569 | - echo ' |
|
597 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
598 | + echo ' |
|
570 | 599 | <li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>'; |
600 | + } |
|
571 | 601 | |
572 | 602 | // Or, should we show it because this is you? |
573 | - elseif ($message['can_see_ip']) |
|
574 | - echo ' |
|
603 | + elseif ($message['can_see_ip']) { |
|
604 | + echo ' |
|
575 | 605 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
606 | + } |
|
576 | 607 | |
577 | 608 | // Okay, are you at least logged in? Then we can show something about why IPs are logged... |
578 | - elseif (!$context['user']['is_guest']) |
|
579 | - echo ' |
|
609 | + elseif (!$context['user']['is_guest']) { |
|
610 | + echo ' |
|
580 | 611 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
612 | + } |
|
581 | 613 | |
582 | 614 | // Otherwise, you see NOTHING! |
583 | - else |
|
584 | - echo ' |
|
615 | + else { |
|
616 | + echo ' |
|
585 | 617 | <li class="poster_ip">', $txt['logged'], '</li>'; |
618 | + } |
|
586 | 619 | |
587 | 620 | // Are we showing the warning status? |
588 | 621 | // Don't show these things for guests. |
589 | - if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) |
|
590 | - echo ' |
|
622 | + if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) { |
|
623 | + echo ' |
|
591 | 624 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span> ', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
625 | + } |
|
592 | 626 | |
593 | 627 | // Are there any custom fields to show at the bottom of the poster info? |
594 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
595 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
628 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
629 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
596 | 630 | echo ' |
597 | 631 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
632 | + } |
|
598 | 633 | |
599 | 634 | // Poster info ends. |
600 | 635 | echo ' |
@@ -623,9 +658,10 @@ discard block |
||
623 | 658 | echo ' |
624 | 659 | <span class="smalltext modified" id="modified_', $message['id'], '">'; |
625 | 660 | |
626 | - if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
|
627 | - echo |
|
661 | + if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) { |
|
662 | + echo |
|
628 | 663 | $message['modified']['last_edit_text']; |
664 | + } |
|
629 | 665 | |
630 | 666 | echo ' |
631 | 667 | </span>'; |
@@ -636,22 +672,24 @@ discard block |
||
636 | 672 | </div>'; |
637 | 673 | |
638 | 674 | // Ignoring this user? Hide the post. |
639 | - if ($ignoring) |
|
640 | - echo ' |
|
675 | + if ($ignoring) { |
|
676 | + echo ' |
|
641 | 677 | <div id="msg_', $message['id'], '_ignored_prompt"> |
642 | 678 | ', $txt['ignoring_user'], ' |
643 | 679 | <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
644 | 680 | </div>'; |
681 | + } |
|
645 | 682 | |
646 | 683 | // Show the post itself, finally! |
647 | 684 | echo ' |
648 | 685 | <div class="post">'; |
649 | 686 | |
650 | - if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) |
|
651 | - echo ' |
|
687 | + if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { |
|
688 | + echo ' |
|
652 | 689 | <div class="approve_post"> |
653 | 690 | ', $txt['post_awaiting_approval'], ' |
654 | 691 | </div>'; |
692 | + } |
|
655 | 693 | echo ' |
656 | 694 | <div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div> |
657 | 695 | </div>'; |
@@ -668,9 +706,9 @@ discard block |
||
668 | 706 | foreach ($message['attachment'] as $attachment) |
669 | 707 | { |
670 | 708 | // Do we want this attachment to not be showed here? |
671 | - if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) |
|
672 | - continue; |
|
673 | - elseif (!$div_output) |
|
709 | + if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) { |
|
710 | + continue; |
|
711 | + } elseif (!$div_output) |
|
674 | 712 | { |
675 | 713 | $div_output = true; |
676 | 714 | |
@@ -686,9 +724,10 @@ discard block |
||
686 | 724 | <fieldset> |
687 | 725 | <legend>', $txt['attach_awaiting_approve']; |
688 | 726 | |
689 | - if ($context['can_approve']) |
|
690 | - echo ' |
|
727 | + if ($context['can_approve']) { |
|
728 | + echo ' |
|
691 | 729 | [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; |
730 | + } |
|
692 | 731 | |
693 | 732 | echo ' |
694 | 733 | </legend>'; |
@@ -702,12 +741,13 @@ discard block |
||
702 | 741 | echo ' |
703 | 742 | <div class="attachments_top">'; |
704 | 743 | |
705 | - if ($attachment['thumbnail']['has_thumb']) |
|
706 | - echo ' |
|
744 | + if ($attachment['thumbnail']['has_thumb']) { |
|
745 | + echo ' |
|
707 | 746 | <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>'; |
708 | - else |
|
709 | - echo ' |
|
747 | + } else { |
|
748 | + echo ' |
|
710 | 749 | <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">'; |
750 | + } |
|
711 | 751 | |
712 | 752 | echo ' |
713 | 753 | </div>'; |
@@ -717,9 +757,10 @@ discard block |
||
717 | 757 | <div class="attachments_bot"> |
718 | 758 | <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*"> ' . $attachment['name'] . '</a> '; |
719 | 759 | |
720 | - if (!$attachment['is_approved'] && $context['can_approve']) |
|
721 | - echo ' |
|
760 | + if (!$attachment['is_approved'] && $context['can_approve']) { |
|
761 | + echo ' |
|
722 | 762 | [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] '; |
763 | + } |
|
723 | 764 | echo ' |
724 | 765 | <br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), ' |
725 | 766 | </div>'; |
@@ -728,33 +769,38 @@ discard block |
||
728 | 769 | </div>'; |
729 | 770 | |
730 | 771 | // Next attachment line ? |
731 | - if (++$i % $attachments_per_line === 0) |
|
732 | - echo ' |
|
772 | + if (++$i % $attachments_per_line === 0) { |
|
773 | + echo ' |
|
733 | 774 | <br>'; |
775 | + } |
|
734 | 776 | } |
735 | 777 | |
736 | 778 | // If we had unapproved attachments clean up. |
737 | - if ($last_approved_state == 0) |
|
738 | - echo ' |
|
779 | + if ($last_approved_state == 0) { |
|
780 | + echo ' |
|
739 | 781 | </fieldset>'; |
782 | + } |
|
740 | 783 | |
741 | 784 | // Only do this if we output a div above - otherwise it'll break things |
742 | - if ($div_output) |
|
743 | - echo ' |
|
785 | + if ($div_output) { |
|
786 | + echo ' |
|
744 | 787 | </div>'; |
788 | + } |
|
745 | 789 | } |
746 | 790 | |
747 | 791 | // And stuff below the attachments. |
748 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
749 | - echo ' |
|
792 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
793 | + echo ' |
|
750 | 794 | <div class="under_message">'; |
795 | + } |
|
751 | 796 | |
752 | 797 | // Maybe they want to report this post to the moderator(s)? |
753 | - if ($context['can_report_moderator']) |
|
754 | - echo ' |
|
798 | + if ($context['can_report_moderator']) { |
|
799 | + echo ' |
|
755 | 800 | <ul class="floatright smalltext"> |
756 | 801 | <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li> |
757 | 802 | </ul>'; |
803 | + } |
|
758 | 804 | |
759 | 805 | // What about likes? |
760 | 806 | if (!empty($modSettings['enable_likes'])) |
@@ -795,78 +841,91 @@ discard block |
||
795 | 841 | <ul class="quickbuttons">'; |
796 | 842 | |
797 | 843 | // Can they quote? if so they can select and quote as well! |
798 | - if ($context['can_quote']) |
|
799 | - echo ' |
|
844 | + if ($context['can_quote']) { |
|
845 | + echo ' |
|
800 | 846 | <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li> |
801 | 847 | <li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>'; |
848 | + } |
|
802 | 849 | |
803 | 850 | // Can the user modify the contents of this post? Show the modify inline image. |
804 | - if ($message['can_modify']) |
|
805 | - echo ' |
|
851 | + if ($message['can_modify']) { |
|
852 | + echo ' |
|
806 | 853 | <li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>'; |
854 | + } |
|
807 | 855 | |
808 | - if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
809 | - echo ' |
|
856 | + if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
857 | + echo ' |
|
810 | 858 | <li class="post_options">', $txt['post_options']; |
859 | + } |
|
811 | 860 | |
812 | 861 | echo ' |
813 | 862 | <ul>'; |
814 | 863 | |
815 | 864 | // Can the user modify the contents of this post? |
816 | - if ($message['can_modify']) |
|
817 | - echo ' |
|
865 | + if ($message['can_modify']) { |
|
866 | + echo ' |
|
818 | 867 | <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>'; |
868 | + } |
|
819 | 869 | |
820 | 870 | // How about... even... remove it entirely?! |
821 | - if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) |
|
822 | - echo ' |
|
871 | + if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) { |
|
872 | + echo ' |
|
823 | 873 | <li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'],'</a></li>'; |
824 | - elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) |
|
825 | - echo ' |
|
874 | + } elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) { |
|
875 | + echo ' |
|
826 | 876 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>'; |
877 | + } |
|
827 | 878 | |
828 | 879 | // What about splitting it off the rest of the topic? |
829 | - if ($context['can_split'] && !empty($context['real_num_replies'])) |
|
830 | - echo ' |
|
880 | + if ($context['can_split'] && !empty($context['real_num_replies'])) { |
|
881 | + echo ' |
|
831 | 882 | <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>'; |
883 | + } |
|
832 | 884 | |
833 | 885 | // Can we issue a warning because of this post? Remember, we can't give guests warnings. |
834 | - if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) |
|
835 | - echo ' |
|
886 | + if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) { |
|
887 | + echo ' |
|
836 | 888 | <li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>'; |
889 | + } |
|
837 | 890 | |
838 | 891 | // Can we restore topics? |
839 | - if ($context['can_restore_msg']) |
|
840 | - echo ' |
|
892 | + if ($context['can_restore_msg']) { |
|
893 | + echo ' |
|
841 | 894 | <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>'; |
895 | + } |
|
842 | 896 | |
843 | 897 | // Maybe we can approve it, maybe we should? |
844 | - if ($message['can_approve']) |
|
845 | - echo ' |
|
898 | + if ($message['can_approve']) { |
|
899 | + echo ' |
|
846 | 900 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>'; |
901 | + } |
|
847 | 902 | |
848 | 903 | // Maybe we can unapprove it? |
849 | - if ($message['can_unapprove']) |
|
850 | - echo ' |
|
904 | + if ($message['can_unapprove']) { |
|
905 | + echo ' |
|
851 | 906 | <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>'; |
907 | + } |
|
852 | 908 | |
853 | 909 | echo ' |
854 | 910 | </ul> |
855 | 911 | </li>'; |
856 | 912 | |
857 | 913 | // Show a checkbox for quick moderation? |
858 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) |
|
859 | - echo ' |
|
914 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { |
|
915 | + echo ' |
|
860 | 916 | <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; |
917 | + } |
|
861 | 918 | |
862 | - if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) |
|
863 | - echo ' |
|
919 | + if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { |
|
920 | + echo ' |
|
864 | 921 | </ul>'; |
922 | + } |
|
865 | 923 | } |
866 | 924 | |
867 | - if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) |
|
868 | - echo ' |
|
925 | + if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) { |
|
926 | + echo ' |
|
869 | 927 | </div>'; |
928 | + } |
|
870 | 929 | |
871 | 930 | echo ' |
872 | 931 | </div> |
@@ -879,9 +938,10 @@ discard block |
||
879 | 938 | <div class="custom_fields_above_signature"> |
880 | 939 | <ul class="nolist">'; |
881 | 940 | |
882 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
883 | - echo ' |
|
941 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
942 | + echo ' |
|
884 | 943 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
944 | + } |
|
885 | 945 | |
886 | 946 | echo ' |
887 | 947 | </ul> |
@@ -889,9 +949,10 @@ discard block |
||
889 | 949 | } |
890 | 950 | |
891 | 951 | // Show the member's signature? |
892 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
893 | - echo ' |
|
952 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
953 | + echo ' |
|
894 | 954 | <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>'; |
955 | + } |
|
895 | 956 | |
896 | 957 | |
897 | 958 | // Are there any custom profile fields for below the signature? |
@@ -901,9 +962,10 @@ discard block |
||
901 | 962 | <div class="custom_fields_below_signature"> |
902 | 963 | <ul class="nolist">'; |
903 | 964 | |
904 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
905 | - echo ' |
|
965 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
966 | + echo ' |
|
906 | 967 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
968 | + } |
|
907 | 969 | |
908 | 970 | echo ' |
909 | 971 | </ul> |
@@ -951,8 +1013,8 @@ discard block |
||
951 | 1013 | <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">'; |
952 | 1014 | |
953 | 1015 | // Guests just need more. |
954 | - if ($context['user']['is_guest']) |
|
955 | - echo ' |
|
1016 | + if ($context['user']['is_guest']) { |
|
1017 | + echo ' |
|
956 | 1018 | <dl id="post_header"> |
957 | 1019 | <dt> |
958 | 1020 | ', $txt['name'], ': |
@@ -967,6 +1029,7 @@ discard block |
||
967 | 1029 | <input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required> |
968 | 1030 | </dd> |
969 | 1031 | </dl>'; |
1032 | + } |
|
970 | 1033 | |
971 | 1034 | echo ' |
972 | 1035 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' |
@@ -1014,8 +1077,8 @@ discard block |
||
1014 | 1077 | <br class="clear">'; |
1015 | 1078 | |
1016 | 1079 | // draft autosave available and the user has it enabled? |
1017 | - if (!empty($context['drafts_autosave'])) |
|
1018 | - echo ' |
|
1080 | + if (!empty($context['drafts_autosave'])) { |
|
1081 | + echo ' |
|
1019 | 1082 | <script> |
1020 | 1083 | var oDraftAutoSave = new smf_DraftAutoSave({ |
1021 | 1084 | sSelf: \'oDraftAutoSave\', |
@@ -1027,10 +1090,12 @@ discard block |
||
1027 | 1090 | iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), ' |
1028 | 1091 | }); |
1029 | 1092 | </script>'; |
1093 | + } |
|
1030 | 1094 | |
1031 | - if ($context['show_spellchecking']) |
|
1032 | - echo ' |
|
1095 | + if ($context['show_spellchecking']) { |
|
1096 | + echo ' |
|
1033 | 1097 | <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>'; |
1098 | + } |
|
1034 | 1099 | |
1035 | 1100 | echo ' |
1036 | 1101 | <script> |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | <a class="menu_icon mobile_generic_menu_', $context['cur_menu_id'], '"></a> |
53 | 53 | <div id="mobile_generic_menu_', $context['cur_menu_id'], '" class="popup_container"> |
54 | 54 | <div class="popup_window description"> |
55 | - <div class="popup_heading">', $txt['mobile_user_menu'],' |
|
55 | + <div class="popup_heading">', $txt['mobile_user_menu'], ' |
|
56 | 56 | <a href="javascript:void(0);" class="generic_icons hide_popup"></a></div> |
57 | 57 | ', template_generic_menu($menu_context), ' |
58 | 58 | </div> |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | </script>'; |
68 | 68 | } |
69 | 69 | |
70 | -function template_generic_menu (&$menu_context) |
|
70 | +function template_generic_menu(&$menu_context) |
|
71 | 71 | { |
72 | 72 | global $context; |
73 | 73 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | foreach ($menu_context['sections'] as $section) |
82 | 82 | { |
83 | 83 | echo ' |
84 | - <li ', !empty($section['areas']) ? 'class="subsections"' : '', '><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'] , '</a> |
|
84 | + <li ', !empty($section['areas']) ? 'class="subsections"' : '', '><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'], '</a> |
|
85 | 85 | <ul>'; |
86 | 86 | |
87 | 87 | // For every area of this section show a link to that area (bold if it's currently selected.) |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
221 | 221 | |
222 | 222 | if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
223 | - echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>'; |
|
223 | + echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>'; |
|
224 | 224 | |
225 | 225 | echo $tab_context['title']; |
226 | 226 | } |
@@ -89,8 +89,9 @@ discard block |
||
89 | 89 | foreach ($section['areas'] as $i => $area) |
90 | 90 | { |
91 | 91 | // Not supposed to be printed? |
92 | - if (empty($area['label'])) |
|
93 | - continue; |
|
92 | + if (empty($area['label'])) { |
|
93 | + continue; |
|
94 | + } |
|
94 | 95 | |
95 | 96 | echo ' |
96 | 97 | <li', !empty($area['subsections']) ? ' class="subsections"' : '', '>'; |
@@ -99,8 +100,9 @@ discard block |
||
99 | 100 | <a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>'; |
100 | 101 | |
101 | 102 | // Is this the current area, or just some area? |
102 | - if (!empty($area['selected']) && empty($context['tabs'])) |
|
103 | - $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
103 | + if (!empty($area['selected']) && empty($context['tabs'])) { |
|
104 | + $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array(); |
|
105 | + } |
|
104 | 106 | |
105 | 107 | // Are there any subsections? |
106 | 108 | if (!empty($area['subsections'])) |
@@ -110,8 +112,9 @@ discard block |
||
110 | 112 | |
111 | 113 | foreach ($area['subsections'] as $sa => $sub) |
112 | 114 | { |
113 | - if (!empty($sub['disabled'])) |
|
114 | - continue; |
|
115 | + if (!empty($sub['disabled'])) { |
|
116 | + continue; |
|
117 | + } |
|
115 | 118 | |
116 | 119 | $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa; |
117 | 120 | |
@@ -158,8 +161,9 @@ discard block |
||
158 | 161 | <h3 class="catbg">'; |
159 | 162 | |
160 | 163 | // The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available |
161 | - if (function_exists('template_admin_quick_search')) |
|
162 | - template_admin_quick_search(); |
|
164 | + if (function_exists('template_admin_quick_search')) { |
|
165 | + template_admin_quick_search(); |
|
166 | + } |
|
163 | 167 | |
164 | 168 | // Exactly how many tabs do we have? |
165 | 169 | if (!empty($context['tabs'])) |
@@ -174,30 +178,36 @@ discard block |
||
174 | 178 | } |
175 | 179 | |
176 | 180 | // Did this not even exist - or do we not have a label? |
177 | - if (!isset($tab_context['tabs'][$id])) |
|
178 | - $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
179 | - elseif (!isset($tab_context['tabs'][$id]['label'])) |
|
180 | - $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
181 | + if (!isset($tab_context['tabs'][$id])) { |
|
182 | + $tab_context['tabs'][$id] = array('label' => $tab['label']); |
|
183 | + } elseif (!isset($tab_context['tabs'][$id]['label'])) { |
|
184 | + $tab_context['tabs'][$id]['label'] = $tab['label']; |
|
185 | + } |
|
181 | 186 | |
182 | 187 | // Has a custom URL defined in the main admin structure? |
183 | - if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) |
|
184 | - $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
188 | + if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) { |
|
189 | + $tab_context['tabs'][$id]['url'] = $tab['url']; |
|
190 | + } |
|
185 | 191 | |
186 | 192 | // Any additional paramaters for the url? |
187 | - if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) |
|
188 | - $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
193 | + if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) { |
|
194 | + $tab_context['tabs'][$id]['add_params'] = $tab['add_params']; |
|
195 | + } |
|
189 | 196 | |
190 | 197 | // Has it been deemed selected? |
191 | - if (!empty($tab['is_selected'])) |
|
192 | - $tab_context['tabs'][$id]['is_selected'] = true; |
|
198 | + if (!empty($tab['is_selected'])) { |
|
199 | + $tab_context['tabs'][$id]['is_selected'] = true; |
|
200 | + } |
|
193 | 201 | |
194 | 202 | // Does it have its own help? |
195 | - if (!empty($tab['help'])) |
|
196 | - $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
203 | + if (!empty($tab['help'])) { |
|
204 | + $tab_context['tabs'][$id]['help'] = $tab['help']; |
|
205 | + } |
|
197 | 206 | |
198 | 207 | // Is this the last one? |
199 | - if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) |
|
200 | - $tab_context['tabs'][$id]['is_last'] = true; |
|
208 | + if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) { |
|
209 | + $tab_context['tabs'][$id]['is_last'] = true; |
|
210 | + } |
|
201 | 211 | } |
202 | 212 | |
203 | 213 | // Find the selected tab |
@@ -214,17 +224,18 @@ discard block |
||
214 | 224 | // Show an icon and/or a help item? |
215 | 225 | if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help'])) |
216 | 226 | { |
217 | - if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) |
|
218 | - echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
|
219 | - elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) |
|
220 | - echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
|
227 | + if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) { |
|
228 | + echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>'; |
|
229 | + } elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) { |
|
230 | + echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">'; |
|
231 | + } |
|
221 | 232 | |
222 | - if (!empty($selected_tab['help']) || !empty($tab_context['help'])) |
|
223 | - echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>'; |
|
233 | + if (!empty($selected_tab['help']) || !empty($tab_context['help'])) { |
|
234 | + echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>'; |
|
235 | + } |
|
224 | 236 | |
225 | 237 | echo $tab_context['title']; |
226 | - } |
|
227 | - else |
|
238 | + } else |
|
228 | 239 | { |
229 | 240 | echo ' |
230 | 241 | ', $tab_context['title']; |
@@ -237,11 +248,12 @@ discard block |
||
237 | 248 | } |
238 | 249 | |
239 | 250 | // Shall we use the tabs? Yes, it's the only known way! |
240 | - if (!empty($selected_tab['description']) || !empty($tab_context['description'])) |
|
241 | - echo ' |
|
251 | + if (!empty($selected_tab['description']) || !empty($tab_context['description'])) { |
|
252 | + echo ' |
|
242 | 253 | <p class="information"> |
243 | 254 | ', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], ' |
244 | 255 | </p>'; |
256 | + } |
|
245 | 257 | |
246 | 258 | // Print out all the items in this tab (if any). |
247 | 259 | if (!empty($context['tabs'])) |
@@ -253,8 +265,9 @@ discard block |
||
253 | 265 | |
254 | 266 | foreach ($tab_context['tabs'] as $sa => $tab) |
255 | 267 | { |
256 | - if (!empty($tab['disabled'])) |
|
257 | - continue; |
|
268 | + if (!empty($tab['disabled'])) { |
|
269 | + continue; |
|
270 | + } |
|
258 | 271 | |
259 | 272 | if (!empty($tab['is_selected'])) |
260 | 273 | { |
@@ -262,12 +275,12 @@ discard block |
||
262 | 275 | <li> |
263 | 276 | <a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
264 | 277 | </li>'; |
265 | - } |
|
266 | - else |
|
267 | - echo ' |
|
278 | + } else { |
|
279 | + echo ' |
|
268 | 280 | <li> |
269 | 281 | <a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a> |
270 | 282 | </li>'; |
283 | + } |
|
271 | 284 | } |
272 | 285 | |
273 | 286 | // the end of tabs |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | </dd>'; |
614 | 614 | } |
615 | 615 | // A Textarea? |
616 | - elseif ($setting['type'] == 'textarea') |
|
616 | + elseif ($setting['type'] == 'textarea') |
|
617 | 617 | { |
618 | 618 | echo ' |
619 | 619 | <dt> |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | </dt> |
627 | 627 | <dd> |
628 | 628 | <textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>'; |
629 | - echo ' |
|
629 | + echo ' |
|
630 | 630 | </dd>'; |
631 | 631 | } |
632 | 632 | // A regular input box, then? |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | echo ' |
25 | 25 | <div class="cat_bar"> |
26 | 26 | <h3 class="catbg"> |
27 | - <a href="', $scripturl, '?action=helpadmin;help=themes" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> |
|
27 | + <a href="', $scripturl, '?action=helpadmin;help=themes" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> |
|
28 | 28 | ', $txt['themeadmin_title'], ' |
29 | 29 | </h3> |
30 | 30 | </div> |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if (isset($_GET['done'])) |
193 | 193 | echo ' |
194 | 194 | <div class="infobox"> |
195 | - ', $txt['theme_confirmed_'. $_GET['done']] ,' |
|
195 | + ', $txt['theme_confirmed_' . $_GET['done']], ' |
|
196 | 196 | </div>'; |
197 | 197 | |
198 | 198 | echo ' |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | <div class="cat_bar"> |
219 | 219 | <h3 class="catbg"> |
220 | 220 | <span class="floatleft"> |
221 | - ', (!empty($theme['enable']) || $theme['id'] == 1 ? '<a href="'. $scripturl .'?action=admin;area=theme;th='. $theme['id'] .';'. $context['session_var'] .'='. $context['session_id'] .';sa=list">'. $theme['name'] .'</a>' : $theme['name'] ),'', (!empty($theme['version']) ? ' <em>(' . $theme['version'] . ')</em>' : ''), ' |
|
221 | + ', (!empty($theme['enable']) || $theme['id'] == 1 ? '<a href="' . $scripturl . '?action=admin;area=theme;th=' . $theme['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';sa=list">' . $theme['name'] . '</a>' : $theme['name']), '', (!empty($theme['version']) ? ' <em>(' . $theme['version'] . ')</em>' : ''), ' |
|
222 | 222 | </span>'; |
223 | 223 | |
224 | 224 | // You *cannot* disable/enable/delete the default theme. It's important! |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | // Enable/Disable. |
231 | 231 | echo ' |
232 | - <a href="', $scripturl, '?action=admin;area=theme;sa=enable;th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['admin-tre_token_var'], '=', $context['admin-tre_token'], '', (!empty($theme['enable']) ? ';disabled' : '') ,'" data-confirm="', $txt['theme_'. (!empty($theme['enable']) ? 'disable' : 'enable') .'_confirm'], '" class="you_sure"><span class="generic_icons ',!empty($theme['enable']) ? 'disable' : 'enable','" title="', $txt['theme_'. (!empty($theme['enable']) ? 'disable' : 'enable')] ,'"></span></a>'; |
|
232 | + <a href="', $scripturl, '?action=admin;area=theme;sa=enable;th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['admin-tre_token_var'], '=', $context['admin-tre_token'], '', (!empty($theme['enable']) ? ';disabled' : ''), '" data-confirm="', $txt['theme_' . (!empty($theme['enable']) ? 'disable' : 'enable') . '_confirm'], '" class="you_sure"><span class="generic_icons ', !empty($theme['enable']) ? 'disable' : 'enable', '" title="', $txt['theme_' . (!empty($theme['enable']) ? 'disable' : 'enable')], '"></span></a>'; |
|
233 | 233 | |
234 | 234 | // Deleting. |
235 | 235 | echo ' |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | <form action="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['theme_settings']['theme_id'], '" method="post" accept-charset="', $context['character_set'], '"> |
457 | 457 | <div class="cat_bar"> |
458 | 458 | <h3 class="catbg"> |
459 | - <a href="', $scripturl, '?action=helpadmin;help=theme_settings" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ', $txt['theme_settings'], ' - ', $context['theme_settings']['name'], ' |
|
459 | + <a href="', $scripturl, '?action=helpadmin;help=theme_settings" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ', $txt['theme_settings'], ' - ', $context['theme_settings']['name'], ' |
|
460 | 460 | </h3> |
461 | 461 | </div> |
462 | 462 | <br>'; |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | echo ' |
626 | 626 | </dt> |
627 | 627 | <dd> |
628 | - <textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>'; |
|
628 | + <textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>'; |
|
629 | 629 | echo ' |
630 | 630 | </dd>'; |
631 | 631 | } |
@@ -809,14 +809,14 @@ discard block |
||
809 | 809 | if (!empty($context['error_message'])) |
810 | 810 | echo ' |
811 | 811 | <p> |
812 | - ', $context['error_message'] ,' |
|
812 | + ', $context['error_message'], ' |
|
813 | 813 | </p>'; |
814 | 814 | |
815 | 815 | // Not much to show except a link back... |
816 | 816 | else |
817 | 817 | echo ' |
818 | 818 | <p> |
819 | - <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_'. (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') .'_message'], ' |
|
819 | + <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], ' |
|
820 | 820 | </p> |
821 | 821 | <p> |
822 | 822 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | echo ' |
1157 | 1157 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
1158 | 1158 | <div class="centertext"> |
1159 | - <textarea id="on_line', $part['line'] ,'" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
|
1159 | + <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
|
1160 | 1160 | </div>'; |
1161 | 1161 | |
1162 | 1162 | echo ' |
@@ -54,9 +54,10 @@ discard block |
||
54 | 54 | <dd> |
55 | 55 | <div id="known_themes_list">'; |
56 | 56 | |
57 | - foreach ($context['themes'] as $theme) |
|
58 | - echo ' |
|
57 | + foreach ($context['themes'] as $theme) { |
|
58 | + echo ' |
|
59 | 59 | <label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>'; |
60 | + } |
|
60 | 61 | |
61 | 62 | echo ' |
62 | 63 | </div> |
@@ -73,9 +74,10 @@ discard block |
||
73 | 74 | <select name="options[theme_guests]" id="theme_guests">'; |
74 | 75 | |
75 | 76 | // Put an option for each theme in the select box. |
76 | - foreach ($context['themes'] as $theme) |
|
77 | - echo ' |
|
77 | + foreach ($context['themes'] as $theme) { |
|
78 | + echo ' |
|
78 | 79 | <option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
80 | + } |
|
79 | 81 | |
80 | 82 | echo ' |
81 | 83 | </select> |
@@ -90,9 +92,10 @@ discard block |
||
90 | 92 | <option value="0">', $txt['theme_forum_default'], '</option>'; |
91 | 93 | |
92 | 94 | // Same thing, this time for changing the theme of everyone. |
93 | - foreach ($context['themes'] as $theme) |
|
94 | - echo ' |
|
95 | + foreach ($context['themes'] as $theme) { |
|
96 | + echo ' |
|
95 | 97 | <option value="', $theme['id'], '">', $theme['name'], '</option>'; |
98 | + } |
|
96 | 99 | |
97 | 100 | echo ' |
98 | 101 | </select> |
@@ -189,11 +192,12 @@ discard block |
||
189 | 192 | global $context, $scripturl, $txt; |
190 | 193 | |
191 | 194 | // Show a nice confirmation message. |
192 | - if (isset($_GET['done'])) |
|
193 | - echo ' |
|
195 | + if (isset($_GET['done'])) { |
|
196 | + echo ' |
|
194 | 197 | <div class="infobox"> |
195 | 198 | ', $txt['theme_confirmed_'. $_GET['done']] ,' |
196 | 199 | </div>'; |
200 | + } |
|
197 | 201 | |
198 | 202 | echo ' |
199 | 203 | <div id="admincenter">'; |
@@ -353,22 +357,24 @@ discard block |
||
353 | 357 | <dt ', $context['theme_options_reset'] ? 'style="width:50%"' : '', '>'; |
354 | 358 | |
355 | 359 | // Show the change option box ? |
356 | - if ($context['theme_options_reset']) |
|
357 | - echo ' |
|
360 | + if ($context['theme_options_reset']) { |
|
361 | + echo ' |
|
358 | 362 | <span class="floatleft"><select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
359 | 363 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
360 | 364 | <option value="1">', $txt['themeadmin_reset_options_change'], '</option> |
361 | 365 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
362 | 366 | </select> </span>'; |
367 | + } |
|
363 | 368 | |
364 | 369 | // display checkbox options |
365 | 370 | if ($setting['type'] == 'checkbox') |
366 | 371 | { |
367 | 372 | echo ' |
368 | 373 | <label for="options_', $setting['id'], '">', $setting['label'], '</label>'; |
369 | - if (isset($setting['description'])) |
|
370 | - echo ' |
|
374 | + if (isset($setting['description'])) { |
|
375 | + echo ' |
|
371 | 376 | <br><span class="smalltext">', $setting['description'], '</span>'; |
377 | + } |
|
372 | 378 | echo ' |
373 | 379 | </dt> |
374 | 380 | <dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '> |
@@ -380,9 +386,10 @@ discard block |
||
380 | 386 | { |
381 | 387 | echo ' |
382 | 388 | <label for="options_', $setting['id'], '">', $setting['label'], '</label>'; |
383 | - if (isset($setting['description'])) |
|
384 | - echo ' |
|
389 | + if (isset($setting['description'])) { |
|
390 | + echo ' |
|
385 | 391 | <br><span class="smalltext">', $setting['description'], '</span>'; |
392 | + } |
|
386 | 393 | echo ' |
387 | 394 | </dt> |
388 | 395 | <dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '> |
@@ -402,9 +409,10 @@ discard block |
||
402 | 409 | { |
403 | 410 | echo ' |
404 | 411 | <label for="options_', $setting['id'], '">', $setting['label'], '</label>'; |
405 | - if (isset($setting['description'])) |
|
406 | - echo ' |
|
412 | + if (isset($setting['description'])) { |
|
413 | + echo ' |
|
407 | 414 | <br><span class="smalltext">', $setting['description'], '</span>'; |
415 | + } |
|
408 | 416 | echo ' |
409 | 417 | </dt> |
410 | 418 | <dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>'; |
@@ -417,8 +425,7 @@ discard block |
||
417 | 425 | |
418 | 426 | echo ' |
419 | 427 | <input type="number"', $min . $max . $step; |
420 | - } |
|
421 | - else |
|
428 | + } else |
|
422 | 429 | { |
423 | 430 | echo ' |
424 | 431 | <input type="text"'; |
@@ -462,8 +469,8 @@ discard block |
||
462 | 469 | <br>'; |
463 | 470 | |
464 | 471 | // @todo Why can't I edit the default theme popup. |
465 | - if ($context['theme_settings']['theme_id'] != 1) |
|
466 | - echo ' |
|
472 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
473 | + echo ' |
|
467 | 474 | <div class="cat_bar"> |
468 | 475 | <h3 class="catbg config_hd"> |
469 | 476 | ', $txt['theme_edit'], ' |
@@ -479,6 +486,7 @@ discard block |
||
479 | 486 | </li> |
480 | 487 | </ul> |
481 | 488 | </div>'; |
489 | + } |
|
482 | 490 | |
483 | 491 | echo ' |
484 | 492 | <div class="cat_bar"> |
@@ -532,9 +540,10 @@ discard block |
||
532 | 540 | <dd> |
533 | 541 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
534 | 542 | |
535 | - foreach ($context['theme_variants'] as $key => $variant) |
|
536 | - echo ' |
|
543 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
544 | + echo ' |
|
537 | 545 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
546 | + } |
|
538 | 547 | |
539 | 548 | echo ' |
540 | 549 | </select> |
@@ -577,9 +586,10 @@ discard block |
||
577 | 586 | <dt> |
578 | 587 | <label for="', $setting['id'], '">', $setting['label'], '</label>:'; |
579 | 588 | |
580 | - if (isset($setting['description'])) |
|
581 | - echo '<br> |
|
589 | + if (isset($setting['description'])) { |
|
590 | + echo '<br> |
|
582 | 591 | <span class="smalltext">', $setting['description'], '</span>'; |
592 | + } |
|
583 | 593 | |
584 | 594 | echo ' |
585 | 595 | </dt> |
@@ -595,18 +605,20 @@ discard block |
||
595 | 605 | <dt> |
596 | 606 | <label for="', $setting['id'], '">', $setting['label'], '</label>:'; |
597 | 607 | |
598 | - if (isset($setting['description'])) |
|
599 | - echo '<br> |
|
608 | + if (isset($setting['description'])) { |
|
609 | + echo '<br> |
|
600 | 610 | <span class="smalltext">', $setting['description'], '</span>'; |
611 | + } |
|
601 | 612 | |
602 | 613 | echo ' |
603 | 614 | </dt> |
604 | 615 | <dd> |
605 | 616 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
606 | 617 | |
607 | - foreach ($setting['options'] as $value => $label) |
|
608 | - echo ' |
|
618 | + foreach ($setting['options'] as $value => $label) { |
|
619 | + echo ' |
|
609 | 620 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
621 | + } |
|
610 | 622 | |
611 | 623 | echo ' |
612 | 624 | </select> |
@@ -619,9 +631,10 @@ discard block |
||
619 | 631 | <dt> |
620 | 632 | <label for="', $setting['id'], '">', $setting['label'], '</label>:'; |
621 | 633 | |
622 | - if (isset($setting['description'])) |
|
623 | - echo '<br> |
|
634 | + if (isset($setting['description'])) { |
|
635 | + echo '<br> |
|
624 | 636 | <span class="smalltext">', $setting['description'], '</span>'; |
637 | + } |
|
625 | 638 | echo ' |
626 | 639 | </dt> |
627 | 640 | <dd> |
@@ -636,9 +649,10 @@ discard block |
||
636 | 649 | <dt> |
637 | 650 | <label for="', $setting['id'], '">', $setting['label'], '</label>:'; |
638 | 651 | |
639 | - if (isset($setting['description'])) |
|
640 | - echo '<br> |
|
652 | + if (isset($setting['description'])) { |
|
653 | + echo '<br> |
|
641 | 654 | <span class="smalltext">', $setting['description'], '</span>'; |
655 | + } |
|
642 | 656 | |
643 | 657 | echo ' |
644 | 658 | </dt> |
@@ -652,8 +666,7 @@ discard block |
||
652 | 666 | |
653 | 667 | echo ' |
654 | 668 | <input type="number"', $min . $max . $step; |
655 | - } |
|
656 | - else |
|
669 | + } else |
|
657 | 670 | { |
658 | 671 | echo ' |
659 | 672 | <input type="text"'; |
@@ -806,21 +819,23 @@ discard block |
||
806 | 819 | <div class="windowbg">'; |
807 | 820 | |
808 | 821 | // Oops! there was an error :( |
809 | - if (!empty($context['error_message'])) |
|
810 | - echo ' |
|
822 | + if (!empty($context['error_message'])) { |
|
823 | + echo ' |
|
811 | 824 | <p> |
812 | 825 | ', $context['error_message'] ,' |
813 | 826 | </p>'; |
827 | + } |
|
814 | 828 | |
815 | 829 | // Not much to show except a link back... |
816 | - else |
|
817 | - echo ' |
|
830 | + else { |
|
831 | + echo ' |
|
818 | 832 | <p> |
819 | 833 | <a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_'. (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') .'_message'], ' |
820 | 834 | </p> |
821 | 835 | <p> |
822 | 836 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
823 | 837 | </p>'; |
838 | + } |
|
824 | 839 | |
825 | 840 | echo ' |
826 | 841 | </div> |
@@ -887,10 +902,11 @@ discard block |
||
887 | 902 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
888 | 903 | <span class="floatright">'; |
889 | 904 | |
890 | - if ($template['can_copy']) |
|
891 | - echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
|
892 | - else |
|
893 | - echo $txt['themeadmin_edit_no_copy']; |
|
905 | + if ($template['can_copy']) { |
|
906 | + echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>'; |
|
907 | + } else { |
|
908 | + echo $txt['themeadmin_edit_no_copy']; |
|
909 | + } |
|
894 | 910 | |
895 | 911 | echo ' |
896 | 912 | </span> |
@@ -913,11 +929,12 @@ discard block |
||
913 | 929 | echo ' |
914 | 930 | <div id="admincenter">'; |
915 | 931 | |
916 | - if (!empty($context['browse_title'])) |
|
917 | - echo ' |
|
932 | + if (!empty($context['browse_title'])) { |
|
933 | + echo ' |
|
918 | 934 | <div class="cat_bar"> |
919 | 935 | <h3 class="catbg">', $context['browse_title'], '</h3> |
920 | 936 | </div>'; |
937 | + } |
|
921 | 938 | |
922 | 939 | echo ' |
923 | 940 | <table class="table_grid tborder"> |
@@ -937,14 +954,13 @@ discard block |
||
937 | 954 | <tr class="windowbg"> |
938 | 955 | <td>'; |
939 | 956 | |
940 | - if ($file['is_editable']) |
|
941 | - echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
|
942 | - |
|
943 | - elseif ($file['is_directory']) |
|
944 | - echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
|
945 | - |
|
946 | - else |
|
947 | - echo $file['filename']; |
|
957 | + if ($file['is_editable']) { |
|
958 | + echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
|
959 | + } elseif ($file['is_directory']) { |
|
960 | + echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
|
961 | + } else { |
|
962 | + echo $file['filename']; |
|
963 | + } |
|
948 | 964 | |
949 | 965 | echo ' |
950 | 966 | </td> |
@@ -966,11 +982,12 @@ discard block |
||
966 | 982 | { |
967 | 983 | global $context, $settings, $scripturl, $txt; |
968 | 984 | |
969 | - if ($context['session_error']) |
|
970 | - echo ' |
|
985 | + if ($context['session_error']) { |
|
986 | + echo ' |
|
971 | 987 | <div class="errorbox"> |
972 | 988 | ', $txt['error_session_timeout'], ' |
973 | 989 | </div>'; |
990 | + } |
|
974 | 991 | |
975 | 992 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
976 | 993 | echo ' |
@@ -1033,17 +1050,18 @@ discard block |
||
1033 | 1050 | try |
1034 | 1051 | { |
1035 | 1052 | '; |
1036 | - if (isBrowser('is_ie')) |
|
1037 | - echo ' |
|
1053 | + if (isBrowser('is_ie')) { |
|
1054 | + echo ' |
|
1038 | 1055 | var sheets = frames["css_preview_box"].document.styleSheets; |
1039 | 1056 | for (var j = 0; j < sheets.length; j++) |
1040 | 1057 | { |
1041 | 1058 | if (sheets[j].id == "css_preview_box") |
1042 | 1059 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
1043 | 1060 | }'; |
1044 | - else |
|
1045 | - echo ' |
|
1061 | + } else { |
|
1062 | + echo ' |
|
1046 | 1063 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
1064 | + } |
|
1047 | 1065 | echo ' |
1048 | 1066 | } |
1049 | 1067 | catch (e) |
@@ -1095,9 +1113,10 @@ discard block |
||
1095 | 1113 | </div> |
1096 | 1114 | <div class="windowbg">'; |
1097 | 1115 | |
1098 | - if (!$context['allow_save']) |
|
1099 | - echo ' |
|
1116 | + if (!$context['allow_save']) { |
|
1117 | + echo ' |
|
1100 | 1118 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1119 | + } |
|
1101 | 1120 | |
1102 | 1121 | echo ' |
1103 | 1122 | <textarea name="entire_file" cols="80" rows="20" style="width: 96%; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br> |
@@ -1110,9 +1129,10 @@ discard block |
||
1110 | 1129 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1111 | 1130 | |
1112 | 1131 | // Hopefully it exists. |
1113 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1114 | - echo ' |
|
1132 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1133 | + echo ' |
|
1115 | 1134 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1135 | + } |
|
1116 | 1136 | |
1117 | 1137 | echo ' |
1118 | 1138 | </form> |
@@ -1126,18 +1146,20 @@ discard block |
||
1126 | 1146 | { |
1127 | 1147 | global $context, $scripturl, $txt; |
1128 | 1148 | |
1129 | - if ($context['session_error']) |
|
1130 | - echo ' |
|
1149 | + if ($context['session_error']) { |
|
1150 | + echo ' |
|
1131 | 1151 | <div class="errorbox"> |
1132 | 1152 | ', $txt['error_session_timeout'], ' |
1133 | 1153 | </div>'; |
1154 | + } |
|
1134 | 1155 | |
1135 | - if (isset($context['parse_error'])) |
|
1136 | - echo ' |
|
1156 | + if (isset($context['parse_error'])) { |
|
1157 | + echo ' |
|
1137 | 1158 | <div class="errorbox"> |
1138 | 1159 | ', $txt['themeadmin_edit_error'], ' |
1139 | 1160 | <div><pre>', $context['parse_error'], '</pre></div> |
1140 | 1161 | </div>'; |
1162 | + } |
|
1141 | 1163 | |
1142 | 1164 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1143 | 1165 | echo ' |
@@ -1148,16 +1170,18 @@ discard block |
||
1148 | 1170 | </div> |
1149 | 1171 | <div class="windowbg">'; |
1150 | 1172 | |
1151 | - if (!$context['allow_save']) |
|
1152 | - echo ' |
|
1173 | + if (!$context['allow_save']) { |
|
1174 | + echo ' |
|
1153 | 1175 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
1176 | + } |
|
1154 | 1177 | |
1155 | - foreach ($context['file_parts'] as $part) |
|
1156 | - echo ' |
|
1178 | + foreach ($context['file_parts'] as $part) { |
|
1179 | + echo ' |
|
1157 | 1180 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
1158 | 1181 | <div class="centertext"> |
1159 | 1182 | <textarea id="on_line', $part['line'] ,'" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
1160 | 1183 | </div>'; |
1184 | + } |
|
1161 | 1185 | |
1162 | 1186 | echo ' |
1163 | 1187 | <div class="padding righttext"> |
@@ -1166,9 +1190,10 @@ discard block |
||
1166 | 1190 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1167 | 1191 | |
1168 | 1192 | // Hopefully it exists. |
1169 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1170 | - echo ' |
|
1193 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1194 | + echo ' |
|
1171 | 1195 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1196 | + } |
|
1172 | 1197 | |
1173 | 1198 | echo ' |
1174 | 1199 | </div> |
@@ -1184,18 +1209,20 @@ discard block |
||
1184 | 1209 | { |
1185 | 1210 | global $context, $scripturl, $txt; |
1186 | 1211 | |
1187 | - if ($context['session_error']) |
|
1188 | - echo ' |
|
1212 | + if ($context['session_error']) { |
|
1213 | + echo ' |
|
1189 | 1214 | <div class="errorbox"> |
1190 | 1215 | ', $txt['error_session_timeout'], ' |
1191 | 1216 | </div>'; |
1217 | + } |
|
1192 | 1218 | |
1193 | 1219 | //Is this file writeable? |
1194 | - if (!$context['allow_save']) |
|
1195 | - echo ' |
|
1220 | + if (!$context['allow_save']) { |
|
1221 | + echo ' |
|
1196 | 1222 | <div class="errorbox"> |
1197 | 1223 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
1198 | 1224 | </div>'; |
1225 | + } |
|
1199 | 1226 | |
1200 | 1227 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
1201 | 1228 | echo ' |
@@ -1211,9 +1238,10 @@ discard block |
||
1211 | 1238 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
1212 | 1239 | |
1213 | 1240 | // Hopefully it exists. |
1214 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
1215 | - echo ' |
|
1241 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
1242 | + echo ' |
|
1216 | 1243 | <input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">'; |
1244 | + } |
|
1217 | 1245 | |
1218 | 1246 | echo ' |
1219 | 1247 | </div> |
@@ -25,18 +25,20 @@ discard block |
||
25 | 25 | </div> |
26 | 26 | <div class="windowbg2 noup">'; |
27 | 27 | |
28 | - if (!empty($context['move_board'])) |
|
29 | - echo ' |
|
28 | + if (!empty($context['move_board'])) { |
|
29 | + echo ' |
|
30 | 30 | <div class="noticebox"> |
31 | 31 | ', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', ' |
32 | 32 | </div>'; |
33 | + } |
|
33 | 34 | |
34 | 35 | // No categories so show a label. |
35 | - if (empty($context['categories'])) |
|
36 | - echo ' |
|
36 | + if (empty($context['categories'])) { |
|
37 | + echo ' |
|
37 | 38 | <div class="windowbg centertext"> |
38 | 39 | ', $txt['mboards_no_cats'], ' |
39 | 40 | </div>'; |
41 | + } |
|
40 | 42 | |
41 | 43 | // Loop through every category, listing the boards in each as we go. |
42 | 44 | foreach ($context['categories'] as $category) |
@@ -54,9 +56,10 @@ discard block |
||
54 | 56 | <form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '"> |
55 | 57 | <ul id="category_', $category['id'], '" class="nolist">'; |
56 | 58 | |
57 | - if (!empty($category['move_link'])) |
|
58 | - echo ' |
|
59 | + if (!empty($category['move_link'])) { |
|
60 | + echo ' |
|
59 | 61 | <li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>'; |
62 | + } |
|
60 | 63 | |
61 | 64 | $recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>'; |
62 | 65 | $redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">'; |
@@ -81,9 +84,10 @@ discard block |
||
81 | 84 | echo ' |
82 | 85 | <li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">'; |
83 | 86 | |
84 | - foreach ($board['move_links'] as $link) |
|
85 | - echo ' |
|
87 | + foreach ($board['move_links'] as $link) { |
|
88 | + echo ' |
|
86 | 89 | <a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>'; |
90 | + } |
|
87 | 91 | |
88 | 92 | echo ' |
89 | 93 | </li>'; |
@@ -132,9 +136,10 @@ discard block |
||
132 | 136 | <select name="cat_order">'; |
133 | 137 | |
134 | 138 | // Print every existing category into a select box. |
135 | - foreach ($context['category_order'] as $order) |
|
136 | - echo ' |
|
139 | + foreach ($context['category_order'] as $order) { |
|
140 | + echo ' |
|
137 | 141 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
142 | + } |
|
138 | 143 | echo ' |
139 | 144 | </select> |
140 | 145 | </dd>'; |
@@ -168,21 +173,23 @@ discard block |
||
168 | 173 | echo ' |
169 | 174 | </dl>'; |
170 | 175 | |
171 | - if (isset($context['category']['is_new'])) |
|
172 | - echo ' |
|
176 | + if (isset($context['category']['is_new'])) { |
|
177 | + echo ' |
|
173 | 178 | <input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit">'; |
174 | - else |
|
175 | - echo ' |
|
179 | + } else { |
|
180 | + echo ' |
|
176 | 181 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button_submit"> |
177 | 182 | <input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button_submit you_sure">'; |
183 | + } |
|
178 | 184 | echo ' |
179 | 185 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
180 | 186 | <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">'; |
181 | 187 | |
182 | 188 | // If this category is empty we don't bother with the next confirmation screen. |
183 | - if ($context['category']['is_empty']) |
|
184 | - echo ' |
|
189 | + if ($context['category']['is_empty']) { |
|
190 | + echo ' |
|
185 | 191 | <input type="hidden" name="empty" value="1">'; |
192 | + } |
|
186 | 193 | |
187 | 194 | echo ' |
188 | 195 | </div> |
@@ -209,9 +216,10 @@ discard block |
||
209 | 216 | <p>', $txt['mboards_delete_cat_contains'], ':</p> |
210 | 217 | <ul>'; |
211 | 218 | |
212 | - foreach ($context['category']['children'] as $child) |
|
213 | - echo ' |
|
219 | + foreach ($context['category']['children'] as $child) { |
|
220 | + echo ' |
|
214 | 221 | <li>', $child, '</li>'; |
222 | + } |
|
215 | 223 | |
216 | 224 | echo ' |
217 | 225 | </ul> |
@@ -225,10 +233,11 @@ discard block |
||
225 | 233 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>: |
226 | 234 | <select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>'; |
227 | 235 | |
228 | - foreach ($context['category_order'] as $cat) |
|
229 | - if ($cat['id'] != 0) |
|
236 | + foreach ($context['category_order'] as $cat) { |
|
237 | + if ($cat['id'] != 0) |
|
230 | 238 | echo ' |
231 | 239 | <option value="', $cat['id'], '">', $cat['true_name'], '</option>'; |
240 | + } |
|
232 | 241 | |
233 | 242 | echo ' |
234 | 243 | </select> |
@@ -272,9 +281,10 @@ discard block |
||
272 | 281 | </dt> |
273 | 282 | <dd> |
274 | 283 | <select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">'; |
275 | - foreach ($context['categories'] as $category) |
|
276 | - echo ' |
|
284 | + foreach ($context['categories'] as $category) { |
|
285 | + echo ' |
|
277 | 286 | <option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>'; |
287 | + } |
|
278 | 288 | echo ' |
279 | 289 | </select> |
280 | 290 | </dd>'; |
@@ -301,9 +311,10 @@ discard block |
||
301 | 311 | echo ' |
302 | 312 | <select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '> |
303 | 313 | ', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : ''; |
304 | - foreach ($context['board_order'] as $order) |
|
305 | - echo ' |
|
314 | + foreach ($context['board_order'] as $order) { |
|
315 | + echo ' |
|
306 | 316 | <option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>'; |
317 | + } |
|
307 | 318 | echo ' |
308 | 319 | </select> |
309 | 320 | </dd>'; |
@@ -332,13 +343,15 @@ discard block |
||
332 | 343 | <dd> |
333 | 344 | <select name="profile">'; |
334 | 345 | |
335 | - if (isset($context['board']['is_new'])) |
|
336 | - echo ' |
|
346 | + if (isset($context['board']['is_new'])) { |
|
347 | + echo ' |
|
337 | 348 | <option value="-1">[', $txt['permission_profile_inherit'], ']</option>'; |
349 | + } |
|
338 | 350 | |
339 | - foreach ($context['profiles'] as $id => $profile) |
|
340 | - echo ' |
|
351 | + foreach ($context['profiles'] as $id => $profile) { |
|
352 | + echo ' |
|
341 | 353 | <option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>'; |
354 | + } |
|
342 | 355 | |
343 | 356 | echo ' |
344 | 357 | </select> |
@@ -351,8 +364,8 @@ discard block |
||
351 | 364 | </dt> |
352 | 365 | <dd>'; |
353 | 366 | |
354 | - if (!empty($modSettings['deny_boards_access'])) |
|
355 | - echo ' |
|
367 | + if (!empty($modSettings['deny_boards_access'])) { |
|
368 | + echo ' |
|
356 | 369 | <table> |
357 | 370 | <tr> |
358 | 371 | <td></td> |
@@ -360,10 +373,11 @@ discard block |
||
360 | 373 | <th>', $txt['permissions_option_off'], '</th> |
361 | 374 | <th>', $txt['permissions_option_deny'], '</th> |
362 | 375 | </tr>'; |
376 | + } |
|
363 | 377 | |
364 | 378 | // List all the membergroups so the user can choose who may access this board. |
365 | - foreach ($context['groups'] as $group) |
|
366 | - if (empty($modSettings['deny_boards_access'])) |
|
379 | + foreach ($context['groups'] as $group) { |
|
380 | + if (empty($modSettings['deny_boards_access'])) |
|
367 | 381 | echo ' |
368 | 382 | <label for="groups_', $group['id'], '"> |
369 | 383 | <input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), ' class="input_check"> |
@@ -371,8 +385,9 @@ discard block |
||
371 | 385 | ', $group['name'], ' |
372 | 386 | </span> |
373 | 387 | </label><br>'; |
374 | - else |
|
375 | - echo ' |
|
388 | + } |
|
389 | + else { |
|
390 | + echo ' |
|
376 | 391 | <tr> |
377 | 392 | <td> |
378 | 393 | <label for="groups_', $group['id'], '_a"> |
@@ -392,16 +407,17 @@ discard block |
||
392 | 407 | </td> |
393 | 408 | <td></td> |
394 | 409 | </tr>'; |
410 | + } |
|
395 | 411 | |
396 | - if (empty($modSettings['deny_boards_access'])) |
|
397 | - echo ' |
|
412 | + if (empty($modSettings['deny_boards_access'])) { |
|
413 | + echo ' |
|
398 | 414 | <span class="select_all_box"> |
399 | 415 | <em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[\');"> |
400 | 416 | </span> |
401 | 417 | <br><br> |
402 | 418 | </dd>'; |
403 | - else |
|
404 | - echo ' |
|
419 | + } else { |
|
420 | + echo ' |
|
405 | 421 | <tr class="select_all_box"> |
406 | 422 | <td> |
407 | 423 | </td> |
@@ -420,6 +436,7 @@ discard block |
||
420 | 436 | </tr> |
421 | 437 | </table> |
422 | 438 | </dd>'; |
439 | + } |
|
423 | 440 | |
424 | 441 | // Options to choose moderators, specify as announcement board and choose whether to count posts here. |
425 | 442 | echo ' |
@@ -474,8 +491,8 @@ discard block |
||
474 | 491 | </dl> |
475 | 492 | </div>'; |
476 | 493 | |
477 | - if ($context['board']['redirect']) |
|
478 | - echo ' |
|
494 | + if ($context['board']['redirect']) { |
|
495 | + echo ' |
|
479 | 496 | <div id="reset_redirect_div"> |
480 | 497 | <dl class="settings"> |
481 | 498 | <dt> |
@@ -488,6 +505,7 @@ discard block |
||
488 | 505 | </dd> |
489 | 506 | </dl> |
490 | 507 | </div>'; |
508 | + } |
|
491 | 509 | } |
492 | 510 | |
493 | 511 | echo ' |
@@ -515,9 +533,10 @@ discard block |
||
515 | 533 | <select name="boardtheme" id="boardtheme" onchange="refreshOptions();"> |
516 | 534 | <option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>'; |
517 | 535 | |
518 | - foreach ($context['themes'] as $theme) |
|
519 | - echo ' |
|
536 | + foreach ($context['themes'] as $theme) { |
|
537 | + echo ' |
|
520 | 538 | <option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>'; |
539 | + } |
|
521 | 540 | |
522 | 541 | echo ' |
523 | 542 | </select> |
@@ -536,9 +555,10 @@ discard block |
||
536 | 555 | </dl> |
537 | 556 | </div>'; |
538 | 557 | |
539 | - if (!empty($context['board']['is_recycle'])) |
|
540 | - echo ' |
|
558 | + if (!empty($context['board']['is_recycle'])) { |
|
559 | + echo ' |
|
541 | 560 | <div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>'; |
561 | + } |
|
542 | 562 | |
543 | 563 | echo ' |
544 | 564 | <input type="hidden" name="rid" value="', $context['redirect_location'], '"> |
@@ -546,21 +566,24 @@ discard block |
||
546 | 566 | <input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">'; |
547 | 567 | |
548 | 568 | // If this board has no children don't bother with the next confirmation screen. |
549 | - if ($context['board']['no_children']) |
|
550 | - echo ' |
|
569 | + if ($context['board']['no_children']) { |
|
570 | + echo ' |
|
551 | 571 | <input type="hidden" name="no_children" value="1">'; |
572 | + } |
|
552 | 573 | |
553 | - if (isset($context['board']['is_new'])) |
|
554 | - echo ' |
|
574 | + if (isset($context['board']['is_new'])) { |
|
575 | + echo ' |
|
555 | 576 | <input type="hidden" name="cur_cat" value="', $context['board']['category'], '"> |
556 | 577 | <input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit">'; |
557 | - else |
|
558 | - echo ' |
|
578 | + } else { |
|
579 | + echo ' |
|
559 | 580 | <input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button_submit">'; |
581 | + } |
|
560 | 582 | |
561 | - if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) |
|
562 | - echo ' |
|
583 | + if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) { |
|
584 | + echo ' |
|
563 | 585 | <input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button_submit you_sure">'; |
586 | + } |
|
564 | 587 | echo ' |
565 | 588 | </div> |
566 | 589 | </form> |
@@ -581,12 +604,13 @@ discard block |
||
581 | 604 | sItemListContainerId: \'moderator_container\', |
582 | 605 | aListItems: ['; |
583 | 606 | |
584 | - foreach ($context['board']['moderators'] as $id_member => $member_name) |
|
585 | - echo ' |
|
607 | + foreach ($context['board']['moderators'] as $id_member => $member_name) { |
|
608 | + echo ' |
|
586 | 609 | { |
587 | 610 | sItemId: ', JavaScriptEscape($id_member), ', |
588 | 611 | sItemName: ', JavaScriptEscape($member_name), ' |
589 | 612 | }', $id_member == $context['board']['last_moderator_id'] ? '' : ','; |
613 | + } |
|
590 | 614 | |
591 | 615 | echo ' |
592 | 616 | ] |
@@ -606,12 +630,13 @@ discard block |
||
606 | 630 | sItemListContainerId: \'moderator_group_container\', |
607 | 631 | aListItems: ['; |
608 | 632 | |
609 | - foreach ($context['board']['moderator_groups'] as $id_group => $group_name) |
|
610 | - echo ' |
|
633 | + foreach ($context['board']['moderator_groups'] as $id_group => $group_name) { |
|
634 | + echo ' |
|
611 | 635 | { |
612 | 636 | sItemId: ', JavaScriptEscape($id_group), ', |
613 | 637 | sItemName: ', JavaScriptEscape($group_name), ' |
614 | 638 | }', $id_group == $context['board']['last_moderator_group_id'] ? '' : ','; |
639 | + } |
|
615 | 640 | |
616 | 641 | echo ' |
617 | 642 | ] |
@@ -637,9 +662,10 @@ discard block |
||
637 | 662 | echo ' |
638 | 663 | document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";'; |
639 | 664 | |
640 | - if ($context['board']['redirect']) |
|
641 | - echo ' |
|
665 | + if ($context['board']['redirect']) { |
|
666 | + echo ' |
|
642 | 667 | document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";'; |
668 | + } |
|
643 | 669 | } |
644 | 670 | |
645 | 671 | echo ' |
@@ -668,9 +694,10 @@ discard block |
||
668 | 694 | <p>', $txt['mboards_delete_board_contains'], '</p> |
669 | 695 | <ul>'; |
670 | 696 | |
671 | - foreach ($context['children'] as $child) |
|
672 | - echo ' |
|
697 | + foreach ($context['children'] as $child) { |
|
698 | + echo ' |
|
673 | 699 | <li>', $child['node']['name'], '</li>'; |
700 | + } |
|
674 | 701 | |
675 | 702 | echo ' |
676 | 703 | </ul> |
@@ -684,10 +711,11 @@ discard block |
||
684 | 711 | <label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>: |
685 | 712 | <select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>'; |
686 | 713 | |
687 | - foreach ($context['board_order'] as $board) |
|
688 | - if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
714 | + foreach ($context['board_order'] as $board) { |
|
715 | + if ($board['id'] != $context['board']['id'] && empty($board['is_child'])) |
|
689 | 716 | echo ' |
690 | 717 | <option value="', $board['id'], '">', $board['name'], '</option>'; |
718 | + } |
|
691 | 719 | |
692 | 720 | echo ' |
693 | 721 | </select> |