当前位置: 首页>>代码示例>>PHP>>正文


PHP Area::getAreaHandle方法代码示例

本文整理汇总了PHP中Area::getAreaHandle方法的典型用法代码示例。如果您正苦于以下问题:PHP Area::getAreaHandle方法的具体用法?PHP Area::getAreaHandle怎么用?PHP Area::getAreaHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Area的用法示例。


在下文中一共展示了Area::getAreaHandle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setPermissionObject

 public function setPermissionObject(Area $a)
 {
     $ax = $a;
     if ($a->isGlobalArea()) {
         $cx = Stack::getByName($a->getAreaHandle());
         $a = Area::get($cx, STACKS_AREA_NAME);
     }
     $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();
         }
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:31,代码来源:area.php

示例2: getBlockTypeAliasAction

		/**
		 * gets the form post action for the current block type given the area
		 * @param Area $a
		 * @return string
		 */
		public function getBlockTypeAliasAction(&$a) {
			$step = ($_REQUEST['step']) ? '&step=' . $_REQUEST['step'] : '';
			$arHandle = urlencode($a->getAreaHandle());
			$c = $a->getAreaCollectionObject();
			$cID = $c->getCollectionID();
			$str = DIR_REL . "/" . DISPATCHER_FILENAME . "?cID={$cID}&areaName={$arHandle}&mode=edit&btask=alias" . $step . '&' . $valt->getParameter();
			return $str;			
		}
开发者ID:ronlobo,项目名称:concrete5,代码行数:13,代码来源:block_types.php

示例3: setAreaPermissions

 /**
  * sets the permissions on the area??
  * @todo Documnetation?? not sure what type $cp is or how this is used?
  * @param Area $area
  * @param unknown $cp
  */
 function setAreaPermissions(&$area, &$cp)
 {
     $db = Loader::db();
     if ($area->overrideCollectionPermissions()) {
         $setBlocksVia = "AREA";
     } else {
         if ($area->getAreaCollectionInheritID() > 0) {
             // see if the area/page we're supposed to be getting these from actually has a record
             $arOverrideCollectionPermissions = $db->getOne("select arOverrideCollectionPermissions from Areas where cID = ? and arHandle = ?", array($area->getAreaCollectionInheritID(), $area->getAreaHandle()));
             if ($arOverrideCollectionPermissions) {
                 $setBlocksVia = "AREA";
             }
         }
         if (!isset($setBlocksVia)) {
             $setBlocksVia = "PAGE";
         }
     }
     if ($setBlocksVia == "AREA") {
         $c = $area->getAreaCollectionObject();
         $cpID = $area->getAreaCollectionInheritID() > 0 ? $area->getAreaCollectionInheritID() : $c->getCollectionID();
         $v = array($cpID, $area->getAreaHandle(), $this->getBlockTypeID());
         $q = "select uID, gID from AreaGroupBlockTypes where cID = ? and arHandle = ? and btID = ?";
         $r = $db->query($q, $v);
         while ($row = $r->fetchRow()) {
             if ($row['uID'] != 0) {
                 $this->addBTUArray[] = $row['uID'];
             }
             if ($row['gID'] != 0) {
                 $this->addBTGArray[] = $row['gID'];
             }
         }
     } else {
         $cID = $area->getCollectionID();
         // we grab all the uID/gID combos from PagePermissions that can edit the page
         // then we allow them to add all the blocks they want
         $cInheritCID = $db->getOne('select cInheritPermissionsFromCID from Pages where cID = ?', array($cID));
         $v = array($cInheritCID);
         $q = "select uID, gID, cgPermissions from PagePermissions where cID = ?";
         $r = $db->query($q, $v);
         while ($row = $r->fetchRow()) {
             if ($row['uID'] != 0 && strpos($row['cgPermissions'], 'wa') !== false) {
                 $this->addBTUArray[] = $row['uID'];
             }
             if ($row['gID'] != 0 && strpos($row['cgPermissions'], 'wa') !== false) {
                 $this->addBTGArray[] = $row['gID'];
             }
         }
     }
 }
开发者ID:nbourguig,项目名称:concrete5,代码行数:55,代码来源:block_types.php


注:本文中的Area::getAreaHandle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。