| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Opentalent\OtTemplating\ViewHelpers\Template;
- use Closure;
- use Opentalent\OtCore\Page\OtPageRepository;
- use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
- use Opentalent\OtTemplating\Templating\TemplateRepository;
- use TYPO3\CMS\Core\Utility\GeneralUtility;
- use TYPO3\CMS\Extbase\Object\ObjectManager;
- use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
- /**
- * Returns the recorded preferences
- *
- * {namespace ot=Opentalent\OtTemplating\ViewHelpers}
- *
- * {ot:template.preferences()}
- *
- * @package Opentalent\OtTemplating\ViewHelpers\Template
- */
- class PreferencesViewHelper extends OtAbstractViewHelper
- {
- /**
- * -- This method is expected by Fluid --
- * Renders the content as html
- *
- * @param array $arguments
- * @param Closure $renderChildrenClosure
- * @param RenderingContextInterface $renderingContext
- * @return array
- */
- public static function renderStatic(
- array $arguments,
- Closure $renderChildrenClosure,
- RenderingContextInterface $renderingContext
- ) {
- $pageRepository = GeneralUtility::makeInstance(ObjectManager::class)->get(OtPageRepository::class);
- $rootUid = $pageRepository->getCurrentSiteRootPageId();
- $templateRepository = GeneralUtility::makeInstance(TemplateRepository::class);
- return $templateRepository->getTemplatePreferences($rootUid);
- }
- }
|