Admin: switch topics to tree editing layout
Render topics as a two-level tree so editing is clearer and limit updates to name/sort while parent selection stays create-only. Keep topic deletion safe with FK cascades and ensure photo tag links are cleaned automatically when a topic is removed.
This commit is contained in:
@@ -119,13 +119,6 @@ function topicUpdate(int $topicId, string $name, ?int $parentId, int $sortOrder
|
||||
$st->execute();
|
||||
}
|
||||
|
||||
function topicChildrenCount(int $topicId): int
|
||||
{
|
||||
$st = db()->prepare('SELECT COUNT(*) FROM topics WHERE parent_id=:id');
|
||||
$st->execute(['id' => $topicId]);
|
||||
return (int)$st->fetchColumn();
|
||||
}
|
||||
|
||||
function topicDelete(int $topicId): void
|
||||
{
|
||||
$st = db()->prepare('DELETE FROM topics WHERE id=:id');
|
||||
|
||||
Reference in New Issue
Block a user