From efc5d9b5af33b38a2850119e2133bc0c52fcc57e Mon Sep 17 00:00:00 2001 From: VladVilya Date: Thu, 6 May 2021 15:02:23 +0300 Subject: [PATCH] [TASK] added single view comment --- Classes/Controller/QuestionController.php | 9 ++++----- Resources/Private/Partials/Question/Question.html | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) mode change 100644 => 100755 Resources/Private/Partials/Question/Question.html diff --git a/Classes/Controller/QuestionController.php b/Classes/Controller/QuestionController.php index b8fd9e0..da02fb6 100755 --- a/Classes/Controller/QuestionController.php +++ b/Classes/Controller/QuestionController.php @@ -64,9 +64,8 @@ public function initializeListAction() */ public function listAction(Question $question = null, string $selectedCategory = '', int $categoryDetail = 0, string $singleViewPid = '0', array $gtag = []) { - if ($question !== null) { - $this->forward('detail', null, null, ['question' => $question]); + $this->forward('detail', null, null, ['question' => $question, 'showCommentForm' => (int)$this->settings['flexform']['showQuestionCommentForm']]); } if ($this->settings['singleViewPid']) { @@ -112,10 +111,10 @@ public function listAction(Question $question = null, string $selectedCategory = * * @param Question $question * @param array $gtag - * + * @param int $showCommentForm * @return void */ - public function detailAction(Question $question, array $gtag) + public function detailAction(Question $question, array $gtag, int $showCommentForm = 0) { $currentUid = $this->getCurrentUid(); @@ -132,7 +131,7 @@ public function detailAction(Question $question, array $gtag) $this->view->assignMultiple(array( 'question' => $question, - 'showQuestionCommentForm' => (int)$this->settings['flexform']['showQuestionCommentForm'], + 'showQuestionCommentForm' => $showCommentForm, 'currentUid' => $currentUid, 'gtag' => $gtag, 'restrictToCategories' => $restrictToCategories, diff --git a/Resources/Private/Partials/Question/Question.html b/Resources/Private/Partials/Question/Question.html old mode 100644 new mode 100755 index 789c3cc..cebc376 --- a/Resources/Private/Partials/Question/Question.html +++ b/Resources/Private/Partials/Question/Question.html @@ -5,7 +5,7 @@

{question.question}

- {question.question} + {question.question} @@ -29,4 +29,4 @@

{question.question}

- \ No newline at end of file +