当前位置: 首页>>代码示例>>PHP>>正文


PHP modMediaSource::setRequestProperties方法代码示例

本文整理汇总了PHP中modMediaSource::setRequestProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP modMediaSource::setRequestProperties方法的具体用法?PHP modMediaSource::setRequestProperties怎么用?PHP modMediaSource::setRequestProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在modMediaSource的用法示例。


在下文中一共展示了modMediaSource::setRequestProperties方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 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('create')) {
         return $this->failure($this->modx->lexicon('permission_denied'));
     }
     $this->ensureSavePathExists($_POST['path']);
     $success = $this->source->uploadObjectsToContainer($_POST['path'], $_FILES);
     /* Check for upload errors
      * Remove 'directory already exists' error
      */
     $errors = array();
     if (empty($success)) {
         $msg = '';
         $errors = $this->source->getErrors();
         if (isset($errors['name'])) {
             unset($errors['name']);
         }
     }
     if (count($errors) > 0) {
         foreach ($errors as $k => $msg) {
             $this->modx->error->addField($k, $msg);
         }
         return $this->failure($msg);
     }
     return $this->success();
 }
开发者ID:neonoviy,项目名称:CET_AssetsTV,代码行数:31,代码来源:upload.class.php

示例2: process

 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);
 }
开发者ID:rosstimson,项目名称:revolution,代码行数:10,代码来源:getfiles.class.php

示例3: getSource

 /**
  * @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();
 }
开发者ID:neonoviy,项目名称:CET_AssetsTV,代码行数:14,代码来源:remove.class.php

示例4: getSource

 /**
  * @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();
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:15,代码来源:update.class.php

示例5: process

 public function process()
 {
     if (!$this->getSource()) {
         return $this->modx->toJSON(array());
     }
     if (!$this->source->checkPolicy('list')) {
         return $this->modx->toJSON(array());
     }
     $this->source->setRequestProperties($this->getProperties());
     $this->source->initialize();
     $list = $this->source->getContainerList($this->getProperty('dir'));
     return $this->modx->toJSON($list);
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:13,代码来源:getlist.class.php

示例6: process

 public function process()
 {
     if (!$this->getSource()) {
         return $this->failure($this->modx->lexicon('permission_denied'));
     }
     $this->source->setRequestProperties($this->getProperties());
     $this->source->initialize();
     $fields = $this->getProperties();
     if (!$this->validate($fields)) {
         return $this->failure();
     }
     $response = $this->source->renameContainer($fields['path'], $fields['name']);
     return $this->handleResponse($response);
 }
开发者ID:rosstimson,项目名称:revolution,代码行数:14,代码来源:rename.class.php

示例7: getSource

 /**
  * 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;
 }
开发者ID:Burick,项目名称:modx-WebDAV,代码行数:21,代码来源:proxy.class.php

示例8: process

 public function process()
 {
     $tv = $_POST['tv_id'];
     $resId = $_POST['resource_id'];
     $page = $this->modx->getObject('modResource', $resId);
     $tvvalue = $page->getTVValue($tv);
     $nowTVarray = json_decode($tvvalue, true);
     if (!$this->getSource()) {
         return $this->modx->toJSON(array());
     }
     if (!$this->source->checkPolicy('list')) {
         return $this->modx->toJSON(array());
     }
     $this->source->setRequestProperties($this->getProperties());
     $this->source->initialize();
     $list = $this->source->getContainerList($this->getProperty('dir'));
     foreach ($list as $file) {
         if ('.' != $file && '..' != $file && '.DS_Store' != $file && '.htaccess' != $file && is_dir($storeFolder . $file) != true) {
             //If there is no file in TV, it was uploaded another way. Let it be in the end of the list.
             $obj['index'] = '9999';
             foreach ($nowTVarray as $key => $value) {
                 if ($key == $file['text']) {
                     $obj['index'] = $value['index'];
                 }
             }
             //Define picture size
             $path_info = pathinfo($file['url']);
             $extension = strtolower($path_info['extension']);
             if ($extension == 'jpg' || $extension == 'png' || $extension == 'gif' || $extension == 'jpeg') {
                 list($width, $height, $type, $attr) = getimagesize($file['path']);
                 $obj['width'] = $width;
                 $obj['height'] = $height;
             }
             $obj['name'] = $file['text'];
             $obj['url'] = $file['url'];
             $obj['obj'] = $file;
             $obj['ext'] = $path_info['extension'];
             $obj['size'] = filesize($file['path']);
             $result[] = $obj;
         }
     }
     foreach ($result as $key => $row) {
         $index[$key] = $row['index'];
         $name[$key] = $row['name'];
     }
     array_multisort($index, SORT_ASC, $name, SORT_ASC, $result);
     return $this->modx->toJSON($result);
 }
开发者ID:neonoviy,项目名称:CET_AssetsTV,代码行数:48,代码来源:getlist.class.php

示例9: process

 public function process()
 {
     if (!$this->getSource()) {
         return $this->failure($this->modx->lexicon('permission_denied'));
     }
     $this->source->setRequestProperties($this->getProperties());
     $this->source->initialize();
     $success = $this->source->createContainer($this->getProperty('name'), $this->getProperty('parent'));
     if (empty($success)) {
         $msg = '';
         $errors = $this->source->getErrors();
         foreach ($errors as $k => $msg) {
             $this->modx->error->addField($k, $msg);
         }
         return $this->failure($msg);
     }
     return $this->success();
 }
开发者ID:rosstimson,项目名称:revolution,代码行数:18,代码来源:create.class.php

示例10: process

 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);
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:18,代码来源:getfiles.class.php


注:本文中的modMediaSource::setRequestProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。