Пример #1
0
 protected function Init()
 {
     $this->area = new Area(Request::GetData('area'));
     $selectedID = Request::GetData('selected');
     $this->selected = $selectedID ? LayoutContent::Schema()->ByID($selectedID) : null;
     if (!$this->area->Exists()) {
         Response::Redirect(BackendRouter::ModuleUrl(new LayoutList()));
         return true;
     }
     $this->tree = new LayoutContentTreeProvider($this->area);
     $this->layoutContent = $this->tree->TopMost();
     $this->hasContents = (bool) $this->layoutContent;
     return parent::Init();
 }
Пример #2
0
 protected function Init()
 {
     $this->page = new Page(Request::GetData('page'));
     $selectedID = Request::GetData('selected');
     $this->selected = $selectedID ? PageContent::Schema()->ByID($selectedID) : null;
     if (!$this->page->Exists()) {
         Response::Redirect(BackendRouter::ModuleUrl(new SiteList()));
         return true;
     }
     $this->area = new Area(Request::GetData('area'));
     if (!$this->area->Exists()) {
         $params = array('site' => $this->page->GetSite()->GetID());
         Response::Redirect(BackendRouter::ModuleUrl(new PageTree(), $params));
         return true;
     }
     $this->tree = new PageContentTreeProvider($this->page, $this->area);
     $this->pageContent = $this->tree->TopMost();
     $this->hasContents = (bool) $this->pageContent;
     return parent::Init();
 }