diff --git a/Classes/Controller/RatingController.php b/Classes/Controller/RatingController.php
index 0462649..7d539b0 100644
--- a/Classes/Controller/RatingController.php
+++ b/Classes/Controller/RatingController.php
@@ -2,17 +2,19 @@
namespace TTN\Tea\Controller;
-use Psr\Http\Message\ResponseInterface;
-use TTN\Tea\Domain\Model\Product\Tea;
-use TTN\Tea\Domain\Repository\Product\TeaRepository;
-use TYPO3\CMS\Core\Context\Context;
-use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult;
+use TTN\Tea\Domain\Model\Tea;
+use TTN\Tea\Domain\Repository\TeaRepository;
+use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
-class RatingController extends FrontEndEditorController
+class RatingController extends ActionController
{
+
+ public function __construct(protected TeaRepository $teaRepository)
+ {
+ }
+
public function ratingAction(Tea $tea, int $stars)
{
- $this->checkIfUserIsOwner($tea);
$tea->setStars($stars);
$this->teaRepository->update($tea);
diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php
index 7d35150..c4908f9 100644
--- a/Configuration/TCA/Overrides/tt_content.php
+++ b/Configuration/TCA/Overrides/tt_content.php
@@ -30,10 +30,18 @@ call_user_func(
'EXT:tea/Resources/Public/Icons/Extension.svg'
);
+ \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
+ 'Tea',
+ 'TeaRating',
+ 'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_rating',
+ 'EXT:tea/Resources/Public/Icons/Extension.svg'
+ );
+
// This removes the default controls from the plugin.
$controlsToRemove = 'recursive,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_teaindex'] = $controlsToRemove;
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_teashow'] = $controlsToRemove;
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_teafrontendeditor'] = $controlsToRemove;
+ $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_tearating'] = $controlsToRemove;
}
);
diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript
index 4de562a..2dc2c2b 100644
--- a/Configuration/TypoScript/setup.typoscript
+++ b/Configuration/TypoScript/setup.typoscript
@@ -21,3 +21,27 @@ plugin.tx_tea {
singleViewPageUid = {$plugin.tx_tea.settings.singleViewPageUid}
}
}
+
+plugin.tx_tea_tearating {
+ view {
+ templateRootPaths {
+ 0 = EXT:tea/Resources/Private/Plugins/Rating/Templates/
+ }
+
+ partialRootPaths {
+ 0 = EXT:tea/Resources/Private/Plugins/Rating/Partials/
+ }
+
+ layoutRootPaths {
+ 0 = EXT:tea/Resources/Private/Plugins/Rating/Layouts/
+ }
+ }
+
+ persistence {
+ storagePid = {$plugin.tx_tea.persistence.storagePid}
+ }
+
+ settings {
+ singleViewPageUid = {$plugin.tx_tea_tearating.settings.singleViewPageUid}
+ }
+}
diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf
index ec70e63..ec6bbfd 100644
--- a/Resources/Private/Language/de.locallang.xlf
+++ b/Resources/Private/Language/de.locallang.xlf
@@ -11,6 +11,10 @@
Tee-Einzelansicht
+
+
+ Tee-Bewertungsansicht
+
Frontend-Editor für Tee
diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf
index a905a48..68cdad4 100644
--- a/Resources/Private/Language/locallang.xlf
+++ b/Resources/Private/Language/locallang.xlf
@@ -9,6 +9,9 @@
+
+
+
@@ -66,6 +69,10 @@
+
+
+
+