Ejemplo n.º 1
0
 public function startup()
 {
     parent::startup();
     if ($this->action === 'youtube') {
         return;
     }
     $this->loadVideo();
     $this->loadBlock(function () {
         $block = $this->video->getRandomParent();
         if ($block) {
             $this->redirectToEntity($this->video, $block);
         }
     });
     $this->loadSchema(function () {
         if (!$this->block) {
             return NULL;
         }
         $schema = $this->block->getRandomParent();
         if ($schema) {
             $this->redirectToEntity($this->video, $this->block, $schema);
         }
     });
     if ($this->block && !$this->block->contains($this->video)) {
         $this->redirectToEntity($this->video);
     }
     if ($this->block && $this->schema && !$this->schema->contains($this->block)) {
         $this->redirectToEntity($this->video);
     }
     $this->checkSlug($this->video);
 }
Ejemplo n.º 2
0
 public function startup()
 {
     parent::startup();
     $this->loadBlueprint();
     $this->loadBlock(function () {
         $block = $this->blueprint->getRandomParent();
         if ($block) {
             $this->redirectToEntity($this->blueprint, $block);
         }
     });
     $this->loadSchema(function () {
         if (!$this->block) {
             return NULL;
         }
         $schema = $this->block->getRandomParent();
         if ($schema) {
             $this->redirectToEntity($this->blueprint, $this->block, $schema);
         }
     });
     if ($this->block && !$this->block->contains($this->blueprint)) {
         $this->redirectToEntity($this->blueprint);
     }
     if ($this->block && $this->schema && !$this->schema->contains($this->block)) {
         $this->redirectToEntity($this->blueprint);
     }
     $this->checkSlug($this->blueprint);
 }
 public function startup()
 {
     parent::startup();
     $this->loadBlackboard(function () {
         return NULL;
     });
     $this->loadBlock(function () {
         return NULL;
     });
     $this->loadSchema(function () {
         return NULL;
     });
     if ($this->blackboard && $this->block && !$this->block->contains($this->blackboard)) {
         $this->error();
     }
     if ($this->block && $this->schema && !$this->schema->contains($this->block)) {
         $this->error();
     }
     if (!($this->user->isAllowed(Acl::ADD_CONTENT) || $this->blackboard && $this->user->isAllowed($this->blackboard))) {
         $this->flashError('acl.denied.blackboard');
         $this->redirect('Homepage:default');
     }
 }