Admin: move welcome message editor to dedicated sidebar menu section
This commit is contained in:
parent
0e357c0e42
commit
9207c739fc
11
admin.php
11
admin.php
|
|
@ -139,7 +139,7 @@ $commenters = commentersAll();
|
||||||
$latestComments = commentsLatest(80);
|
$latestComments = commentsLatest(80);
|
||||||
$welcomeText = settingGet('welcome_text', 'Добро пожаловать в галерею. Выберите раздел слева, чтобы посмотреть фотографии.');
|
$welcomeText = settingGet('welcome_text', 'Добро пожаловать в галерею. Выберите раздел слева, чтобы посмотреть фотографии.');
|
||||||
$adminMode = (string)($_GET['mode'] ?? 'media');
|
$adminMode = (string)($_GET['mode'] ?? 'media');
|
||||||
if (!in_array($adminMode, ['media', 'comments'], true)) {
|
if (!in_array($adminMode, ['media', 'comments', 'welcome'], true)) {
|
||||||
$adminMode = 'media';
|
$adminMode = 'media';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -273,6 +273,7 @@ function nextUniqueCodeName(string $base): string
|
||||||
<h3>Меню</h3>
|
<h3>Меню</h3>
|
||||||
<div class="sec">
|
<div class="sec">
|
||||||
<a class="<?= $adminMode==='media'?'active':'' ?>" href="?token=<?= urlencode($tokenIncoming) ?>&mode=media<?= $activeSectionId>0 ? '§ion_id='.(int)$activeSectionId : '' ?>">Разделы и фото</a>
|
<a class="<?= $adminMode==='media'?'active':'' ?>" href="?token=<?= urlencode($tokenIncoming) ?>&mode=media<?= $activeSectionId>0 ? '§ion_id='.(int)$activeSectionId : '' ?>">Разделы и фото</a>
|
||||||
|
<a class="<?= $adminMode==='welcome'?'active':'' ?>" href="?token=<?= urlencode($tokenIncoming) ?>&mode=welcome">Приветственное сообщение</a>
|
||||||
<a class="<?= $adminMode==='comments'?'active':'' ?>" href="?token=<?= urlencode($tokenIncoming) ?>&mode=comments">Комментаторы и комментарии</a>
|
<a class="<?= $adminMode==='comments'?'active':'' ?>" href="?token=<?= urlencode($tokenIncoming) ?>&mode=comments">Комментаторы и комментарии</a>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -310,16 +311,18 @@ function nextUniqueCodeName(string $base): string
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<?php if ($adminMode === 'media'): ?>
|
<?php if ($adminMode === 'welcome'): ?>
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<h3>Приветственное сообщение (публичная часть)</h3>
|
<h3>Приветственное сообщение (публичная часть)</h3>
|
||||||
<form method="post" action="?token=<?= urlencode($tokenIncoming) ?>&mode=media<?= $activeSectionId>0 ? '§ion_id='.(int)$activeSectionId : '' ?>">
|
<form method="post" action="?token=<?= urlencode($tokenIncoming) ?>&mode=welcome">
|
||||||
<input type="hidden" name="action" value="update_welcome"><input type="hidden" name="token" value="<?= h($tokenIncoming) ?>">
|
<input type="hidden" name="action" value="update_welcome"><input type="hidden" name="token" value="<?= h($tokenIncoming) ?>">
|
||||||
<p><textarea class="in" name="welcome_text" rows="3" placeholder="Текст приветствия"><?= h($welcomeText) ?></textarea></p>
|
<p><textarea class="in" name="welcome_text" rows="5" placeholder="Текст приветствия"><?= h($welcomeText) ?></textarea></p>
|
||||||
<button class="btn" type="submit">Сохранить приветствие</button>
|
<button class="btn" type="submit">Сохранить приветствие</button>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($adminMode === 'media'): ?>
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<h3>Загрузка фото “до” в выбранный раздел</h3>
|
<h3>Загрузка фото “до” в выбранный раздел</h3>
|
||||||
<?php if ($activeSectionId > 0): ?>
|
<?php if ($activeSectionId > 0): ?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user