diff --git a/Classes/Controller/BackendModerateCommentsController.php b/Classes/Controller/BackendModerateCommentsController.php index ef44f4f..3dd1127 100644 --- a/Classes/Controller/BackendModerateCommentsController.php +++ b/Classes/Controller/BackendModerateCommentsController.php @@ -8,15 +8,17 @@ use Neusta\Modmod\Provider\PagetreeProvider; use Neusta\Modmod\Utility\BackendUserUtility; use Neusta\Modmod\Utility\PagetreeUtility; +use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Backend\Routing\UriBuilder as BackendUriBuilder; use TYPO3\CMS\Core\Http\ServerRequestFactory; +use TYPO3\CMS\Extbase\Http\ForwardResponse; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; class BackendModerateCommentsController extends ActionController { - const CMD_PUBLISH = 'publish'; - const CMD_UNPUBLISH = 'unpublish'; + public const CMD_PUBLISH = 'publish'; + public const CMD_UNPUBLISH = 'unpublish'; private BackendUriBuilder $beUriBuilder; @@ -38,7 +40,7 @@ public function __construct( $this->formValueProvider = $formValueProvider; } - public function indexAction(): void + public function indexAction(): ResponseInterface { $pageId = $this->getCurrentPageId(); $depth = (int)$this->formValueProvider->getStoredValue($this->request->getPluginName(), 'depth'); @@ -64,9 +66,11 @@ public function indexAction(): void 'tree' => $pageTree, 'comments' => $this->commentRepository->findByPageIds($uidList), ]); + + return $this->htmlResponse(); } - public function toggleVisibilityAction(): void + public function toggleVisibilityAction(): ResponseInterface { $commentUid = (int)($this->request->getArgument('comment') ?? 0); $action = $this->request->getArgument('command') ?? ''; @@ -80,16 +84,18 @@ public function toggleVisibilityAction(): void default: break; } - $this->forward('index'); + + return new ForwardResponse('index'); } - public function deleteAction(): void + public function deleteAction(): ResponseInterface { $commentUid = (int)($this->request->getArgument('comment') ?? 0); if ($commentUid > 0) { $this->commentRepository->deleteComment($commentUid); } - $this->forward('index'); + + return new ForwardResponse('index'); } protected function getCurrentPageId(): int diff --git a/Configuration/Icons.php b/Configuration/Icons.php new file mode 100644 index 0000000..2fa3407 --- /dev/null +++ b/Configuration/Icons.php @@ -0,0 +1,8 @@ + [ + 'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + 'source' => 'EXT:modmod/Resources/Public/Icons/module-modmod.svg', + ], +]; diff --git a/README.md b/README.md index 4fe4233..0befd8c 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,5 @@ You can specify the displayed levels of the page tree, starting with the selecte The dashboard widget will show the latest 15 unmoderated (hidden) comments across all pages. -install via composer `composer req neusta/modmod` +install via composer `composer req teamneusta/modmod` diff --git a/composer.json b/composer.json index 3a494f2..2de0e71 100755 --- a/composer.json +++ b/composer.json @@ -9,13 +9,18 @@ "name": "team neusta GmbH", "role": "Developer", "homepage": "https://team-neusta.de/" + }, + { + "name": "Tobias Kretschmann", + "role": "Developer", + "email": "t.kretschmann@neusta.de" } ], - "version": "1.0.4", + "version": "2.0.0", "require": { "php": "~7.4", - "typo3/cms-core": ">=10.4.0 <=10.4.99", - "t3/pw_comments": ">=5.1.0 <=5.1.99" + "typo3/cms-core": "^11.5", + "t3/pw_comments": "^5.2" }, "require-dev": { "roave/security-advisories": "dev-latest" diff --git a/ext_emconf.php b/ext_emconf.php deleted file mode 100755 index 52a7ecc..0000000 --- a/ext_emconf.php +++ /dev/null @@ -1,31 +0,0 @@ - 'modmod', - 'description' => 'Add-on to pw_comments to moderate comments across pages. This extension provides a dashboard widget and a web module.', - 'category' => 'extension', - 'constraints' => [ - 'depends' => [ - 'typo3' => '10.4.0-10.99.99', - ], - 'conflicts' => [ - ], - ], - 'autoload' => [ - 'psr-4' => [ - 'Neusta\\Modmod\\' => 'Classes', - ], - ], - 'autoload-dev' => [ - 'psr-4' => [ - 'Neusta\\Modmod\\Tests\\' => 'Tests', - ], - ], - 'state' => 'stable', - 'uploadfolder' => 0, - 'createDirs' => '', - 'clearCacheOnLoad' => 1, - 'author' => 'Tobias Kretschmann', - 'author_email' => 't.kretschmann@neusta.de', - 'author_company' => 'team neusta GmbH', - 'version' => '1.0.4', -]; diff --git a/ext_localconf.php b/ext_localconf.php deleted file mode 100644 index 620c7bd..0000000 --- a/ext_localconf.php +++ /dev/null @@ -1,14 +0,0 @@ -registerIcon( - 'tx-modmod-widgets', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:modmod/Resources/Public/Icons/module-modmod.svg'] - ); -}); diff --git a/ext_tables.php b/ext_tables.php index f1728a0..9e6bcc4 100755 --- a/ext_tables.php +++ b/ext_tables.php @@ -1,16 +1,20 @@ 'index, toggleVisibility, delete', + BackendModerateCommentsController::class => 'index, toggleVisibility, delete', ], [ 'access' => 'user',