@@ -31,9 +31,10 @@ discard block |
||
| 31 | 31 | ', $txt['who_show1'], ' |
| 32 | 32 | <select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">'; |
| 33 | 33 | |
| 34 | - foreach ($context['show_methods'] as $value => $label) |
|
| 35 | - echo ' |
|
| 34 | + foreach ($context['show_methods'] as $value => $label) { |
|
| 35 | + echo ' |
|
| 36 | 36 | <option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>'; |
| 37 | + } |
|
| 37 | 38 | echo ' |
| 38 | 39 | </select> |
| 39 | 40 | <noscript> |
@@ -58,20 +59,22 @@ discard block |
||
| 58 | 59 | <td>'; |
| 59 | 60 | |
| 60 | 61 | // Guests can't be messaged. |
| 61 | - if (!$member['is_guest']) |
|
| 62 | - echo ' |
|
| 62 | + if (!$member['is_guest']) { |
|
| 63 | + echo ' |
|
| 63 | 64 | <span class="contact_info floatright"> |
| 64 | 65 | ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span>' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', ' |
| 65 | 66 | </span>'; |
| 67 | + } |
|
| 66 | 68 | |
| 67 | 69 | echo ' |
| 68 | 70 | <span class="member', $member['is_hidden'] ? ' hidden' : '', '"> |
| 69 | 71 | ', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt['profile_of'] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', ' |
| 70 | 72 | </span>'; |
| 71 | 73 | |
| 72 | - if (!empty($member['ip'])) |
|
| 73 | - echo ' |
|
| 74 | + if (!empty($member['ip'])) { |
|
| 75 | + echo ' |
|
| 74 | 76 | (<a href="' . $scripturl . '?action=', ($member['is_guest'] ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $member['id']), ';searchip=' . $member['ip'] . '">' . $member['ip'] . '</a>)'; |
| 77 | + } |
|
| 75 | 78 | |
| 76 | 79 | echo ' |
| 77 | 80 | </td> |
@@ -81,13 +84,14 @@ discard block |
||
| 81 | 84 | } |
| 82 | 85 | |
| 83 | 86 | // No members? |
| 84 | - if (empty($context['members'])) |
|
| 85 | - echo ' |
|
| 87 | + if (empty($context['members'])) { |
|
| 88 | + echo ' |
|
| 86 | 89 | <tr class="windowbg"> |
| 87 | 90 | <td colspan="3"> |
| 88 | 91 | ', $txt['who_no_online_' . ($context['show_by'] == 'guests' || $context['show_by'] == 'spiders' ? $context['show_by'] : 'members')], ' |
| 89 | 92 | </td> |
| 90 | 93 | </tr>'; |
| 94 | + } |
|
| 91 | 95 | |
| 92 | 96 | echo ' |
| 93 | 97 | </tbody> |
@@ -98,9 +102,10 @@ discard block |
||
| 98 | 102 | ', $txt['who_show1'], ' |
| 99 | 103 | <select name="show" onchange="document.forms.whoFilter.submit();">'; |
| 100 | 104 | |
| 101 | - foreach ($context['show_methods'] as $value => $label) |
|
| 102 | - echo ' |
|
| 105 | + foreach ($context['show_methods'] as $value => $label) { |
|
| 106 | + echo ' |
|
| 103 | 107 | <option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>'; |
| 108 | + } |
|
| 104 | 109 | echo ' |
| 105 | 110 | </select> |
| 106 | 111 | <noscript> |
@@ -129,17 +134,19 @@ discard block |
||
| 129 | 134 | |
| 130 | 135 | foreach ($context['credits'] as $section) |
| 131 | 136 | { |
| 132 | - if (isset($section['pretext'])) |
|
| 133 | - echo ' |
|
| 137 | + if (isset($section['pretext'])) { |
|
| 138 | + echo ' |
|
| 134 | 139 | <div class="windowbg noup"> |
| 135 | 140 | <p>', $section['pretext'], '</p> |
| 136 | 141 | </div>'; |
| 142 | + } |
|
| 137 | 143 | |
| 138 | - if (isset($section['title'])) |
|
| 139 | - echo ' |
|
| 144 | + if (isset($section['title'])) { |
|
| 145 | + echo ' |
|
| 140 | 146 | <div class="cat_bar"> |
| 141 | 147 | <h3 class="catbg">', $section['title'], '</h3> |
| 142 | 148 | </div>'; |
| 149 | + } |
|
| 143 | 150 | |
| 144 | 151 | echo ' |
| 145 | 152 | <div class="windowbg noup"> |
@@ -147,17 +154,18 @@ discard block |
||
| 147 | 154 | |
| 148 | 155 | foreach ($section['groups'] as $group) |
| 149 | 156 | { |
| 150 | - if (isset($group['title'])) |
|
| 151 | - echo ' |
|
| 157 | + if (isset($group['title'])) { |
|
| 158 | + echo ' |
|
| 152 | 159 | <dt> |
| 153 | 160 | <strong>', $group['title'], '</strong> |
| 154 | 161 | </dt> |
| 155 | 162 | <dd>'; |
| 163 | + } |
|
| 156 | 164 | |
| 157 | 165 | // Try to make this read nicely. |
| 158 | - if (count($group['members']) <= 2) |
|
| 159 | - echo implode(' ' . $txt['credits_and'] . ' ', $group['members']); |
|
| 160 | - else |
|
| 166 | + if (count($group['members']) <= 2) { |
|
| 167 | + echo implode(' ' . $txt['credits_and'] . ' ', $group['members']); |
|
| 168 | + } else |
|
| 161 | 169 | { |
| 162 | 170 | $last_peep = array_pop($group['members']); |
| 163 | 171 | echo implode(', ', $group['members']), ' ', $txt['credits_and'], ' ', $last_peep; |
@@ -170,9 +178,10 @@ discard block |
||
| 170 | 178 | echo ' |
| 171 | 179 | </dl>'; |
| 172 | 180 | |
| 173 | - if (isset($section['posttext'])) |
|
| 174 | - echo ' |
|
| 181 | + if (isset($section['posttext'])) { |
|
| 182 | + echo ' |
|
| 175 | 183 | <p class="posttext">', $section['posttext'], '</p>'; |
| 184 | + } |
|
| 176 | 185 | |
| 177 | 186 | echo ' |
| 178 | 187 | </div>'; |
@@ -187,26 +196,29 @@ discard block |
||
| 187 | 196 | </div> |
| 188 | 197 | <div class="windowbg noup">'; |
| 189 | 198 | |
| 190 | - if (!empty($context['credits_software_graphics']['graphics'])) |
|
| 191 | - echo ' |
|
| 199 | + if (!empty($context['credits_software_graphics']['graphics'])) { |
|
| 200 | + echo ' |
|
| 192 | 201 | <dl> |
| 193 | 202 | <dt><strong>', $txt['credits_graphics'], '</strong></dt> |
| 194 | 203 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['graphics']), '</dd> |
| 195 | 204 | </dl>'; |
| 205 | + } |
|
| 196 | 206 | |
| 197 | - if (!empty($context['credits_software_graphics']['software'])) |
|
| 198 | - echo ' |
|
| 207 | + if (!empty($context['credits_software_graphics']['software'])) { |
|
| 208 | + echo ' |
|
| 199 | 209 | <dl> |
| 200 | 210 | <dt><strong>', $txt['credits_software'], '</strong></dt> |
| 201 | 211 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['software']), '</dd> |
| 202 | 212 | </dl>'; |
| 213 | + } |
|
| 203 | 214 | |
| 204 | - if (!empty($context['credits_software_graphics']['fonts'])) |
|
| 205 | - echo ' |
|
| 215 | + if (!empty($context['credits_software_graphics']['fonts'])) { |
|
| 216 | + echo ' |
|
| 206 | 217 | <dl> |
| 207 | 218 | <dt><strong>', $txt['credits_fonts'], '</strong></dt> |
| 208 | 219 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['fonts']), '</dd> |
| 209 | 220 | </dl>'; |
| 221 | + } |
|
| 210 | 222 | echo ' |
| 211 | 223 | </div>'; |
| 212 | 224 | } |
@@ -222,14 +234,16 @@ discard block |
||
| 222 | 234 | <ul>'; |
| 223 | 235 | |
| 224 | 236 | // Display the credits. |
| 225 | - if (!empty($context['credits_modifications'])) |
|
| 226 | - echo ' |
|
| 237 | + if (!empty($context['credits_modifications'])) { |
|
| 238 | + echo ' |
|
| 227 | 239 | <li>', implode('</li><li>', $context['credits_modifications']), '</li>'; |
| 240 | + } |
|
| 228 | 241 | |
| 229 | 242 | // Legacy. |
| 230 | - if (!empty($context['copyrights']['mods'])) |
|
| 231 | - echo ' |
|
| 243 | + if (!empty($context['copyrights']['mods'])) { |
|
| 244 | + echo ' |
|
| 232 | 245 | <li>', implode('</li><li>', $context['copyrights']['mods']), '</li>'; |
| 246 | + } |
|
| 233 | 247 | |
| 234 | 248 | echo ' |
| 235 | 249 | </ul> |
@@ -41,11 +41,12 @@ discard block |
||
| 41 | 41 | </div>'; |
| 42 | 42 | |
| 43 | 43 | // If this is an existing set, and there are still un-added smileys - offer an import opportunity. |
| 44 | - if (!empty($context['current_set']['can_import'])) |
|
| 45 | - echo ' |
|
| 44 | + if (!empty($context['current_set']['can_import'])) { |
|
| 45 | + echo ' |
|
| 46 | 46 | <div class="information"> |
| 47 | 47 | ', $context['current_set']['can_import'] == 1 ? sprintf($txt['smiley_set_import_single'], $context['current_set']['import_url']) : sprintf($txt['smiley_set_import_multiple'], $context['current_set']['can_import'], $context['current_set']['import_url']), ' |
| 48 | 48 | </div>'; |
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | echo ' |
| 51 | 52 | <div class="windowbg noup"> |
@@ -62,20 +63,20 @@ discard block |
||
| 62 | 63 | <dd> |
| 63 | 64 | ', $modSettings['smileys_url'], '/'; |
| 64 | 65 | |
| 65 | - if ($context['current_set']['id'] == 'default') |
|
| 66 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
| 67 | - |
|
| 68 | - elseif (empty($context['smiley_set_dirs'])) |
|
| 69 | - echo ' |
|
| 66 | + if ($context['current_set']['id'] == 'default') { |
|
| 67 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
| 68 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
| 69 | + echo ' |
|
| 70 | 70 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> '; |
| 71 | - else |
|
| 71 | + } else |
|
| 72 | 72 | { |
| 73 | 73 | echo ' |
| 74 | 74 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
| 75 | 75 | |
| 76 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
| 77 | - echo ' |
|
| 76 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
| 77 | + echo ' |
|
| 78 | 78 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
| 79 | + } |
|
| 79 | 80 | echo ' |
| 80 | 81 | </select> '; |
| 81 | 82 | } |
@@ -90,14 +91,15 @@ discard block |
||
| 90 | 91 | </dd>'; |
| 91 | 92 | |
| 92 | 93 | // If this is a new smiley set they have the option to import smileys already in the directory. |
| 93 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
| 94 | - echo ' |
|
| 94 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
| 95 | + echo ' |
|
| 95 | 96 | <dt> |
| 96 | 97 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
| 97 | 98 | </dt> |
| 98 | 99 | <dd> |
| 99 | 100 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1"> |
| 100 | 101 | </dd>'; |
| 102 | + } |
|
| 101 | 103 | |
| 102 | 104 | echo ' |
| 103 | 105 | </dl> |
@@ -131,9 +133,10 @@ discard block |
||
| 131 | 133 | <dd> |
| 132 | 134 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">'; |
| 133 | 135 | |
| 134 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 135 | - echo ' |
|
| 136 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 137 | + echo ' |
|
| 136 | 138 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
| 139 | + } |
|
| 137 | 140 | |
| 138 | 141 | echo ' |
| 139 | 142 | </select>) |
@@ -149,17 +152,18 @@ discard block |
||
| 149 | 152 | </dt> |
| 150 | 153 | <dd>'; |
| 151 | 154 | |
| 152 | - if (empty($context['filenames'])) |
|
| 153 | - echo ' |
|
| 155 | + if (empty($context['filenames'])) { |
|
| 156 | + echo ' |
|
| 154 | 157 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">'; |
| 155 | - else |
|
| 158 | + } else |
|
| 156 | 159 | { |
| 157 | 160 | echo ' |
| 158 | 161 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
| 159 | 162 | |
| 160 | - foreach ($context['filenames'] as $filename) |
|
| 161 | - echo ' |
|
| 163 | + foreach ($context['filenames'] as $filename) { |
|
| 164 | + echo ' |
|
| 162 | 165 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
| 166 | + } |
|
| 163 | 167 | echo ' |
| 164 | 168 | </select>'; |
| 165 | 169 | } |
@@ -228,9 +232,10 @@ discard block |
||
| 228 | 232 | <dd> |
| 229 | 233 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
| 230 | 234 | |
| 231 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 232 | - echo ' |
|
| 235 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 236 | + echo ' |
|
| 233 | 237 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
| 238 | + } |
|
| 234 | 239 | |
| 235 | 240 | echo ' |
| 236 | 241 | </select> |
@@ -240,17 +245,18 @@ discard block |
||
| 240 | 245 | </dt> |
| 241 | 246 | <dd>'; |
| 242 | 247 | |
| 243 | - if (empty($context['filenames'])) |
|
| 244 | - echo ' |
|
| 248 | + if (empty($context['filenames'])) { |
|
| 249 | + echo ' |
|
| 245 | 250 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">'; |
| 246 | - else |
|
| 251 | + } else |
|
| 247 | 252 | { |
| 248 | 253 | echo ' |
| 249 | 254 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
| 250 | 255 | |
| 251 | - foreach ($context['filenames'] as $filename) |
|
| 252 | - echo ' |
|
| 256 | + foreach ($context['filenames'] as $filename) { |
|
| 257 | + echo ' |
|
| 253 | 258 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
| 259 | + } |
|
| 254 | 260 | echo ' |
| 255 | 261 | </select>'; |
| 256 | 262 | } |
@@ -279,14 +285,15 @@ discard block |
||
| 279 | 285 | |
| 280 | 286 | <dl id="uploadMore" style="display: none;" class="settings">'; |
| 281 | 287 | |
| 282 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 283 | - echo ' |
|
| 288 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 289 | + echo ' |
|
| 284 | 290 | <dt> |
| 285 | 291 | ', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ': |
| 286 | 292 | </dt> |
| 287 | 293 | <dd> |
| 288 | 294 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');"> |
| 289 | 295 | </dd>'; |
| 296 | + } |
|
| 290 | 297 | |
| 291 | 298 | echo ' |
| 292 | 299 | </dl> |
@@ -357,27 +364,30 @@ discard block |
||
| 357 | 364 | |
| 358 | 365 | foreach ($location['rows'] as $row) |
| 359 | 366 | { |
| 360 | - if (!empty($context['move_smiley'])) |
|
| 361 | - echo ' |
|
| 367 | + if (!empty($context['move_smiley'])) { |
|
| 368 | + echo ' |
|
| 362 | 369 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 370 | + } |
|
| 363 | 371 | |
| 364 | 372 | foreach ($row as $smiley) |
| 365 | 373 | { |
| 366 | - if (empty($context['move_smiley'])) |
|
| 367 | - echo ' |
|
| 374 | + if (empty($context['move_smiley'])) { |
|
| 375 | + echo ' |
|
| 368 | 376 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '"></a>'; |
| 369 | - else |
|
| 370 | - echo ' |
|
| 377 | + } else { |
|
| 378 | + echo ' |
|
| 371 | 379 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '" ', $smiley['selected'] ? 'class="selected_item"' : '', '> |
| 372 | 380 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 381 | + } |
|
| 373 | 382 | } |
| 374 | 383 | |
| 375 | 384 | echo ' |
| 376 | 385 | <br>'; |
| 377 | 386 | } |
| 378 | - if (!empty($context['move_smiley'])) |
|
| 379 | - echo ' |
|
| 387 | + if (!empty($context['move_smiley'])) { |
|
| 388 | + echo ' |
|
| 380 | 389 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
| 390 | + } |
|
| 381 | 391 | echo ' |
| 382 | 392 | </div><!-- .windowbg --> |
| 383 | 393 | <input type="hidden" name="reorder" value="1"> |
@@ -414,14 +424,15 @@ discard block |
||
| 414 | 424 | <div class="windowbg"> |
| 415 | 425 | <dl class="settings">'; |
| 416 | 426 | |
| 417 | - if (!$context['new_icon']) |
|
| 418 | - echo ' |
|
| 427 | + if (!$context['new_icon']) { |
|
| 428 | + echo ' |
|
| 419 | 429 | <dt> |
| 420 | 430 | <strong>', $txt['smiley_preview'], ': </strong> |
| 421 | 431 | </dt> |
| 422 | 432 | <dd> |
| 423 | 433 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
| 424 | 434 | </dd>'; |
| 435 | + } |
|
| 425 | 436 | |
| 426 | 437 | echo ' |
| 427 | 438 | <dt> |
@@ -448,9 +459,10 @@ discard block |
||
| 448 | 459 | echo ' |
| 449 | 460 | <optgroup label="', $category['name'], '">'; |
| 450 | 461 | |
| 451 | - foreach ($category['boards'] as $board) |
|
| 452 | - echo ' |
|
| 462 | + foreach ($category['boards'] as $board) { |
|
| 463 | + echo ' |
|
| 453 | 464 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 465 | + } |
|
| 454 | 466 | |
| 455 | 467 | echo ' |
| 456 | 468 | </optgroup>'; |
@@ -467,19 +479,21 @@ discard block |
||
| 467 | 479 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
| 468 | 480 | |
| 469 | 481 | // Print the list of all the icons it can be put after... |
| 470 | - foreach ($context['icons'] as $id => $data) |
|
| 471 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
| 482 | + foreach ($context['icons'] as $id => $data) { |
|
| 483 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
| 472 | 484 | echo ' |
| 473 | 485 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
| 486 | + } |
|
| 474 | 487 | |
| 475 | 488 | echo ' |
| 476 | 489 | </select> |
| 477 | 490 | </dd> |
| 478 | 491 | </dl>'; |
| 479 | 492 | |
| 480 | - if (!$context['new_icon']) |
|
| 481 | - echo ' |
|
| 493 | + if (!$context['new_icon']) { |
|
| 494 | + echo ' |
|
| 482 | 495 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
| 496 | + } |
|
| 483 | 497 | |
| 484 | 498 | echo ' |
| 485 | 499 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button"> |
@@ -37,9 +37,10 @@ discard block |
||
| 37 | 37 | echo ' |
| 38 | 38 | <optgroup label="', $category['name'], '">'; |
| 39 | 39 | |
| 40 | - foreach ($category['boards'] as $board) |
|
| 41 | - echo ' |
|
| 40 | + foreach ($category['boards'] as $board) { |
|
| 41 | + echo ' |
|
| 42 | 42 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', $board['id'] == $context['current_board'] ? ' disabled' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level']-1) . '=> ' : '', $board['name'], '</option>'; |
| 43 | + } |
|
| 43 | 44 | echo ' |
| 44 | 45 | </optgroup>'; |
| 45 | 46 | } |
@@ -70,9 +71,10 @@ discard block |
||
| 70 | 71 | </div><!-- .move_topic --> |
| 71 | 72 | </div><!-- .windowbg -->'; |
| 72 | 73 | |
| 73 | - if ($context['back_to_topic']) |
|
| 74 | - echo ' |
|
| 74 | + if ($context['back_to_topic']) { |
|
| 75 | + echo ' |
|
| 75 | 76 | <input type="hidden" name="goback" value="1">'; |
| 77 | + } |
|
| 76 | 78 | |
| 77 | 79 | echo ' |
| 78 | 80 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -125,10 +127,10 @@ discard block |
||
| 125 | 127 | <option value="86400">', $txt['two_months'], '</option> |
| 126 | 128 | </select> |
| 127 | 129 | </dd>'; |
| 128 | - } |
|
| 129 | - else |
|
| 130 | - echo ' |
|
| 130 | + } else { |
|
| 131 | + echo ' |
|
| 131 | 132 | <input type="hidden" name="redirect_expires" value="0">'; |
| 133 | + } |
|
| 132 | 134 | |
| 133 | 135 | echo ' |
| 134 | 136 | </dl> |
@@ -207,9 +209,10 @@ discard block |
||
| 207 | 209 | echo ' |
| 208 | 210 | <optgroup label="', $cat['name'], '">'; |
| 209 | 211 | |
| 210 | - foreach ($cat['boards'] as $board) |
|
| 211 | - echo ' |
|
| 212 | + foreach ($cat['boards'] as $board) { |
|
| 213 | + echo ' |
|
| 212 | 214 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 215 | + } |
|
| 213 | 216 | |
| 214 | 217 | echo ' |
| 215 | 218 | </optgroup>'; |
@@ -219,9 +222,9 @@ discard block |
||
| 219 | 222 | <input type="hidden" name="from" value="' . $context['origin_topic'] . '"> |
| 220 | 223 | <input type="submit" value="', $txt['go'], '" class="button"> |
| 221 | 224 | </form>'; |
| 225 | + } else { |
|
| 226 | + echo $txt['target_below']; |
|
| 222 | 227 | } |
| 223 | - else |
|
| 224 | - echo $txt['target_below']; |
|
| 225 | 228 | |
| 226 | 229 | echo ' </h4> |
| 227 | 230 | </div><!-- .title_bar --> |
@@ -239,12 +242,13 @@ discard block |
||
| 239 | 242 | |
| 240 | 243 | $merge_button = create_button('merge', 'merge', ''); |
| 241 | 244 | |
| 242 | - foreach ($context['topics'] as $topic) |
|
| 243 | - echo ' |
|
| 245 | + foreach ($context['topics'] as $topic) { |
|
| 246 | + echo ' |
|
| 244 | 247 | <li> |
| 245 | 248 | <a href="', $scripturl, '?action=mergetopics;sa=options;board=', $context['current_board'], '.0;from=', $context['origin_topic'], ';to=', $topic['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $merge_button, '</a> |
| 246 | 249 | <a href="', $scripturl, '?topic=', $topic['id'], '.0" target="_blank" rel="noopener">', $topic['subject'], '</a> ', $txt['started_by'], ' ', $topic['poster']['link'], ' |
| 247 | 250 | </li>'; |
| 251 | + } |
|
| 248 | 252 | |
| 249 | 253 | echo ' |
| 250 | 254 | </ul> |
@@ -255,9 +259,10 @@ discard block |
||
| 255 | 259 | </div>'; |
| 256 | 260 | } |
| 257 | 261 | // Just a nice "There aren't any topics" message |
| 258 | - else |
|
| 259 | - echo ' |
|
| 262 | + else { |
|
| 263 | + echo ' |
|
| 260 | 264 | <div class="windowbg">', $txt['topic_alert_none'], '</div>'; |
| 265 | + } |
|
| 261 | 266 | |
| 262 | 267 | echo ' |
| 263 | 268 | <br> |
@@ -307,8 +312,8 @@ discard block |
||
| 307 | 312 | </thead> |
| 308 | 313 | <tbody>'; |
| 309 | 314 | |
| 310 | - foreach ($context['topics'] as $topic) |
|
| 311 | - echo ' |
|
| 315 | + foreach ($context['topics'] as $topic) { |
|
| 316 | + echo ' |
|
| 312 | 317 | <tr class="windowbg"> |
| 313 | 318 | <td> |
| 314 | 319 | <input type="checkbox" name="topics[]" value="' . $topic['id'] . '" checked> |
@@ -328,6 +333,7 @@ discard block |
||
| 328 | 333 | <input type="checkbox" name="notifications[]" value="' . $topic['id'] . '" checked> |
| 329 | 334 | </td> |
| 330 | 335 | </tr>'; |
| 336 | + } |
|
| 331 | 337 | echo ' |
| 332 | 338 | </tbody> |
| 333 | 339 | </table> |
@@ -337,9 +343,10 @@ discard block |
||
| 337 | 343 | <legend>', $txt['merge_select_subject'], '</legend> |
| 338 | 344 | <select name="subject" onchange="this.form.custom_subject.style.display = (this.options[this.selectedIndex].value != 0) ? \'none\': \'\' ;">'; |
| 339 | 345 | |
| 340 | - foreach ($context['topics'] as $topic) |
|
| 341 | - echo ' |
|
| 346 | + foreach ($context['topics'] as $topic) { |
|
| 347 | + echo ' |
|
| 342 | 348 | <option value="', $topic['id'], '"' . ($topic['selected'] ? ' selected' : '') . '>', $topic['subject'], '</option>'; |
| 349 | + } |
|
| 343 | 350 | echo ' |
| 344 | 351 | <option value="0">', $txt['merge_custom_subject'], ':</option> |
| 345 | 352 | </select> |
@@ -358,11 +365,12 @@ discard block |
||
| 358 | 365 | <legend>', $txt['merge_select_target_board'], '</legend> |
| 359 | 366 | <ul>'; |
| 360 | 367 | |
| 361 | - foreach ($context['boards'] as $board) |
|
| 362 | - echo ' |
|
| 368 | + foreach ($context['boards'] as $board) { |
|
| 369 | + echo ' |
|
| 363 | 370 | <li> |
| 364 | 371 | <input type="radio" name="board" value="' . $board['id'] . '"' . ($board['selected'] ? ' checked' : '') . '> ' . $board['name'] . ' |
| 365 | 372 | </li>'; |
| 373 | + } |
|
| 366 | 374 | echo ' |
| 367 | 375 | </ul> |
| 368 | 376 | </fieldset>'; |
@@ -374,11 +382,12 @@ discard block |
||
| 374 | 382 | <legend>' . $txt['merge_select_poll'] . '</legend> |
| 375 | 383 | <ul>'; |
| 376 | 384 | |
| 377 | - foreach ($context['polls'] as $poll) |
|
| 378 | - echo ' |
|
| 385 | + foreach ($context['polls'] as $poll) { |
|
| 386 | + echo ' |
|
| 379 | 387 | <li> |
| 380 | 388 | <input type="radio" name="poll" value="' . $poll['id'] . '"' . ($poll['selected'] ? ' checked' : '') . '> ' . $poll['question'] . ' (' . $txt['topic'] . ': <a href="' . $scripturl . '?topic=' . $poll['topic']['id'] . '.0" target="_blank" rel="noopener">' . $poll['topic']['subject'] . '</a>) |
| 381 | 389 | </li>'; |
| 390 | + } |
|
| 382 | 391 | echo ' |
| 383 | 392 | <li> |
| 384 | 393 | <input type="radio" name="poll" value="-1"> (' . $txt['merge_no_poll'] . ') |
@@ -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="windowbg"> |
@@ -69,9 +70,10 @@ discard block |
||
| 69 | 70 | <option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>'; |
| 70 | 71 | |
| 71 | 72 | // Put each group into the box. |
| 72 | - foreach ($context['groups'] as $id => $name) |
|
| 73 | - echo ' |
|
| 73 | + foreach ($context['groups'] as $id => $name) { |
|
| 74 | + echo ' |
|
| 74 | 75 | <option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>'; |
| 76 | + } |
|
| 75 | 77 | |
| 76 | 78 | echo ' |
| 77 | 79 | </select> |
@@ -83,12 +85,13 @@ discard block |
||
| 83 | 85 | <dd>'; |
| 84 | 86 | |
| 85 | 87 | // Put a checkbox in for each group |
| 86 | - foreach ($context['groups'] as $id => $name) |
|
| 87 | - echo ' |
|
| 88 | + foreach ($context['groups'] as $id => $name) { |
|
| 89 | + echo ' |
|
| 88 | 90 | <label for="addgroup_', $id, '"> |
| 89 | 91 | <input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '> |
| 90 | 92 | <span class="smalltext">', $name, '</span> |
| 91 | 93 | </label><br>'; |
| 94 | + } |
|
| 92 | 95 | |
| 93 | 96 | echo ' |
| 94 | 97 | </dd> |
@@ -238,8 +241,8 @@ discard block |
||
| 238 | 241 | <dl class="settings">'; |
| 239 | 242 | |
| 240 | 243 | // Do we need a username? |
| 241 | - if ($context['action_type'] == 'add') |
|
| 242 | - echo ' |
|
| 244 | + if ($context['action_type'] == 'add') { |
|
| 245 | + echo ' |
|
| 243 | 246 | <dt> |
| 244 | 247 | <strong>', $txt['paid_username'], ':</strong><br> |
| 245 | 248 | <span class="smalltext">', $txt['one_username'], '</span> |
@@ -247,6 +250,7 @@ discard block |
||
| 247 | 250 | <dd> |
| 248 | 251 | <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30"> |
| 249 | 252 | </dd>'; |
| 253 | + } |
|
| 250 | 254 | |
| 251 | 255 | echo ' |
| 252 | 256 | <dt> |
@@ -264,9 +268,10 @@ discard block |
||
| 264 | 268 | <select name="year" id="year" onchange="generateDays();">'; |
| 265 | 269 | |
| 266 | 270 | // Show a list of all the years we allow... |
| 267 | - for ($year = 2005; $year <= 2030; $year++) |
|
| 268 | - echo ' |
|
| 271 | + for ($year = 2005; $year <= 2030; $year++) { |
|
| 272 | + echo ' |
|
| 269 | 273 | <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 274 | + } |
|
| 270 | 275 | |
| 271 | 276 | echo ' |
| 272 | 277 | </select> |
@@ -274,9 +279,10 @@ discard block |
||
| 274 | 279 | <select name="month" id="month" onchange="generateDays();">'; |
| 275 | 280 | |
| 276 | 281 | // There are 12 months per year - ensure that they all get listed. |
| 277 | - for ($month = 1; $month <= 12; $month++) |
|
| 278 | - echo ' |
|
| 282 | + for ($month = 1; $month <= 12; $month++) { |
|
| 283 | + echo ' |
|
| 279 | 284 | <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 285 | + } |
|
| 280 | 286 | |
| 281 | 287 | echo ' |
| 282 | 288 | </select> |
@@ -284,9 +290,10 @@ discard block |
||
| 284 | 290 | <select name="day" id="day">'; |
| 285 | 291 | |
| 286 | 292 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 287 | - for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) |
|
| 288 | - echo ' |
|
| 293 | + for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) { |
|
| 294 | + echo ' |
|
| 289 | 295 | <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 296 | + } |
|
| 290 | 297 | |
| 291 | 298 | echo ' |
| 292 | 299 | </select> |
@@ -298,9 +305,10 @@ discard block |
||
| 298 | 305 | <select name="yearend" id="yearend" onchange="generateDays(\'end\');">'; |
| 299 | 306 | |
| 300 | 307 | // Show a list of all the years we allow... |
| 301 | - for ($year = 2005; $year <= 2030; $year++) |
|
| 302 | - echo ' |
|
| 308 | + for ($year = 2005; $year <= 2030; $year++) { |
|
| 309 | + echo ' |
|
| 303 | 310 | <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>'; |
| 311 | + } |
|
| 304 | 312 | |
| 305 | 313 | echo ' |
| 306 | 314 | </select> |
@@ -308,9 +316,10 @@ discard block |
||
| 308 | 316 | <select name="monthend" id="monthend" onchange="generateDays(\'end\');">'; |
| 309 | 317 | |
| 310 | 318 | // There are 12 months per year - ensure that they all get listed. |
| 311 | - for ($month = 1; $month <= 12; $month++) |
|
| 312 | - echo ' |
|
| 319 | + for ($month = 1; $month <= 12; $month++) { |
|
| 320 | + echo ' |
|
| 313 | 321 | <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
| 322 | + } |
|
| 314 | 323 | |
| 315 | 324 | echo ' |
| 316 | 325 | </select> |
@@ -318,9 +327,10 @@ discard block |
||
| 318 | 327 | <select name="dayend" id="dayend">'; |
| 319 | 328 | |
| 320 | 329 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
| 321 | - for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) |
|
| 322 | - echo ' |
|
| 330 | + for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) { |
|
| 331 | + echo ' |
|
| 323 | 332 | <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>'; |
| 333 | + } |
|
| 324 | 334 | |
| 325 | 335 | echo ' |
| 326 | 336 | </select> |
@@ -359,8 +369,8 @@ discard block |
||
| 359 | 369 | <div class="windowbg"> |
| 360 | 370 | <ul>'; |
| 361 | 371 | |
| 362 | - foreach ($context['pending_payments'] as $id => $payment) |
|
| 363 | - echo ' |
|
| 372 | + foreach ($context['pending_payments'] as $id => $payment) { |
|
| 373 | + echo ' |
|
| 364 | 374 | <li> |
| 365 | 375 | ', $payment['desc'], ' |
| 366 | 376 | <span class="floatleft"> |
@@ -370,6 +380,7 @@ discard block |
||
| 370 | 380 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a> |
| 371 | 381 | </span> |
| 372 | 382 | </li>'; |
| 383 | + } |
|
| 373 | 384 | |
| 374 | 385 | echo ' |
| 375 | 386 | </ul> |
@@ -394,12 +405,12 @@ discard block |
||
| 394 | 405 | <h3 class="catbg">', $txt['subscriptions'], '</h3> |
| 395 | 406 | </div>'; |
| 396 | 407 | |
| 397 | - if (empty($context['subscriptions'])) |
|
| 398 | - echo ' |
|
| 408 | + if (empty($context['subscriptions'])) { |
|
| 409 | + echo ' |
|
| 399 | 410 | <div class="information"> |
| 400 | 411 | ', $txt['paid_subs_none'], ' |
| 401 | 412 | </div>'; |
| 402 | - else |
|
| 413 | + } else |
|
| 403 | 414 | { |
| 404 | 415 | echo ' |
| 405 | 416 | <div class="information"> |
@@ -410,8 +421,9 @@ discard block |
||
| 410 | 421 | foreach ($context['subscriptions'] as $id => $subscription) |
| 411 | 422 | { |
| 412 | 423 | // Ignore the inactive ones... |
| 413 | - if (empty($subscription['active'])) |
|
| 414 | - continue; |
|
| 424 | + if (empty($subscription['active'])) { |
|
| 425 | + continue; |
|
| 426 | + } |
|
| 415 | 427 | |
| 416 | 428 | echo ' |
| 417 | 429 | <div class="cat_bar"> |
@@ -421,9 +433,10 @@ discard block |
||
| 421 | 433 | <p><strong>', $subscription['name'], '</strong></p> |
| 422 | 434 | <p class="smalltext">', $subscription['desc'], '</p>'; |
| 423 | 435 | |
| 424 | - if (!$subscription['flexible']) |
|
| 425 | - echo ' |
|
| 436 | + if (!$subscription['flexible']) { |
|
| 437 | + echo ' |
|
| 426 | 438 | <div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>'; |
| 439 | + } |
|
| 427 | 440 | |
| 428 | 441 | if ($context['user']['is_owner']) |
| 429 | 442 | { |
@@ -436,24 +449,25 @@ discard block |
||
| 436 | 449 | <select name="cur[', $subscription['id'], ']">'; |
| 437 | 450 | |
| 438 | 451 | // Print out the costs for this one. |
| 439 | - foreach ($subscription['costs'] as $duration => $value) |
|
| 440 | - echo ' |
|
| 452 | + foreach ($subscription['costs'] as $duration => $value) { |
|
| 453 | + echo ' |
|
| 441 | 454 | <option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>'; |
| 455 | + } |
|
| 442 | 456 | |
| 443 | 457 | echo ' |
| 444 | 458 | </select>'; |
| 445 | - } |
|
| 446 | - else |
|
| 447 | - echo ' |
|
| 459 | + } else { |
|
| 460 | + echo ' |
|
| 448 | 461 | ', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']); |
| 462 | + } |
|
| 449 | 463 | |
| 450 | 464 | echo ' |
| 451 | 465 | <hr> |
| 452 | 466 | <input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">'; |
| 453 | - } |
|
| 454 | - else |
|
| 455 | - echo ' |
|
| 467 | + } else { |
|
| 468 | + echo ' |
|
| 456 | 469 | <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>'; |
| 470 | + } |
|
| 457 | 471 | |
| 458 | 472 | echo ' |
| 459 | 473 | </div><!-- .windowbg -->'; |
@@ -480,18 +494,19 @@ discard block |
||
| 480 | 494 | </thead> |
| 481 | 495 | <tbody>'; |
| 482 | 496 | |
| 483 | - if (empty($context['current'])) |
|
| 484 | - echo ' |
|
| 497 | + if (empty($context['current'])) { |
|
| 498 | + echo ' |
|
| 485 | 499 | <tr class="windowbg"> |
| 486 | 500 | <td colspan="4"> |
| 487 | 501 | ', $txt['paid_none_yet'], ' |
| 488 | 502 | </td> |
| 489 | 503 | </tr>'; |
| 504 | + } |
|
| 490 | 505 | |
| 491 | 506 | foreach ($context['current'] as $sub) |
| 492 | 507 | { |
| 493 | - if (!$sub['hide']) |
|
| 494 | - echo ' |
|
| 508 | + if (!$sub['hide']) { |
|
| 509 | + echo ' |
|
| 495 | 510 | <tr class="windowbg"> |
| 496 | 511 | <td> |
| 497 | 512 | ', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), ' |
@@ -502,6 +517,7 @@ discard block |
||
| 502 | 517 | <td>', $sub['start'], '</td> |
| 503 | 518 | <td>', $sub['end'], '</td> |
| 504 | 519 | </tr>'; |
| 520 | + } |
|
| 505 | 521 | } |
| 506 | 522 | |
| 507 | 523 | echo ' |
@@ -553,15 +569,17 @@ discard block |
||
| 553 | 569 | ', $gateway['desc'], '<br> |
| 554 | 570 | <form action="', $gateway['form'], '" method="post">'; |
| 555 | 571 | |
| 556 | - if (!empty($gateway['javascript'])) |
|
| 557 | - echo ' |
|
| 572 | + if (!empty($gateway['javascript'])) { |
|
| 573 | + echo ' |
|
| 558 | 574 | <script> |
| 559 | 575 | ', $gateway['javascript'], ' |
| 560 | 576 | </script>'; |
| 577 | + } |
|
| 561 | 578 | |
| 562 | - foreach ($gateway['hidden'] as $name => $value) |
|
| 563 | - echo ' |
|
| 579 | + foreach ($gateway['hidden'] as $name => $value) { |
|
| 580 | + echo ' |
|
| 564 | 581 | <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">'; |
| 582 | + } |
|
| 565 | 583 | |
| 566 | 584 | echo ' |
| 567 | 585 | <br> |
@@ -55,9 +55,10 @@ discard block |
||
| 55 | 55 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
| 56 | 56 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
| 57 | 57 | |
| 58 | - if ($context['allow_protected']) |
|
| 59 | - echo ' |
|
| 58 | + if ($context['allow_protected']) { |
|
| 59 | + echo ' |
|
| 60 | 60 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
| 61 | + } |
|
| 61 | 62 | |
| 62 | 63 | echo ' |
| 63 | 64 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -67,14 +68,15 @@ discard block |
||
| 67 | 68 | </dd>'; |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | - if ($context['post_group'] || $context['undefined_group']) |
|
| 71 | - echo ' |
|
| 71 | + if ($context['post_group'] || $context['undefined_group']) { |
|
| 72 | + echo ' |
|
| 72 | 73 | <dt id="min_posts_text"> |
| 73 | 74 | <strong>', $txt['membergroups_min_posts'], ':</strong> |
| 74 | 75 | </dt> |
| 75 | 76 | <dd> |
| 76 | 77 | <input type="number" name="min_posts" id="min_posts_input" size="5"> |
| 77 | 78 | </dd>'; |
| 79 | + } |
|
| 78 | 80 | |
| 79 | 81 | if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups'])) |
| 80 | 82 | { |
@@ -92,9 +94,10 @@ discard block |
||
| 92 | 94 | <option value="-1">', $txt['membergroups_guests'], '</option> |
| 93 | 95 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
| 94 | 96 | |
| 95 | - foreach ($context['groups'] as $group) |
|
| 96 | - echo ' |
|
| 97 | + foreach ($context['groups'] as $group) { |
|
| 98 | + echo ' |
|
| 97 | 99 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
| 100 | + } |
|
| 98 | 101 | |
| 99 | 102 | echo ' |
| 100 | 103 | </select> |
@@ -105,9 +108,10 @@ discard block |
||
| 105 | 108 | <option value="-1">', $txt['membergroups_guests'], '</option> |
| 106 | 109 | <option value="0" selected>', $txt['membergroups_members'], '</option>'; |
| 107 | 110 | |
| 108 | - foreach ($context['groups'] as $group) |
|
| 109 | - echo ' |
|
| 111 | + foreach ($context['groups'] as $group) { |
|
| 112 | + echo ' |
|
| 110 | 113 | <option value="', $group['id'], '">', $group['name'], '</option>'; |
| 114 | + } |
|
| 111 | 115 | |
| 112 | 116 | echo ' |
| 113 | 117 | </select> |
@@ -139,8 +143,8 @@ discard block |
||
| 139 | 143 | <input type="submit" value="', $txt['membergroups_add_group'], '" class="button"> |
| 140 | 144 | </div><!-- .windowbg -->'; |
| 141 | 145 | |
| 142 | - if ($context['undefined_group']) |
|
| 143 | - echo ' |
|
| 146 | + if ($context['undefined_group']) { |
|
| 147 | + echo ' |
|
| 144 | 148 | <script> |
| 145 | 149 | function swapPostGroup(isChecked) |
| 146 | 150 | { |
@@ -150,6 +154,7 @@ discard block |
||
| 150 | 154 | } |
| 151 | 155 | swapPostGroup(', $context['post_group'] ? 'true' : 'false', '); |
| 152 | 156 | </script>'; |
| 157 | + } |
|
| 153 | 158 | |
| 154 | 159 | echo ' |
| 155 | 160 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -181,14 +186,15 @@ discard block |
||
| 181 | 186 | <input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30"> |
| 182 | 187 | </dd>'; |
| 183 | 188 | |
| 184 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
| 185 | - echo ' |
|
| 189 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
| 190 | + echo ' |
|
| 186 | 191 | <dt id="group_desc_text"> |
| 187 | 192 | <label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label> |
| 188 | 193 | </dt> |
| 189 | 194 | <dd> |
| 190 | 195 | <textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea> |
| 191 | 196 | </dd>'; |
| 197 | + } |
|
| 192 | 198 | |
| 193 | 199 | // Group type... |
| 194 | 200 | if ($context['group']['allow_post_group']) |
@@ -202,9 +208,10 @@ discard block |
||
| 202 | 208 | <legend>', $txt['membergroups_edit_select_group_type'], '</legend> |
| 203 | 209 | <label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>'; |
| 204 | 210 | |
| 205 | - if ($context['group']['allow_protected']) |
|
| 206 | - echo ' |
|
| 211 | + if ($context['group']['allow_protected']) { |
|
| 212 | + echo ' |
|
| 207 | 213 | <label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>'; |
| 214 | + } |
|
| 208 | 215 | |
| 209 | 216 | echo ' |
| 210 | 217 | <label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br> |
@@ -214,8 +221,8 @@ discard block |
||
| 214 | 221 | </dd>'; |
| 215 | 222 | } |
| 216 | 223 | |
| 217 | - if ($context['group']['id'] != 3 && $context['group']['id'] != 4) |
|
| 218 | - echo ' |
|
| 224 | + if ($context['group']['id'] != 3 && $context['group']['id'] != 4) { |
|
| 225 | + echo ' |
|
| 219 | 226 | <dt id="group_moderators_text"> |
| 220 | 227 | <label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label> |
| 221 | 228 | </dt> |
@@ -233,6 +240,7 @@ discard block |
||
| 233 | 240 | <option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option> |
| 234 | 241 | </select> |
| 235 | 242 | </dd>'; |
| 243 | + } |
|
| 236 | 244 | |
| 237 | 245 | // Can they inherit permissions? |
| 238 | 246 | if ($context['group']['id'] > 1 && $context['group']['id'] != 3) |
@@ -249,9 +257,10 @@ discard block |
||
| 249 | 257 | <option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>'; |
| 250 | 258 | |
| 251 | 259 | // For all the inheritable groups show an option. |
| 252 | - foreach ($context['inheritable_groups'] as $id => $group) |
|
| 253 | - echo ' |
|
| 260 | + foreach ($context['inheritable_groups'] as $id => $group) { |
|
| 261 | + echo ' |
|
| 254 | 262 | <option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>'; |
| 263 | + } |
|
| 255 | 264 | |
| 256 | 265 | echo ' |
| 257 | 266 | </select> |
@@ -259,8 +268,8 @@ discard block |
||
| 259 | 268 | </dd>'; |
| 260 | 269 | } |
| 261 | 270 | |
| 262 | - if ($context['group']['allow_post_group']) |
|
| 263 | - echo ' |
|
| 271 | + if ($context['group']['allow_post_group']) { |
|
| 272 | + echo ' |
|
| 264 | 273 | |
| 265 | 274 | <dt id="min_posts_text"> |
| 266 | 275 | <label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label> |
@@ -268,6 +277,7 @@ discard block |
||
| 268 | 277 | <dd> |
| 269 | 278 | <input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6"> |
| 270 | 279 | </dd>'; |
| 280 | + } |
|
| 271 | 281 | |
| 272 | 282 | echo ' |
| 273 | 283 | <dt> |
@@ -297,9 +307,10 @@ discard block |
||
| 297 | 307 | <select name="icon_image" id="icon_image_input">'; |
| 298 | 308 | |
| 299 | 309 | // For every possible icon, create an option. |
| 300 | - foreach ($context['possible_icons'] as $icon) |
|
| 301 | - echo ' |
|
| 310 | + foreach ($context['possible_icons'] as $icon) { |
|
| 311 | + echo ' |
|
| 302 | 312 | <option value="', $icon, '"', $context['group']['icon_image'] == $icon ? ' selected' : '', '>', $icon, '</option>'; |
| 313 | + } |
|
| 303 | 314 | |
| 304 | 315 | echo ' |
| 305 | 316 | </select> |
@@ -308,9 +319,10 @@ discard block |
||
| 308 | 319 | } |
| 309 | 320 | |
| 310 | 321 | // No? Hide the entire control. |
| 311 | - else |
|
| 312 | - echo ' |
|
| 322 | + else { |
|
| 323 | + echo ' |
|
| 313 | 324 | <input type="hidden" name="icon_image" value="">'; |
| 325 | + } |
|
| 314 | 326 | |
| 315 | 327 | echo ' |
| 316 | 328 | <dt> |
@@ -322,8 +334,8 @@ discard block |
||
| 322 | 334 | </dd>'; |
| 323 | 335 | |
| 324 | 336 | // Force 2FA for this membergroup? |
| 325 | - if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) |
|
| 326 | - echo ' |
|
| 337 | + if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) { |
|
| 338 | + echo ' |
|
| 327 | 339 | <dt> |
| 328 | 340 | <label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br> |
| 329 | 341 | <span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span> |
@@ -331,6 +343,7 @@ discard block |
||
| 331 | 343 | <dd> |
| 332 | 344 | <input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '> |
| 333 | 345 | </dd>'; |
| 346 | + } |
|
| 334 | 347 | |
| 335 | 348 | if (!empty($context['categories'])) |
| 336 | 349 | { |
@@ -341,11 +354,11 @@ discard block |
||
| 341 | 354 | </dt> |
| 342 | 355 | <dd>'; |
| 343 | 356 | |
| 344 | - if (!empty($context['can_manage_boards'])) |
|
| 345 | - echo $txt['membergroups_can_manage_access']; |
|
| 346 | - |
|
| 347 | - else |
|
| 348 | - template_add_edit_group_boards_list(); |
|
| 357 | + if (!empty($context['can_manage_boards'])) { |
|
| 358 | + echo $txt['membergroups_can_manage_access']; |
|
| 359 | + } else { |
|
| 360 | + template_add_edit_group_boards_list(); |
|
| 361 | + } |
|
| 349 | 362 | |
| 350 | 363 | echo ' |
| 351 | 364 | </dd>'; |
@@ -375,20 +388,21 @@ discard block |
||
| 375 | 388 | sItemListContainerId: \'moderator_container\', |
| 376 | 389 | aListItems: ['; |
| 377 | 390 | |
| 378 | - foreach ($context['group']['moderators'] as $id_member => $member_name) |
|
| 379 | - echo ' |
|
| 391 | + foreach ($context['group']['moderators'] as $id_member => $member_name) { |
|
| 392 | + echo ' |
|
| 380 | 393 | { |
| 381 | 394 | sItemId: ', JavaScriptEscape($id_member), ', |
| 382 | 395 | sItemName: ', JavaScriptEscape($member_name), ' |
| 383 | 396 | }', $id_member == $context['group']['last_moderator_id'] ? '' : ','; |
| 397 | + } |
|
| 384 | 398 | |
| 385 | 399 | echo ' |
| 386 | 400 | ] |
| 387 | 401 | }); |
| 388 | 402 | </script>'; |
| 389 | 403 | |
| 390 | - if ($context['group']['allow_post_group']) |
|
| 391 | - echo ' |
|
| 404 | + if ($context['group']['allow_post_group']) { |
|
| 405 | + echo ' |
|
| 392 | 406 | <script> |
| 393 | 407 | function swapPostGroup(isChecked) |
| 394 | 408 | { |
@@ -436,7 +450,8 @@ discard block |
||
| 436 | 450 | |
| 437 | 451 | swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', '); |
| 438 | 452 | </script>'; |
| 439 | -} |
|
| 453 | + } |
|
| 454 | + } |
|
| 440 | 455 | |
| 441 | 456 | /** |
| 442 | 457 | * The template for determining which boards a group has access to. |
@@ -454,13 +469,13 @@ discard block |
||
| 454 | 469 | |
| 455 | 470 | foreach ($context['categories'] as $category) |
| 456 | 471 | { |
| 457 | - if (empty($modSettings['deny_boards_access'])) |
|
| 458 | - echo ' |
|
| 472 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 473 | + echo ' |
|
| 459 | 474 | <li class="category"> |
| 460 | 475 | <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a> |
| 461 | 476 | <ul>'; |
| 462 | - else |
|
| 463 | - echo ' |
|
| 477 | + } else { |
|
| 478 | + echo ' |
|
| 464 | 479 | <li class="category"> |
| 465 | 480 | <strong>', $category['name'], '</strong> |
| 466 | 481 | <span class="select_all_box"> |
@@ -473,16 +488,17 @@ discard block |
||
| 473 | 488 | </select> |
| 474 | 489 | </span> |
| 475 | 490 | <ul id="boards_list_', $category['id'], '">'; |
| 491 | + } |
|
| 476 | 492 | |
| 477 | 493 | foreach ($category['boards'] as $board) |
| 478 | 494 | { |
| 479 | - if (empty($modSettings['deny_boards_access'])) |
|
| 480 | - echo ' |
|
| 495 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 496 | + echo ' |
|
| 481 | 497 | <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> |
| 482 | 498 | <input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label> |
| 483 | 499 | </li>'; |
| 484 | - else |
|
| 485 | - echo ' |
|
| 500 | + } else { |
|
| 501 | + echo ' |
|
| 486 | 502 | <li class="board" style="width:100%"> |
| 487 | 503 | <span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span> |
| 488 | 504 | <span style="width:50%;float:right"> |
@@ -491,6 +507,7 @@ discard block |
||
| 491 | 507 | <input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', '> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label> |
| 492 | 508 | </span> |
| 493 | 509 | </li>'; |
| 510 | + } |
|
| 494 | 511 | } |
| 495 | 512 | |
| 496 | 513 | echo ' |
@@ -501,14 +518,14 @@ discard block |
||
| 501 | 518 | echo ' |
| 502 | 519 | </ul>'; |
| 503 | 520 | |
| 504 | - if (empty($modSettings['deny_boards_access'])) |
|
| 505 | - echo ' |
|
| 521 | + if (empty($modSettings['deny_boards_access'])) { |
|
| 522 | + echo ' |
|
| 506 | 523 | <br class="clear"><br> |
| 507 | 524 | <input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');"> |
| 508 | 525 | <label for="checkall_check"><em>', $txt['check_all'], '</em></label> |
| 509 | 526 | </fieldset>'; |
| 510 | - else |
|
| 511 | - echo ' |
|
| 527 | + } else { |
|
| 528 | + echo ' |
|
| 512 | 529 | <br class="clear"> |
| 513 | 530 | <span class="select_all_box"> |
| 514 | 531 | <em>', $txt['all'], ': </em> |
@@ -524,15 +541,17 @@ discard block |
||
| 524 | 541 | }); |
| 525 | 542 | }); |
| 526 | 543 | </script>'; |
| 544 | + } |
|
| 527 | 545 | |
| 528 | - if ($collapse) |
|
| 529 | - echo ' |
|
| 546 | + if ($collapse) { |
|
| 547 | + echo ' |
|
| 530 | 548 | <a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a> |
| 531 | 549 | <script> |
| 532 | 550 | document.getElementById("visible_boards_link").style.display = ""; |
| 533 | 551 | document.getElementById("visible_boards").style.display = "none"; |
| 534 | 552 | </script>'; |
| 535 | -} |
|
| 553 | + } |
|
| 554 | + } |
|
| 536 | 555 | |
| 537 | 556 | /** |
| 538 | 557 | * Templatine for viewing the members of a group. |
@@ -557,14 +576,15 @@ discard block |
||
| 557 | 576 | </dd>'; |
| 558 | 577 | |
| 559 | 578 | // Any description to show? |
| 560 | - if (!empty($context['group']['description'])) |
|
| 561 | - echo ' |
|
| 579 | + if (!empty($context['group']['description'])) { |
|
| 580 | + echo ' |
|
| 562 | 581 | <dt> |
| 563 | 582 | <strong>' . $txt['membergroups_members_description'] . ':</strong> |
| 564 | 583 | </dt> |
| 565 | 584 | <dd> |
| 566 | 585 | ', $context['group']['description'], ' |
| 567 | 586 | </dd>'; |
| 587 | + } |
|
| 568 | 588 | |
| 569 | 589 | echo ' |
| 570 | 590 | <dt> |
@@ -578,8 +598,9 @@ discard block |
||
| 578 | 598 | if (!empty($context['group']['moderators'])) |
| 579 | 599 | { |
| 580 | 600 | $moderators = array(); |
| 581 | - foreach ($context['group']['moderators'] as $moderator) |
|
| 582 | - $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
| 601 | + foreach ($context['group']['moderators'] as $moderator) { |
|
| 602 | + $moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>'; |
|
| 603 | + } |
|
| 583 | 604 | |
| 584 | 605 | echo ' |
| 585 | 606 | <dt> |
@@ -604,9 +625,10 @@ discard block |
||
| 604 | 625 | <tr class="title_bar"> |
| 605 | 626 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
| 606 | 627 | |
| 607 | - if ($context['can_send_email']) |
|
| 608 | - echo ' |
|
| 628 | + if ($context['can_send_email']) { |
|
| 629 | + echo ' |
|
| 609 | 630 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>'; |
| 631 | + } |
|
| 610 | 632 | |
| 611 | 633 | echo ' |
| 612 | 634 | <th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th> |
@@ -615,20 +637,22 @@ discard block |
||
| 615 | 637 | <a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a> |
| 616 | 638 | </th>'; |
| 617 | 639 | |
| 618 | - if (!empty($context['group']['assignable'])) |
|
| 619 | - echo ' |
|
| 640 | + if (!empty($context['group']['assignable'])) { |
|
| 641 | + echo ' |
|
| 620 | 642 | <th style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>'; |
| 643 | + } |
|
| 621 | 644 | |
| 622 | 645 | echo ' |
| 623 | 646 | </tr> |
| 624 | 647 | </thead> |
| 625 | 648 | <tbody>'; |
| 626 | 649 | |
| 627 | - if (empty($context['members'])) |
|
| 628 | - echo ' |
|
| 650 | + if (empty($context['members'])) { |
|
| 651 | + echo ' |
|
| 629 | 652 | <tr class="windowbg"> |
| 630 | 653 | <td colspan="6">', $txt['membergroups_members_no_members'], '</td> |
| 631 | 654 | </tr>'; |
| 655 | + } |
|
| 632 | 656 | |
| 633 | 657 | foreach ($context['members'] as $member) |
| 634 | 658 | { |
@@ -636,20 +660,22 @@ discard block |
||
| 636 | 660 | <tr class="windowbg"> |
| 637 | 661 | <td>', $member['name'], '</td>'; |
| 638 | 662 | |
| 639 | - if ($context['can_send_email']) |
|
| 640 | - echo ' |
|
| 663 | + if ($context['can_send_email']) { |
|
| 664 | + echo ' |
|
| 641 | 665 | <td> |
| 642 | 666 | <a href="mailto:', $member['email'], '">', $member['email'], '</a> |
| 643 | 667 | </td>'; |
| 668 | + } |
|
| 644 | 669 | |
| 645 | 670 | echo ' |
| 646 | 671 | <td>', $member['last_online'], '</td> |
| 647 | 672 | <td>', $member['registered'], '</td> |
| 648 | 673 | <td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>'; |
| 649 | 674 | |
| 650 | - if (!empty($context['group']['assignable'])) |
|
| 651 | - echo ' |
|
| 675 | + if (!empty($context['group']['assignable'])) { |
|
| 676 | + echo ' |
|
| 652 | 677 | <td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>'; |
| 678 | + } |
|
| 653 | 679 | |
| 654 | 680 | echo ' |
| 655 | 681 | </tr>'; |
@@ -659,11 +685,12 @@ discard block |
||
| 659 | 685 | </tbody> |
| 660 | 686 | </table>'; |
| 661 | 687 | |
| 662 | - if (!empty($context['group']['assignable'])) |
|
| 663 | - echo ' |
|
| 688 | + if (!empty($context['group']['assignable'])) { |
|
| 689 | + echo ' |
|
| 664 | 690 | <div class="floatright"> |
| 665 | 691 | <input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button "> |
| 666 | 692 | </div>'; |
| 693 | + } |
|
| 667 | 694 | |
| 668 | 695 | echo ' |
| 669 | 696 | <div class="pagesection flow_hidden"> |
@@ -671,8 +698,8 @@ discard block |
||
| 671 | 698 | </div> |
| 672 | 699 | <br>'; |
| 673 | 700 | |
| 674 | - if (!empty($context['group']['assignable'])) |
|
| 675 | - echo ' |
|
| 701 | + if (!empty($context['group']['assignable'])) { |
|
| 702 | + echo ' |
|
| 676 | 703 | <div class="cat_bar"> |
| 677 | 704 | <h3 class="catbg">', $txt['membergroups_members_add_title'], '</h3> |
| 678 | 705 | </div> |
@@ -688,6 +715,7 @@ discard block |
||
| 688 | 715 | </dl> |
| 689 | 716 | <input type="submit" name="add" value="', $txt['membergroups_members_add'], '" class="button"> |
| 690 | 717 | </div>'; |
| 718 | + } |
|
| 691 | 719 | |
| 692 | 720 | echo ' |
| 693 | 721 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -695,8 +723,8 @@ discard block |
||
| 695 | 723 | </form> |
| 696 | 724 | </div><!-- #admincenter -->'; |
| 697 | 725 | |
| 698 | - if (!empty($context['group']['assignable'])) |
|
| 699 | - echo ' |
|
| 726 | + if (!empty($context['group']['assignable'])) { |
|
| 727 | + echo ' |
|
| 700 | 728 | <script> |
| 701 | 729 | var oAddMemberSuggest = new smc_AutoSuggest({ |
| 702 | 730 | sSelf: \'oAddMemberSuggest\', |
@@ -712,7 +740,8 @@ discard block |
||
| 712 | 740 | sItemListContainerId: \'toAddItemContainer\' |
| 713 | 741 | }); |
| 714 | 742 | </script>'; |
| 715 | -} |
|
| 743 | + } |
|
| 744 | + } |
|
| 716 | 745 | |
| 717 | 746 | /** |
| 718 | 747 | * Allow the moderator to enter a reason to each user being rejected. |
@@ -732,8 +761,8 @@ discard block |
||
| 732 | 761 | <dl class="settings">'; |
| 733 | 762 | |
| 734 | 763 | // Loop through and print out a reason box for each... |
| 735 | - foreach ($context['group_requests'] as $request) |
|
| 736 | - echo ' |
|
| 764 | + foreach ($context['group_requests'] as $request) { |
|
| 765 | + echo ' |
|
| 737 | 766 | <dt> |
| 738 | 767 | <strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong> |
| 739 | 768 | </dt> |
@@ -741,6 +770,7 @@ discard block |
||
| 741 | 770 | <input type="hidden" name="groupr[]" value="', $request['id'], '"> |
| 742 | 771 | <textarea name="groupreason[', $request['id'], ']" rows="3" cols="40"></textarea> |
| 743 | 772 | </dd>'; |
| 773 | + } |
|
| 744 | 774 | |
| 745 | 775 | echo ' |
| 746 | 776 | </dl> |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | <div class="windowbg noup"> |
| 128 | 128 | <dl class="settings">'; |
| 129 | 129 | |
| 130 | - if (!empty($context['table_info'])) |
|
| 131 | - echo ' |
|
| 130 | + if (!empty($context['table_info'])) { |
|
| 131 | + echo ' |
|
| 132 | 132 | <dt> |
| 133 | 133 | <strong>', $txt['search_method_messages_table_space'], ':</strong> |
| 134 | 134 | </dt> |
@@ -141,6 +141,7 @@ discard block |
||
| 141 | 141 | <dd> |
| 142 | 142 | ', $context['table_info']['index_length'], ' |
| 143 | 143 | </dd>'; |
| 144 | + } |
|
| 144 | 145 | echo ' |
| 145 | 146 | </dl> |
| 146 | 147 | ', $context['double_index'] ? '<div class="noticebox"> |
@@ -163,17 +164,17 @@ discard block |
||
| 163 | 164 | <dd> |
| 164 | 165 | <span class="smalltext">'; |
| 165 | 166 | |
| 166 | - if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) |
|
| 167 | - echo ' |
|
| 167 | + if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) { |
|
| 168 | + echo ' |
|
| 168 | 169 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]'; |
| 169 | - |
|
| 170 | - elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) |
|
| 171 | - echo ' |
|
| 170 | + } elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) { |
|
| 171 | + echo ' |
|
| 172 | 172 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create']; |
| 173 | - else |
|
| 174 | - echo ' |
|
| 173 | + } else { |
|
| 174 | + echo ' |
|
| 175 | 175 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br> |
| 176 | 176 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length']; |
| 177 | + } |
|
| 177 | 178 | echo ' |
| 178 | 179 | </span> |
| 179 | 180 | </dd>'; |
@@ -187,26 +188,27 @@ discard block |
||
| 187 | 188 | <dd> |
| 188 | 189 | <span class="smalltext">'; |
| 189 | 190 | |
| 190 | - if ($context['custom_index']) |
|
| 191 | - echo ' |
|
| 191 | + if ($context['custom_index']) { |
|
| 192 | + echo ' |
|
| 192 | 193 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br> |
| 193 | 194 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
| 194 | - |
|
| 195 | - elseif ($context['partial_custom_index']) |
|
| 196 | - echo ' |
|
| 195 | + } elseif ($context['partial_custom_index']) { |
|
| 196 | + echo ' |
|
| 197 | 197 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br> |
| 198 | 198 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
| 199 | - else |
|
| 200 | - echo ' |
|
| 199 | + } else { |
|
| 200 | + echo ' |
|
| 201 | 201 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]'; |
| 202 | + } |
|
| 202 | 203 | echo ' |
| 203 | 204 | </span> |
| 204 | 205 | </dd>'; |
| 205 | 206 | |
| 206 | 207 | foreach ($context['search_apis'] as $api) |
| 207 | 208 | { |
| 208 | - if (empty($api['label']) || $api['has_template']) |
|
| 209 | - continue; |
|
| 209 | + if (empty($api['label']) || $api['has_template']) { |
|
| 210 | + continue; |
|
| 211 | + } |
|
| 210 | 212 | |
| 211 | 213 | echo ' |
| 212 | 214 | <dt> |
@@ -214,11 +216,12 @@ discard block |
||
| 214 | 216 | ', $api['label'], ' |
| 215 | 217 | </dt>'; |
| 216 | 218 | |
| 217 | - if ($api['desc']) |
|
| 218 | - echo ' |
|
| 219 | + if ($api['desc']) { |
|
| 220 | + echo ' |
|
| 219 | 221 | <dd> |
| 220 | 222 | <span class="smalltext">', $api['desc'], '</span> |
| 221 | 223 | </dd>'; |
| 224 | + } |
|
| 222 | 225 | } |
| 223 | 226 | |
| 224 | 227 | echo ' |
@@ -22,30 +22,32 @@ discard block |
||
| 22 | 22 | <div id="calendar">'; |
| 23 | 23 | |
| 24 | 24 | // Show the mini-blocks if they're enabled. |
| 25 | - if (empty($context['blocks_disabled'])) |
|
| 26 | - echo ' |
|
| 25 | + if (empty($context['blocks_disabled'])) { |
|
| 26 | + echo ' |
|
| 27 | 27 | <div id="month_grid"> |
| 28 | 28 | ', template_show_month_grid('prev', true), ' |
| 29 | 29 | ', template_show_month_grid('current', true), ' |
| 30 | 30 | ', template_show_month_grid('next', true), ' |
| 31 | 31 | </div>'; |
| 32 | + } |
|
| 32 | 33 | |
| 33 | 34 | // What view are we showing? |
| 34 | - if ($context['calendar_view'] == 'viewlist') |
|
| 35 | - echo ' |
|
| 35 | + if ($context['calendar_view'] == 'viewlist') { |
|
| 36 | + echo ' |
|
| 36 | 37 | <div id="main_grid"> |
| 37 | 38 | ', template_show_upcoming_list('main'), ' |
| 38 | 39 | </div>'; |
| 39 | - elseif ($context['calendar_view'] == 'viewweek') |
|
| 40 | - echo ' |
|
| 40 | + } elseif ($context['calendar_view'] == 'viewweek') { |
|
| 41 | + echo ' |
|
| 41 | 42 | <div id="main_grid"> |
| 42 | 43 | ', template_show_week_grid('main'), ' |
| 43 | 44 | </div>'; |
| 44 | - else |
|
| 45 | - echo ' |
|
| 45 | + } else { |
|
| 46 | + echo ' |
|
| 46 | 47 | <div id="main_grid"> |
| 47 | 48 | ', template_show_month_grid('main'), ' |
| 48 | 49 | </div>'; |
| 50 | + } |
|
| 49 | 51 | |
| 50 | 52 | // Close our wrapper. |
| 51 | 53 | echo ' |
@@ -64,20 +66,22 @@ discard block |
||
| 64 | 66 | global $context, $scripturl, $txt; |
| 65 | 67 | |
| 66 | 68 | // Bail out if we have nothing to work with |
| 67 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 68 | - return false; |
|
| 69 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 70 | + return false; |
|
| 71 | + } |
|
| 69 | 72 | |
| 70 | 73 | // Protect programmer sanity |
| 71 | 74 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
| 72 | 75 | |
| 73 | 76 | // Do we want a title? |
| 74 | - if (empty($calendar_data['disable_title'])) |
|
| 75 | - echo ' |
|
| 77 | + if (empty($calendar_data['disable_title'])) { |
|
| 78 | + echo ' |
|
| 76 | 79 | <div class="cat_bar"> |
| 77 | 80 | <h3 class="catbg centertext largetext"> |
| 78 | 81 | <a href="', $scripturl, '?action=calendar;viewlist;year=', $calendar_data['start_year'], ';month=', $calendar_data['start_month'], ';day=', $calendar_data['start_day'], '">', $txt['calendar_upcoming'], '</a> |
| 79 | 82 | </h3> |
| 80 | 83 | </div>'; |
| 84 | + } |
|
| 81 | 85 | |
| 82 | 86 | // Give the user some controls to work with |
| 83 | 87 | template_calendar_top($calendar_data); |
@@ -100,11 +104,13 @@ discard block |
||
| 100 | 104 | <li class="windowbg"> |
| 101 | 105 | <strong class="event_title">', $event['link'], '</strong>'; |
| 102 | 106 | |
| 103 | - if ($event['can_edit']) |
|
| 104 | - echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 107 | + if ($event['can_edit']) { |
|
| 108 | + echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>'; |
|
| 109 | + } |
|
| 105 | 110 | |
| 106 | - if ($event['can_export']) |
|
| 107 | - echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 111 | + if ($event['can_export']) { |
|
| 112 | + echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>'; |
|
| 113 | + } |
|
| 108 | 114 | |
| 109 | 115 | echo ' |
| 110 | 116 | <br>'; |
@@ -112,14 +118,14 @@ discard block |
||
| 112 | 118 | if (!empty($event['allday'])) |
| 113 | 119 | { |
| 114 | 120 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' – <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : ''; |
| 115 | - } |
|
| 116 | - else |
|
| 121 | + } else |
|
| 117 | 122 | { |
| 118 | 123 | // Display event info relative to user's local timezone |
| 119 | 124 | echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 120 | 125 | |
| 121 | - if ($event['start_date_local'] != $event['end_date_local']) |
|
| 122 | - echo trim($event['end_date_local']) . ', '; |
|
| 126 | + if ($event['start_date_local'] != $event['end_date_local']) { |
|
| 127 | + echo trim($event['end_date_local']) . ', '; |
|
| 128 | + } |
|
| 123 | 129 | |
| 124 | 130 | echo trim($event['end_time_local']); |
| 125 | 131 | |
@@ -128,23 +134,27 @@ discard block |
||
| 128 | 134 | { |
| 129 | 135 | echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">'; |
| 130 | 136 | |
| 131 | - if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) |
|
| 132 | - echo trim($event['start_date_orig']), ', '; |
|
| 137 | + if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) { |
|
| 138 | + echo trim($event['start_date_orig']), ', '; |
|
| 139 | + } |
|
| 133 | 140 | |
| 134 | 141 | echo trim($event['start_time_orig']), '</time> – <time datetime="' . $event['end_iso_gmdate'] . '">'; |
| 135 | 142 | |
| 136 | - if ($event['start_date_orig'] != $event['end_date_orig']) |
|
| 137 | - echo trim($event['end_date_orig']) . ', '; |
|
| 143 | + if ($event['start_date_orig'] != $event['end_date_orig']) { |
|
| 144 | + echo trim($event['end_date_orig']) . ', '; |
|
| 145 | + } |
|
| 138 | 146 | |
| 139 | 147 | echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)'; |
| 140 | 148 | } |
| 141 | 149 | // Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion |
| 142 | - else |
|
| 143 | - echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 150 | + else { |
|
| 151 | + echo ' ', $event['tz_abbrev'], '</time>'; |
|
| 152 | + } |
|
| 144 | 153 | } |
| 145 | 154 | |
| 146 | - if (!empty($event['location'])) |
|
| 147 | - echo '<br>', $event['location']; |
|
| 155 | + if (!empty($event['location'])) { |
|
| 156 | + echo '<br>', $event['location']; |
|
| 157 | + } |
|
| 148 | 158 | |
| 149 | 159 | echo ' |
| 150 | 160 | </li>'; |
@@ -176,8 +186,9 @@ discard block |
||
| 176 | 186 | |
| 177 | 187 | $birthdays = array(); |
| 178 | 188 | |
| 179 | - foreach ($date as $member) |
|
| 180 | - $birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>'; |
|
| 189 | + foreach ($date as $member) { |
|
| 190 | + $birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>'; |
|
| 191 | + } |
|
| 181 | 192 | |
| 182 | 193 | echo implode(', ', $birthdays); |
| 183 | 194 | |
@@ -208,8 +219,9 @@ discard block |
||
| 208 | 219 | $date_local = $date['date_local']; |
| 209 | 220 | unset($date['date_local']); |
| 210 | 221 | |
| 211 | - foreach ($date as $holiday) |
|
| 212 | - $holidays[] = $holiday . ' (' . $date_local . ')'; |
|
| 222 | + foreach ($date as $holiday) { |
|
| 223 | + $holidays[] = $holiday . ' (' . $date_local . ')'; |
|
| 224 | + } |
|
| 213 | 225 | } |
| 214 | 226 | |
| 215 | 227 | echo implode(', ', $holidays); |
@@ -233,17 +245,19 @@ discard block |
||
| 233 | 245 | global $context, $txt, $scripturl, $modSettings; |
| 234 | 246 | |
| 235 | 247 | // If the grid doesn't exist, no point in proceeding. |
| 236 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 237 | - return false; |
|
| 248 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 249 | + return false; |
|
| 250 | + } |
|
| 238 | 251 | |
| 239 | 252 | // A handy little pointer variable. |
| 240 | 253 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
| 241 | 254 | |
| 242 | 255 | // Some conditions for whether or not we should show the week links *here*. |
| 243 | - if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) |
|
| 244 | - $show_week_links = true; |
|
| 245 | - else |
|
| 246 | - $show_week_links = false; |
|
| 256 | + if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) { |
|
| 257 | + $show_week_links = true; |
|
| 258 | + } else { |
|
| 259 | + $show_week_links = false; |
|
| 260 | + } |
|
| 247 | 261 | |
| 248 | 262 | // Assuming that we've not disabled it, show the title block! |
| 249 | 263 | if (empty($calendar_data['disable_title'])) |
@@ -253,18 +267,20 @@ discard block |
||
| 253 | 267 | <h3 class="catbg centertext largetext">'; |
| 254 | 268 | |
| 255 | 269 | // Previous Link: If we're showing prev / next and it's not a mini-calendar. |
| 256 | - if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) |
|
| 257 | - echo ' |
|
| 270 | + if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) { |
|
| 271 | + echo ' |
|
| 258 | 272 | <span class="floatleft"> |
| 259 | 273 | <a href="', $calendar_data['previous_calendar']['href'], '">«</a> |
| 260 | 274 | </span>'; |
| 275 | + } |
|
| 261 | 276 | |
| 262 | 277 | // Next Link: if we're showing prev / next and it's not a mini-calendar. |
| 263 | - if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) |
|
| 264 | - echo ' |
|
| 278 | + if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) { |
|
| 279 | + echo ' |
|
| 265 | 280 | <span class="floatright"> |
| 266 | 281 | <a href="', $calendar_data['next_calendar']['href'], '">»</a> |
| 267 | 282 | </span>'; |
| 283 | + } |
|
| 268 | 284 | |
| 269 | 285 | // Arguably the most exciting part, the title! |
| 270 | 286 | echo ' |
@@ -274,8 +290,9 @@ discard block |
||
| 274 | 290 | } |
| 275 | 291 | |
| 276 | 292 | // Show the controls on main grids |
| 277 | - if ($is_mini === false) |
|
| 278 | - template_calendar_top($calendar_data); |
|
| 293 | + if ($is_mini === false) { |
|
| 294 | + template_calendar_top($calendar_data); |
|
| 295 | + } |
|
| 279 | 296 | |
| 280 | 297 | // Finally, the main calendar table. |
| 281 | 298 | echo ' |
@@ -288,14 +305,16 @@ discard block |
||
| 288 | 305 | <tr>'; |
| 289 | 306 | |
| 290 | 307 | // If we're showing week links, there's an extra column ahead of the week links, so let's think ahead and be prepared! |
| 291 | - if ($show_week_links === true) |
|
| 292 | - echo ' |
|
| 308 | + if ($show_week_links === true) { |
|
| 309 | + echo ' |
|
| 293 | 310 | <th></th>'; |
| 311 | + } |
|
| 294 | 312 | |
| 295 | 313 | // Now, loop through each actual day of the week. |
| 296 | - foreach ($calendar_data['week_days'] as $day) |
|
| 297 | - echo ' |
|
| 314 | + foreach ($calendar_data['week_days'] as $day) { |
|
| 315 | + echo ' |
|
| 298 | 316 | <th class="days" scope="col">', !empty($calendar_data['short_day_titles']) || $is_mini === true ? $txt['days_short'][$day] : $txt['days'][$day], '</th>'; |
| 317 | + } |
|
| 299 | 318 | |
| 300 | 319 | echo ' |
| 301 | 320 | </tr>'; |
@@ -313,11 +332,12 @@ discard block |
||
| 313 | 332 | <tr class="days_wrapper">'; |
| 314 | 333 | |
| 315 | 334 | // This is where we add the actual week link, if enabled on this location. |
| 316 | - if ($show_week_links === true) |
|
| 317 | - echo ' |
|
| 335 | + if ($show_week_links === true) { |
|
| 336 | + echo ' |
|
| 318 | 337 | <td class="windowbg weeks"> |
| 319 | 338 | <a href="', $scripturl, '?action=calendar;viewweek;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $week['days'][0]['day'], '" title="', $txt['calendar_view_week'], '">»</a> |
| 320 | 339 | </td>'; |
| 340 | + } |
|
| 321 | 341 | |
| 322 | 342 | // Now loop through each day in the week we're on. |
| 323 | 343 | foreach ($week['days'] as $day) |
@@ -333,27 +353,29 @@ discard block |
||
| 333 | 353 | // Additional classes are given for events, holidays, and birthdays. |
| 334 | 354 | if (!empty($day['events']) && !empty($calendar_data['highlight']['events'])) |
| 335 | 355 | { |
| 336 | - if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) |
|
| 337 | - $classes[] = 'events'; |
|
| 338 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) |
|
| 339 | - $classes[] = 'events'; |
|
| 356 | + if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) { |
|
| 357 | + $classes[] = 'events'; |
|
| 358 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) { |
|
| 359 | + $classes[] = 'events'; |
|
| 360 | + } |
|
| 340 | 361 | } |
| 341 | 362 | if (!empty($day['holidays']) && !empty($calendar_data['highlight']['holidays'])) |
| 342 | 363 | { |
| 343 | - if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) |
|
| 344 | - $classes[] = 'holidays'; |
|
| 345 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) |
|
| 346 | - $classes[] = 'holidays'; |
|
| 364 | + if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) { |
|
| 365 | + $classes[] = 'holidays'; |
|
| 366 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) { |
|
| 367 | + $classes[] = 'holidays'; |
|
| 368 | + } |
|
| 347 | 369 | } |
| 348 | 370 | if (!empty($day['birthdays']) && !empty($calendar_data['highlight']['birthdays'])) |
| 349 | 371 | { |
| 350 | - if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) |
|
| 351 | - $classes[] = 'birthdays'; |
|
| 352 | - elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) |
|
| 353 | - $classes[] = 'birthdays'; |
|
| 372 | + if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) { |
|
| 373 | + $classes[] = 'birthdays'; |
|
| 374 | + } elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) { |
|
| 375 | + $classes[] = 'birthdays'; |
|
| 376 | + } |
|
| 354 | 377 | } |
| 355 | - } |
|
| 356 | - else |
|
| 378 | + } else |
|
| 357 | 379 | { |
| 358 | 380 | // Default Classes (either compact or comfortable and disabled). |
| 359 | 381 | $classes[] = !empty($calendar_data['size']) && $calendar_data['size'] == 'small' ? 'compact' : 'comfortable'; |
@@ -371,25 +393,27 @@ discard block |
||
| 371 | 393 | $title_prefix = !empty($day['is_first_of_month']) && $context['current_month'] == $calendar_data['current_month'] && $is_mini === false ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$calendar_data['current_month']] . ' ' : $txt['months_titles'][$calendar_data['current_month']] . ' ') : ''; |
| 372 | 394 | |
| 373 | 395 | // The actual day number - be it a link, or just plain old text! |
| 374 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
| 375 | - echo ' |
|
| 396 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
| 397 | + echo ' |
|
| 376 | 398 | <a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
| 377 | - elseif ($is_mini) |
|
| 378 | - echo ' |
|
| 399 | + } elseif ($is_mini) { |
|
| 400 | + echo ' |
|
| 379 | 401 | <a href="', $scripturl, '?action=calendar;', $context['calendar_view'], ';year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>'; |
| 380 | - else |
|
| 381 | - echo ' |
|
| 402 | + } else { |
|
| 403 | + echo ' |
|
| 382 | 404 | <span class="day_text">', $title_prefix, $day['day'], '</span>'; |
| 405 | + } |
|
| 383 | 406 | |
| 384 | 407 | // A lot of stuff, we're not showing on mini-calendars to conserve space. |
| 385 | 408 | if ($is_mini === false) |
| 386 | 409 | { |
| 387 | 410 | // Holidays are always fun, let's show them! |
| 388 | - if (!empty($day['holidays'])) |
|
| 389 | - echo ' |
|
| 411 | + if (!empty($day['holidays'])) { |
|
| 412 | + echo ' |
|
| 390 | 413 | <div class="smalltext holiday"> |
| 391 | 414 | <span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), ' |
| 392 | 415 | </div>'; |
| 416 | + } |
|
| 393 | 417 | |
| 394 | 418 | // Happy Birthday Dear Member! |
| 395 | 419 | if (!empty($day['birthdays'])) |
@@ -407,15 +431,17 @@ discard block |
||
| 407 | 431 | echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '"><span class="fix_rtl_names">', $member['name'], '</span>', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', '; |
| 408 | 432 | |
| 409 | 433 | // 9...10! Let's stop there. |
| 410 | - if ($birthday_count == 10 && $use_js_hide) |
|
| 411 | - // !!TODO - Inline CSS and JavaScript should be moved. |
|
| 434 | + if ($birthday_count == 10 && $use_js_hide) { |
|
| 435 | + // !!TODO - Inline CSS and JavaScript should be moved. |
|
| 412 | 436 | echo '<span class="hidelink" id="bdhidelink_', $day['day'], '">...<br><a href="', $scripturl, '?action=calendar;month=', $calendar_data['current_month'], ';year=', $calendar_data['current_year'], ';showbd" onclick="document.getElementById(\'bdhide_', $day['day'], '\').style.display = \'\'; document.getElementById(\'bdhidelink_', $day['day'], '\').style.display = \'none\'; return false;">(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ')</a></span><span id="bdhide_', $day['day'], '" style="display: none;">, '; |
| 437 | + } |
|
| 413 | 438 | |
| 414 | 439 | ++$birthday_count; |
| 415 | 440 | } |
| 416 | - if ($use_js_hide) |
|
| 417 | - echo ' |
|
| 441 | + if ($use_js_hide) { |
|
| 442 | + echo ' |
|
| 418 | 443 | </span>'; |
| 444 | + } |
|
| 419 | 445 | |
| 420 | 446 | echo ' |
| 421 | 447 | </div><!-- .smalltext -->'; |
@@ -426,8 +452,9 @@ discard block |
||
| 426 | 452 | { |
| 427 | 453 | // Sort events by start time (all day events will be listed first) |
| 428 | 454 | uasort($day['events'], function($a, $b) { |
| 429 | - if ($a['start_timestamp'] == $b['start_timestamp']) |
|
| 430 | - return 0; |
|
| 455 | + if ($a['start_timestamp'] == $b['start_timestamp']) { |
|
| 456 | + return 0; |
|
| 457 | + } |
|
| 431 | 458 | |
| 432 | 459 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
| 433 | 460 | }); |
@@ -447,20 +474,22 @@ discard block |
||
| 447 | 474 | ', $event['link'], '<br> |
| 448 | 475 | <span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">'; |
| 449 | 476 | |
| 450 | - if (!empty($event['start_time_local']) && $event['starts_today'] == true) |
|
| 451 | - echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); |
|
| 452 | - elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) |
|
| 453 | - echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); |
|
| 454 | - elseif (!empty($event['allday'])) |
|
| 455 | - echo $txt['calendar_allday']; |
|
| 477 | + if (!empty($event['start_time_local']) && $event['starts_today'] == true) { |
|
| 478 | + echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); |
|
| 479 | + } elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) { |
|
| 480 | + echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); |
|
| 481 | + } elseif (!empty($event['allday'])) { |
|
| 482 | + echo $txt['calendar_allday']; |
|
| 483 | + } |
|
| 456 | 484 | |
| 457 | 485 | echo ' |
| 458 | 486 | </span>'; |
| 459 | 487 | |
| 460 | - if (!empty($event['location'])) |
|
| 461 | - echo ' |
|
| 488 | + if (!empty($event['location'])) { |
|
| 489 | + echo ' |
|
| 462 | 490 | <br> |
| 463 | 491 | <span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>'; |
| 492 | + } |
|
| 464 | 493 | |
| 465 | 494 | if ($event['can_edit'] || $event['can_export']) |
| 466 | 495 | { |
@@ -468,18 +497,20 @@ discard block |
||
| 468 | 497 | <span class="modify_event_links">'; |
| 469 | 498 | |
| 470 | 499 | // If they can edit the event, show an icon they can click on.... |
| 471 | - if ($event['can_edit']) |
|
| 472 | - echo ' |
|
| 500 | + if ($event['can_edit']) { |
|
| 501 | + echo ' |
|
| 473 | 502 | <a class="modify_event" href="', $event['modify_href'], '"> |
| 474 | 503 | <span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span> |
| 475 | 504 | </a>'; |
| 505 | + } |
|
| 476 | 506 | |
| 477 | 507 | // Exporting! |
| 478 | - if ($event['can_export']) |
|
| 479 | - echo ' |
|
| 508 | + if ($event['can_export']) { |
|
| 509 | + echo ' |
|
| 480 | 510 | <a class="modify_event" href="', $event['export_href'], '"> |
| 481 | 511 | <span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span> |
| 482 | 512 | </a>'; |
| 513 | + } |
|
| 483 | 514 | |
| 484 | 515 | echo ' |
| 485 | 516 | </span><br class="clear">'; |
@@ -498,10 +529,11 @@ discard block |
||
| 498 | 529 | // Otherwise, assuming it's not a mini-calendar, we can show previous / next month days! |
| 499 | 530 | elseif ($is_mini === false) |
| 500 | 531 | { |
| 501 | - if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) |
|
| 502 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>'; |
|
| 503 | - elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) |
|
| 504 | - echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
| 532 | + if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) { |
|
| 533 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>'; |
|
| 534 | + } elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) { |
|
| 535 | + echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>'; |
|
| 536 | + } |
|
| 505 | 537 | } |
| 506 | 538 | |
| 507 | 539 | // Close this day and increase var count. |
@@ -531,8 +563,9 @@ discard block |
||
| 531 | 563 | global $context, $txt, $scripturl, $modSettings; |
| 532 | 564 | |
| 533 | 565 | // We might have no reason to proceed, if the variable isn't there. |
| 534 | - if (!isset($context['calendar_grid_' . $grid_name])) |
|
| 535 | - return false; |
|
| 566 | + if (!isset($context['calendar_grid_' . $grid_name])) { |
|
| 567 | + return false; |
|
| 568 | + } |
|
| 536 | 569 | |
| 537 | 570 | // Handy pointer. |
| 538 | 571 | $calendar_data = &$context['calendar_grid_' . $grid_name]; |
@@ -549,22 +582,25 @@ discard block |
||
| 549 | 582 | <h3 class="catbg centertext largetext">'; |
| 550 | 583 | |
| 551 | 584 | // Previous Week Link... |
| 552 | - if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) |
|
| 553 | - echo ' |
|
| 585 | + if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) { |
|
| 586 | + echo ' |
|
| 554 | 587 | <span class="floatleft"> |
| 555 | 588 | <a href="', $calendar_data['previous_week']['href'], '">«</a> |
| 556 | 589 | </span>'; |
| 590 | + } |
|
| 557 | 591 | |
| 558 | 592 | // Next Week Link... |
| 559 | - if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) |
|
| 560 | - echo ' |
|
| 593 | + if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) { |
|
| 594 | + echo ' |
|
| 561 | 595 | <span class="floatright"> |
| 562 | 596 | <a href="', $calendar_data['next_week']['href'], '">»</a> |
| 563 | 597 | </span>'; |
| 598 | + } |
|
| 564 | 599 | |
| 565 | 600 | // The Month Title + Week Number... |
| 566 | - if (!empty($calendar_data['week_title'])) |
|
| 567 | - echo $calendar_data['week_title']; |
|
| 601 | + if (!empty($calendar_data['week_title'])) { |
|
| 602 | + echo $calendar_data['week_title']; |
|
| 603 | + } |
|
| 568 | 604 | |
| 569 | 605 | echo ' |
| 570 | 606 | </h3> |
@@ -605,11 +641,12 @@ discard block |
||
| 605 | 641 | <td class="', implode(' ', $classes), ' act_day">'; |
| 606 | 642 | |
| 607 | 643 | // Should the day number be a link? |
| 608 | - if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) |
|
| 609 | - echo ' |
|
| 644 | + if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) { |
|
| 645 | + echo ' |
|
| 610 | 646 | <a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>'; |
| 611 | - else |
|
| 612 | - echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
| 647 | + } else { |
|
| 648 | + echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; |
|
| 649 | + } |
|
| 613 | 650 | |
| 614 | 651 | echo ' |
| 615 | 652 | </td> |
@@ -620,8 +657,9 @@ discard block |
||
| 620 | 657 | { |
| 621 | 658 | // Sort events by start time (all day events will be listed first) |
| 622 | 659 | uasort($day['events'], function($a, $b) { |
| 623 | - if ($a['start_timestamp'] == $b['start_timestamp']) |
|
| 624 | - return 0; |
|
| 660 | + if ($a['start_timestamp'] == $b['start_timestamp']) { |
|
| 661 | + return 0; |
|
| 662 | + } |
|
| 625 | 663 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
| 626 | 664 | }); |
| 627 | 665 | |
@@ -635,35 +673,39 @@ discard block |
||
| 635 | 673 | echo $event['link'], '<br> |
| 636 | 674 | <span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">'; |
| 637 | 675 | |
| 638 | - if (!empty($event['start_time_local'])) |
|
| 639 | - echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; |
|
| 640 | - else |
|
| 641 | - echo $txt['calendar_allday']; |
|
| 676 | + if (!empty($event['start_time_local'])) { |
|
| 677 | + echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; |
|
| 678 | + } else { |
|
| 679 | + echo $txt['calendar_allday']; |
|
| 680 | + } |
|
| 642 | 681 | |
| 643 | 682 | echo ' |
| 644 | 683 | </span>'; |
| 645 | 684 | |
| 646 | - if (!empty($event['location'])) |
|
| 647 | - echo '<br> |
|
| 685 | + if (!empty($event['location'])) { |
|
| 686 | + echo '<br> |
|
| 648 | 687 | <span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>'; |
| 688 | + } |
|
| 649 | 689 | |
| 650 | 690 | if (!empty($event_icons_needed)) |
| 651 | 691 | { |
| 652 | 692 | echo ' <span class="modify_event_links">'; |
| 653 | 693 | |
| 654 | 694 | // If they can edit the event, show a star they can click on.... |
| 655 | - if (!empty($event['can_edit'])) |
|
| 656 | - echo ' |
|
| 695 | + if (!empty($event['can_edit'])) { |
|
| 696 | + echo ' |
|
| 657 | 697 | <a class="modify_event" href="', $event['modify_href'], '"> |
| 658 | 698 | <span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span> |
| 659 | 699 | </a>'; |
| 700 | + } |
|
| 660 | 701 | |
| 661 | 702 | // Can we export? Sweet. |
| 662 | - if (!empty($event['can_export'])) |
|
| 663 | - echo ' |
|
| 703 | + if (!empty($event['can_export'])) { |
|
| 704 | + echo ' |
|
| 664 | 705 | <a class="modify_event" href="', $event['export_href'], '"> |
| 665 | 706 | <span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span> |
| 666 | 707 | </a>'; |
| 708 | + } |
|
| 667 | 709 | |
| 668 | 710 | echo ' |
| 669 | 711 | </span><br class="clear">'; |
@@ -681,22 +723,23 @@ discard block |
||
| 681 | 723 | </div> |
| 682 | 724 | <br class="clear">'; |
| 683 | 725 | } |
| 684 | - } |
|
| 685 | - else |
|
| 726 | + } else |
|
| 686 | 727 | { |
| 687 | - if (!empty($context['can_post'])) |
|
| 688 | - echo ' |
|
| 728 | + if (!empty($context['can_post'])) { |
|
| 729 | + echo ' |
|
| 689 | 730 | <div class="week_add_event"> |
| 690 | 731 | <a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['calendar_post_event'], '</a> |
| 691 | 732 | </div>'; |
| 733 | + } |
|
| 692 | 734 | } |
| 693 | 735 | echo ' |
| 694 | 736 | </td> |
| 695 | 737 | <td class="', implode(' ', $classes), !empty($day['holidays']) ? ' holidays' : ' disabled', ' holiday_col" data-css-prefix="' . $txt['calendar_prompt'] . ' ">'; |
| 696 | 738 | |
| 697 | 739 | // Show any holidays! |
| 698 | - if (!empty($day['holidays'])) |
|
| 699 | - echo implode('<br>', $day['holidays']); |
|
| 740 | + if (!empty($day['holidays'])) { |
|
| 741 | + echo implode('<br>', $day['holidays']); |
|
| 742 | + } |
|
| 700 | 743 | |
| 701 | 744 | echo ' |
| 702 | 745 | </td> |
@@ -705,11 +748,12 @@ discard block |
||
| 705 | 748 | // Show any birthdays... |
| 706 | 749 | if (!empty($day['birthdays'])) |
| 707 | 750 | { |
| 708 | - foreach ($day['birthdays'] as $member) |
|
| 709 | - echo ' |
|
| 751 | + foreach ($day['birthdays'] as $member) { |
|
| 752 | + echo ' |
|
| 710 | 753 | <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], '</a> |
| 711 | 754 | ', isset($member['age']) ? ' (' . $member['age'] . ')' : '', ' |
| 712 | 755 | ', $member['is_last'] ? '' : '<br>'; |
| 756 | + } |
|
| 713 | 757 | } |
| 714 | 758 | echo ' |
| 715 | 759 | </td> |
@@ -755,26 +799,27 @@ discard block |
||
| 755 | 799 | <input type="text" name="end_date" id="end_date" maxlength="10" value="', $calendar_data['end_date'], '" tabindex="', $context['tabindex']++, '" class="date_input end" data-type="date"> |
| 756 | 800 | <input type="submit" class="button" style="float:none" id="view_button" value="', $txt['view'], '"> |
| 757 | 801 | </form>'; |
| 758 | - } |
|
| 759 | - else |
|
| 802 | + } else |
|
| 760 | 803 | { |
| 761 | 804 | echo' |
| 762 | 805 | <form action="', $scripturl, '?action=calendar" id="calendar_navigation" method="post" accept-charset="', $context['character_set'], '"> |
| 763 | 806 | <select name="month" id="input_month">'; |
| 764 | 807 | |
| 765 | 808 | // Show a select box with all the months. |
| 766 | - foreach ($txt['months_short'] as $number => $month) |
|
| 767 | - echo ' |
|
| 809 | + foreach ($txt['months_short'] as $number => $month) { |
|
| 810 | + echo ' |
|
| 768 | 811 | <option value="', $number, '"', $number == $context['current_month'] ? ' selected' : '', '>', $month, '</option>'; |
| 812 | + } |
|
| 769 | 813 | |
| 770 | 814 | echo ' |
| 771 | 815 | </select> |
| 772 | 816 | <select name="year">'; |
| 773 | 817 | |
| 774 | 818 | // Show a link for every year... |
| 775 | - for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) |
|
| 776 | - echo ' |
|
| 819 | + for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) { |
|
| 820 | + echo ' |
|
| 777 | 821 | <option value="', $year, '"', $year == $context['current_year'] ? ' selected' : '', '>', $year, '</option>'; |
| 822 | + } |
|
| 778 | 823 | |
| 779 | 824 | echo ' |
| 780 | 825 | </select> |
@@ -796,9 +841,10 @@ discard block |
||
| 796 | 841 | echo ' |
| 797 | 842 | <form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">'; |
| 798 | 843 | |
| 799 | - if (!empty($context['event']['new'])) |
|
| 800 | - echo ' |
|
| 844 | + if (!empty($context['event']['new'])) { |
|
| 845 | + echo ' |
|
| 801 | 846 | <input type="hidden" name="eventid" value="', $context['event']['eventid'], '">'; |
| 847 | + } |
|
| 802 | 848 | |
| 803 | 849 | // Start the main table. |
| 804 | 850 | echo ' |
@@ -809,8 +855,8 @@ discard block |
||
| 809 | 855 | </h3> |
| 810 | 856 | </div>'; |
| 811 | 857 | |
| 812 | - if (!empty($context['post_error']['messages'])) |
|
| 813 | - echo ' |
|
| 858 | + if (!empty($context['post_error']['messages'])) { |
|
| 859 | + echo ' |
|
| 814 | 860 | <div class="errorbox"> |
| 815 | 861 | <dl class="event_error"> |
| 816 | 862 | <dt> |
@@ -821,6 +867,7 @@ discard block |
||
| 821 | 867 | </dt> |
| 822 | 868 | </dl> |
| 823 | 869 | </div>'; |
| 870 | + } |
|
| 824 | 871 | |
| 825 | 872 | echo ' |
| 826 | 873 | <div class="roundframe noup"> |
@@ -848,9 +895,10 @@ discard block |
||
| 848 | 895 | echo ' |
| 849 | 896 | <optgroup label="', $category['name'], '">'; |
| 850 | 897 | |
| 851 | - foreach ($category['boards'] as $board) |
|
| 852 | - echo ' |
|
| 898 | + foreach ($category['boards'] as $board) { |
|
| 899 | + echo ' |
|
| 853 | 900 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 901 | + } |
|
| 854 | 902 | echo ' |
| 855 | 903 | </optgroup>'; |
| 856 | 904 | } |
@@ -886,9 +934,10 @@ discard block |
||
| 886 | 934 | <span class="label">', $txt['calendar_timezone'], '</span> |
| 887 | 935 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
| 888 | 936 | |
| 889 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
| 890 | - echo ' |
|
| 937 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
| 938 | + echo ' |
|
| 891 | 939 | <option', is_numeric($tz) ? ' value="" disabled' : ' value="' . $tz . '"', $tz === $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
| 940 | + } |
|
| 892 | 941 | |
| 893 | 942 | echo ' |
| 894 | 943 | </select> |
@@ -904,9 +953,10 @@ discard block |
||
| 904 | 953 | <input type="submit" value="', empty($context['event']['new']) ? $txt['save'] : $txt['post'], '" class="button">'; |
| 905 | 954 | |
| 906 | 955 | // Delete button? |
| 907 | - if (empty($context['event']['new'])) |
|
| 908 | - echo ' |
|
| 956 | + if (empty($context['event']['new'])) { |
|
| 957 | + echo ' |
|
| 909 | 958 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['calendar_confirm_delete'], '" class="button you_sure">'; |
| 959 | + } |
|
| 910 | 960 | |
| 911 | 961 | echo ' |
| 912 | 962 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -934,9 +984,10 @@ discard block |
||
| 934 | 984 | echo ' |
| 935 | 985 | <td style="padding-', $alt ? 'right' : 'left', ': 1.5em;">'; |
| 936 | 986 | |
| 937 | - foreach ($v as $i) |
|
| 938 | - echo ' |
|
| 987 | + foreach ($v as $i) { |
|
| 988 | + echo ' |
|
| 939 | 989 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '"><br>'; |
| 990 | + } |
|
| 940 | 991 | |
| 941 | 992 | echo ' |
| 942 | 993 | </td>'; |
@@ -957,9 +1008,10 @@ discard block |
||
| 957 | 1008 | |
| 958 | 1009 | foreach ($context['clockicons'] as $t => $v) |
| 959 | 1010 | { |
| 960 | - foreach ($v as $i) |
|
| 961 | - echo ' |
|
| 1011 | + foreach ($v as $i) { |
|
| 1012 | + echo ' |
|
| 962 | 1013 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1014 | + } |
|
| 963 | 1015 | } |
| 964 | 1016 | |
| 965 | 1017 | echo ' |
@@ -984,13 +1036,14 @@ discard block |
||
| 984 | 1036 | |
| 985 | 1037 | foreach ($context['clockicons'] as $t => $v) |
| 986 | 1038 | { |
| 987 | - foreach ($v as $i) |
|
| 988 | - echo ' |
|
| 1039 | + foreach ($v as $i) { |
|
| 1040 | + echo ' |
|
| 989 | 1041 | if (', $t, ' >= ', $i, ') |
| 990 | 1042 | { |
| 991 | 1043 | turnon.push("', $t, '_', $i, '"); |
| 992 | 1044 | ', $t, ' -= ', $i, '; |
| 993 | 1045 | }'; |
| 1046 | + } |
|
| 994 | 1047 | } |
| 995 | 1048 | |
| 996 | 1049 | echo ' |
@@ -1034,9 +1087,10 @@ discard block |
||
| 1034 | 1087 | <tr class="windowbg"> |
| 1035 | 1088 | <td>'; |
| 1036 | 1089 | |
| 1037 | - foreach ($v as $i) |
|
| 1038 | - echo ' |
|
| 1090 | + foreach ($v as $i) { |
|
| 1091 | + echo ' |
|
| 1039 | 1092 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">'; |
| 1093 | + } |
|
| 1040 | 1094 | |
| 1041 | 1095 | echo ' |
| 1042 | 1096 | </td> |
@@ -1058,9 +1112,10 @@ discard block |
||
| 1058 | 1112 | |
| 1059 | 1113 | foreach ($context['clockicons'] as $t => $v) |
| 1060 | 1114 | { |
| 1061 | - foreach ($v as $i) |
|
| 1062 | - echo ' |
|
| 1115 | + foreach ($v as $i) { |
|
| 1116 | + echo ' |
|
| 1063 | 1117 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1118 | + } |
|
| 1064 | 1119 | } |
| 1065 | 1120 | |
| 1066 | 1121 | echo ' |
@@ -1077,13 +1132,14 @@ discard block |
||
| 1077 | 1132 | |
| 1078 | 1133 | foreach ($context['clockicons'] as $t => $v) |
| 1079 | 1134 | { |
| 1080 | - foreach ($v as $i) |
|
| 1081 | - echo ' |
|
| 1135 | + foreach ($v as $i) { |
|
| 1136 | + echo ' |
|
| 1082 | 1137 | if (', $t, ' >= ', $i, ') |
| 1083 | 1138 | { |
| 1084 | 1139 | turnon.push("', $t, '_', $i, '"); |
| 1085 | 1140 | ', $t, ' -= ', $i, '; |
| 1086 | 1141 | }'; |
| 1142 | + } |
|
| 1087 | 1143 | } |
| 1088 | 1144 | |
| 1089 | 1145 | echo ' |
@@ -1127,9 +1183,10 @@ discard block |
||
| 1127 | 1183 | <tr class="windowbg"> |
| 1128 | 1184 | <td>'; |
| 1129 | 1185 | |
| 1130 | - foreach ($v as $i) |
|
| 1131 | - echo ' |
|
| 1186 | + foreach ($v as $i) { |
|
| 1187 | + echo ' |
|
| 1132 | 1188 | <img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">'; |
| 1189 | + } |
|
| 1133 | 1190 | |
| 1134 | 1191 | echo ' |
| 1135 | 1192 | </td> |
@@ -1145,9 +1202,10 @@ discard block |
||
| 1145 | 1202 | |
| 1146 | 1203 | foreach ($context['clockicons'] as $t => $v) |
| 1147 | 1204 | { |
| 1148 | - foreach ($v as $i) |
|
| 1149 | - echo ' |
|
| 1205 | + foreach ($v as $i) { |
|
| 1206 | + echo ' |
|
| 1150 | 1207 | icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');'; |
| 1208 | + } |
|
| 1151 | 1209 | } |
| 1152 | 1210 | |
| 1153 | 1211 | echo ' |
@@ -1168,13 +1226,14 @@ discard block |
||
| 1168 | 1226 | |
| 1169 | 1227 | foreach ($context['clockicons'] as $t => $v) |
| 1170 | 1228 | { |
| 1171 | - foreach ($v as $i) |
|
| 1172 | - echo ' |
|
| 1229 | + foreach ($v as $i) { |
|
| 1230 | + echo ' |
|
| 1173 | 1231 | if (', $t, ' >= ', $i, ') |
| 1174 | 1232 | { |
| 1175 | 1233 | turnon.push("', $t, '_', $i, '"); |
| 1176 | 1234 | ', $t, ' -= ', $i, '; |
| 1177 | 1235 | }'; |
| 1236 | + } |
|
| 1178 | 1237 | } |
| 1179 | 1238 | |
| 1180 | 1239 | echo ' |
@@ -1218,9 +1277,10 @@ discard block |
||
| 1218 | 1277 | <tr class="windowbg"> |
| 1219 | 1278 | <td>'; |
| 1220 | 1279 | |
| 1221 | - foreach ($v as $i) |
|
| 1222 | - echo ' |
|
| 1280 | + foreach ($v as $i) { |
|
| 1281 | + echo ' |
|
| 1223 | 1282 | <img src="', $i ? $context['onimg'] : $context['offimg'], '" alt="" style="padding: 2px;">'; |
| 1283 | + } |
|
| 1224 | 1284 | |
| 1225 | 1285 | echo ' |
| 1226 | 1286 | </td> |