public function process() { if (!$this->getSource()) { return $this->failure($this->modx->lexicon('permission_denied')); } $this->source->setRequestProperties($this->getProperties()); $this->source->initialize(); $list = $this->source->getObjectsInContainer($this->getProperty('dir')); return $this->outputArray($list); }
public function process() { if (!$this->getSource()) { return $this->failure($this->modx->lexicon('permission_denied')); } $allowedFileTypes = $this->getProperty('allowedFileTypes'); if (empty($allowedFileTypes)) { // Prevent overriding media source configuration unset($this->properties['allowedFileTypes']); } $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); }