@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | </thead> |
| 149 | 149 | <tbody>'; |
| 150 | 150 | |
| 151 | - foreach ($context['membergroups'] as $membergroup) |
|
| 152 | - echo ' |
|
| 151 | + foreach ($context['membergroups'] as $membergroup) { |
|
| 152 | + echo ' |
|
| 153 | 153 | <tr class="windowbg"> |
| 154 | 154 | <td>', $membergroup['name'], '</td> |
| 155 | 155 | <td class="centercol"> |
@@ -159,6 +159,7 @@ discard block |
||
| 159 | 159 | ', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked>' : '', ' |
| 160 | 160 | </td> |
| 161 | 161 | </tr>'; |
| 162 | + } |
|
| 162 | 163 | |
| 163 | 164 | echo ' |
| 164 | 165 | <tr class="windowbg"> |
@@ -185,8 +186,8 @@ discard block |
||
| 185 | 186 | </thead> |
| 186 | 187 | <tbody>'; |
| 187 | 188 | |
| 188 | - foreach ($context['postgroups'] as $postgroup) |
|
| 189 | - echo ' |
|
| 189 | + foreach ($context['postgroups'] as $postgroup) { |
|
| 190 | + echo ' |
|
| 190 | 191 | <tr class="windowbg"> |
| 191 | 192 | <td> |
| 192 | 193 | ', $postgroup['name'], ' |
@@ -195,6 +196,7 @@ discard block |
||
| 195 | 196 | <input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked> |
| 196 | 197 | </td> |
| 197 | 198 | </tr>'; |
| 199 | + } |
|
| 198 | 200 | |
| 199 | 201 | echo ' |
| 200 | 202 | <tr class="windowbg"> |
@@ -144,11 +144,12 @@ discard block |
||
| 144 | 144 | <div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>'; |
| 145 | 145 | |
| 146 | 146 | $options = 1; |
| 147 | - foreach ($context['poll']['options'] as $option) |
|
| 148 | - echo ' |
|
| 147 | + foreach ($context['poll']['options'] as $option) { |
|
| 148 | + echo ' |
|
| 149 | 149 | <div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong> |
| 150 | 150 | ', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', ' |
| 151 | 151 | </div>'; |
| 152 | + } |
|
| 152 | 153 | |
| 153 | 154 | echo ' |
| 154 | 155 | </div>'; |
@@ -170,9 +171,10 @@ discard block |
||
| 170 | 171 | echo ' |
| 171 | 172 | <hr>'; |
| 172 | 173 | |
| 173 | - foreach ($context['printattach'][$post['id_msg']] as $attach) |
|
| 174 | - echo ' |
|
| 174 | + foreach ($context['printattach'][$post['id_msg']] as $attach) { |
|
| 175 | + echo ' |
|
| 175 | 176 | <img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">'; |
| 177 | + } |
|
| 176 | 178 | } |
| 177 | 179 | |
| 178 | 180 | echo ' |
@@ -207,12 +209,13 @@ discard block |
||
| 207 | 209 | <div class="print_options">'; |
| 208 | 210 | |
| 209 | 211 | // Which option is set, text or text&images |
| 210 | - if (isset($_REQUEST['images'])) |
|
| 211 | - echo ' |
|
| 212 | + if (isset($_REQUEST['images'])) { |
|
| 213 | + echo ' |
|
| 212 | 214 | <a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>'; |
| 213 | - else |
|
| 214 | - echo ' |
|
| 215 | + } else { |
|
| 216 | + echo ' |
|
| 215 | 217 | <strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>'; |
| 218 | + } |
|
| 216 | 219 | |
| 217 | 220 | echo ' |
| 218 | 221 | </div><!-- .print_options -->'; |
@@ -26,9 +26,10 @@ discard block |
||
| 26 | 26 | </div> |
| 27 | 27 | <div class="pagesection">', $context['page_index'], '</div>'; |
| 28 | 28 | |
| 29 | - if (empty($context['posts'])) |
|
| 30 | - echo ' |
|
| 29 | + if (empty($context['posts'])) { |
|
| 30 | + echo ' |
|
| 31 | 31 | <div class="windowbg">', $txt['no_messages'], '</div>'; |
| 32 | + } |
|
| 32 | 33 | |
| 33 | 34 | foreach ($context['posts'] as $post) |
| 34 | 35 | { |
@@ -41,28 +42,33 @@ discard block |
||
| 41 | 42 | </div> |
| 42 | 43 | <div class="list_posts">', $post['message'], '</div>'; |
| 43 | 44 | |
| 44 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 45 | - echo ' |
|
| 45 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 46 | + echo ' |
|
| 46 | 47 | <ul class="quickbuttons">'; |
| 48 | + } |
|
| 47 | 49 | |
| 48 | 50 | // If they *can* reply? |
| 49 | - if ($post['can_reply']) |
|
| 50 | - echo ' |
|
| 51 | + if ($post['can_reply']) { |
|
| 52 | + echo ' |
|
| 51 | 53 | <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>'; |
| 54 | + } |
|
| 52 | 55 | |
| 53 | 56 | // If they *can* quote? |
| 54 | - if ($post['can_quote']) |
|
| 55 | - echo ' |
|
| 57 | + if ($post['can_quote']) { |
|
| 58 | + echo ' |
|
| 56 | 59 | <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>'; |
| 60 | + } |
|
| 57 | 61 | |
| 58 | 62 | // How about... even... remove it entirely?! |
| 59 | - if ($post['can_delete']) |
|
| 60 | - echo ' |
|
| 63 | + if ($post['can_delete']) { |
|
| 64 | + echo ' |
|
| 61 | 65 | <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>'; |
| 66 | + } |
|
| 62 | 67 | |
| 63 | - if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) |
|
| 64 | - echo ' |
|
| 68 | + if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) { |
|
| 69 | + echo ' |
|
| 65 | 70 | </ul>'; |
| 71 | + } |
|
| 66 | 72 | |
| 67 | 73 | echo ' |
| 68 | 74 | </div><!-- $post[css_class] -->'; |
@@ -84,12 +90,13 @@ discard block |
||
| 84 | 90 | echo ' |
| 85 | 91 | <div id="recent" class="main_content">'; |
| 86 | 92 | |
| 87 | - if ($context['showCheckboxes']) |
|
| 88 | - echo ' |
|
| 93 | + if ($context['showCheckboxes']) { |
|
| 94 | + echo ' |
|
| 89 | 95 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm"> |
| 90 | 96 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 91 | 97 | <input type="hidden" name="qaction" value="markread"> |
| 92 | 98 | <input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
| 99 | + } |
|
| 93 | 100 | |
| 94 | 101 | if (!empty($context['topics'])) |
| 95 | 102 | { |
@@ -118,11 +125,12 @@ discard block |
||
| 118 | 125 | </div>'; |
| 119 | 126 | |
| 120 | 127 | // Show a "select all" box for quick moderation? |
| 121 | - if ($context['showCheckboxes']) |
|
| 122 | - echo ' |
|
| 128 | + if ($context['showCheckboxes']) { |
|
| 129 | + echo ' |
|
| 123 | 130 | <div class="moderation"> |
| 124 | 131 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 125 | 132 | </div>'; |
| 133 | + } |
|
| 126 | 134 | |
| 127 | 135 | echo ' |
| 128 | 136 | </div><!-- #topic_header --> |
@@ -142,17 +150,20 @@ discard block |
||
| 142 | 150 | echo ' |
| 143 | 151 | <div class="icons floatright">'; |
| 144 | 152 | |
| 145 | - if ($topic['is_locked']) |
|
| 146 | - echo ' |
|
| 153 | + if ($topic['is_locked']) { |
|
| 154 | + echo ' |
|
| 147 | 155 | <span class="generic_icons lock"></span>'; |
| 156 | + } |
|
| 148 | 157 | |
| 149 | - if ($topic['is_sticky']) |
|
| 150 | - echo ' |
|
| 158 | + if ($topic['is_sticky']) { |
|
| 159 | + echo ' |
|
| 151 | 160 | <span class="generic_icons sticky"></span>'; |
| 161 | + } |
|
| 152 | 162 | |
| 153 | - if ($topic['is_poll']) |
|
| 154 | - echo ' |
|
| 163 | + if ($topic['is_poll']) { |
|
| 164 | + echo ' |
|
| 155 | 165 | <span class="generic_icons poll"></span>'; |
| 166 | + } |
|
| 156 | 167 | |
| 157 | 168 | echo ' |
| 158 | 169 | </div>'; |
@@ -178,19 +189,21 @@ discard block |
||
| 178 | 189 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
| 179 | 190 | </div>'; |
| 180 | 191 | |
| 181 | - if ($context['showCheckboxes']) |
|
| 182 | - echo ' |
|
| 192 | + if ($context['showCheckboxes']) { |
|
| 193 | + echo ' |
|
| 183 | 194 | <div class="moderation"> |
| 184 | 195 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
| 185 | 196 | </div>'; |
| 197 | + } |
|
| 186 | 198 | |
| 187 | 199 | echo ' |
| 188 | 200 | </div><!-- $topic[css_class] -->'; |
| 189 | 201 | } |
| 190 | 202 | |
| 191 | - if (empty($context['topics'])) |
|
| 192 | - echo ' |
|
| 203 | + if (empty($context['topics'])) { |
|
| 204 | + echo ' |
|
| 193 | 205 | <div style="display: none;"></div>'; |
| 206 | + } |
|
| 194 | 207 | |
| 195 | 208 | echo ' |
| 196 | 209 | </div><!-- #topic_container --> |
@@ -205,25 +218,27 @@ discard block |
||
| 205 | 218 | ', $context['page_index'], ' |
| 206 | 219 | </div> |
| 207 | 220 | </div>'; |
| 208 | - } |
|
| 209 | - else |
|
| 210 | - echo ' |
|
| 221 | + } else { |
|
| 222 | + echo ' |
|
| 211 | 223 | <div class="cat_bar"> |
| 212 | 224 | <h3 class="catbg centertext"> |
| 213 | 225 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
| 214 | 226 | </h3> |
| 215 | 227 | </div>'; |
| 228 | + } |
|
| 216 | 229 | |
| 217 | - if ($context['showCheckboxes']) |
|
| 218 | - echo ' |
|
| 230 | + if ($context['showCheckboxes']) { |
|
| 231 | + echo ' |
|
| 219 | 232 | </form>'; |
| 233 | + } |
|
| 220 | 234 | |
| 221 | 235 | echo ' |
| 222 | 236 | </div><!-- #recent -->'; |
| 223 | 237 | |
| 224 | - if (empty($context['no_topic_listing'])) |
|
| 225 | - template_topic_legend(); |
|
| 226 | -} |
|
| 238 | + if (empty($context['no_topic_listing'])) { |
|
| 239 | + template_topic_legend(); |
|
| 240 | + } |
|
| 241 | + } |
|
| 227 | 242 | |
| 228 | 243 | /** |
| 229 | 244 | * Template for showing unread replies (eg new replies to topics you've posted in) |
@@ -235,12 +250,13 @@ discard block |
||
| 235 | 250 | echo ' |
| 236 | 251 | <div id="recent">'; |
| 237 | 252 | |
| 238 | - if ($context['showCheckboxes']) |
|
| 239 | - echo ' |
|
| 253 | + if ($context['showCheckboxes']) { |
|
| 254 | + echo ' |
|
| 240 | 255 | <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm"> |
| 241 | 256 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
| 242 | 257 | <input type="hidden" name="qaction" value="markread"> |
| 243 | 258 | <input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">'; |
| 259 | + } |
|
| 244 | 260 | |
| 245 | 261 | if (!empty($context['topics'])) |
| 246 | 262 | { |
@@ -269,11 +285,12 @@ discard block |
||
| 269 | 285 | </div>'; |
| 270 | 286 | |
| 271 | 287 | // Show a "select all" box for quick moderation? |
| 272 | - if ($context['showCheckboxes']) |
|
| 273 | - echo ' |
|
| 288 | + if ($context['showCheckboxes']) { |
|
| 289 | + echo ' |
|
| 274 | 290 | <div class="moderation"> |
| 275 | 291 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
| 276 | 292 | </div>'; |
| 293 | + } |
|
| 277 | 294 | |
| 278 | 295 | echo ' |
| 279 | 296 | </div><!-- #topic_header --> |
@@ -293,17 +310,20 @@ discard block |
||
| 293 | 310 | echo ' |
| 294 | 311 | <div class="icons floatright">'; |
| 295 | 312 | |
| 296 | - if ($topic['is_locked']) |
|
| 297 | - echo ' |
|
| 313 | + if ($topic['is_locked']) { |
|
| 314 | + echo ' |
|
| 298 | 315 | <span class="generic_icons lock"></span>'; |
| 316 | + } |
|
| 299 | 317 | |
| 300 | - if ($topic['is_sticky']) |
|
| 301 | - echo ' |
|
| 318 | + if ($topic['is_sticky']) { |
|
| 319 | + echo ' |
|
| 302 | 320 | <span class="generic_icons sticky"></span>'; |
| 321 | + } |
|
| 303 | 322 | |
| 304 | - if ($topic['is_poll']) |
|
| 305 | - echo ' |
|
| 323 | + if ($topic['is_poll']) { |
|
| 324 | + echo ' |
|
| 306 | 325 | <span class="generic_icons poll"></span>'; |
| 326 | + } |
|
| 307 | 327 | |
| 308 | 328 | echo ' |
| 309 | 329 | </div>'; |
@@ -329,11 +349,12 @@ discard block |
||
| 329 | 349 | ', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), ' |
| 330 | 350 | </div>'; |
| 331 | 351 | |
| 332 | - if ($context['showCheckboxes']) |
|
| 333 | - echo ' |
|
| 352 | + if ($context['showCheckboxes']) { |
|
| 353 | + echo ' |
|
| 334 | 354 | <div class="moderation"> |
| 335 | 355 | <input type="checkbox" name="topics[]" value="', $topic['id'], '"> |
| 336 | 356 | </div>'; |
| 357 | + } |
|
| 337 | 358 | |
| 338 | 359 | echo ' |
| 339 | 360 | </div><!-- $topic[css_class] -->'; |
@@ -350,24 +371,26 @@ discard block |
||
| 350 | 371 | ', $context['page_index'], ' |
| 351 | 372 | </div> |
| 352 | 373 | </div>'; |
| 353 | - } |
|
| 354 | - else |
|
| 355 | - echo ' |
|
| 374 | + } else { |
|
| 375 | + echo ' |
|
| 356 | 376 | <div class="cat_bar"> |
| 357 | 377 | <h3 class="catbg centertext"> |
| 358 | 378 | ', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_visit_none'], ' |
| 359 | 379 | </h3> |
| 360 | 380 | </div>'; |
| 381 | + } |
|
| 361 | 382 | |
| 362 | - if ($context['showCheckboxes']) |
|
| 363 | - echo ' |
|
| 383 | + if ($context['showCheckboxes']) { |
|
| 384 | + echo ' |
|
| 364 | 385 | </form>'; |
| 386 | + } |
|
| 365 | 387 | |
| 366 | 388 | echo ' |
| 367 | 389 | </div><!-- #recent -->'; |
| 368 | 390 | |
| 369 | - if (empty($context['no_topic_listing'])) |
|
| 370 | - template_topic_legend(); |
|
| 371 | -} |
|
| 391 | + if (empty($context['no_topic_listing'])) { |
|
| 392 | + template_topic_legend(); |
|
| 393 | + } |
|
| 394 | + } |
|
| 372 | 395 | |
| 373 | 396 | ?> |
| 374 | 397 | \ No newline at end of file |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | <div class="windowbg"> |
| 32 | 32 | <ul id="likes">'; |
| 33 | 33 | |
| 34 | - foreach ($context['likers'] as $liker => $like_details) |
|
| 35 | - echo ' |
|
| 34 | + foreach ($context['likers'] as $liker => $like_details) { |
|
| 35 | + echo ' |
|
| 36 | 36 | <li> |
| 37 | 37 | ', $like_details['profile']['avatar']['image'], ' |
| 38 | 38 | <span> |
@@ -41,6 +41,7 @@ discard block |
||
| 41 | 41 | </span> |
| 42 | 42 | <span class="floatright">', $like_details['time'], '</span> |
| 43 | 43 | </li>'; |
| 44 | + } |
|
| 44 | 45 | |
| 45 | 46 | echo ' |
| 46 | 47 | </ul> |
@@ -61,11 +62,12 @@ discard block |
||
| 61 | 62 | echo ' |
| 62 | 63 | <ul class="floatleft">'; |
| 63 | 64 | |
| 64 | - if (!empty($context['data']['can_like'])) |
|
| 65 | - echo ' |
|
| 65 | + if (!empty($context['data']['can_like'])) { |
|
| 66 | + echo ' |
|
| 66 | 67 | <li class="like_button" id="', $context['data']['type'], '_', $context['data']['id_content'], '_likes"', '> |
| 67 | 68 | <a href="', $scripturl, '?action=likes;ltype=', $context['data']['type'], ';sa=like;like=', $context['data']['id_content'], ';', $context['session_var'], '=', $context['session_id'], '" class="', $context['data']['type'], '_like"><span class="generic_icons ', $context['data']['already_liked'] ? 'unlike' : 'like', '"></span> ', $context['data']['already_liked'] ? $txt['unlike'] : $txt['like'], '</a> |
| 68 | 69 | </li>'; |
| 70 | + } |
|
| 69 | 71 | |
| 70 | 72 | if (!empty($context['data']['count'])) |
| 71 | 73 | { |
@@ -20,13 +20,12 @@ discard block |
||
| 20 | 20 | // We completed some tasks? |
| 21 | 21 | if (!empty($context['tasks_were_run'])) |
| 22 | 22 | { |
| 23 | - if (empty($context['scheduled_errors'])) |
|
| 24 | - echo ' |
|
| 23 | + if (empty($context['scheduled_errors'])) { |
|
| 24 | + echo ' |
|
| 25 | 25 | <div class="infobox"> |
| 26 | 26 | ', $txt['scheduled_tasks_were_run'], ' |
| 27 | 27 | </div>'; |
| 28 | - |
|
| 29 | - else |
|
| 28 | + } else |
|
| 30 | 29 | { |
| 31 | 30 | echo ' |
| 32 | 31 | <div class="errorbox" id="errors"> |
@@ -35,14 +34,15 @@ discard block |
||
| 35 | 34 | <strong id="error_serious">', $txt['scheduled_tasks_were_run_errors'], '</strong> |
| 36 | 35 | </dt>'; |
| 37 | 36 | |
| 38 | - foreach ($context['scheduled_errors'] as $task => $errors) |
|
| 39 | - echo ' |
|
| 37 | + foreach ($context['scheduled_errors'] as $task => $errors) { |
|
| 38 | + echo ' |
|
| 40 | 39 | <dd class="error"> |
| 41 | 40 | <strong>', isset($txt['scheduled_task_' . $task]) ? $txt['scheduled_task_' . $task] : $task, '</strong> |
| 42 | 41 | <ul> |
| 43 | 42 | <li>', implode('</li><li>', $errors), '</li> |
| 44 | 43 | </ul> |
| 45 | 44 | </dd>'; |
| 45 | + } |
|
| 46 | 46 | |
| 47 | 47 | echo ' |
| 48 | 48 | </dl> |
@@ -62,16 +62,17 @@ |
||
| 62 | 62 | <div id="error_box" class="errorbox"> |
| 63 | 63 | <ul id="error_list">'; |
| 64 | 64 | |
| 65 | - foreach ($context['post_errors'] as $key => $error) |
|
| 66 | - echo ' |
|
| 65 | + foreach ($context['post_errors'] as $key => $error) { |
|
| 66 | + echo ' |
|
| 67 | 67 | <li id="error_', $key, '" class="error">', $error, '</li>'; |
| 68 | + } |
|
| 68 | 69 | |
| 69 | 70 | echo ' |
| 70 | 71 | </ul>'; |
| 71 | - } |
|
| 72 | - else |
|
| 73 | - echo ' |
|
| 72 | + } else { |
|
| 73 | + echo ' |
|
| 74 | 74 | <div style="display:none" id="error_box" class="errorbox">'; |
| 75 | + } |
|
| 75 | 76 | |
| 76 | 77 | echo ' |
| 77 | 78 | </div>'; |
@@ -72,9 +72,10 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // Allow css/js files to be disabled for this specific theme. |
| 74 | 74 | // Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference. |
| 75 | - if (!isset($settings['disable_files'])) |
|
| 76 | - $settings['disable_files'] = array(); |
|
| 77 | -} |
|
| 75 | + if (!isset($settings['disable_files'])) { |
|
| 76 | + $settings['disable_files'] = array(); |
|
| 77 | + } |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | /** |
| 80 | 81 | * The main sub template above the content. |
@@ -112,8 +113,9 @@ discard block |
||
| 112 | 113 | echo ' |
| 113 | 114 | <meta'; |
| 114 | 115 | |
| 115 | - foreach ($meta_tag as $meta_key => $meta_value) |
|
| 116 | - echo ' ', $meta_key, '="', $meta_value, '"'; |
|
| 116 | + foreach ($meta_tag as $meta_key => $meta_value) { |
|
| 117 | + echo ' ', $meta_key, '="', $meta_value, '"'; |
|
| 118 | + } |
|
| 117 | 119 | |
| 118 | 120 | echo '>'; |
| 119 | 121 | } |
@@ -124,14 +126,16 @@ discard block |
||
| 124 | 126 | <meta name="theme-color" content="#557EA0">'; |
| 125 | 127 | |
| 126 | 128 | // Please don't index these Mr Robot. |
| 127 | - if (!empty($context['robot_no_index'])) |
|
| 128 | - echo ' |
|
| 129 | + if (!empty($context['robot_no_index'])) { |
|
| 130 | + echo ' |
|
| 129 | 131 | <meta name="robots" content="noindex">'; |
| 132 | + } |
|
| 130 | 133 | |
| 131 | 134 | // Present a canonical url for search engines to prevent duplicate content in their indices. |
| 132 | - if (!empty($context['canonical_url'])) |
|
| 133 | - echo ' |
|
| 135 | + if (!empty($context['canonical_url'])) { |
|
| 136 | + echo ' |
|
| 134 | 137 | <link rel="canonical" href="', $context['canonical_url'], '">'; |
| 138 | + } |
|
| 135 | 139 | |
| 136 | 140 | // Show all the relative links, such as help, search, contents, and the like. |
| 137 | 141 | echo ' |
@@ -140,24 +144,28 @@ discard block |
||
| 140 | 144 | <link rel="search" href="' . $scripturl . '?action=search">' : ''); |
| 141 | 145 | |
| 142 | 146 | // If RSS feeds are enabled, advertise the presence of one. |
| 143 | - if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) |
|
| 144 | - echo ' |
|
| 147 | + if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) { |
|
| 148 | + echo ' |
|
| 145 | 149 | <link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?action=.xml;type=rss2', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '"> |
| 146 | 150 | <link rel="alternate" type="application/atom+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?action=.xml;type=atom', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">'; |
| 151 | + } |
|
| 147 | 152 | |
| 148 | 153 | // If we're viewing a topic, these should be the previous and next topics, respectively. |
| 149 | - if (!empty($context['links']['next'])) |
|
| 150 | - echo ' |
|
| 154 | + if (!empty($context['links']['next'])) { |
|
| 155 | + echo ' |
|
| 151 | 156 | <link rel="next" href="', $context['links']['next'], '">'; |
| 157 | + } |
|
| 152 | 158 | |
| 153 | - if (!empty($context['links']['prev'])) |
|
| 154 | - echo ' |
|
| 159 | + if (!empty($context['links']['prev'])) { |
|
| 160 | + echo ' |
|
| 155 | 161 | <link rel="prev" href="', $context['links']['prev'], '">'; |
| 162 | + } |
|
| 156 | 163 | |
| 157 | 164 | // If we're in a board, or a topic for that matter, the index will be the board's index. |
| 158 | - if (!empty($context['current_board'])) |
|
| 159 | - echo ' |
|
| 165 | + if (!empty($context['current_board'])) { |
|
| 166 | + echo ' |
|
| 160 | 167 | <link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">'; |
| 168 | + } |
|
| 161 | 169 | |
| 162 | 170 | // Output any remaining HTML headers. (from mods, maybe?) |
| 163 | 171 | echo $context['html_headers']; |
@@ -190,20 +198,22 @@ discard block |
||
| 190 | 198 | <li> |
| 191 | 199 | <a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">'; |
| 192 | 200 | |
| 193 | - if (!empty($context['user']['avatar'])) |
|
| 194 | - echo $context['user']['avatar']['image']; |
|
| 201 | + if (!empty($context['user']['avatar'])) { |
|
| 202 | + echo $context['user']['avatar']['image']; |
|
| 203 | + } |
|
| 195 | 204 | |
| 196 | 205 | echo $context['user']['name'], '</a> |
| 197 | 206 | <div id="profile_menu" class="top_menu"></div> |
| 198 | 207 | </li>'; |
| 199 | 208 | |
| 200 | 209 | // Secondly, PMs if we're doing them |
| 201 | - if ($context['allow_pm']) |
|
| 202 | - echo ' |
|
| 210 | + if ($context['allow_pm']) { |
|
| 211 | + echo ' |
|
| 203 | 212 | <li> |
| 204 | 213 | <a href="', $scripturl, '?action=pm"', !empty($context['self_pm']) ? ' class="active"' : '', ' id="pm_menu_top">', $txt['pm_short'], !empty($context['user']['unread_messages']) ? ' <span class="amt">' . $context['user']['unread_messages'] . '</span>' : '', '</a> |
| 205 | 214 | <div id="pm_menu" class="top_menu scrollable"></div> |
| 206 | 215 | </li>'; |
| 216 | + } |
|
| 207 | 217 | |
| 208 | 218 | // Thirdly, alerts |
| 209 | 219 | echo ' |
@@ -218,17 +228,18 @@ discard block |
||
| 218 | 228 | } |
| 219 | 229 | // Otherwise they're a guest. Ask them to either register or login. |
| 220 | 230 | else |
| 221 | - if (empty($maintenance)) |
|
| 222 | - echo ' |
|
| 231 | + if (empty($maintenance)) { |
|
| 232 | + echo ' |
|
| 223 | 233 | <ul class="floatleft welcome"> |
| 224 | 234 | <li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li> |
| 225 | 235 | </ul>'; |
| 226 | - else |
|
| 227 | - // In maintenance mode, only login is allowed and don't show OverlayDiv |
|
| 236 | + } else { |
|
| 237 | + // In maintenance mode, only login is allowed and don't show OverlayDiv |
|
| 228 | 238 | echo ' |
| 229 | 239 | <ul class="floatleft welcome"> |
| 230 | 240 | <li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li> |
| 231 | 241 | </ul>'; |
| 242 | + } |
|
| 232 | 243 | |
| 233 | 244 | if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1) |
| 234 | 245 | { |
@@ -236,9 +247,10 @@ discard block |
||
| 236 | 247 | <form id="languages_form" method="get" class="floatright"> |
| 237 | 248 | <select id="language_select" name="language" onchange="this.form.submit()">'; |
| 238 | 249 | |
| 239 | - foreach ($context['languages'] as $language) |
|
| 240 | - echo ' |
|
| 250 | + foreach ($context['languages'] as $language) { |
|
| 251 | + echo ' |
|
| 241 | 252 | <option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>'; |
| 253 | + } |
|
| 242 | 254 | |
| 243 | 255 | echo ' |
| 244 | 256 | </select> |
@@ -262,32 +274,37 @@ discard block |
||
| 262 | 274 | <option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>'; |
| 263 | 275 | |
| 264 | 276 | // Can't limit it to a specific topic if we are not in one |
| 265 | - if (!empty($context['current_topic'])) |
|
| 266 | - echo ' |
|
| 277 | + if (!empty($context['current_topic'])) { |
|
| 278 | + echo ' |
|
| 267 | 279 | <option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>'; |
| 280 | + } |
|
| 268 | 281 | |
| 269 | 282 | // Can't limit it to a specific board if we are not in one |
| 270 | - if (!empty($context['current_board'])) |
|
| 271 | - echo ' |
|
| 283 | + if (!empty($context['current_board'])) { |
|
| 284 | + echo ' |
|
| 272 | 285 | <option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>'; |
| 286 | + } |
|
| 273 | 287 | |
| 274 | 288 | // Can't search for members if we can't see the memberlist |
| 275 | - if (!empty($context['allow_memberlist'])) |
|
| 276 | - echo ' |
|
| 289 | + if (!empty($context['allow_memberlist'])) { |
|
| 290 | + echo ' |
|
| 277 | 291 | <option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>'; |
| 292 | + } |
|
| 278 | 293 | |
| 279 | 294 | echo ' |
| 280 | 295 | </select>'; |
| 281 | 296 | |
| 282 | 297 | // Search within current topic? |
| 283 | - if (!empty($context['current_topic'])) |
|
| 284 | - echo ' |
|
| 298 | + if (!empty($context['current_topic'])) { |
|
| 299 | + echo ' |
|
| 285 | 300 | <input type="hidden" name="sd_topic" value="', $context['current_topic'], '">'; |
| 301 | + } |
|
| 286 | 302 | |
| 287 | 303 | // If we're on a certain board, limit it to this board ;). |
| 288 | - elseif (!empty($context['current_board'])) |
|
| 289 | - echo ' |
|
| 304 | + elseif (!empty($context['current_board'])) { |
|
| 305 | + echo ' |
|
| 290 | 306 | <input type="hidden" name="sd_brd" value="', $context['current_board'], '">'; |
| 307 | + } |
|
| 291 | 308 | |
| 292 | 309 | echo ' |
| 293 | 310 | <input type="submit" name="search2" value="', $txt['search'], '" class="button"> |
@@ -319,12 +336,13 @@ discard block |
||
| 319 | 336 | </div>'; |
| 320 | 337 | |
| 321 | 338 | // Show a random news item? (or you could pick one from news_lines...) |
| 322 | - if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) |
|
| 323 | - echo ' |
|
| 339 | + if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) { |
|
| 340 | + echo ' |
|
| 324 | 341 | <div class="news"> |
| 325 | 342 | <h2>', $txt['news'], ': </h2> |
| 326 | 343 | <p>', $context['random_news_line'], '</p> |
| 327 | 344 | </div>'; |
| 345 | + } |
|
| 328 | 346 | |
| 329 | 347 | echo ' |
| 330 | 348 | <hr class="clear"> |
@@ -385,9 +403,10 @@ discard block |
||
| 385 | 403 | </ul>'; |
| 386 | 404 | |
| 387 | 405 | // Show the load time? |
| 388 | - if ($context['show_load_time']) |
|
| 389 | - echo ' |
|
| 406 | + if ($context['show_load_time']) { |
|
| 407 | + echo ' |
|
| 390 | 408 | <p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>'; |
| 409 | + } |
|
| 391 | 410 | |
| 392 | 411 | echo ' |
| 393 | 412 | </div> |
@@ -418,18 +437,20 @@ discard block |
||
| 418 | 437 | global $context, $shown_linktree, $scripturl, $txt; |
| 419 | 438 | |
| 420 | 439 | // If linktree is empty, just return - also allow an override. |
| 421 | - if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) |
|
| 422 | - return; |
|
| 440 | + if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) { |
|
| 441 | + return; |
|
| 442 | + } |
|
| 423 | 443 | echo ' |
| 424 | 444 | <div class="navigate_section"> |
| 425 | 445 | <ul>'; |
| 426 | 446 | |
| 427 | - if ($context['user']['is_logged']) |
|
| 428 | - echo ' |
|
| 447 | + if ($context['user']['is_logged']) { |
|
| 448 | + echo ' |
|
| 429 | 449 | <li class="unread_links"> |
| 430 | 450 | <a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a> |
| 431 | 451 | <a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a> |
| 432 | 452 | </li>'; |
| 453 | + } |
|
| 433 | 454 | |
| 434 | 455 | // Each tree item has a URL and name. Some may have extra_before and extra_after. |
| 435 | 456 | foreach ($context['linktree'] as $link_num => $tree) |
@@ -440,25 +461,29 @@ discard block |
||
| 440 | 461 | // Don't show a separator for the first one. |
| 441 | 462 | // Better here. Always points to the next level when the linktree breaks to a second line. |
| 442 | 463 | // Picked a better looking HTML entity, and added support for RTL plus a span for styling. |
| 443 | - if ($link_num != 0) |
|
| 444 | - echo ' |
|
| 464 | + if ($link_num != 0) { |
|
| 465 | + echo ' |
|
| 445 | 466 | <span class="dividers">', $context['right_to_left'] ? ' ◄ ' : ' ► ', '</span>'; |
| 467 | + } |
|
| 446 | 468 | |
| 447 | 469 | // Show something before the link? |
| 448 | - if (isset($tree['extra_before'])) |
|
| 449 | - echo $tree['extra_before'], ' '; |
|
| 470 | + if (isset($tree['extra_before'])) { |
|
| 471 | + echo $tree['extra_before'], ' '; |
|
| 472 | + } |
|
| 450 | 473 | |
| 451 | 474 | // Show the link, including a URL if it should have one. |
| 452 | - if (isset($tree['url'])) |
|
| 453 | - echo ' |
|
| 475 | + if (isset($tree['url'])) { |
|
| 476 | + echo ' |
|
| 454 | 477 | <a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>'; |
| 455 | - else |
|
| 456 | - echo ' |
|
| 478 | + } else { |
|
| 479 | + echo ' |
|
| 457 | 480 | <span>' . $tree['name'] . '</span>'; |
| 481 | + } |
|
| 458 | 482 | |
| 459 | 483 | // Show something after the link...? |
| 460 | - if (isset($tree['extra_after'])) |
|
| 461 | - echo ' ', $tree['extra_after']; |
|
| 484 | + if (isset($tree['extra_after'])) { |
|
| 485 | + echo ' ', $tree['extra_after']; |
|
| 486 | + } |
|
| 462 | 487 | |
| 463 | 488 | echo ' |
| 464 | 489 | </li>'; |
@@ -509,13 +534,14 @@ discard block |
||
| 509 | 534 | echo ' |
| 510 | 535 | <ul>'; |
| 511 | 536 | |
| 512 | - foreach ($childbutton['sub_buttons'] as $grandchildbutton) |
|
| 513 | - echo ' |
|
| 537 | + foreach ($childbutton['sub_buttons'] as $grandchildbutton) { |
|
| 538 | + echo ' |
|
| 514 | 539 | <li> |
| 515 | 540 | <a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '> |
| 516 | 541 | ', $grandchildbutton['title'], ' |
| 517 | 542 | </a> |
| 518 | 543 | </li>'; |
| 544 | + } |
|
| 519 | 545 | |
| 520 | 546 | echo ' |
| 521 | 547 | </ul>'; |
@@ -546,8 +572,9 @@ discard block |
||
| 546 | 572 | { |
| 547 | 573 | global $context, $txt; |
| 548 | 574 | |
| 549 | - if (!is_array($strip_options)) |
|
| 550 | - $strip_options = array(); |
|
| 575 | + if (!is_array($strip_options)) { |
|
| 576 | + $strip_options = array(); |
|
| 577 | + } |
|
| 551 | 578 | |
| 552 | 579 | // Create the buttons... |
| 553 | 580 | $buttons = array(); |
@@ -556,8 +583,9 @@ discard block |
||
| 556 | 583 | // As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!) |
| 557 | 584 | if (!isset($value['test']) || !empty($context[$value['test']])) |
| 558 | 585 | { |
| 559 | - if (!isset($value['id'])) |
|
| 560 | - $value['id'] = $key; |
|
| 586 | + if (!isset($value['id'])) { |
|
| 587 | + $value['id'] = $key; |
|
| 588 | + } |
|
| 561 | 589 | |
| 562 | 590 | $button = ' |
| 563 | 591 | <a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>'; |
@@ -570,13 +598,15 @@ discard block |
||
| 570 | 598 | <div class="overview">'; |
| 571 | 599 | foreach ($value['sub_buttons'] as $element) |
| 572 | 600 | { |
| 573 | - if (isset($element['test']) && empty($context[$element['test']])) |
|
| 574 | - continue; |
|
| 601 | + if (isset($element['test']) && empty($context[$element['test']])) { |
|
| 602 | + continue; |
|
| 603 | + } |
|
| 575 | 604 | |
| 576 | 605 | $button .= ' |
| 577 | 606 | <a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>'; |
| 578 | - if (isset($txt[$element['text'] . '_desc'])) |
|
| 579 | - $button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
| 607 | + if (isset($txt[$element['text'] . '_desc'])) { |
|
| 608 | + $button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>'; |
|
| 609 | + } |
|
| 580 | 610 | $button .= '</a>'; |
| 581 | 611 | } |
| 582 | 612 | $button .= ' |
@@ -590,8 +620,9 @@ discard block |
||
| 590 | 620 | } |
| 591 | 621 | |
| 592 | 622 | // No buttons? No button strip either. |
| 593 | - if (empty($buttons)) |
|
| 594 | - return; |
|
| 623 | + if (empty($buttons)) { |
|
| 624 | + return; |
|
| 625 | + } |
|
| 595 | 626 | |
| 596 | 627 | echo ' |
| 597 | 628 | <div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"' : ''), '> |
@@ -18,11 +18,12 @@ discard block |
||
| 18 | 18 | global $context, $txt, $scripturl, $modSettings; |
| 19 | 19 | |
| 20 | 20 | // If maintenance has finished tell the user. |
| 21 | - if (!empty($context['maintenance_finished'])) |
|
| 22 | - echo ' |
|
| 21 | + if (!empty($context['maintenance_finished'])) { |
|
| 22 | + echo ' |
|
| 23 | 23 | <div class="infobox"> |
| 24 | 24 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
| 25 | 25 | </div>'; |
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | echo ' |
| 28 | 29 | <div id="manage_maintenance"> |
@@ -39,8 +40,8 @@ discard block |
||
| 39 | 40 | </div>'; |
| 40 | 41 | |
| 41 | 42 | // Show an option to convert the body column of the post table to MEDIUMTEXT or TEXT |
| 42 | - if (isset($context['convert_to'])) |
|
| 43 | - echo ' |
|
| 43 | + if (isset($context['convert_to'])) { |
|
| 44 | + echo ' |
|
| 44 | 45 | <div class="cat_bar"> |
| 45 | 46 | <h3 class="catbg">', $txt[$context['convert_to'] . '_title'], '</h3> |
| 46 | 47 | </div> |
@@ -53,10 +54,11 @@ discard block |
||
| 53 | 54 | <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '"> |
| 54 | 55 | </form> |
| 55 | 56 | </div>'; |
| 57 | + } |
|
| 56 | 58 | |
| 57 | 59 | // Show an option to convert to UTF-8 if we're not on UTF-8 yet. |
| 58 | - if ($context['convert_utf8']) |
|
| 59 | - echo ' |
|
| 60 | + if ($context['convert_utf8']) { |
|
| 61 | + echo ' |
|
| 60 | 62 | <div class="cat_bar"> |
| 61 | 63 | <h3 class="catbg">', $txt['utf8_title'], '</h3> |
| 62 | 64 | </div> |
@@ -69,10 +71,11 @@ discard block |
||
| 69 | 71 | <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '"> |
| 70 | 72 | </form> |
| 71 | 73 | </div>'; |
| 74 | + } |
|
| 72 | 75 | |
| 73 | 76 | // We might want to convert entities if we're on UTF-8. |
| 74 | - if ($context['convert_entities']) |
|
| 75 | - echo ' |
|
| 77 | + if ($context['convert_entities']) { |
|
| 78 | + echo ' |
|
| 76 | 79 | <div class="cat_bar"> |
| 77 | 80 | <h3 class="catbg">', $txt['entity_convert_title'], '</h3> |
| 78 | 81 | </div> |
@@ -84,6 +87,7 @@ discard block |
||
| 84 | 87 | <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '"> |
| 85 | 88 | </form> |
| 86 | 89 | </div>'; |
| 90 | + } |
|
| 87 | 91 | |
| 88 | 92 | echo ' |
| 89 | 93 | </div><!-- #manage_maintenance -->'; |
@@ -101,11 +105,12 @@ discard block |
||
| 101 | 105 | <div id="manage_maintenance">'; |
| 102 | 106 | |
| 103 | 107 | // If maintenance has finished tell the user. |
| 104 | - if (!empty($context['maintenance_finished'])) |
|
| 105 | - echo ' |
|
| 108 | + if (!empty($context['maintenance_finished'])) { |
|
| 109 | + echo ' |
|
| 106 | 110 | <div class="infobox"> |
| 107 | 111 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
| 108 | 112 | </div>'; |
| 113 | + } |
|
| 109 | 114 | |
| 110 | 115 | echo ' |
| 111 | 116 | <div class="cat_bar"> |
@@ -237,11 +242,12 @@ discard block |
||
| 237 | 242 | <div id="manage_maintenance">'; |
| 238 | 243 | |
| 239 | 244 | // If maintenance has finished, tell the user. |
| 240 | - if (!empty($context['maintenance_finished'])) |
|
| 241 | - echo ' |
|
| 245 | + if (!empty($context['maintenance_finished'])) { |
|
| 246 | + echo ' |
|
| 242 | 247 | <div class="infobox"> |
| 243 | 248 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
| 244 | 249 | </div>'; |
| 250 | + } |
|
| 245 | 251 | |
| 246 | 252 | echo ' |
| 247 | 253 | <div class="cat_bar"> |
@@ -303,9 +309,10 @@ discard block |
||
| 303 | 309 | </p> |
| 304 | 310 | <div style="display: none;" id="membersPanel">'; |
| 305 | 311 | |
| 306 | - foreach ($context['membergroups'] as $group) |
|
| 307 | - echo ' |
|
| 312 | + foreach ($context['membergroups'] as $group) { |
|
| 313 | + echo ' |
|
| 308 | 314 | <label for="groups', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups', $group['id'], '" checked> ', $group['name'], '</label><br>'; |
| 315 | + } |
|
| 309 | 316 | |
| 310 | 317 | echo ' |
| 311 | 318 | </div> |
@@ -349,11 +356,12 @@ discard block |
||
| 349 | 356 | global $scripturl, $txt, $context, $settings, $modSettings; |
| 350 | 357 | |
| 351 | 358 | // If maintenance has finished tell the user. |
| 352 | - if (!empty($context['maintenance_finished'])) |
|
| 353 | - echo ' |
|
| 359 | + if (!empty($context['maintenance_finished'])) { |
|
| 360 | + echo ' |
|
| 354 | 361 | <div class="infobox"> |
| 355 | 362 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
| 356 | 363 | </div>'; |
| 364 | + } |
|
| 357 | 365 | |
| 358 | 366 | // Bit of javascript for showing which boards to prune in an otherwise hidden list. |
| 359 | 367 | echo ' |
@@ -421,21 +429,23 @@ discard block |
||
| 421 | 429 | <ul>'; |
| 422 | 430 | |
| 423 | 431 | // Display a checkbox with every board. |
| 424 | - foreach ($category['boards'] as $board) |
|
| 425 | - echo ' |
|
| 432 | + foreach ($category['boards'] as $board) { |
|
| 433 | + echo ' |
|
| 426 | 434 | <li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;"> |
| 427 | 435 | <label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked>', $board['name'], '</label> |
| 428 | 436 | </li>'; |
| 437 | + } |
|
| 429 | 438 | |
| 430 | 439 | echo ' |
| 431 | 440 | </ul> |
| 432 | 441 | </fieldset>'; |
| 433 | 442 | |
| 434 | 443 | // Increase $i, and check if we're at the middle yet. |
| 435 | - if (++$i == $middle) |
|
| 436 | - echo ' |
|
| 444 | + if (++$i == $middle) { |
|
| 445 | + echo ' |
|
| 437 | 446 | </div><!-- .floatleft --> |
| 438 | 447 | <div class="floatright" style="width: 49%;">'; |
| 448 | + } |
|
| 439 | 449 | } |
| 440 | 450 | |
| 441 | 451 | echo ' |
@@ -477,9 +487,10 @@ discard block |
||
| 477 | 487 | echo ' |
| 478 | 488 | <optgroup label="', $category['name'], '">'; |
| 479 | 489 | |
| 480 | - foreach ($category['boards'] as $board) |
|
| 481 | - echo ' |
|
| 490 | + foreach ($category['boards'] as $board) { |
|
| 491 | + echo ' |
|
| 482 | 492 | <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; |
| 493 | + } |
|
| 483 | 494 | |
| 484 | 495 | echo ' |
| 485 | 496 | </optgroup>'; |
@@ -497,9 +508,10 @@ discard block |
||
| 497 | 508 | echo ' |
| 498 | 509 | <optgroup label="', $category['name'], '">'; |
| 499 | 510 | |
| 500 | - foreach ($category['boards'] as $board) |
|
| 501 | - echo ' |
|
| 511 | + foreach ($category['boards'] as $board) { |
|
| 512 | + echo ' |
|
| 502 | 513 | <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; |
| 514 | + } |
|
| 503 | 515 | |
| 504 | 516 | echo ' |
| 505 | 517 | </optgroup>'; |
@@ -540,9 +552,10 @@ discard block |
||
| 540 | 552 | ', $txt['database_optimize_attempt'], '<br>'; |
| 541 | 553 | |
| 542 | 554 | // List each table being optimized... |
| 543 | - foreach ($context['optimized_tables'] as $table) |
|
| 544 | - echo ' |
|
| 555 | + foreach ($context['optimized_tables'] as $table) { |
|
| 556 | + echo ' |
|
| 545 | 557 | ', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br>'; |
| 558 | + } |
|
| 546 | 559 | |
| 547 | 560 | // How did we go? |
| 548 | 561 | echo ' |
@@ -602,13 +615,14 @@ discard block |
||
| 602 | 615 | </li> |
| 603 | 616 | </ul>'; |
| 604 | 617 | |
| 605 | - if (!empty($context['exceeding_messages_morethan'])) |
|
| 606 | - echo ' |
|
| 618 | + if (!empty($context['exceeding_messages_morethan'])) { |
|
| 619 | + echo ' |
|
| 607 | 620 | <p>', $context['exceeding_messages_morethan'], '</p>'; |
| 608 | - } |
|
| 609 | - else |
|
| 610 | - echo ' |
|
| 621 | + } |
|
| 622 | + } else { |
|
| 623 | + echo ' |
|
| 611 | 624 | <p class="infobox">', $txt['convert_to_text'], '</p>'; |
| 625 | + } |
|
| 612 | 626 | |
| 613 | 627 | echo ' |
| 614 | 628 | <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertmsgbody" method="post" accept-charset="', $context['character_set'], '"> |
@@ -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' : '', '> ', $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> |
@@ -187,11 +190,12 @@ discard block |
||
| 187 | 190 | global $context, $scripturl, $txt; |
| 188 | 191 | |
| 189 | 192 | // Show a nice confirmation message. |
| 190 | - if (isset($_GET['done'])) |
|
| 191 | - echo ' |
|
| 193 | + if (isset($_GET['done'])) { |
|
| 194 | + echo ' |
|
| 192 | 195 | <div class="infobox"> |
| 193 | 196 | ', $txt['theme_confirmed_' . $_GET['done']], ' |
| 194 | 197 | </div>'; |
| 198 | + } |
|
| 195 | 199 | |
| 196 | 200 | echo ' |
| 197 | 201 | <div id="admincenter"> |
@@ -354,11 +358,12 @@ discard block |
||
| 354 | 358 | if (empty($setting) || !is_array($setting)) |
| 355 | 359 | { |
| 356 | 360 | // Insert a separator (unless this is the first item in the list) |
| 357 | - if ($i !== $first_option_key) |
|
| 358 | - echo ' |
|
| 361 | + if ($i !== $first_option_key) { |
|
| 362 | + echo ' |
|
| 359 | 363 | </dl> |
| 360 | 364 | <hr> |
| 361 | 365 | <dl class="settings">'; |
| 366 | + } |
|
| 362 | 367 | |
| 363 | 368 | // Should we give a name to this section? |
| 364 | 369 | if (is_string($setting) && !empty($setting)) |
@@ -367,9 +372,9 @@ discard block |
||
| 367 | 372 | echo ' |
| 368 | 373 | <dt><strong>' . $setting . '</strong></dt> |
| 369 | 374 | <dd></dd>'; |
| 375 | + } else { |
|
| 376 | + $titled_section = false; |
|
| 370 | 377 | } |
| 371 | - else |
|
| 372 | - $titled_section = false; |
|
| 373 | 378 | |
| 374 | 379 | continue; |
| 375 | 380 | } |
@@ -378,8 +383,8 @@ discard block |
||
| 378 | 383 | <dt>'; |
| 379 | 384 | |
| 380 | 385 | // Show the change option box? |
| 381 | - if ($context['theme_options_reset']) |
|
| 382 | - echo ' |
|
| 386 | + if ($context['theme_options_reset']) { |
|
| 387 | + echo ' |
|
| 383 | 388 | <span class="floatleft"> |
| 384 | 389 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;"> |
| 385 | 390 | <option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option> |
@@ -387,23 +392,26 @@ discard block |
||
| 387 | 392 | <option value="2">', $txt['themeadmin_reset_options_default'], '</option> |
| 388 | 393 | </select> |
| 389 | 394 | </span>'; |
| 395 | + } |
|
| 390 | 396 | |
| 391 | 397 | echo ' |
| 392 | 398 | <label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>'; |
| 393 | 399 | |
| 394 | - if (isset($setting['description'])) |
|
| 395 | - echo ' |
|
| 400 | + if (isset($setting['description'])) { |
|
| 401 | + echo ' |
|
| 396 | 402 | <br> |
| 397 | 403 | <span class="smalltext">', $setting['description'], '</span>'; |
| 404 | + } |
|
| 398 | 405 | echo ' |
| 399 | 406 | </dt>'; |
| 400 | 407 | |
| 401 | 408 | // Display checkbox options |
| 402 | - if ($setting['type'] == 'checkbox') |
|
| 403 | - echo ' |
|
| 409 | + if ($setting['type'] == 'checkbox') { |
|
| 410 | + echo ' |
|
| 404 | 411 | <dd> |
| 405 | 412 | <input type="hidden" name="' . (!empty($setting['default']) ? 'default_' : '') . 'options[' . $setting['id'] . ']" value="0"> |
| 406 | 413 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', $context['theme_options_reset'] ? ' disabled' : '', ' value="1" class="floatleft">'; |
| 414 | + } |
|
| 407 | 415 | |
| 408 | 416 | // How about selection lists, we all love them |
| 409 | 417 | elseif ($setting['type'] == 'list') |
@@ -412,9 +420,10 @@ discard block |
||
| 412 | 420 | <dd> |
| 413 | 421 | <select class="floatleft" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
| 414 | 422 | |
| 415 | - foreach ($setting['options'] as $value => $label) |
|
| 416 | - echo ' |
|
| 423 | + foreach ($setting['options'] as $value => $label) { |
|
| 424 | + echo ' |
|
| 417 | 425 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 426 | + } |
|
| 418 | 427 | |
| 419 | 428 | echo ' |
| 420 | 429 | </select>'; |
@@ -433,14 +442,13 @@ discard block |
||
| 433 | 442 | |
| 434 | 443 | echo ' |
| 435 | 444 | <input type="number"', $min . $max . $step; |
| 436 | - } |
|
| 437 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
| 438 | - echo' |
|
| 445 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
| 446 | + echo' |
|
| 439 | 447 | <input type="url"'; |
| 440 | - |
|
| 441 | - else |
|
| 442 | - echo ' |
|
| 448 | + } else { |
|
| 449 | + echo ' |
|
| 443 | 450 | <input type="text"'; |
| 451 | + } |
|
| 444 | 452 | |
| 445 | 453 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', $context['theme_options_reset'] ? ' disabled' : '', '>'; |
| 446 | 454 | } |
@@ -479,8 +487,8 @@ discard block |
||
| 479 | 487 | <br>'; |
| 480 | 488 | |
| 481 | 489 | // @todo Why can't I edit the default theme popup. |
| 482 | - if ($context['theme_settings']['theme_id'] != 1) |
|
| 483 | - echo ' |
|
| 490 | + if ($context['theme_settings']['theme_id'] != 1) { |
|
| 491 | + echo ' |
|
| 484 | 492 | <div class="cat_bar"> |
| 485 | 493 | <h3 class="catbg config_hd"> |
| 486 | 494 | ', $txt['theme_edit'], ' |
@@ -496,6 +504,7 @@ discard block |
||
| 496 | 504 | </li> |
| 497 | 505 | </ul> |
| 498 | 506 | </div>'; |
| 507 | + } |
|
| 499 | 508 | |
| 500 | 509 | echo ' |
| 501 | 510 | <div class="cat_bar"> |
@@ -549,9 +558,10 @@ discard block |
||
| 549 | 558 | <dd> |
| 550 | 559 | <select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">'; |
| 551 | 560 | |
| 552 | - foreach ($context['theme_variants'] as $key => $variant) |
|
| 553 | - echo ' |
|
| 561 | + foreach ($context['theme_variants'] as $key => $variant) { |
|
| 562 | + echo ' |
|
| 554 | 563 | <option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 564 | + } |
|
| 555 | 565 | |
| 556 | 566 | echo ' |
| 557 | 567 | </select> |
@@ -587,11 +597,12 @@ discard block |
||
| 587 | 597 | if (empty($setting) || !is_array($setting)) |
| 588 | 598 | { |
| 589 | 599 | // We don't need a separator before the first list element |
| 590 | - if ($i !== $first_setting_key) |
|
| 591 | - echo ' |
|
| 600 | + if ($i !== $first_setting_key) { |
|
| 601 | + echo ' |
|
| 592 | 602 | </dl> |
| 593 | 603 | <hr> |
| 594 | 604 | <dl class="settings">'; |
| 605 | + } |
|
| 595 | 606 | |
| 596 | 607 | // Add a fake heading? |
| 597 | 608 | if (is_string($setting) && !empty($setting)) |
@@ -600,9 +611,9 @@ discard block |
||
| 600 | 611 | echo ' |
| 601 | 612 | <dt><strong>' . $setting . '</strong></dt> |
| 602 | 613 | <dd></dd>'; |
| 614 | + } else { |
|
| 615 | + $titled_section = false; |
|
| 603 | 616 | } |
| 604 | - else |
|
| 605 | - $titled_section = false; |
|
| 606 | 617 | |
| 607 | 618 | continue; |
| 608 | 619 | } |
@@ -611,20 +622,22 @@ discard block |
||
| 611 | 622 | <dt> |
| 612 | 623 | <label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:'; |
| 613 | 624 | |
| 614 | - if (isset($setting['description'])) |
|
| 615 | - echo '<br> |
|
| 625 | + if (isset($setting['description'])) { |
|
| 626 | + echo '<br> |
|
| 616 | 627 | <span class="smalltext">', $setting['description'], '</span>'; |
| 628 | + } |
|
| 617 | 629 | |
| 618 | 630 | echo ' |
| 619 | 631 | </dt>'; |
| 620 | 632 | |
| 621 | 633 | // A checkbox? |
| 622 | - if ($setting['type'] == 'checkbox') |
|
| 623 | - echo ' |
|
| 634 | + if ($setting['type'] == 'checkbox') { |
|
| 635 | + echo ' |
|
| 624 | 636 | <dd> |
| 625 | 637 | <input type="hidden" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" value="0"> |
| 626 | 638 | <input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', ' value="1"> |
| 627 | 639 | </dd>'; |
| 640 | + } |
|
| 628 | 641 | |
| 629 | 642 | // A list with options? |
| 630 | 643 | elseif ($setting['type'] == 'list') |
@@ -633,9 +646,10 @@ discard block |
||
| 633 | 646 | <dd> |
| 634 | 647 | <select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">'; |
| 635 | 648 | |
| 636 | - foreach ($setting['options'] as $value => $label) |
|
| 637 | - echo ' |
|
| 649 | + foreach ($setting['options'] as $value => $label) { |
|
| 650 | + echo ' |
|
| 638 | 651 | <option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>'; |
| 652 | + } |
|
| 639 | 653 | |
| 640 | 654 | echo ' |
| 641 | 655 | </select> |
@@ -663,14 +677,13 @@ discard block |
||
| 663 | 677 | |
| 664 | 678 | echo ' |
| 665 | 679 | <input type="number"', $min . $max . $step; |
| 666 | - } |
|
| 667 | - elseif (isset($setting['type']) && $setting['type'] == 'url') |
|
| 668 | - echo' |
|
| 680 | + } elseif (isset($setting['type']) && $setting['type'] == 'url') { |
|
| 681 | + echo' |
|
| 669 | 682 | <input type="url"'; |
| 670 | - |
|
| 671 | - else |
|
| 672 | - echo ' |
|
| 683 | + } else { |
|
| 684 | + echo ' |
|
| 673 | 685 | <input type="text"'; |
| 686 | + } |
|
| 674 | 687 | |
| 675 | 688 | echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : (empty($settings['size']) ? ' size="40"' : ' size="' . $setting['size'] . '"'), '> |
| 676 | 689 | </dd>'; |
@@ -742,9 +755,10 @@ discard block |
||
| 742 | 755 | <label for="variant', $theme['id'], '"><strong>', $theme['pick_label'], '</strong></label>: |
| 743 | 756 | <select id="variant', $theme['id'], '" name="vrt[', $theme['id'], ']" onchange="changeVariant', $theme['id'], '(this.value);">'; |
| 744 | 757 | |
| 745 | - foreach ($theme['variants'] as $key => $variant) |
|
| 746 | - echo ' |
|
| 758 | + foreach ($theme['variants'] as $key => $variant) { |
|
| 759 | + echo ' |
|
| 747 | 760 | <option value="', $key, '"', $theme['selected_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>'; |
| 761 | + } |
|
| 748 | 762 | |
| 749 | 763 | echo ' |
| 750 | 764 | </select> |
@@ -822,21 +836,23 @@ discard block |
||
| 822 | 836 | <div class="windowbg">'; |
| 823 | 837 | |
| 824 | 838 | // Oops! there was an error :( |
| 825 | - if (!empty($context['error_message'])) |
|
| 826 | - echo ' |
|
| 839 | + if (!empty($context['error_message'])) { |
|
| 840 | + echo ' |
|
| 827 | 841 | <p> |
| 828 | 842 | ', $context['error_message'], ' |
| 829 | 843 | </p>'; |
| 844 | + } |
|
| 830 | 845 | |
| 831 | 846 | // Not much to show except a link back... |
| 832 | - else |
|
| 833 | - echo ' |
|
| 847 | + else { |
|
| 848 | + echo ' |
|
| 834 | 849 | <p> |
| 835 | 850 | <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'], ' |
| 836 | 851 | </p> |
| 837 | 852 | <p> |
| 838 | 853 | <a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a> |
| 839 | 854 | </p>'; |
| 855 | + } |
|
| 840 | 856 | |
| 841 | 857 | echo ' |
| 842 | 858 | </div><!-- .windowbg --> |
@@ -903,11 +919,12 @@ discard block |
||
| 903 | 919 | <span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span> |
| 904 | 920 | <span class="floatright">'; |
| 905 | 921 | |
| 906 | - if ($template['can_copy']) |
|
| 907 | - echo ' |
|
| 922 | + if ($template['can_copy']) { |
|
| 923 | + echo ' |
|
| 908 | 924 | <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>'; |
| 909 | - else |
|
| 910 | - echo $txt['themeadmin_edit_no_copy']; |
|
| 925 | + } else { |
|
| 926 | + echo $txt['themeadmin_edit_no_copy']; |
|
| 927 | + } |
|
| 911 | 928 | |
| 912 | 929 | echo ' |
| 913 | 930 | </span> |
@@ -930,11 +947,12 @@ discard block |
||
| 930 | 947 | echo ' |
| 931 | 948 | <div id="admincenter">'; |
| 932 | 949 | |
| 933 | - if (!empty($context['browse_title'])) |
|
| 934 | - echo ' |
|
| 950 | + if (!empty($context['browse_title'])) { |
|
| 951 | + echo ' |
|
| 935 | 952 | <div class="cat_bar"> |
| 936 | 953 | <h3 class="catbg">', $context['browse_title'], '</h3> |
| 937 | 954 | </div>'; |
| 955 | + } |
|
| 938 | 956 | |
| 939 | 957 | echo ' |
| 940 | 958 | <table class="table_grid tborder"> |
@@ -954,16 +972,15 @@ discard block |
||
| 954 | 972 | <tr class="windowbg"> |
| 955 | 973 | <td>'; |
| 956 | 974 | |
| 957 | - if ($file['is_editable']) |
|
| 958 | - echo ' |
|
| 975 | + if ($file['is_editable']) { |
|
| 976 | + echo ' |
|
| 959 | 977 | <a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>'; |
| 960 | - |
|
| 961 | - elseif ($file['is_directory']) |
|
| 962 | - echo ' |
|
| 978 | + } elseif ($file['is_directory']) { |
|
| 979 | + echo ' |
|
| 963 | 980 | <a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>'; |
| 964 | - |
|
| 965 | - else |
|
| 966 | - echo $file['filename']; |
|
| 981 | + } else { |
|
| 982 | + echo $file['filename']; |
|
| 983 | + } |
|
| 967 | 984 | |
| 968 | 985 | echo ' |
| 969 | 986 | </td> |
@@ -985,11 +1002,12 @@ discard block |
||
| 985 | 1002 | { |
| 986 | 1003 | global $context, $settings, $scripturl, $txt; |
| 987 | 1004 | |
| 988 | - if ($context['session_error']) |
|
| 989 | - echo ' |
|
| 1005 | + if ($context['session_error']) { |
|
| 1006 | + echo ' |
|
| 990 | 1007 | <div class="errorbox"> |
| 991 | 1008 | ', $txt['error_session_timeout'], ' |
| 992 | 1009 | </div>'; |
| 1010 | + } |
|
| 993 | 1011 | |
| 994 | 1012 | // From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com. |
| 995 | 1013 | echo ' |
@@ -1053,17 +1071,18 @@ discard block |
||
| 1053 | 1071 | { |
| 1054 | 1072 | '; |
| 1055 | 1073 | |
| 1056 | - if (isBrowser('is_ie')) |
|
| 1057 | - echo ' |
|
| 1074 | + if (isBrowser('is_ie')) { |
|
| 1075 | + echo ' |
|
| 1058 | 1076 | var sheets = frames["css_preview_box"].document.styleSheets; |
| 1059 | 1077 | for (var j = 0; j < sheets.length; j++) |
| 1060 | 1078 | { |
| 1061 | 1079 | if (sheets[j].id == "css_preview_box") |
| 1062 | 1080 | sheets[j].cssText = document.forms.stylesheetForm.entire_file.value; |
| 1063 | 1081 | }'; |
| 1064 | - else |
|
| 1065 | - echo ' |
|
| 1082 | + } else { |
|
| 1083 | + echo ' |
|
| 1066 | 1084 | setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);'; |
| 1085 | + } |
|
| 1067 | 1086 | echo ' |
| 1068 | 1087 | } |
| 1069 | 1088 | catch (e) |
@@ -1115,9 +1134,10 @@ discard block |
||
| 1115 | 1134 | </div> |
| 1116 | 1135 | <div class="windowbg">'; |
| 1117 | 1136 | |
| 1118 | - if (!$context['allow_save']) |
|
| 1119 | - echo ' |
|
| 1137 | + if (!$context['allow_save']) { |
|
| 1138 | + echo ' |
|
| 1120 | 1139 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1140 | + } |
|
| 1121 | 1141 | |
| 1122 | 1142 | echo ' |
| 1123 | 1143 | <textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea> |
@@ -1131,9 +1151,10 @@ discard block |
||
| 1131 | 1151 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1132 | 1152 | |
| 1133 | 1153 | // Hopefully it exists. |
| 1134 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1135 | - echo ' |
|
| 1154 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1155 | + echo ' |
|
| 1136 | 1156 | <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'], '">'; |
| 1157 | + } |
|
| 1137 | 1158 | |
| 1138 | 1159 | echo ' |
| 1139 | 1160 | </form> |
@@ -1147,18 +1168,20 @@ discard block |
||
| 1147 | 1168 | { |
| 1148 | 1169 | global $context, $scripturl, $txt; |
| 1149 | 1170 | |
| 1150 | - if ($context['session_error']) |
|
| 1151 | - echo ' |
|
| 1171 | + if ($context['session_error']) { |
|
| 1172 | + echo ' |
|
| 1152 | 1173 | <div class="errorbox"> |
| 1153 | 1174 | ', $txt['error_session_timeout'], ' |
| 1154 | 1175 | </div>'; |
| 1176 | + } |
|
| 1155 | 1177 | |
| 1156 | - if (isset($context['parse_error'])) |
|
| 1157 | - echo ' |
|
| 1178 | + if (isset($context['parse_error'])) { |
|
| 1179 | + echo ' |
|
| 1158 | 1180 | <div class="errorbox"> |
| 1159 | 1181 | ', $txt['themeadmin_edit_error'], ' |
| 1160 | 1182 | <div><pre>', $context['parse_error'], '</pre></div> |
| 1161 | 1183 | </div>'; |
| 1184 | + } |
|
| 1162 | 1185 | |
| 1163 | 1186 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1164 | 1187 | echo ' |
@@ -1169,16 +1192,18 @@ discard block |
||
| 1169 | 1192 | </div> |
| 1170 | 1193 | <div class="windowbg">'; |
| 1171 | 1194 | |
| 1172 | - if (!$context['allow_save']) |
|
| 1173 | - echo ' |
|
| 1195 | + if (!$context['allow_save']) { |
|
| 1196 | + echo ' |
|
| 1174 | 1197 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>'; |
| 1198 | + } |
|
| 1175 | 1199 | |
| 1176 | - foreach ($context['file_parts'] as $part) |
|
| 1177 | - echo ' |
|
| 1200 | + foreach ($context['file_parts'] as $part) { |
|
| 1201 | + echo ' |
|
| 1178 | 1202 | <label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br> |
| 1179 | 1203 | <div class="centertext"> |
| 1180 | 1204 | <textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea> |
| 1181 | 1205 | </div>'; |
| 1206 | + } |
|
| 1182 | 1207 | |
| 1183 | 1208 | echo ' |
| 1184 | 1209 | <div class="padding righttext"> |
@@ -1187,9 +1212,10 @@ discard block |
||
| 1187 | 1212 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1188 | 1213 | |
| 1189 | 1214 | // Hopefully it exists. |
| 1190 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1191 | - echo ' |
|
| 1215 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1216 | + echo ' |
|
| 1192 | 1217 | <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'], '">'; |
| 1218 | + } |
|
| 1193 | 1219 | |
| 1194 | 1220 | echo ' |
| 1195 | 1221 | </div><!-- .righttext --> |
@@ -1205,18 +1231,20 @@ discard block |
||
| 1205 | 1231 | { |
| 1206 | 1232 | global $context, $scripturl, $txt; |
| 1207 | 1233 | |
| 1208 | - if ($context['session_error']) |
|
| 1209 | - echo ' |
|
| 1234 | + if ($context['session_error']) { |
|
| 1235 | + echo ' |
|
| 1210 | 1236 | <div class="errorbox"> |
| 1211 | 1237 | ', $txt['error_session_timeout'], ' |
| 1212 | 1238 | </div>'; |
| 1239 | + } |
|
| 1213 | 1240 | |
| 1214 | 1241 | // Is this file writeable? |
| 1215 | - if (!$context['allow_save']) |
|
| 1216 | - echo ' |
|
| 1242 | + if (!$context['allow_save']) { |
|
| 1243 | + echo ' |
|
| 1217 | 1244 | <div class="errorbox"> |
| 1218 | 1245 | ', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], ' |
| 1219 | 1246 | </div>'; |
| 1247 | + } |
|
| 1220 | 1248 | |
| 1221 | 1249 | // Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.) |
| 1222 | 1250 | echo ' |
@@ -1232,9 +1260,10 @@ discard block |
||
| 1232 | 1260 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
| 1233 | 1261 | |
| 1234 | 1262 | // Hopefully it exists. |
| 1235 | - if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) |
|
| 1236 | - echo ' |
|
| 1263 | + if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) { |
|
| 1264 | + echo ' |
|
| 1237 | 1265 | <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'], '">'; |
| 1266 | + } |
|
| 1238 | 1267 | |
| 1239 | 1268 | echo ' |
| 1240 | 1269 | </div><!-- .windowbg --> |