/** * @see \wcf\system\sitemap\ISitemapProvider::getTemplate() */ public function getTemplate() { $nodeTree = new AccessiblePageNodeTree(); $nodeList = $nodeTree->getIterator(); // sitemap only supports up to child-child-pages $nodeList->setMaxDepth(2); WCF::getTPL()->assign(array('pageList' => $nodeList)); return WCF::getTPL()->fetch('cmsSitemap', 'cms'); }
/** * @see \cms\system\content\type\IContentType::getOutput() */ public function getOutput(Content $content) { switch ($content->type) { case "children": $menuItems = $content->getPage()->getChildrenTree($content->depth ? intval($content->depth) - 1 : null); break; case "all": $nodeTree = new AccessiblePageNodeTree(); $menuItems = $nodeTree->getIterator(); if ($content->depth) { $menuItems->setMaxDepth(intval($content->depth) - 1); } break; } WCF::getTPL()->assign(array('menuItems' => $menuItems)); return parent::getOutput($content); }
/** * Returns a list of all descendants of this page. * * @param integer $maxDepth * @return \RecursiveIteratorIterator */ public function getChildrenTree($maxDepth = -1) { $nodeTree = new AccessiblePageNodeTree($this->pageID); $nodeList = $nodeTree->getIterator(); $nodeList->setMaxDepth($maxDepth); return $nodeList; }