更新完善网页逻辑,工具迁移至html逻辑
This commit is contained in:
1 parent
c3bfce7afb
commit
646754c04d
26 files changed
+1606
-167
No files matched your search
+3
-2
@@ -33,7 +33,8 @@ function renumber_sorts(PDO $pdo): void
|
||||
|
||||
function msg_block(string $kind, string $text): string
|
||||
{
|
||||
return '<div class="' . ($kind === 'ok' ? 'ok-msg' : 'err-msg') . '">' . he($text) . '</div>';
|
||||
// 改为右下角 Toast:注入 hpToastMsg,由 common.js 在页面加载后自动弹出
|
||||
return '<script>window.hpToastMsg = ' . json_encode(['kind' => $kind === 'ok' ? 'ok' : 'err', 'text' => $text], JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP) . ';</script>';
|
||||
}
|
||||
|
||||
$msgKind = '';
|
||||
@@ -236,7 +237,7 @@ admin_topbar('articles');
|
||||
<p class="tip">文章库(第五大板块)的文章维护:正文为标准 Markdown,图片统一上传到 data/articles/img 目录。</p>
|
||||
|
||||
<?php if ($savedFlag): ?>
|
||||
<div class="ok-msg">保存成功,文章库前台已同步更新。</div>
|
||||
<script>window.hpToastMsg = <?= json_encode(['kind' => 'ok', 'text' => '保存成功,文章库前台已同步更新。'], JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); ?>;</script>
|
||||
<?php endif; ?>
|
||||
<?php if ($msgText !== ''): echo msg_block($msgKind, $msgText); endif; ?>
|
||||
|
||||
|
||||
Reference in new issue
Block a user