예제 #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;
 }
예제 #2
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();
 }
예제 #3
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();
 }
예제 #4
0
 /**
  * Get the source to load the paths from
  * 
  * @param int $sourceId
  * @return modMediaSource|modFileMediaSource
  */
 public function getSource($sourceId)
 {
     /** @var modMediaSource|modFileMediaSource $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;
 }
예제 #5
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;
 }