Example #1
0
 /**
  * @return FrontendModule
  */
 protected function FrontendModule()
 {
     if (!$this->frontendModule) {
         $this->frontendModule = ClassFinder::CreateFrontendModule($this->Value('Module'));
     }
     return $this->frontendModule;
 }
Example #2
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);
 }
 /**
  * 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();
 }
Example #4
0
 /**
  * Initializes the bundle and module names
  * @param array $idParts
  */
 private function InitModule(array $idParts)
 {
     if (count($idParts) < 1 || count($idParts) > 2) {
         //TODO: Message
         Response::Redirect(BackendRouter::ModuleUrl(new TemplateList()));
     }
     $this->module = ClassFinder::CreateFrontendModule($idParts[0]);
     if (!$this->module instanceof FrontendModule || !$this->module->AllowCustomTemplates()) {
         //TODO: Message
         Response::Redirect(BackendRouter::ModuleUrl(new TemplateList()));
     }
 }
Example #5
0
 /**
  * The removel template module
  * @param array $idParts
  * @return FrontendModule
  */
 protected function RemovalTemplateModule(array $idParts)
 {
     if (count($idParts) != 2) {
         return null;
     }
     $module = ClassFinder::CreateFrontendModule($idParts[0]);
     return $module instanceof FrontendModule && $module->AllowCustomTemplates() ? $module : null;
 }