Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * Get the active Source
  * @return modMediaSource|boolean
  */
 public function getSource()
 {
     $this->modx->loadClass('sources.modMediaSource');
     $this->source = $this->modx->getObject('modMediaSource', $_POST['sourceID']);
     if (empty($this->source) || !$this->source->getWorkingContext()) {
         return false;
     }
     return $this->source;
 }
Example #3
0
 /**
  * @return boolean|string
  */
 public function getSource()
 {
     /** @var modMediaSource $source */
     $this->modx->loadClass('sources.modMediaSource');
     $this->source = $this->modx->getObject('modMediaSource', $_POST['sourceID']);
     if (!$this->source->getWorkingContext()) {
         return $this->modx->lexicon('permission_denied');
     }
     $this->source->setRequestProperties($this->getProperties());
     return $this->source->initialize();
 }
Example #4
0
 /**
  * @return boolean|string
  */
 public function getSource()
 {
     $source = $this->getProperty('source', 1);
     /** @var modMediaSource $source */
     $this->modx->loadClass('sources.modMediaSource');
     $this->source = modMediaSource::getDefaultSource($this->modx, $source);
     if (!$this->source->getWorkingContext()) {
         return $this->modx->lexicon('permission_denied');
     }
     $this->source->setRequestProperties($this->getProperties());
     return $this->source->initialize();
 }
Example #5
0
 /**
  * Get the source to load the paths from
  * 
  * @param int $sourceId
  * @return modMediaSource|modFileMediaSource
  */
 public function getSource($sourceId)
 {
     /** @var modMediaSource|modWebDAVMediaSource $source */
     $this->modx->loadClass('sources.modMediaSource');
     $this->source = modMediaSource::getDefaultSource($this->modx, $sourceId, false);
     if (empty($this->source)) {
         return false;
     }
     if (!$this->source->getWorkingContext()) {
         return false;
     }
     $this->source->setRequestProperties($this->getProperties());
     $this->source->initialize();
     return $this->source;
 }