Пример #1
0
 public function __construct()
 {
     parent::__construct();
     $pk = PermissionKey::getByHandle('edit_page_properties');
     $pk->setPermissionObject($this->page);
     $this->asl = $pk->getMyAssignment();
 }
Пример #2
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);
 }
Пример #3
0
 public function __construct()
 {
     parent::__construct();
     if ($this->page) {
         $this->set('publishErrors', $this->checkForPublishing());
     }
 }
Пример #4
0
 public function __construct()
 {
     parent::__construct();
     $this->area = \Area::getOrCreate($this->page, $_REQUEST['arHandle']);
     $this->permissions = new \Permissions($this->area);
     $this->set('a', $this->area);
 }
Пример #5
0
 public function __construct()
 {
     parent::__construct();
     $request = $this->request;
     if (!Loader::helper('validation/numbers')->integer($_REQUEST['btID'])) {
         throw new Exception(t('Access Denied'));
     }
     $this->blockType = BlockType::getByID($_REQUEST['btID']);
     $this->area = Area::get($this->page, $_REQUEST['arHandle']);
     $this->pageToModify = $this->page;
     $this->areaToModify = $this->area;
     if ($this->area->isGlobalArea()) {
         $this->pageToModify = Stack::getByName($_REQUEST['arHandle']);
         $this->areaToModify = Area::get($this->page, STACKS_AREA_NAME);
     }
     $this->areaPermissions = new Permissions($this->areaToModify);
     $cnt = $this->blockType->getController();
     if (!is_a($cnt, '\\Concrete\\Core\\Block\\BlockController')) {
         throw new Exception(t('Unable to load the controller for this block type. Perhaps it has been moved or removed.'));
     }
     $this->blockTypeController = $cnt;
 }