diff --git a/admin/actions.php b/admin/actions.php index 535f3ac..5de9c9e 100644 --- a/admin/actions.php +++ b/admin/actions.php @@ -210,6 +210,20 @@ try { move_sort('groups', post_id(), (string)($_POST['dir'] ?? 'up'), null); break; } + case 'group_reorder': { + // 拖拽排序落库:板块没有分组维度(全表一套顺序),无需归属校验 —— + // apply_sort_order() 不带 $groupId 时按给定 id 顺序整组重写。 + // 表单字段 `order` = 逗号分隔的 group id(按新顺序)。 + $ids = []; + foreach (explode(',', (string)($_POST['order'] ?? '')) as $one) { + $one = (int)trim($one); + if ($one > 0) { $ids[] = $one; } + } + $n = apply_sort_order('groups', $ids); + $ajax = ['count' => $n]; + if (!$isAjax) { flash('已保存排序(' . $n . ' 项)'); } + break; + } /* ---------- 搜索引擎 ---------- */ case 'engine_save': { diff --git a/admin/index.php b/admin/index.php index cf13eb9..4493dee 100644 --- a/admin/index.php +++ b/admin/index.php @@ -191,7 +191,7 @@ if ($p === 'sites'): data-group-id="">
- + @@ -251,11 +251,18 @@ elseif ($p === 'groups'): ?>
-
简称(展示)名称网址显示微调操作
- - +

板块列表()

+

+ 板块的先后顺序就是它们在前台出现的顺序:按住某一行拖动即可调整,松手即保存; + 也可以用每行右侧的 ↑ ↓ 微调(不支持拖拽的环境用)。 + 新添加的板块一律排在最后,直到你手动把它拖到别处。 +

+
名称展示方式网站数显示排序操作
+ + query('SELECT COUNT(*) FROM sites WHERE group_id=' . (int)$g['id'])->fetchColumn(); ?> - + + @@ -272,6 +279,7 @@ elseif ($p === 'groups'): ?>
名称展示方式网站数显示微调操作
+