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(); }
function Render() { $renderer = new ContentsRenderer($this->tree->TopMost(), $this->tree); return $renderer->Render(); }