Spamworldpro Mini Shell
Spamworldpro


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/plugin/event/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/palandch/www/core/model/modx/processors/element/plugin/event/getlist.class.php
<?php
/**
 * Gets a list of system events
 *
 * @package modx
 * @subpackage processors.element.plugin.event
 */
class modPluginEventGetListProcessor extends modObjectProcessor {
    public $classKey = 'modPluginEvent';
    public $languageTopics = array('plugin','system_events');
    public $permission = 'view_plugin';

    public function initialize() {
        $this->setDefaultProperties(array(
            'start' => 0,
            'limit' => 0,
            'sort' => 'name',
            'dir' => 'ASC',
            'name' => false,
            'plugin' => false,
        ));
        return true;
    }

    public function process() {
        $data = $this->getData();

        $list = array();
        /** @var modEvent $event */
        foreach ($data['results'] as $event) {
            $eventArray = $event->toArray();
            $eventArray['enabled'] = $event->get('enabled') ? 1 : 0;

            $eventArray['menu'] = array(
                array(
                    'text' => $this->modx->lexicon('plugin_event_update'),
                    'handler' => 'this.updateEvent',
                )
            );
            $list[] = $eventArray;
        }
        return $this->outputArray($list,$data['total']);
    }

    public function getData() {
        $criteria = array();
        if (!empty($name)) {
            $criteria[] = array('name:LIKE' => '%'.$name.'%');
        }
        $this->modx->newQuery('modEvent');
        $eventsResult = $this->modx->call('modEvent', 'listEvents', array(&$this->modx, $this->getProperty('plugin'), $criteria, array(
            $this->getProperty('sort') => $this->getProperty('dir')), $this->getProperty('limit'), $this->getProperty('start')));
        return array(
            'total' => $eventsResult['count'],
            'results' => $eventsResult['collection'],
        );
    }
}
return 'modPluginEventGetListProcessor';

Spamworldpro Mini