| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace Opentalent\OtTemplating\ViewHelpers\Template;
- use Closure;
- use Opentalent\OtTemplating\Page\OtPageRepository;
- use TYPO3\CMS\Core\Utility\GeneralUtility;
- use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
- use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
- /**
- * Returns the recorded preferences
- *
- * {namespace ot=Opentalent\OtTemplating\ViewHelpers}
- *
- * {ot:template.preferences()}
- *
- * @package Opentalent\OtTemplating\ViewHelpers\Template
- */
- class PreferencesViewHelper extends AbstractViewHelper
- {
- /**
- * -- 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
- ) {
- if (TYPO3_MODE == 'FE') {
- $pageUid = (int) $GLOBALS['TSFE']->id;
- } else {
- $pageUid = (int) GeneralUtility::_GP('id');
- }
- $pageRepository = new OtPageRepository();
- return $pageRepository->getTemplatePreferences($pageUid);
- }
- }
|