public function setPermissionObject(Area $a) { $ax = $a; if ($a->isGlobalArea()) { $cx = Stack::getByName($a->getAreaHandle()); $a = Area::get($cx, STACKS_AREA_NAME); } if ($a instanceof SubArea && !$a->overrideCollectionPermissions()) { $a = $a->getSubAreaParentPermissionsObject(); } $this->permissionObject = $a; // if the area overrides the collection permissions explicitly (with a one on the override column) we check if ($a->overrideCollectionPermissions()) { $this->permissionObjectToCheck = $a; } else { if ($a->getAreaCollectionInheritID() > 0) { // in theory we're supposed to be inheriting some permissions from an area with the same handle, // set on the collection id specified above (inheritid). however, if someone's come along and // reverted that area to the page's permissions, there won't be any permissions, and we // won't see anything. so we have to check $areac = Page::getByID($a->getAreaCollectionInheritID()); $inheritArea = Area::get($areac, $a->getAreaHandle()); if (is_object($inheritArea) && $inheritArea->overrideCollectionPermissions()) { // okay, so that area is still around, still has set permissions on it. So we // pass our current area to our grouplist, userinfolist objects, knowing that they will // smartly inherit the correct items. $this->permissionObjectToCheck = $inheritArea; } } if (!$this->permissionObjectToCheck) { $this->permissionObjectToCheck = $a->getAreaCollectionObject(); } } }
public function __construct($arHandle, Area $parent) { $arHandle = $parent->getAreaHandle() . self::AREA_SUB_DELIMITER . $arHandle; $this->arParentID = $parent->getAreaID(); parent::__construct($arHandle); }
/** * returns the handle for the current area. * * @return string */ public function getAreaHandle() { return parent::getAreaHandle(); }
public function __construct(StyleSet $set = null, Area $area, $theme) { $this->arHandle = $area->getAreaHandle(); $this->set = $set; $this->theme = $theme; }