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


PHP xPDOObject::checkPolicy方法代码示例

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


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

示例1: prepareRow

 /**
  * @param xPDOObject|quipThread $object
  * @return boolean
  */
 public function prepareRow(xPDOObject $object)
 {
     if (!$object->checkPolicy('view')) {
         return false;
     }
     $threadArray = $object->toArray();
     $resourceTitle = $object->get('pagetitle');
     if (!empty($resourceTitle)) {
         $threadArray['url'] = $object->makeUrl();
     }
     $cls = '';
     $cls .= $object->checkPolicy('truncate') ? ' truncate' : '';
     $cls .= $object->checkPolicy('remove') ? ' remove' : '';
     $threadArray['perm'] = $cls;
     return $threadArray;
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:20,代码来源:getlist.class.php

示例2: prepareRow

 /**
  * Prepare the source for iteration and output
  * 
  * @param xPDOObject|modAccessibleObject $object
  * @return array
  */
 public function prepareRow(xPDOObject $object)
 {
     $canEdit = $this->modx->hasPermission('source_edit');
     $canSave = $this->modx->hasPermission('source_save');
     $canRemove = $this->modx->hasPermission('source_delete');
     $objectArray = $object->toArray();
     $cls = array();
     if ($object->checkPolicy('save') && $canSave && $canEdit) {
         $cls[] = 'pupdate';
     }
     if ($object->checkPolicy('remove') && $canRemove) {
         $cls[] = 'premove';
     }
     if ($object->checkPolicy('copy') && $canSave) {
         $cls[] = 'pduplicate';
     }
     $objectArray['cls'] = implode(' ', $cls);
     return $objectArray;
 }
开发者ID:e-gob,项目名称:apps.gob.cl,代码行数:25,代码来源:getlist.class.php

示例3: prepareRow

 /**
  * Prepare the source for iteration and output
  *
  * @param xPDOObject|modAccessibleObject|modMediaSource $object
  * @return array
  */
 public function prepareRow(xPDOObject $object)
 {
     $canEdit = $this->modx->hasPermission('source_edit');
     $canSave = $this->modx->hasPermission('source_save');
     $canRemove = $this->modx->hasPermission('source_delete');
     $objectArray = $object->toArray();
     $objectArray['iconCls'] = $this->modx->getOption('mgr_source_icon', null, 'icon-folder-open-o');
     $props = $object->getPropertyList();
     if (isset($props['iconCls']) && !empty($props['iconCls'])) {
         $objectArray['iconCls'] = $props['iconCls'];
     }
     $cls = array();
     if ($object->checkPolicy('save') && $canSave && $canEdit) {
         $cls[] = 'pupdate';
     }
     if ($object->checkPolicy('remove') && $canRemove) {
         $cls[] = 'premove';
     }
     if ($object->checkPolicy('copy') && $canSave) {
         $cls[] = 'pduplicate';
     }
     $objectArray['cls'] = implode(' ', $cls);
     return $objectArray;
 }
开发者ID:modxcustomize,项目名称:Clickatell,代码行数:30,代码来源:getlist.class.php

示例4: prepareRow

 /**
  * Prepare the row for iteration
  * @param xPDOObject $object
  * @return array
  */
 public function prepareRow(xPDOObject $object)
 {
     if (!$object->checkPolicy('view')) {
         return array();
     }
     $resourceArray = $object->get(array('id', 'pagetitle', 'description', 'published', 'deleted', 'context_key'));
     $resourceArray['menu'] = array();
     $resourceArray['menu'][] = array('text' => $this->modx->lexicon('resource_view'), 'params' => array('a' => 'resource/data', 'id' => $object->get('id')));
     if ($this->modx->hasPermission('edit_document')) {
         $resourceArray['menu'][] = array('text' => $this->modx->lexicon('resource_edit'), 'params' => array('a' => 'resource/update', 'id' => $object->get('id')));
     }
     $resourceArray['menu'][] = '-';
     $resourceArray['menu'][] = array('text' => $this->modx->lexicon('resource_preview'), 'handler' => 'this.preview');
     return $resourceArray;
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:20,代码来源:getrecentlyeditedresources.class.php


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