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/element/ |
<?php /** * Outputs a list of Element subclasses * * @deprecated Use $modx->getDescendants($className) now * * @package modx * @subpackage processors.element */ class modElementGetClassesProcessor extends modProcessor { public function checkPermissions() { return $this->modx->hasPermission('view_element'); } public function initialize() { $this->setDefaultProperties(array( 'limit' => 10, 'start' => 0, 'sort' => 'class', 'dir' => 'ASC', )); return true; } public function process() { $limit = $this->getProperty('limit',10); $isLimit = !empty($limit); /* build query */ $c = $this->modx->newQuery('modClassMap'); $c->where(array( 'parent_class' => 'modElement', 'class:!=' => 'modTemplate', )); $c->sortby($this->getProperty('sort'),$this->getProperty('dir')); if ($isLimit) $c->limit($limit,$this->getProperty('start')); $classes = $this->modx->getCollection('modClassMap',$c); /* iterate */ $list = array(); /** @var modClassMap $class */ foreach ($classes as $class) { $el = array( 'name' => $class->get('class') ); $list[] = $el; } return $this->outputArray($list); } } return 'modElementGetClassesProcessor';