示例#1
0
 protected function Init()
 {
     $this->site = new Site(Request::GetData('site'));
     $selectedID = Request::GetData('selected');
     $this->selected = $selectedID ? Page::Schema()->ByID($selectedID) : null;
     if (!$this->site->Exists()) {
         Response::Redirect(BackendRouter::ModuleUrl(new SiteList()));
         return true;
     }
     $this->tree = new PageTreeProvider($this->site);
     $this->page = $this->tree->TopMost();
     $this->hasPages = (bool) $this->page;
     return parent::Init();
 }
示例#2
0
 /**
  * Sets the site as current site and returns true if it has pages below
  * @param Site $site The site to set and check for pages
  * @return boolean Returns true if the site has pages
  */
 protected function HasPages(Site $site)
 {
     $this->site = $site;
     $this->tree = new PageTreeProvider($site);
     $this->page = $this->tree->TopMost();
     return (bool) $this->page;
 }
示例#3
0
 /**
  * The entry point for fetching all pages as sitemap
  */
 private function AddAllPages()
 {
     $page = $this->pageTree->TopMost();
     while ($page) {
         $this->AddPageBranch($page);
         $page = $this->pageTree->NextOf($page);
     }
 }