@@ -34,11 +34,12 @@ discard block |
||
| 34 | 34 | </div>'; |
| 35 | 35 | |
| 36 | 36 | // If this is an existing set, and there are still un-added smileys - offer an import opportunity. |
| 37 | - if (!empty($context['current_set']['can_import'])) |
|
| 38 | - echo ' |
|
| 37 | + if (!empty($context['current_set']['can_import'])) { |
|
| 38 | + echo ' |
|
| 39 | 39 | <div class="information noup"> |
| 40 | 40 | ', $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']), ' |
| 41 | 41 | </div>'; |
| 42 | + } |
|
| 42 | 43 | |
| 43 | 44 | echo ' |
| 44 | 45 | <div class="windowbg noup"> |
@@ -54,20 +55,20 @@ discard block |
||
| 54 | 55 | </dt> |
| 55 | 56 | <dd> |
| 56 | 57 | ', $modSettings['smileys_url'], '/'; |
| 57 | - if ($context['current_set']['id'] == 'default') |
|
| 58 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
| 59 | - |
|
| 60 | - elseif (empty($context['smiley_set_dirs'])) |
|
| 61 | - echo ' |
|
| 58 | + if ($context['current_set']['id'] == 'default') { |
|
| 59 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
| 60 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
| 61 | + echo ' |
|
| 62 | 62 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> '; |
| 63 | - else |
|
| 63 | + } else |
|
| 64 | 64 | { |
| 65 | 65 | echo ' |
| 66 | 66 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
| 67 | 67 | |
| 68 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
| 69 | - echo ' |
|
| 68 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
| 69 | + echo ' |
|
| 70 | 70 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
| 71 | + } |
|
| 71 | 72 | echo ' |
| 72 | 73 | </select> '; |
| 73 | 74 | } |
@@ -82,14 +83,15 @@ discard block |
||
| 82 | 83 | </dd>'; |
| 83 | 84 | |
| 84 | 85 | // If this is a new smiley set they have the option to import smileys already in the directory. |
| 85 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
| 86 | - echo ' |
|
| 86 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
| 87 | + echo ' |
|
| 87 | 88 | <dt> |
| 88 | 89 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
| 89 | 90 | </dt> |
| 90 | 91 | <dd> |
| 91 | 92 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1"> |
| 92 | 93 | </dd>'; |
| 94 | + } |
|
| 93 | 95 | |
| 94 | 96 | echo ' |
| 95 | 97 | </dl> |
@@ -121,9 +123,10 @@ discard block |
||
| 121 | 123 | <dd> |
| 122 | 124 | <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();">'; |
| 123 | 125 | |
| 124 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 125 | - echo ' |
|
| 126 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 127 | + echo ' |
|
| 126 | 128 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
| 129 | + } |
|
| 127 | 130 | |
| 128 | 131 | echo ' |
| 129 | 132 | </select> |
@@ -139,17 +142,18 @@ discard block |
||
| 139 | 142 | </dt> |
| 140 | 143 | <dd>'; |
| 141 | 144 | |
| 142 | - if (empty($context['filenames'])) |
|
| 143 | - echo ' |
|
| 145 | + if (empty($context['filenames'])) { |
|
| 146 | + echo ' |
|
| 144 | 147 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">'; |
| 145 | - else |
|
| 148 | + } else |
|
| 146 | 149 | { |
| 147 | 150 | echo ' |
| 148 | 151 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
| 149 | 152 | |
| 150 | - foreach ($context['filenames'] as $filename) |
|
| 151 | - echo ' |
|
| 153 | + foreach ($context['filenames'] as $filename) { |
|
| 154 | + echo ' |
|
| 152 | 155 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
| 156 | + } |
|
| 153 | 157 | echo ' |
| 154 | 158 | </select>'; |
| 155 | 159 | } |
@@ -216,9 +220,10 @@ discard block |
||
| 216 | 220 | <dd> |
| 217 | 221 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
| 218 | 222 | |
| 219 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 220 | - echo ' |
|
| 223 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 224 | + echo ' |
|
| 221 | 225 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
| 226 | + } |
|
| 222 | 227 | |
| 223 | 228 | echo ' |
| 224 | 229 | </select> |
@@ -228,17 +233,18 @@ discard block |
||
| 228 | 233 | </dt> |
| 229 | 234 | <dd>'; |
| 230 | 235 | |
| 231 | - if (empty($context['filenames'])) |
|
| 232 | - echo ' |
|
| 236 | + if (empty($context['filenames'])) { |
|
| 237 | + echo ' |
|
| 233 | 238 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">'; |
| 234 | - else |
|
| 239 | + } else |
|
| 235 | 240 | { |
| 236 | 241 | echo ' |
| 237 | 242 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
| 238 | 243 | |
| 239 | - foreach ($context['filenames'] as $filename) |
|
| 240 | - echo ' |
|
| 244 | + foreach ($context['filenames'] as $filename) { |
|
| 245 | + echo ' |
|
| 241 | 246 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
| 247 | + } |
|
| 242 | 248 | echo ' |
| 243 | 249 | </select>'; |
| 244 | 250 | } |
@@ -267,14 +273,15 @@ discard block |
||
| 267 | 273 | |
| 268 | 274 | <dl id="uploadMore" style="display: none;" class="settings">'; |
| 269 | 275 | |
| 270 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
| 271 | - echo ' |
|
| 276 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
| 277 | + echo ' |
|
| 272 | 278 | <dt> |
| 273 | 279 | ', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ': |
| 274 | 280 | </dt> |
| 275 | 281 | <dd> |
| 276 | 282 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');"> |
| 277 | 283 | </dd>'; |
| 284 | + } |
|
| 278 | 285 | |
| 279 | 286 | echo ' |
| 280 | 287 | </dl> |
@@ -341,27 +348,30 @@ discard block |
||
| 341 | 348 | |
| 342 | 349 | foreach ($location['rows'] as $row) |
| 343 | 350 | { |
| 344 | - if (!empty($context['move_smiley'])) |
|
| 345 | - echo ' |
|
| 351 | + if (!empty($context['move_smiley'])) { |
|
| 352 | + echo ' |
|
| 346 | 353 | <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>'; |
| 354 | + } |
|
| 347 | 355 | |
| 348 | 356 | foreach ($row as $smiley) |
| 349 | 357 | { |
| 350 | - if (empty($context['move_smiley'])) |
|
| 351 | - echo ' |
|
| 358 | + if (empty($context['move_smiley'])) { |
|
| 359 | + echo ' |
|
| 352 | 360 | <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>'; |
| 353 | - else |
|
| 354 | - echo ' |
|
| 361 | + } else { |
|
| 362 | + echo ' |
|
| 355 | 363 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '" ', $smiley['selected'] ? 'class="selected_item"' : '', '> |
| 356 | 364 | <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>'; |
| 365 | + } |
|
| 357 | 366 | } |
| 358 | 367 | |
| 359 | 368 | echo ' |
| 360 | 369 | <br>'; |
| 361 | 370 | } |
| 362 | - if (!empty($context['move_smiley'])) |
|
| 363 | - echo ' |
|
| 371 | + if (!empty($context['move_smiley'])) { |
|
| 372 | + echo ' |
|
| 364 | 373 | <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>'; |
| 374 | + } |
|
| 365 | 375 | echo ' |
| 366 | 376 | </div><!-- .windowbg --> |
| 367 | 377 | <input type="hidden" name="reorder" value="1"> |
@@ -394,14 +404,15 @@ discard block |
||
| 394 | 404 | <div class="windowbg"> |
| 395 | 405 | <dl class="settings">'; |
| 396 | 406 | |
| 397 | - if (!$context['new_icon']) |
|
| 398 | - echo ' |
|
| 407 | + if (!$context['new_icon']) { |
|
| 408 | + echo ' |
|
| 399 | 409 | <dt> |
| 400 | 410 | <strong>', $txt['smiley_preview'], ': </strong> |
| 401 | 411 | </dt> |
| 402 | 412 | <dd> |
| 403 | 413 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
| 404 | 414 | </dd>'; |
| 415 | + } |
|
| 405 | 416 | |
| 406 | 417 | echo ' |
| 407 | 418 | <dt> |
@@ -428,9 +439,10 @@ discard block |
||
| 428 | 439 | echo ' |
| 429 | 440 | <optgroup label="', $category['name'], '">'; |
| 430 | 441 | |
| 431 | - foreach ($category['boards'] as $board) |
|
| 432 | - echo ' |
|
| 442 | + foreach ($category['boards'] as $board) { |
|
| 443 | + echo ' |
|
| 433 | 444 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
| 445 | + } |
|
| 434 | 446 | |
| 435 | 447 | echo ' |
| 436 | 448 | </optgroup>'; |
@@ -447,19 +459,21 @@ discard block |
||
| 447 | 459 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
| 448 | 460 | |
| 449 | 461 | // Print the list of all the icons it can be put after... |
| 450 | - foreach ($context['icons'] as $id => $data) |
|
| 451 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
| 462 | + foreach ($context['icons'] as $id => $data) { |
|
| 463 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
| 452 | 464 | echo ' |
| 453 | 465 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
| 466 | + } |
|
| 454 | 467 | |
| 455 | 468 | echo ' |
| 456 | 469 | </select> |
| 457 | 470 | </dd> |
| 458 | 471 | </dl>'; |
| 459 | 472 | |
| 460 | - if (!$context['new_icon']) |
|
| 461 | - echo ' |
|
| 473 | + if (!$context['new_icon']) { |
|
| 474 | + echo ' |
|
| 462 | 475 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
| 476 | + } |
|
| 463 | 477 | |
| 464 | 478 | echo ' |
| 465 | 479 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button"> |