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/browser/directory/ |
<?php /** * Gets all files in a directory * * @param string $dir The directory to browse * @param boolean $prependPath (optional) If true, will prepend rb_base_dir to * the final path * @param boolean $prependUrl (optional) If true, will prepend rb_base_url to * the final url * * @var modX $modx * @var array $scriptProperties * @var modProcessor $this * * @package modx * @subpackage processors.browser.directory */ class modBrowserFolderGetFilesProcessor extends modProcessor { /** @var modMediaSource|modFileMediaSource $source */ public $source; public function checkPermissions() { return $this->modx->hasPermission('file_list'); } public function getLanguageTopics() { return array('file'); } public function initialize() { $this->setDefaultProperties(array( 'dir' => '', )); if ($this->getProperty('dir') == 'root') { $this->setProperty('dir',''); } return true; } public function process() { if (!$this->getSource()) { return $this->failure($this->modx->lexicon('permission_denied')); } $this->source->setRequestProperties($this->getProperties()); $this->source->initialize(); if (!$this->source->checkPolicy('list')) { return $this->failure($this->modx->lexicon('permission_denied')); } $list = $this->source->getObjectsInContainer($this->getProperty('dir')); return $this->outputArray($list); } /** * Get the active Source * @return modMediaSource|boolean */ public function getSource() { $this->modx->loadClass('sources.modMediaSource'); $this->source = modMediaSource::getDefaultSource($this->modx,$this->getProperty('source')); if (empty($this->source) || !$this->source->getWorkingContext()) { return false; } return $this->source; } } return 'modBrowserFolderGetFilesProcessor';