@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | echo ' |
24 | 24 | <div class="infobox"> |
25 | - ', $txt['report_action_'. $context['report_post_action']], ' |
|
25 | + ', $txt['report_action_' . $context['report_post_action']], ' |
|
26 | 26 | </div>'; |
27 | 27 | } |
28 | 28 | |
@@ -65,18 +65,18 @@ discard block |
||
65 | 65 | <br> |
66 | 66 | <ul class="quickbuttons"> |
67 | 67 | <li><a href="', $report['report_href'], '">', $details_button, '</a></li> |
68 | - <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" ', (!$report['ignore'] ? ' class="you_sure" data-confirm="'. $txt['mc_reportedp_ignore_confirm'] .'"' : '') ,'>', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li> |
|
68 | + <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" ', (!$report['ignore'] ? ' class="you_sure" data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : ''), '>', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li> |
|
69 | 69 | <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
70 | 70 | |
71 | 71 | // Delete message button. |
72 | 72 | if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) |
73 | 73 | echo ' |
74 | - <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'] ,'.0;msg=', $report['topic']['id_msg'] ,';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'] ,'" class="you_sure">', $delete_button, '</a></li>'; |
|
74 | + <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'], '.0;msg=', $report['topic']['id_msg'], ';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'], '" class="you_sure">', $delete_button, '</a></li>'; |
|
75 | 75 | |
76 | 76 | // Ban this user button. |
77 | 77 | if (!$report['closed'] && !empty($context['report_manage_bans'])) |
78 | 78 | echo ' |
79 | - <li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u='. $report['author']['id'] : ';msg='. $report['topic']['id_msg']) ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
|
79 | + <li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']), ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
|
80 | 80 | |
81 | 81 | if (!$context['view_closed']) |
82 | 82 | echo ' |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | |
97 | 97 | echo ' |
98 | 98 | <div class="pagesection"> |
99 | - ', !empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many'] ? '<div class="pagelinks floatleft">'. $context['page_index']. '</div>' : '' ,' |
|
99 | + ', !empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many'] ? '<div class="pagelinks floatleft">' . $context['page_index'] . '</div>' : '', ' |
|
100 | 100 | <div class="floatright">', !$context['view_closed'] ? ' |
101 | - <input type="hidden" name="'. $context['mod-report-close-all_token_var'] .'" value="'. $context['mod-report-close-all_token'] .'"> |
|
101 | + <input type="hidden" name="'. $context['mod-report-close-all_token_var'] . '" value="' . $context['mod-report-close-all_token'] . '"> |
|
102 | 102 | <input type="submit" name="close_selected" value="' . $txt['mc_reportedp_close_selected'] . '" class="button_submit">' : '', ' |
103 | 103 | </div> |
104 | 104 | </div> |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | { |
189 | 189 | echo ' |
190 | 190 | <div class="infobox"> |
191 | - ', $txt['report_action_'. $context['report_post_action']], ' |
|
191 | + ', $txt['report_action_' . $context['report_post_action']], ' |
|
192 | 192 | </div>'; |
193 | 193 | } |
194 | 194 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $unignore_button = create_button('ignore', 'mc_reportedp_unignore', 'mc_reportedp_unignore'); |
214 | 214 | |
215 | 215 | echo ' |
216 | - <a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;ignore=', (int) !$context['report']['ignore'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="button', (!$context['report']['ignore'] ? ' you_sure' : '') ,'"', (!$context['report']['ignore'] ? ' data-confirm="'. $txt['mc_reportedp_ignore_confirm'] .'"' : '') ,'>', $context['report']['ignore'] ? $unignore_button : $ignore_button, '</a> |
|
216 | + <a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;ignore=', (int) !$context['report']['ignore'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="button', (!$context['report']['ignore'] ? ' you_sure' : ''), '"', (!$context['report']['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : ''), '>', $context['report']['ignore'] ? $unignore_button : $ignore_button, '</a> |
|
217 | 217 | <a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$context['report']['closed'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '" class="button">', $close_button, '</a> |
218 | 218 | </span> |
219 | 219 | </h3> |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | { |
251 | 251 | echo ' |
252 | 252 | <div class="title_bar"> |
253 | - <h3 class="titlebg">', $comment['member']['link'], ': <em class="smalltext">(', $comment['time'], ')</em>', ($comment['can_edit'] ? '<span class="floatright"><a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=editcomment;rid='. $context['report']['id'] .';mid='. $comment['id'] .';'. $context['session_var'] .'='. $context['session_id'] .'" class="button">'. $txt['mc_reportedp_comment_edit'] .'</a><a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=handlecomment;rid='. $context['report']['id'] .';mid='. $comment['id'] .';delete;'. $context['session_var'] .'='. $context['session_id']. ';'. $context['mod-reportC-delete_token_var'] .'='. $context['mod-reportC-delete_token'] .'" class="button">'. $txt['mc_reportedp_comment_delete'] .'</a></span>' : '') ,'</h3> |
|
253 | + <h3 class="titlebg">', $comment['member']['link'], ': <em class="smalltext">(', $comment['time'], ')</em>', ($comment['can_edit'] ? '<span class="floatright"><a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=editcomment;rid=' . $context['report']['id'] . ';mid=' . $comment['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" class="button">' . $txt['mc_reportedp_comment_edit'] . '</a><a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=handlecomment;rid=' . $context['report']['id'] . ';mid=' . $comment['id'] . ';delete;' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-reportC-delete_token_var'] . '=' . $context['mod-reportC-delete_token'] . '" class="button">' . $txt['mc_reportedp_comment_delete'] . '</a></span>' : ''), '</h3> |
|
254 | 254 | </div>'; |
255 | 255 | |
256 | 256 | echo ' |
@@ -292,17 +292,17 @@ discard block |
||
292 | 292 | |
293 | 293 | echo ' |
294 | 294 | <div id="modcenter"> |
295 | - <form action="', $scripturl, '?action=moderate;area=reported', $context['report_type'], ';sa=editcomment;mid=', $context['comment_id'], ';rid=', $context['report_id'] ,';save" method="post" accept-charset="', $context['character_set'], '">'; |
|
295 | + <form action="', $scripturl, '?action=moderate;area=reported', $context['report_type'], ';sa=editcomment;mid=', $context['comment_id'], ';rid=', $context['report_id'], ';save" method="post" accept-charset="', $context['character_set'], '">'; |
|
296 | 296 | |
297 | 297 | echo ' |
298 | 298 | <br> |
299 | 299 | <div class="cat_bar"> |
300 | - <h3 class="catbg">', $txt['mc_modreport_edit_mod_comment'] ,'</h3> |
|
300 | + <h3 class="catbg">', $txt['mc_modreport_edit_mod_comment'], '</h3> |
|
301 | 301 | </div> |
302 | 302 | <div class="windowbg2">'; |
303 | 303 | |
304 | 304 | echo ' |
305 | - <textarea rows="6" cols="60" style="width: 60%;" name="mod_comment">', $context['comment']['body'] ,'</textarea> |
|
305 | + <textarea rows="6" cols="60" style="width: 60%;" name="mod_comment">', $context['comment']['body'], '</textarea> |
|
306 | 306 | <div> |
307 | 307 | <input type="submit" name="edit_comment" value="', $txt['mc_modreport_edit_mod_comment'], '" class="button_submit"> |
308 | 308 | </div> |
@@ -393,11 +393,11 @@ discard block |
||
393 | 393 | global $context, $txt, $scripturl; |
394 | 394 | |
395 | 395 | // Let them know the action was a success. |
396 | - if (!empty($context['report_post_action']) && !empty($txt['report_action_'. $context['report_post_action']])) |
|
396 | + if (!empty($context['report_post_action']) && !empty($txt['report_action_' . $context['report_post_action']])) |
|
397 | 397 | { |
398 | 398 | echo ' |
399 | 399 | <div class="infobox"> |
400 | - ', $txt['report_action_'. $context['report_post_action']], ' |
|
400 | + ', $txt['report_action_' . $context['report_post_action']], ' |
|
401 | 401 | </div>'; |
402 | 402 | } |
403 | 403 | |
@@ -440,13 +440,13 @@ discard block |
||
440 | 440 | <hr> |
441 | 441 | <ul class="quickbuttons"> |
442 | 442 | <li><a href="', $report['report_href'], '">', $details_button, '</a></li> |
443 | - <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" ', (!$report['ignore'] ? ' class="you_sure" data-confirm="'. $txt['mc_reportedp_ignore_confirm'] .'"' : '') ,'>', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li> |
|
443 | + <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" ', (!$report['ignore'] ? ' class="you_sure" data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : ''), '>', $report['ignore'] ? $unignore_button : $ignore_button, '</a></li> |
|
444 | 444 | <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
445 | 445 | |
446 | 446 | // Ban this user button. |
447 | 447 | if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) |
448 | 448 | echo ' |
449 | - <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'] ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
|
449 | + <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
|
450 | 450 | |
451 | 451 | if (!$context['view_closed']) |
452 | 452 | echo ' |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | { |
488 | 488 | echo ' |
489 | 489 | <div class="infobox"> |
490 | - ', $txt['report_action_'. $context['report_post_action']], ' |
|
490 | + ', $txt['report_action_' . $context['report_post_action']], ' |
|
491 | 491 | </div>'; |
492 | 492 | } |
493 | 493 | |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | $unignore_button = create_button('ignore', 'mc_reportedp_unignore', 'mc_reportedp_unignore'); |
513 | 513 | |
514 | 514 | echo ' |
515 | - <a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;ignore=', (int) !$context['report']['ignore'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="button', (!$context['report']['ignore'] ? ' you_sure' : '') ,'"', (!$context['report']['ignore'] ? ' data-confirm="'. $txt['mc_reportedp_ignore_confirm'] .'"' : '') ,'>', $context['report']['ignore'] ? $unignore_button : $ignore_button, '</a> |
|
515 | + <a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;ignore=', (int) !$context['report']['ignore'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-ignore_token_var'], '=', $context['mod-report-ignore_token'], '" class="button', (!$context['report']['ignore'] ? ' you_sure' : ''), '"', (!$context['report']['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : ''), '>', $context['report']['ignore'] ? $unignore_button : $ignore_button, '</a> |
|
516 | 516 | <a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$context['report']['closed'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '" class="button">', $close_button, '</a> |
517 | 517 | </span> |
518 | 518 | </h3> |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | { |
547 | 547 | echo ' |
548 | 548 | <div class="title_bar"> |
549 | - <h3 class="titlebg">', $comment['member']['link'], ': <em class="smalltext">(', $comment['time'], ')</em>', ($comment['can_edit'] ? '<span class="floatright"><a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=editcomment;rid='. $context['report']['id'] .';mid='. $comment['id'] .';'. $context['session_var'] .'='. $context['session_id'] .'" class="button">'. $txt['mc_reportedp_comment_edit'] .'</a> <a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=handlecomment;rid='. $context['report']['id'] .';mid='. $comment['id'] .';delete;'. $context['session_var'] .'='. $context['session_id']. ';'. $context['mod-reportC-delete_token_var'] .'='. $context['mod-reportC-delete_token'] .'" class="button you_sure" data-confirm="'. $txt['mc_reportedp_delete_confirm'] .'">'. $txt['mc_reportedp_comment_delete'] .'</a></span>' : '') ,'</h3> |
|
549 | + <h3 class="titlebg">', $comment['member']['link'], ': <em class="smalltext">(', $comment['time'], ')</em>', ($comment['can_edit'] ? '<span class="floatright"><a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=editcomment;rid=' . $context['report']['id'] . ';mid=' . $comment['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" class="button">' . $txt['mc_reportedp_comment_edit'] . '</a> <a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=handlecomment;rid=' . $context['report']['id'] . ';mid=' . $comment['id'] . ';delete;' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-reportC-delete_token_var'] . '=' . $context['mod-reportC-delete_token'] . '" class="button you_sure" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '">' . $txt['mc_reportedp_comment_delete'] . '</a></span>' : ''), '</h3> |
|
550 | 550 | </div>'; |
551 | 551 | |
552 | 552 | echo ' |
@@ -54,8 +54,9 @@ discard block |
||
54 | 54 | |
55 | 55 | // Prepare the comments... |
56 | 56 | $comments = array(); |
57 | - foreach ($report['comments'] as $comment) |
|
58 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
57 | + foreach ($report['comments'] as $comment) { |
|
58 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
59 | + } |
|
59 | 60 | |
60 | 61 | echo ' |
61 | 62 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -69,18 +70,21 @@ discard block |
||
69 | 70 | <li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
70 | 71 | |
71 | 72 | // Delete message button. |
72 | - if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) |
|
73 | - echo ' |
|
73 | + if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) { |
|
74 | + echo ' |
|
74 | 75 | <li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'] ,'.0;msg=', $report['topic']['id_msg'] ,';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'] ,'" class="you_sure">', $delete_button, '</a></li>'; |
76 | + } |
|
75 | 77 | |
76 | 78 | // Ban this user button. |
77 | - if (!$report['closed'] && !empty($context['report_manage_bans'])) |
|
78 | - echo ' |
|
79 | + if (!$report['closed'] && !empty($context['report_manage_bans'])) { |
|
80 | + echo ' |
|
79 | 81 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u='. $report['author']['id'] : ';msg='. $report['topic']['id_msg']) ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
82 | + } |
|
80 | 83 | |
81 | - if (!$context['view_closed']) |
|
82 | - echo ' |
|
84 | + if (!$context['view_closed']) { |
|
85 | + echo ' |
|
83 | 86 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check"></li>'; |
87 | + } |
|
84 | 88 | |
85 | 89 | echo ' |
86 | 90 | </ul> |
@@ -88,11 +92,12 @@ discard block |
||
88 | 92 | } |
89 | 93 | |
90 | 94 | // Were none found? |
91 | - if (empty($context['reports'])) |
|
92 | - echo ' |
|
95 | + if (empty($context['reports'])) { |
|
96 | + echo ' |
|
93 | 97 | <div class="windowbg2"> |
94 | 98 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
95 | 99 | </div>'; |
100 | + } |
|
96 | 101 | |
97 | 102 | echo ' |
98 | 103 | <div class="pagesection"> |
@@ -125,18 +130,20 @@ discard block |
||
125 | 130 | <div class="modbox"> |
126 | 131 | <ul>'; |
127 | 132 | |
128 | - foreach ($context['reported_posts'] as $report) |
|
129 | - echo ' |
|
133 | + foreach ($context['reported_posts'] as $report) { |
|
134 | + echo ' |
|
130 | 135 | <li class="smalltext"> |
131 | 136 | <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], ' |
132 | 137 | </li>'; |
138 | + } |
|
133 | 139 | |
134 | 140 | // Don't have any watched users right now? |
135 | - if (empty($context['reported_posts'])) |
|
136 | - echo ' |
|
141 | + if (empty($context['reported_posts'])) { |
|
142 | + echo ' |
|
137 | 143 | <li> |
138 | 144 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
139 | 145 | </li>'; |
146 | + } |
|
140 | 147 | |
141 | 148 | echo ' |
142 | 149 | </ul> |
@@ -226,12 +233,13 @@ discard block |
||
226 | 233 | <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3> |
227 | 234 | </div>'; |
228 | 235 | |
229 | - foreach ($context['report']['comments'] as $comment) |
|
230 | - echo ' |
|
236 | + foreach ($context['report']['comments'] as $comment) { |
|
237 | + echo ' |
|
231 | 238 | <div class="windowbg"> |
232 | 239 | <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p> |
233 | 240 | <p>', $comment['message'], '</p> |
234 | 241 | </div>'; |
242 | + } |
|
235 | 243 | |
236 | 244 | echo ' |
237 | 245 | <br> |
@@ -240,11 +248,12 @@ discard block |
||
240 | 248 | </div> |
241 | 249 | <div>'; |
242 | 250 | |
243 | - if (empty($context['report']['mod_comments'])) |
|
244 | - echo ' |
|
251 | + if (empty($context['report']['mod_comments'])) { |
|
252 | + echo ' |
|
245 | 253 | <div class="information"> |
246 | 254 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
247 | 255 | </div>'; |
256 | + } |
|
248 | 257 | |
249 | 258 | foreach ($context['report']['mod_comments'] as $comment) |
250 | 259 | { |
@@ -334,18 +343,20 @@ discard block |
||
334 | 343 | <div class="modbox"> |
335 | 344 | <ul>'; |
336 | 345 | |
337 | - foreach ($context['reported_members'] as $report) |
|
338 | - echo ' |
|
346 | + foreach ($context['reported_members'] as $report) { |
|
347 | + echo ' |
|
339 | 348 | <li class="smalltext"> |
340 | 349 | <a href="', $report['report_href'], '">', $report['user_name'], '</a> |
341 | 350 | </li>'; |
351 | + } |
|
342 | 352 | |
343 | 353 | // Don't have any reported members right now? |
344 | - if (empty($context['reported_members'])) |
|
345 | - echo ' |
|
354 | + if (empty($context['reported_members'])) { |
|
355 | + echo ' |
|
346 | 356 | <li> |
347 | 357 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
348 | 358 | </li>'; |
359 | + } |
|
349 | 360 | |
350 | 361 | echo ' |
351 | 362 | </ul> |
@@ -431,8 +442,9 @@ discard block |
||
431 | 442 | |
432 | 443 | // Prepare the comments... |
433 | 444 | $comments = array(); |
434 | - foreach ($report['comments'] as $comment) |
|
435 | - $comments[$comment['member']['id']] = $comment['member']['link']; |
|
445 | + foreach ($report['comments'] as $comment) { |
|
446 | + $comments[$comment['member']['id']] = $comment['member']['link']; |
|
447 | + } |
|
436 | 448 | |
437 | 449 | echo ' |
438 | 450 | ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' |
@@ -444,13 +456,15 @@ discard block |
||
444 | 456 | <li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>'; |
445 | 457 | |
446 | 458 | // Ban this user button. |
447 | - if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) |
|
448 | - echo ' |
|
459 | + if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) { |
|
460 | + echo ' |
|
449 | 461 | <li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'] ,';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>'; |
462 | + } |
|
450 | 463 | |
451 | - if (!$context['view_closed']) |
|
452 | - echo ' |
|
464 | + if (!$context['view_closed']) { |
|
465 | + echo ' |
|
453 | 466 | <li><input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check"></li>'; |
467 | + } |
|
454 | 468 | |
455 | 469 | echo ' |
456 | 470 | </ul> |
@@ -458,11 +472,12 @@ discard block |
||
458 | 472 | } |
459 | 473 | |
460 | 474 | // Were none found? |
461 | - if (empty($context['reports'])) |
|
462 | - echo ' |
|
475 | + if (empty($context['reports'])) { |
|
476 | + echo ' |
|
463 | 477 | <div class="windowbg2"> |
464 | 478 | <p class="centertext">', $txt['mc_reportedp_none_found'], '</p> |
465 | 479 | </div>'; |
480 | + } |
|
466 | 481 | |
467 | 482 | echo ' |
468 | 483 | <div class="pagesection"> |
@@ -522,12 +537,13 @@ discard block |
||
522 | 537 | <h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3> |
523 | 538 | </div>'; |
524 | 539 | |
525 | - foreach ($context['report']['comments'] as $comment) |
|
526 | - echo ' |
|
540 | + foreach ($context['report']['comments'] as $comment) { |
|
541 | + echo ' |
|
527 | 542 | <div class="windowbg"> |
528 | 543 | <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p> |
529 | 544 | <p>', $comment['message'], '</p> |
530 | 545 | </div>'; |
546 | + } |
|
531 | 547 | |
532 | 548 | echo ' |
533 | 549 | <br> |
@@ -536,11 +552,12 @@ discard block |
||
536 | 552 | </div> |
537 | 553 | <div>'; |
538 | 554 | |
539 | - if (empty($context['report']['mod_comments'])) |
|
540 | - echo ' |
|
555 | + if (empty($context['report']['mod_comments'])) { |
|
556 | + echo ' |
|
541 | 557 | <div class="information"> |
542 | 558 | <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p> |
543 | 559 | </div>'; |
560 | + } |
|
544 | 561 | |
545 | 562 | foreach ($context['report']['mod_comments'] as $comment) |
546 | 563 | { |
@@ -39,9 +39,10 @@ discard block |
||
39 | 39 | <select name="year" id="year" onchange="generateDays();"> |
40 | 40 | <option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>'; |
41 | 41 | // Show a list of all the years we allow... |
42 | - for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) |
|
43 | - echo ' |
|
42 | + for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { |
|
43 | + echo ' |
|
44 | 44 | <option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>'; |
45 | + } |
|
45 | 46 | |
46 | 47 | echo ' |
47 | 48 | </select> |
@@ -49,9 +50,10 @@ discard block |
||
49 | 50 | <select name="month" id="month" onchange="generateDays();">'; |
50 | 51 | |
51 | 52 | // There are 12 months per year - ensure that they all get listed. |
52 | - for ($month = 1; $month <= 12; $month++) |
|
53 | - echo ' |
|
53 | + for ($month = 1; $month <= 12; $month++) { |
|
54 | + echo ' |
|
54 | 55 | <option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
56 | + } |
|
55 | 57 | |
56 | 58 | echo ' |
57 | 59 | </select> |
@@ -59,23 +61,25 @@ discard block |
||
59 | 61 | <select name="day" id="day" onchange="generateDays();">'; |
60 | 62 | |
61 | 63 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
62 | - for ($day = 1; $day <= $context['holiday']['last_day']; $day++) |
|
63 | - echo ' |
|
64 | + for ($day = 1; $day <= $context['holiday']['last_day']; $day++) { |
|
65 | + echo ' |
|
64 | 66 | <option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>'; |
67 | + } |
|
65 | 68 | |
66 | 69 | echo ' |
67 | 70 | </select> |
68 | 71 | </dd> |
69 | 72 | </dl>'; |
70 | 73 | |
71 | - if ($context['is_new']) |
|
72 | - echo ' |
|
74 | + if ($context['is_new']) { |
|
75 | + echo ' |
|
73 | 76 | <input type="submit" value="', $txt['holidays_button_add'], '" class="button_submit">'; |
74 | - else |
|
75 | - echo ' |
|
77 | + } else { |
|
78 | + echo ' |
|
76 | 79 | <input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button_submit"> |
77 | 80 | <input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button_submit"> |
78 | 81 | <input type="hidden" name="holiday" value="', $context['holiday']['id'], '">'; |
82 | + } |
|
79 | 83 | echo ' |
80 | 84 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
81 | 85 | </div> |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | <h3 class="catbg">', $context['page_title'], '</h3> |
47 | 47 | </div>'; |
48 | 48 | |
49 | - if (!empty($context['poll_error']['messages'])) |
|
50 | - echo ' |
|
49 | + if (!empty($context['poll_error']['messages'])) { |
|
50 | + echo ' |
|
51 | 51 | <div class="errorbox"> |
52 | 52 | <dl class="poll_error"> |
53 | 53 | <dt> |
@@ -58,6 +58,7 @@ discard block |
||
58 | 58 | </dt> |
59 | 59 | </dl> |
60 | 60 | </div>'; |
61 | + } |
|
61 | 62 | |
62 | 63 | echo ' |
63 | 64 | <div> |
@@ -79,8 +80,9 @@ discard block |
||
79 | 80 | <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" class="input_text" size="80" maxlength="255">'; |
80 | 81 | |
81 | 82 | // Does this option have a vote count yet, or is it new? |
82 | - if ($choice['votes'] != -1) |
|
83 | - echo ' (', $choice['votes'], ' ', $txt['votes'], ')'; |
|
83 | + if ($choice['votes'] != -1) { |
|
84 | + echo ' (', $choice['votes'], ' ', $txt['votes'], ')'; |
|
85 | + } |
|
84 | 86 | |
85 | 87 | echo ' |
86 | 88 | </dd>'; |
@@ -118,14 +120,15 @@ discard block |
||
118 | 120 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check"> |
119 | 121 | </dd>'; |
120 | 122 | |
121 | - if ($context['poll']['guest_vote_allowed']) |
|
122 | - echo ' |
|
123 | + if ($context['poll']['guest_vote_allowed']) { |
|
124 | + echo ' |
|
123 | 125 | <dt> |
124 | 126 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
125 | 127 | </dt> |
126 | 128 | <dd> |
127 | 129 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', ' class="input_check"> |
128 | 130 | </dd>'; |
131 | + } |
|
129 | 132 | } |
130 | 133 | |
131 | 134 | echo ' |
@@ -140,12 +143,13 @@ discard block |
||
140 | 143 | </dl> |
141 | 144 | </fieldset>'; |
142 | 145 | // If this is an edit, we can allow them to reset the vote counts. |
143 | - if ($context['is_edit']) |
|
144 | - echo ' |
|
146 | + if ($context['is_edit']) { |
|
147 | + echo ' |
|
145 | 148 | <fieldset id="poll_reset"> |
146 | 149 | <legend>', $txt['reset_votes'], '</legend> |
147 | 150 | <input type="checkbox" name="resetVoteCount" value="on" class="input_check"> ' . $txt['reset_votes_check'] . ' |
148 | 151 | </fieldset>'; |
152 | + } |
|
149 | 153 | echo ' |
150 | 154 | <input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit"> |
151 | 155 | </div> |
@@ -220,7 +220,7 @@ |
||
220 | 220 | ), |
221 | 221 | ), |
222 | 222 | ); |
223 | - */ |
|
223 | + */ |
|
224 | 224 | |
225 | 225 | // Are we using right-to-left orientation? |
226 | 226 | $first = $context['right_to_left'] ? 'last' : 'first'; |
@@ -21,26 +21,30 @@ discard block |
||
21 | 21 | |
22 | 22 | // Get a shortcut to the current list. |
23 | 23 | $list_id = $list_id === null ? (!empty($context['default_list']) ? $context['default_list'] : '') : $list_id; |
24 | - if (empty($list_id) || empty($context[$list_id])) |
|
25 | - return; |
|
24 | + if (empty($list_id) || empty($context[$list_id])) { |
|
25 | + return; |
|
26 | + } |
|
26 | 27 | $cur_list = &$context[$list_id]; |
27 | 28 | |
28 | 29 | // These are the main tabs that is used all around the template. |
29 | - if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) |
|
30 | - template_create_list_menu($cur_list['list_menu'], 'top'); |
|
30 | + if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) { |
|
31 | + template_create_list_menu($cur_list['list_menu'], 'top'); |
|
32 | + } |
|
31 | 33 | |
32 | - if (isset($cur_list['form'])) |
|
33 | - echo ' |
|
34 | + if (isset($cur_list['form'])) { |
|
35 | + echo ' |
|
34 | 36 | <form action="', $cur_list['form']['href'], '" method="post"', empty($cur_list['form']['name']) ? '' : ' name="' . $cur_list['form']['name'] . '" id="' . $cur_list['form']['name'] . '"', ' accept-charset="', $context['character_set'], '">'; |
37 | + } |
|
35 | 38 | |
36 | 39 | // Show the title of the table (if any). |
37 | - if (!empty($cur_list['title'])) |
|
38 | - echo ' |
|
40 | + if (!empty($cur_list['title'])) { |
|
41 | + echo ' |
|
39 | 42 | <div class="cat_bar"> |
40 | 43 | <h3 class="catbg"> |
41 | 44 | ', $cur_list['title'], ' |
42 | 45 | </h3> |
43 | 46 | </div>'; |
47 | + } |
|
44 | 48 | |
45 | 49 | if (isset($cur_list['additional_rows']['after_title'])) |
46 | 50 | { |
@@ -51,20 +55,23 @@ discard block |
||
51 | 55 | </div>'; |
52 | 56 | } |
53 | 57 | |
54 | - if (isset($cur_list['additional_rows']['top_of_list'])) |
|
55 | - template_additional_rows('top_of_list', $cur_list); |
|
58 | + if (isset($cur_list['additional_rows']['top_of_list'])) { |
|
59 | + template_additional_rows('top_of_list', $cur_list); |
|
60 | + } |
|
56 | 61 | |
57 | 62 | if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers'])) |
58 | 63 | { |
59 | 64 | // Show the page index (if this list doesn't intend to show all items). |
60 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
61 | - echo ' |
|
65 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
66 | + echo ' |
|
62 | 67 | <div class="floatleft"> |
63 | 68 | <div class="pagesection">', $cur_list['page_index'], '</div> |
64 | 69 | </div>'; |
70 | + } |
|
65 | 71 | |
66 | - if (isset($cur_list['additional_rows']['above_column_headers'])) |
|
67 | - template_additional_rows('above_column_headers', $cur_list); |
|
72 | + if (isset($cur_list['additional_rows']['above_column_headers'])) { |
|
73 | + template_additional_rows('above_column_headers', $cur_list); |
|
74 | + } |
|
68 | 75 | } |
69 | 76 | |
70 | 77 | echo ' |
@@ -94,11 +101,12 @@ discard block |
||
94 | 101 | <tbody>'; |
95 | 102 | |
96 | 103 | // Show a nice message informing there are no items in this list. |
97 | - if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) |
|
98 | - echo ' |
|
104 | + if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) { |
|
105 | + echo ' |
|
99 | 106 | <tr class="windowbg"> |
100 | 107 | <td colspan="', $cur_list['num_columns'], '" class="', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'centertext', '">', $cur_list['no_items_label'], '</td> |
101 | 108 | </tr>'; |
109 | + } |
|
102 | 110 | |
103 | 111 | // Show the list rows. |
104 | 112 | elseif (!empty($cur_list['rows'])) |
@@ -108,10 +116,11 @@ discard block |
||
108 | 116 | echo ' |
109 | 117 | <tr class="windowbg', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', ' id="list_', $list_id, '_', $id, '">'; |
110 | 118 | |
111 | - if (!empty($row['data'])) |
|
112 | - foreach ($row['data'] as $row_data) |
|
119 | + if (!empty($row['data'])) { |
|
120 | + foreach ($row['data'] as $row_data) |
|
113 | 121 | echo ' |
114 | 122 | <td', empty($row_data['class']) ? '' : ' class="' . $row_data['class'] . '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '>', $row_data['value'], '</td>'; |
123 | + } |
|
115 | 124 | |
116 | 125 | echo ' |
117 | 126 | </tr>'; |
@@ -128,46 +137,53 @@ discard block |
||
128 | 137 | <div class="flow_auto">'; |
129 | 138 | |
130 | 139 | // Show the page index (if this list doesn't intend to show all items). |
131 | - if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) |
|
132 | - echo ' |
|
140 | + if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) { |
|
141 | + echo ' |
|
133 | 142 | <div class="floatleft"> |
134 | 143 | <div class="pagesection">', $cur_list['page_index'], '</div> |
135 | 144 | </div>'; |
145 | + } |
|
136 | 146 | |
137 | - if (isset($cur_list['additional_rows']['below_table_data'])) |
|
138 | - template_additional_rows('below_table_data', $cur_list); |
|
147 | + if (isset($cur_list['additional_rows']['below_table_data'])) { |
|
148 | + template_additional_rows('below_table_data', $cur_list); |
|
149 | + } |
|
139 | 150 | |
140 | 151 | echo ' |
141 | 152 | </div>'; |
142 | 153 | } |
143 | 154 | |
144 | - if (isset($cur_list['additional_rows']['bottom_of_list'])) |
|
145 | - template_additional_rows('bottom_of_list', $cur_list); |
|
155 | + if (isset($cur_list['additional_rows']['bottom_of_list'])) { |
|
156 | + template_additional_rows('bottom_of_list', $cur_list); |
|
157 | + } |
|
146 | 158 | |
147 | 159 | if (isset($cur_list['form'])) |
148 | 160 | { |
149 | - foreach ($cur_list['form']['hidden_fields'] as $name => $value) |
|
150 | - echo ' |
|
161 | + foreach ($cur_list['form']['hidden_fields'] as $name => $value) { |
|
162 | + echo ' |
|
151 | 163 | <input type="hidden" name="', $name, '" value="', $value, '">'; |
164 | + } |
|
152 | 165 | |
153 | - if (isset($cur_list['form']['token'])) |
|
154 | - echo ' |
|
166 | + if (isset($cur_list['form']['token'])) { |
|
167 | + echo ' |
|
155 | 168 | <input type="hidden" name="', $context[$cur_list['form']['token'] . '_token_var'], '" value="', $context[$cur_list['form']['token'] . '_token'], '">'; |
169 | + } |
|
156 | 170 | |
157 | 171 | echo ' |
158 | 172 | </form>'; |
159 | 173 | } |
160 | 174 | |
161 | 175 | // Tabs at the bottom. Usually bottom aligned. |
162 | - if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) |
|
163 | - template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
176 | + if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) { |
|
177 | + template_create_list_menu($cur_list['list_menu'], 'bottom'); |
|
178 | + } |
|
164 | 179 | |
165 | - if (isset($cur_list['javascript'])) |
|
166 | - echo ' |
|
180 | + if (isset($cur_list['javascript'])) { |
|
181 | + echo ' |
|
167 | 182 | <script> |
168 | 183 | ', $cur_list['javascript'], ' |
169 | 184 | </script>'; |
170 | -} |
|
185 | + } |
|
186 | + } |
|
171 | 187 | |
172 | 188 | /** |
173 | 189 | * This template displays additional rows above or below the list. |
@@ -177,10 +193,11 @@ discard block |
||
177 | 193 | */ |
178 | 194 | function template_additional_rows($row_position, $cur_list) |
179 | 195 | { |
180 | - foreach ($cur_list['additional_rows'][$row_position] as $row) |
|
181 | - echo ' |
|
196 | + foreach ($cur_list['additional_rows'][$row_position] as $row) { |
|
197 | + echo ' |
|
182 | 198 | <div class="additional_row', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', '>', $row['value'], '</div>'; |
183 | -} |
|
199 | + } |
|
200 | + } |
|
184 | 201 | |
185 | 202 | /** |
186 | 203 | * This function creates a menu |
@@ -239,18 +256,19 @@ discard block |
||
239 | 256 | |
240 | 257 | foreach ($list_menu['links'] as $link) |
241 | 258 | { |
242 | - if ($link['is_selected']) |
|
243 | - echo ' |
|
259 | + if ($link['is_selected']) { |
|
260 | + echo ' |
|
244 | 261 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $first, '"> </td> |
245 | 262 | <td class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back"> |
246 | 263 | <a href="', $link['href'], '">', $link['label'], '</a> |
247 | 264 | </td> |
248 | 265 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $last, '"> </td>'; |
249 | - else |
|
250 | - echo ' |
|
266 | + } else { |
|
267 | + echo ' |
|
251 | 268 | <td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back"> |
252 | 269 | <a href="', $link['href'], '">', $link['label'], '</a> |
253 | 270 | </td>'; |
271 | + } |
|
254 | 272 | } |
255 | 273 | |
256 | 274 | echo ' |
@@ -261,12 +279,12 @@ discard block |
||
261 | 279 | <td> </td>' : '', ' |
262 | 280 | </tr> |
263 | 281 | </table>'; |
264 | - } |
|
265 | - elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
282 | + } elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') |
|
266 | 283 | { |
267 | 284 | $links = array(); |
268 | - foreach ($list_menu['links'] as $link) |
|
269 | - $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
285 | + foreach ($list_menu['links'] as $link) { |
|
286 | + $links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>'; |
|
287 | + } |
|
270 | 288 | |
271 | 289 | echo ' |
272 | 290 | <table style="margin-', $list_menu['position'], ': 10px; width: 100%;"> |
@@ -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 |
@@ -148,7 +148,7 @@ |
||
148 | 148 | <head> |
149 | 149 | <meta charset="', $context['character_set'], '"> |
150 | 150 | <title>', $context['page_title'], '</title> |
151 | - <link rel="stylesheet" href="', $settings['default_theme_url'], '/css/report.css', $modSettings['browser_cache'] ,'"> |
|
151 | + <link rel="stylesheet" href="', $settings['default_theme_url'], '/css/report.css', $modSettings['browser_cache'], '"> |
|
152 | 152 | </head> |
153 | 153 | <body>'; |
154 | 154 | } |
@@ -29,9 +29,10 @@ discard block |
||
29 | 29 | // Go through each type of report they can run. |
30 | 30 | foreach ($context['report_types'] as $type) |
31 | 31 | { |
32 | - if (isset($type['description'])) |
|
33 | - echo ' |
|
32 | + if (isset($type['description'])) { |
|
33 | + echo ' |
|
34 | 34 | <dt>', $type['description'], '</dt>'; |
35 | + } |
|
35 | 36 | echo ' |
36 | 37 | <dd> |
37 | 38 | <input type="radio" id="rt_', $type['id'], '" name="rt" value="', $type['id'], '"', $type['is_first'] ? ' checked' : '', ' class="input_radio"> |
@@ -61,8 +62,9 @@ discard block |
||
61 | 62 | </div> |
62 | 63 | <div id="report_buttons">'; |
63 | 64 | |
64 | - if (!empty($context['report_buttons'])) |
|
65 | - template_button_strip($context['report_buttons'], 'right'); |
|
65 | + if (!empty($context['report_buttons'])) { |
|
66 | + template_button_strip($context['report_buttons'], 'right'); |
|
67 | + } |
|
66 | 68 | |
67 | 69 | echo ' |
68 | 70 | </div>'; |
@@ -73,25 +75,27 @@ discard block |
||
73 | 75 | echo ' |
74 | 76 | <table class="table_grid report_results">'; |
75 | 77 | |
76 | - if (!empty($table['title'])) |
|
77 | - echo ' |
|
78 | + if (!empty($table['title'])) { |
|
79 | + echo ' |
|
78 | 80 | <thead> |
79 | 81 | <tr class="title_bar"> |
80 | 82 | <th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th> |
81 | 83 | </tr> |
82 | 84 | </thead> |
83 | 85 | <tbody>'; |
86 | + } |
|
84 | 87 | |
85 | 88 | // Now do each row! |
86 | 89 | $row_number = 0; |
87 | 90 | foreach ($table['data'] as $row) |
88 | 91 | { |
89 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
90 | - echo ' |
|
92 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
93 | + echo ' |
|
91 | 94 | <tr class="windowbg table_caption">'; |
92 | - else |
|
93 | - echo ' |
|
95 | + } else { |
|
96 | + echo ' |
|
94 | 97 | <tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">'; |
98 | + } |
|
95 | 99 | |
96 | 100 | // Now do each column. |
97 | 101 | $column_number = 0; |
@@ -109,16 +113,17 @@ discard block |
||
109 | 113 | } |
110 | 114 | |
111 | 115 | // Shaded? |
112 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
113 | - echo ' |
|
116 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
117 | + echo ' |
|
114 | 118 | <td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
115 | 119 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
116 | 120 | </td>'; |
117 | - else |
|
118 | - echo ' |
|
121 | + } else { |
|
122 | + echo ' |
|
119 | 123 | <td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
120 | 124 | ', $data['v'], ' |
121 | 125 | </td>'; |
126 | + } |
|
122 | 127 | |
123 | 128 | $column_number++; |
124 | 129 | } |
@@ -167,24 +172,26 @@ discard block |
||
167 | 172 | <div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '"> |
168 | 173 | <table class="bordercolor">'; |
169 | 174 | |
170 | - if (!empty($table['title'])) |
|
171 | - echo ' |
|
175 | + if (!empty($table['title'])) { |
|
176 | + echo ' |
|
172 | 177 | <tr class="title_bar"> |
173 | 178 | <td colspan="', $table['column_count'], '"> |
174 | 179 | ', $table['title'], ' |
175 | 180 | </td> |
176 | 181 | </tr>'; |
182 | + } |
|
177 | 183 | |
178 | 184 | // Now do each row! |
179 | 185 | $row_number = 0; |
180 | 186 | foreach ($table['data'] as $row) |
181 | 187 | { |
182 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
183 | - echo ' |
|
188 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
189 | + echo ' |
|
184 | 190 | <tr class="titlebg">'; |
185 | - else |
|
186 | - echo ' |
|
191 | + } else { |
|
192 | + echo ' |
|
187 | 193 | <tr class="windowbg">'; |
194 | + } |
|
188 | 195 | |
189 | 196 | // Now do each column!! |
190 | 197 | $column_number = 0; |
@@ -201,16 +208,17 @@ discard block |
||
201 | 208 | } |
202 | 209 | |
203 | 210 | // Shaded? |
204 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
205 | - echo ' |
|
211 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
212 | + echo ' |
|
206 | 213 | <td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
207 | 214 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
208 | 215 | </td>'; |
209 | - else |
|
210 | - echo ' |
|
216 | + } else { |
|
217 | + echo ' |
|
211 | 218 | <td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
212 | 219 | ', $data['v'], ' |
213 | 220 | </td>'; |
221 | + } |
|
214 | 222 | |
215 | 223 | $column_number++; |
216 | 224 | } |
@@ -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 |
@@ -24,11 +24,12 @@ discard block |
||
24 | 24 | <h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3> |
25 | 25 | </div>'; |
26 | 26 | |
27 | - if (!empty($context['disable_groups'])) |
|
28 | - echo ' |
|
27 | + if (!empty($context['disable_groups'])) { |
|
28 | + echo ' |
|
29 | 29 | <div class="information"> |
30 | 30 | <span class="alert">', $txt['paid_mod_edit_note'], '</span> |
31 | 31 | </div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | echo ' |
34 | 35 | <div class="windowbg2"> |
@@ -68,9 +69,10 @@ discard block |
||
68 | 69 | <option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>'; |
69 | 70 | |
70 | 71 | // Put each group into the box. |
71 | - foreach ($context['groups'] as $id => $name) |
|
72 | - echo ' |
|
72 | + foreach ($context['groups'] as $id => $name) { |
|
73 | + echo ' |
|
73 | 74 | <option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>'; |
75 | + } |
|
74 | 76 | |
75 | 77 | echo ' |
76 | 78 | </select> |
@@ -81,9 +83,10 @@ discard block |
||
81 | 83 | <dd>'; |
82 | 84 | |
83 | 85 | // Put a checkbox in for each group |
84 | - foreach ($context['groups'] as $id => $name) |
|
85 | - echo ' |
|
86 | + foreach ($context['groups'] as $id => $name) { |
|
87 | + echo ' |
|
86 | 88 | <label for="addgroup_', $id, '"><input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', ' class="input_check"> <span class="smalltext">', $name, '</span></label><br>'; |
89 | + } |
|
87 | 90 | |
88 | 91 | echo ' |
89 | 92 | </dd> |
@@ -135,8 +138,8 @@ discard block |
||
135 | 138 | <fieldset>'; |
136 | 139 | |
137 | 140 | //!! Removed until implemented |
138 | - if (!empty($sdflsdhglsdjgs)) |
|
139 | - echo ' |
|
141 | + if (!empty($sdflsdhglsdjgs)) { |
|
142 | + echo ' |
|
140 | 143 | <dl class="settings"> |
141 | 144 | <dt> |
142 | 145 | <label for="allow_partial_check">', $txt['paid_mod_allow_partial'], '</label>:<br><span class="smalltext">', $txt['paid_mod_allow_partial_desc'], '</span> |
@@ -145,6 +148,7 @@ discard block |
||
145 | 148 | <input type="checkbox" name="allow_partial" id="allow_partial_check"', empty($context['sub']['allow_partial']) ? '' : ' checked', ' class="input_check"> |
146 | 149 | </dd> |
147 | 150 | </dl>'; |
151 | + } |
|
148 | 152 | |
149 | 153 | echo ' |
150 | 154 | <div class="information"> |
@@ -245,8 +249,8 @@ discard block |
||
245 | 249 | <dl class="settings">'; |
246 | 250 | |
247 | 251 | // Do we need a username? |
248 | - if ($context['action_type'] == 'add') |
|
249 | - echo ' |
|
252 | + if ($context['action_type'] == 'add') { |
|
253 | + echo ' |
|
250 | 254 | |
251 | 255 | <dt> |
252 | 256 | <strong>', $txt['paid_username'], ':</strong><br> |
@@ -255,6 +259,7 @@ discard block |
||
255 | 259 | <dd> |
256 | 260 | <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30" class="input_text"> |
257 | 261 | </dd>'; |
262 | + } |
|
258 | 263 | |
259 | 264 | echo ' |
260 | 265 | <dt> |
@@ -272,9 +277,10 @@ discard block |
||
272 | 277 | <select name="year" id="year" onchange="generateDays();">'; |
273 | 278 | |
274 | 279 | // Show a list of all the years we allow... |
275 | - for ($year = 2005; $year <= 2030; $year++) |
|
276 | - echo ' |
|
280 | + for ($year = 2005; $year <= 2030; $year++) { |
|
281 | + echo ' |
|
277 | 282 | <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>'; |
283 | + } |
|
278 | 284 | |
279 | 285 | echo ' |
280 | 286 | </select> |
@@ -282,9 +288,10 @@ discard block |
||
282 | 288 | <select name="month" id="month" onchange="generateDays();">'; |
283 | 289 | |
284 | 290 | // There are 12 months per year - ensure that they all get listed. |
285 | - for ($month = 1; $month <= 12; $month++) |
|
286 | - echo ' |
|
291 | + for ($month = 1; $month <= 12; $month++) { |
|
292 | + echo ' |
|
287 | 293 | <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
294 | + } |
|
288 | 295 | |
289 | 296 | echo ' |
290 | 297 | </select> |
@@ -292,9 +299,10 @@ discard block |
||
292 | 299 | <select name="day" id="day">'; |
293 | 300 | |
294 | 301 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
295 | - for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) |
|
296 | - echo ' |
|
302 | + for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) { |
|
303 | + echo ' |
|
297 | 304 | <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>'; |
305 | + } |
|
298 | 306 | |
299 | 307 | echo ' |
300 | 308 | </select> |
@@ -306,9 +314,10 @@ discard block |
||
306 | 314 | <select name="yearend" id="yearend" onchange="generateDays(\'end\');">'; |
307 | 315 | |
308 | 316 | // Show a list of all the years we allow... |
309 | - for ($year = 2005; $year <= 2030; $year++) |
|
310 | - echo ' |
|
317 | + for ($year = 2005; $year <= 2030; $year++) { |
|
318 | + echo ' |
|
311 | 319 | <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>'; |
320 | + } |
|
312 | 321 | |
313 | 322 | echo ' |
314 | 323 | </select> |
@@ -316,9 +325,10 @@ discard block |
||
316 | 325 | <select name="monthend" id="monthend" onchange="generateDays(\'end\');">'; |
317 | 326 | |
318 | 327 | // There are 12 months per year - ensure that they all get listed. |
319 | - for ($month = 1; $month <= 12; $month++) |
|
320 | - echo ' |
|
328 | + for ($month = 1; $month <= 12; $month++) { |
|
329 | + echo ' |
|
321 | 330 | <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
331 | + } |
|
322 | 332 | |
323 | 333 | echo ' |
324 | 334 | </select> |
@@ -326,9 +336,10 @@ discard block |
||
326 | 336 | <select name="dayend" id="dayend">'; |
327 | 337 | |
328 | 338 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
329 | - for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) |
|
330 | - echo ' |
|
339 | + for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) { |
|
340 | + echo ' |
|
331 | 341 | <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>'; |
342 | + } |
|
332 | 343 | |
333 | 344 | echo ' |
334 | 345 | </select> |
@@ -410,8 +421,7 @@ discard block |
||
410 | 421 | <div class="information"> |
411 | 422 | ', $txt['paid_subs_none'], ' |
412 | 423 | </div>'; |
413 | - } |
|
414 | - else |
|
424 | + } else |
|
415 | 425 | { |
416 | 426 | echo ' |
417 | 427 | <div class="information"> |
@@ -423,8 +433,9 @@ discard block |
||
423 | 433 | { |
424 | 434 | |
425 | 435 | // Ignore the inactive ones... |
426 | - if (empty($subscription['active'])) |
|
427 | - continue; |
|
436 | + if (empty($subscription['active'])) { |
|
437 | + continue; |
|
438 | + } |
|
428 | 439 | |
429 | 440 | echo ' |
430 | 441 | <div class="cat_bar"> |
@@ -434,9 +445,10 @@ discard block |
||
434 | 445 | <p><strong>', $subscription['name'], '</strong></p> |
435 | 446 | <p class="smalltext">', $subscription['desc'], '</p>'; |
436 | 447 | |
437 | - if (!$subscription['flexible']) |
|
438 | - echo ' |
|
448 | + if (!$subscription['flexible']) { |
|
449 | + echo ' |
|
439 | 450 | <div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>'; |
451 | + } |
|
440 | 452 | |
441 | 453 | if ($context['user']['is_owner']) |
442 | 454 | { |
@@ -449,24 +461,25 @@ discard block |
||
449 | 461 | <select name="cur[', $subscription['id'], ']">'; |
450 | 462 | |
451 | 463 | // Print out the costs for this one. |
452 | - foreach ($subscription['costs'] as $duration => $value) |
|
453 | - echo ' |
|
464 | + foreach ($subscription['costs'] as $duration => $value) { |
|
465 | + echo ' |
|
454 | 466 | <option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>'; |
467 | + } |
|
455 | 468 | |
456 | 469 | echo ' |
457 | 470 | </select>'; |
458 | - } |
|
459 | - else |
|
460 | - echo ' |
|
471 | + } else { |
|
472 | + echo ' |
|
461 | 473 | ', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']); |
474 | + } |
|
462 | 475 | |
463 | 476 | echo ' |
464 | 477 | <hr> |
465 | 478 | <input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button_submit">'; |
466 | - } |
|
467 | - else |
|
468 | - echo ' |
|
479 | + } else { |
|
480 | + echo ' |
|
469 | 481 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>'; |
482 | + } |
|
470 | 483 | |
471 | 484 | echo ' |
472 | 485 | </div>'; |
@@ -493,19 +506,20 @@ discard block |
||
493 | 506 | </thead> |
494 | 507 | <tbody>'; |
495 | 508 | |
496 | - if (empty($context['current'])) |
|
497 | - echo ' |
|
509 | + if (empty($context['current'])) { |
|
510 | + echo ' |
|
498 | 511 | <tr class="windowbg"> |
499 | 512 | <td colspan="4"> |
500 | 513 | ', $txt['paid_none_yet'], ' |
501 | 514 | </td> |
502 | 515 | </tr>'; |
516 | + } |
|
503 | 517 | |
504 | 518 | foreach ($context['current'] as $sub) |
505 | 519 | { |
506 | 520 | |
507 | - if (!$sub['hide']) |
|
508 | - echo ' |
|
521 | + if (!$sub['hide']) { |
|
522 | + echo ' |
|
509 | 523 | <tr class="windowbg"> |
510 | 524 | <td> |
511 | 525 | ', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), ' |
@@ -517,6 +531,7 @@ discard block |
||
517 | 531 | ', $sub['end'], ' |
518 | 532 | </td> |
519 | 533 | </tr>'; |
534 | + } |
|
520 | 535 | } |
521 | 536 | echo ' |
522 | 537 | </tbody> |
@@ -567,15 +582,17 @@ discard block |
||
567 | 582 | ', $gateway['desc'], '<br> |
568 | 583 | <form action="', $gateway['form'], '" method="post">'; |
569 | 584 | |
570 | - if (!empty($gateway['javascript'])) |
|
571 | - echo ' |
|
585 | + if (!empty($gateway['javascript'])) { |
|
586 | + echo ' |
|
572 | 587 | <script> |
573 | 588 | ', $gateway['javascript'], ' |
574 | 589 | </script>'; |
590 | + } |
|
575 | 591 | |
576 | - foreach ($gateway['hidden'] as $name => $value) |
|
577 | - echo ' |
|
592 | + foreach ($gateway['hidden'] as $name => $value) { |
|
593 | + echo ' |
|
578 | 594 | <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">'; |
595 | + } |
|
579 | 596 | |
580 | 597 | echo ' |
581 | 598 | <br><input type="submit" value="', $gateway['submit'], '" class="button_submit"> |
@@ -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> |