/** * @param array $arguments * @return boolean */ protected static function evaluateCondition($arguments = null) { $pageUid = $arguments['pageUid']; $includeHiddenInMenu = (bool) $arguments['includeHiddenInMenu']; $includeAccessProtected = (bool) $arguments['includeAccessProtected']; if (null === $pageUid || true === empty($pageUid) || 0 === (int) $pageUid) { $pageUid = $GLOBALS['TSFE']->id; } if (self::$pageService === null) { $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); self::$pageService = $objectManager->get('FluidTYPO3\\Vhs\\Service\\PageService'); } $menu = self::$pageService->getMenu($pageUid, [], $includeHiddenInMenu, false, $includeAccessProtected); return 0 < count($menu); }
/** * This method decides if the condition is TRUE or FALSE. It can be overriden in extending viewhelpers to adjust functionality. * * @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for flexiblity in overriding this method. * @return bool */ protected static function evaluateCondition($arguments = NULL) { $pageUid = $arguments['pageUid']; $includeHidden = $arguments['includeHidden']; $showHiddenInMenu = $arguments['showHiddenInMenu']; if (NULL === $pageUid || TRUE === empty($pageUid) || 0 === intval($pageUid)) { $pageUid = $GLOBALS['TSFE']->id; } if (self::$pageSelect === NULL) { $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); self::$pageSelect = $objectManager->get('FluidTYPO3\\Vhs\\Service\\PageSelectService'); } $menu = self::$pageSelect->getMenu($pageUid, array(), '', $showHiddenInMenu); $pageHasSubPages = 0 < count($menu); return TRUE === $pageHasSubPages; }