diff --git a/Classes/ViewHelpers/Link/ArchiveViewHelper.php b/Classes/ViewHelpers/Link/ArchiveViewHelper.php index 731f2365..ea944777 100644 --- a/Classes/ViewHelpers/Link/ArchiveViewHelper.php +++ b/Classes/ViewHelpers/Link/ArchiveViewHelper.php @@ -10,6 +10,7 @@ namespace T3G\AgencyPack\Blog\ViewHelpers\Link; +use TYPO3\CMS\Core\TypoScript\FrontendTypoScript; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -40,7 +41,9 @@ public function render(): string $rssFormat = (bool)$this->arguments['rss']; $year = (int)$this->arguments['year']; $month = (int)$this->arguments['month']; - $pageUid = (int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['archiveUid']; + /** @var FrontendTypoScript $typoscriptAttribute */ + $typoscriptAttribute = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript'); + $pageUid = (int)$typoscriptAttribute->getSetupArray()['plugin.']['tx_blog.']['settings.']['archiveUid']; $arguments = [ 'year' => $year ]; @@ -52,8 +55,10 @@ public function render(): string ->setRequest($this->renderingContext->getRequest()) ->setTargetPageUid($pageUid); if ($rssFormat) { + /** @var FrontendTypoScript $typoscriptAttribute */ + $typoscriptAttribute = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript'); $uriBuilder - ->setTargetPageType((int)$this->getTypoScriptFrontendController()->tmpl->setup['blog_rss_archive.']['typeNum']); + ->setTargetPageType((int)$typoscriptAttribute->getSetupArray()['blog_rss_archive.']['typeNum']); } $uri = $uriBuilder->uriFor('listPostsByDate', $arguments, 'Post', 'Blog', 'Archive'); $linkText = $this->renderChildren() ?? implode('-', $arguments); diff --git a/Classes/ViewHelpers/Link/AuthorViewHelper.php b/Classes/ViewHelpers/Link/AuthorViewHelper.php index ad603aa4..fbb2294b 100644 --- a/Classes/ViewHelpers/Link/AuthorViewHelper.php +++ b/Classes/ViewHelpers/Link/AuthorViewHelper.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\ViewHelpers\Link; use T3G\AgencyPack\Blog\Domain\Model\Author; +use TYPO3\CMS\Core\TypoScript\FrontendTypoScript; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -56,7 +57,9 @@ protected function buildUriFromDetailsPage(Author $author, bool $rssFormat): str protected function buildUriFromDefaultPage(Author $author, bool $rssFormat): string { - $uriBuilder = $this->getUriBuilder((int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['authorUid'], [], $rssFormat); + /** @var FrontendTypoScript $typoscriptAttribute */ + $typoscriptAttribute = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript'); + $uriBuilder = $this->getUriBuilder((int)$typoscriptAttribute->getSetupArray()['plugin.']['tx_blog.']['settings.']['authorUid'], [], $rssFormat); $arguments = [ 'author' => $author->getUid(), ]; @@ -71,8 +74,10 @@ protected function getUriBuilder(int $pageUid, array $additionalParams, bool $rs ->setTargetPageUid($pageUid) ->setArguments($additionalParams); if ($rssFormat) { + /** @var FrontendTypoScript $typoscriptAttribute */ + $typoscriptAttribute = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript'); $uriBuilder - ->setTargetPageType((int)$this->getTypoScriptFrontendController()->tmpl->setup['blog_rss_author.']['typeNum']); + ->setTargetPageType((int)$typoscriptAttribute->getSetupArray()['blog_rss_author.']['typeNum']); } return $uriBuilder; diff --git a/Classes/ViewHelpers/Link/CategoryViewHelper.php b/Classes/ViewHelpers/Link/CategoryViewHelper.php index cb133e6e..4b0bab76 100644 --- a/Classes/ViewHelpers/Link/CategoryViewHelper.php +++ b/Classes/ViewHelpers/Link/CategoryViewHelper.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\ViewHelpers\Link; use T3G\AgencyPack\Blog\Domain\Model\Category; +use TYPO3\CMS\Core\TypoScript\FrontendTypoScript; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -40,7 +41,9 @@ public function render(): string $rssFormat = (bool)$this->arguments['rss']; /** @var Category $category */ $category = $this->arguments['category']; - $pageUid = (int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['categoryUid']; + /** @var FrontendTypoScript $typoscriptAttribute */ + $typoscriptAttribute = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript'); + $pageUid = (int)$typoscriptAttribute->getSetupArray()['plugin.']['tx_blog.']['settings.']['categoryUid']; $arguments = [ 'category' => $category->getUid(), ]; @@ -49,8 +52,10 @@ public function render(): string ->setRequest($this->renderingContext->getRequest()) ->setTargetPageUid($pageUid); if ($rssFormat) { + /** @var FrontendTypoScript $typoscriptAttribute */ + $typoscriptAttribute = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript'); $uriBuilder - ->setTargetPageType((int)$this->getTypoScriptFrontendController()->tmpl->setup['blog_rss_category.']['typeNum']); + ->setTargetPageType((int)$typoscriptAttribute->getSetupArray()['blog_rss_category.']['typeNum']); } $uri = $uriBuilder->uriFor('listPostsByCategory', $arguments, 'Post', 'Blog', 'Category'); diff --git a/Classes/ViewHelpers/Link/TagViewHelper.php b/Classes/ViewHelpers/Link/TagViewHelper.php index d6125a39..9fd8daa6 100644 --- a/Classes/ViewHelpers/Link/TagViewHelper.php +++ b/Classes/ViewHelpers/Link/TagViewHelper.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\ViewHelpers\Link; use T3G\AgencyPack\Blog\Domain\Model\Tag; +use TYPO3\CMS\Core\TypoScript\FrontendTypoScript; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -40,7 +41,9 @@ public function render(): string $rssFormat = (bool)$this->arguments['rss']; /** @var Tag $tag */ $tag = $this->arguments['tag']; - $pageUid = (int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['tagUid']; + /** @var FrontendTypoScript $typoscriptAttribute */ + $typoscriptAttribute = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript'); + $pageUid = (int)$typoscriptAttribute->getSetupArray()['plugin.']['tx_blog.']['settings.']['tagUid']; $arguments = [ 'tag' => $tag->getUid(), ]; @@ -49,8 +52,10 @@ public function render(): string ->setRequest($this->renderingContext->getRequest()) ->setTargetPageUid($pageUid); if ($rssFormat) { + /** @var FrontendTypoScript $typoscriptAttribute */ + $typoscriptAttribute = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript'); $uriBuilder - ->setTargetPageType((int)$this->getTypoScriptFrontendController()->tmpl->setup['blog_rss_tag.']['typeNum']); + ->setTargetPageType((int)$typoscriptAttribute->getSetupArray()['blog_rss_tag.']['typeNum']); } $uri = $uriBuilder->uriFor('listPostsByTag', $arguments, 'Post', 'Blog', 'Tag'); if ($uri !== '') {