From eeb84c5be16ecca239adae9c851bc0f7db0875a1 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 4 Mar 2023 01:46:45 +0300 Subject: blog: support ToC --- handler/admin/AutoEdit.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'handler/admin/AutoEdit.php') diff --git a/handler/admin/AutoEdit.php b/handler/admin/AutoEdit.php index 9d70c5b..ba6a7d8 100644 --- a/handler/admin/AutoEdit.php +++ b/handler/admin/AutoEdit.php @@ -16,12 +16,13 @@ class AutoEdit extends AutoAddOrEdit { if ($post) { $tags = $post->getTags(); return $this->_get_postEdit($post, - tags: $post->getTags(), - saved: $saved, title: $post->title, text: $post->md, + tags: $post->getTags(), visible: $post->visible, + toc: $post->toc, short_name: $post->shortName, + saved: $saved, ); } @@ -30,8 +31,8 @@ class AutoEdit extends AutoAddOrEdit { return $this->_get_pageEdit($page, title: $page->title, text: $page->md, - visible: $page->visible, saved: $saved, + visible: $page->visible, ); } @@ -45,8 +46,8 @@ class AutoEdit extends AutoAddOrEdit { if ($post) { csrf::check('editpost'.$post->id); - list($text, $title, $tags, $visible, $short_name) - = $this->input('text, title, tags, b:visible, new_short_name'); + list($text, $title, $tags, $visible, $toc, $short_name) + = $this->input('text, title, tags, b:visible, b:toc, new_short_name'); $tags = posts::splitStringToTags($tags); $error_code = null; @@ -63,10 +64,11 @@ class AutoEdit extends AutoAddOrEdit { if ($error_code) $this->_get_postEdit($post, - text: $text, title: $title, + text: $text, tags: $tags, visible: $visible, + toc: $toc, short_name: $short_name, error_code: $error_code ); @@ -75,6 +77,7 @@ class AutoEdit extends AutoAddOrEdit { 'title' => $title, 'md' => $text, 'visible' => (int)$visible, + 'toc' => (int)$toc, 'short_name' => $short_name ]); $tag_ids = posts::getTagIds($tags); -- cgit v1.2.3