protected function Init()
 {
     $this->container = new Container(Request::GetData('container'));
     $selectedID = Request::GetData('selected');
     $this->selected = $selectedID ? ContainerContent::Schema()->ByID($selectedID) : null;
     if (!$this->container->Exists()) {
         //TODO: error
         Response::Redirect(BackendRouter::ModuleUrl(new ContainerList()));
         return true;
     }
     $this->tree = new ContainerContentTreeProvider($this->container);
     $this->containerContent = $this->tree->TopMost();
     $this->hasContents = (bool) $this->containerContent;
     return parent::Init();
 }
Example #2
0
 /**
  * Initializes the html frontend module
  * @return boolean
  */
 protected function Init()
 {
     $contentContainer = ContentContainer::Schema()->ByContent($this->content);
     $tree = new ContainerContentTreeProvider($contentContainer->GetContainer());
     $renderer = new ContentsRenderer($tree->TopMost(), $tree);
     $this->contents = $renderer->Render();
     return parent::Init();
 }