/** * Filter a node by the current context. * Will either return the node or NULL if it is not permitted in current context. * * @param NodeInterface $node * @param Context $context * @return \TYPO3\TYPO3CR\Domain\Model\Node|NULL */ protected function filterNodeByContext(NodeInterface $node, Context $context) { if (!$context->isRemovedContentShown() && $node->isRemoved()) { return NULL; } if (!$context->isInvisibleContentShown() && !$node->isVisible()) { return NULL; } if (!$context->isInaccessibleContentShown() && !$node->isAccessible()) { return NULL; } return $node; }
/** * Return TRUE/FALSE if the node is currently hidden or not in the menu; taking the "renderHiddenInIndex" configuration * of the Menu TypoScript object into account. * * This method needs to be called inside buildItems() in the subclasses. * * @param NodeInterface $node * @return boolean */ protected function isNodeHidden(NodeInterface $node) { return $node->isVisible() === false || $this->getRenderHiddenInIndex() === false && $node->isHiddenInIndex() === true || $node->isAccessible() === false; }
/** * Shows the specified node and takes visibility and access restrictions into * account. * * @param \TYPO3\TYPO3CR\Domain\Model\NodeInterface $node * @return string View output for the specified node */ public function showWireframeAction(\TYPO3\TYPO3CR\Domain\Model\NodeInterface $node) { if (!$node->isAccessible()) { try { $this->authenticationManager->authenticate(); } catch (\Exception $exception) { } } if (!$node->isAccessible() && !$this->nodeRepository->getContext()->isInaccessibleContentShown()) { $this->throwStatus(403); } if (!$node->isVisible() && !$this->nodeRepository->getContext()->isInvisibleContentShown()) { $this->throwStatus(404); } if ($node->getContentType() === 'TYPO3.Phoenix.ContentTypes:Shortcut') { $this->view->assign('wireframeMode', $node); } $this->nodeRepository->getContext()->setCurrentNode($node); $this->view->assign('value', $node); $this->view->setTypoScriptPath('wireframeMode'); $this->response->setHeader('Cache-Control', 'public, s-maxage=600', FALSE); }
/** * Return TRUE/FALSE if the node is currently hidden or not in the menu; taking the "renderHiddenInIndex" configuration * of the Menu TypoScript object into account. * * This method needs to be called inside buildItems() in the subclasses. * * @param NodeInterface $node * @return boolean */ protected function isNodeHidden(NodeInterface $node) { return $node->isVisible() === FALSE || $this->getRenderHiddenInIndex() === FALSE && $node->isHiddenInIndex() === TRUE || $node->isAccessible() === FALSE; }