diff --git a/public/forum/posting.php b/public/forum/posting.php index 69c421d7..3d26b40f 100644 --- a/public/forum/posting.php +++ b/public/forum/posting.php @@ -239,4 +239,10 @@ echo tpl_render('forum.posting', [ 'posting_notices' => $notices, 'posting_mode' => $mode, 'posting_types' => $topicTypes, + 'posting_defaults' => [ + 'title' => $topicTitle ?? null, + 'type' => $topicType ?? null, + 'text' => $postText ?? null, + 'parser' => $postParser ?? MSZ_PARSER_BBCODE, + ], ]); diff --git a/templates/forum/posting.twig b/templates/forum/posting.twig index 133467ec..55c01960 100644 --- a/templates/forum/posting.twig +++ b/templates/forum/posting.twig @@ -17,7 +17,7 @@ : input_text( 'post[title]', 'forum__header__input', - posting_topic.topic_title|default(''), + posting_defaults.title|default(posting_topic.topic_title|default('')), 'text', 'Enter your title here...' ), @@ -62,13 +62,23 @@
- +
- {{ input_select('post[parser]', constant('MSZ_PARSERS_NAMES'), posting_post.post_parse|default(constant('MSZ_PARSER_BBCODE')), null, null, null, 'forum__post__dropdown') }} + {{ input_select( + 'post[parser]', + constant('MSZ_PARSERS_NAMES'), + posting_defaults.parser|default(posting_post.post_parse|default(constant('MSZ_PARSER_BBCODE'))), + null, null, null, 'forum__post__dropdown' + ) }} {% if is_opening and posting_types|length > 1 %} - {{ input_select('post[type]', posting_types, posting_topic.topic_type|default(posting_types|keys|first), null, null, null, 'forum__post__dropdown') }} + {{ input_select( + 'post[type]', + posting_types, + posting_defaults.type|default(posting_topic.topic_type|default(posting_types|keys|first)), + null, null, null, 'forum__post__dropdown' + ) }} {% endif %}