Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/www/core/model/modx/processors/security/access/permission/ |
<?php /** * @package modx * @subpackage processors.security.permission */ class modAccessPermissionGetListProcessor extends modObjectGetListProcessor { public $checkListPermission = false; public $objectType = 'permission'; public $classKey = 'modAccessPermission'; public $permission = 'access_permissions'; public $languageTopics = array('access','permission'); public function initialize() { $initialized = parent::initialize(); $this->setDefaultProperties(array( 'query' => '', )); return $initialized; } public function prepareQueryBeforeCount(xPDOQuery $c) { $c->leftJoin('modAccessPolicyTemplate','Template'); $c->query['DISTINCT'] = 'DISTINCT'; $query = $this->getProperty('query',''); if (!empty($query)) { $c->where(array( 'modAccessPermission.name:LIKE' => '%'.$query.'%', )); } return $c; } public function prepareQueryAfterCount(xPDOQuery $c) { $c->select(array( 'modAccessPermission.id', 'modAccessPermission.name', 'modAccessPermission.description', 'Template.lexicon', )); $c->groupby('modAccessPermission.name'); return $c; } public function prepareRow(xPDOObject $object) { $objectArray = $object->get(array('name','description')); $lexicon = $object->get('lexicon'); if (!empty($lexicon)) { if (strpos($lexicon,':') !== false) { $this->modx->lexicon->load($lexicon); } else { $this->modx->lexicon->load('core:'.$lexicon); } } $objectArray['description'] = $this->modx->lexicon($objectArray['description']); return $objectArray; } } return 'modAccessPermissionGetListProcessor';