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/security/forms/set/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/palandch/www/core/model/modx/processors/security/forms/set/getlist.class.php
<?php
/**
 * Gets a list of Form Customization sets.
 *
 * @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.
 * @param string $dir (optional) The direction of the sort. Default action.
 *
 * @package modx
 * @subpackage processors.security.forms.set
 */
class modFormCustomizationSetGetListProcessor extends modObjectGetListProcessor {
    public $classKey = 'modFormCustomizationSet';
    public $languageTopics = array('formcustomization');
    public $permission = 'customize_forms';
    public $defaultSortField = 'controller';
    public $canEdit = false;
    public $canRemove = false;

    public function initialize() {
        $this->setDefaultProperties(array(
            'profile' => 0,
            'search' => '',
        ));
        $this->canEdit = $this->modx->hasPermission('save');
        $this->canRemove = $this->modx->hasPermission('remove');
        return parent::initialize();
    }

    public function prepareQueryBeforeCount(xPDOQuery $c) {
        $c->innerJoin('modAction','Action');
        $c->leftJoin('modTemplate','Template');
        $profile = $this->getProperty('profile');
        if (!empty($profile)) {
            $c->where(array(
                'profile' => $profile,
            ));
        }
        $search = $this->getProperty('search');
        if (!empty($search)) {
            $c->where(array(
                'modFormCustomizationSet.description:LIKE' => '%'.$search.'%',
                'OR:Template.templatename:LIKE' => '%'.$search.'%',
                'OR:modFormCustomizationSet.constraint_field:LIKE' => '%'.$search.'%',
            ),null,2);
        }
        return $c;
    }
    public function prepareQueryAfterCount(xPDOQuery $c) {
        $c->select($this->modx->getSelectColumns('modFormCustomizationSet','modFormCustomizationSet'));
        $c->select(array(
            'Action.controller',
            'Template.templatename',
        ));
        return $c;
    }

    public function prepareRow(xPDOObject $object) {
        $objectArray = $object->toArray();

        $constraint = $object->get('constraint');
        if (!empty($constraint)) {
            $objectArray['constraint_data'] = $object->get('constraint_class').'.'.$object->get('constraint_field').' = '.$constraint;
        }
        $objectArray['perm'] = array();
        if ($this->canEdit) $objectArray['perm'][] = 'pedit';
        if ($this->canRemove) $objectArray['perm'][] = 'premove';
        
        return $objectArray;
    }
}
return 'modFormCustomizationSetGetListProcessor';

Spamworldpro Mini