public function accept(NavigationPage $page, $recursive = true) { // accept by default $accept = true; if (!$page->isVisible(false) && !$this->getRenderInvisible()) { // don't accept invisible pages $accept = false; } elseif ($this->getUseAcl() && !$this->_acceptAcl($page)) { // acl is not amused $accept = false; } if ($accept && $recursive) { $parent = $page->getParent(); if ($parent instanceof NavigationPage) { $accept = $this->accept($parent, true); } } return $accept; }