Ejemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $request = $this->request;
     $arHandle = $request->query->get('arHandle');
     $bID = $request->query->get('bID');
     $a = \Area::get($this->page, $arHandle);
     if (!is_object($a)) {
         throw new \Exception('Invalid Area');
     }
     $this->area = $a;
     if (!$a->isGlobalArea()) {
         $b = \Block::getByID($bID, $this->page, $a);
         $this->set('isGlobalArea', false);
     } else {
         $stack = \Stack::getByName($arHandle);
         $sc = ConcretePage::getByID($stack->getCollectionID(), 'RECENT');
         $b = \Block::getByID($bID, $sc, STACKS_AREA_NAME);
         $b->setBlockAreaObject($a);
         // set the original area object
         $this->set('isGlobalArea', true);
     }
     $this->block = $b;
     $this->permissions = new \Permissions($b);
     $this->set('bp', $this->permissions);
     $this->set('b', $b);
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     $request = $this->request;
     $cID = $request->query->get('cID');
     if ($cID) {
         $page = ConcretePage::getByID($cID);
         $this->setPageObject($page);
         $request->setCurrentPage($this->page);
     }
 }
Ejemplo n.º 3
0
 public function on_start()
 {
     $request = $this->request;
     $cID = $request->query->get('cID');
     if ($cID) {
         $page = ConcretePage::getByID($cID);
     }
     if (is_object($page) && !$page->isError()) {
         $this->setPageObject($page);
         $request->setCurrentPage($this->page);
     } else {
         throw new \Exception(t('Access Denied'));
     }
 }