Ejemplo n.º 1
0
 /**
  * Initializes a new content branch
  * @param mixed $item The content tree item
  */
 function __construct($item)
 {
     $this->item = $item;
     $this->tree = $this->TreeProvider();
     $this->child = $this->tree->FirstChildOf($this->item);
     $this->content = $this->tree->ContentByItem($this->item);
     $this->module = ClassFinder::CreateFrontendModule($this->content->GetType());
     $this->module->SetTreeItem($this->tree, $this->item);
 }
Ejemplo n.º 2
0
 /**
  * Renders the content
  * @return string Returns the rendered content
  */
 function Render()
 {
     if (!self::Guard()->Allow(Action::Read(), $this->content)) {
         return '';
     }
     ContentTranslator::Singleton()->SetContent($this->content);
     $module = ClassFinder::CreateFrontendModule($this->content->GetType());
     $module->SetTreeItem($this->tree, $this->item);
     return $module->Render();
 }