/**
  * @inheritdoc
  */
 public function actions()
 {
     $module = Yii::$app->getModule('pages');
     $actions = [];
     // add images that have already been uploaded
     if ($module->addImage) {
         $actions['images-get'] = ['class' => ImperaviGetAction::className(), 'url' => Yii::getAlias($module->urlToImages), 'path' => Yii::getAlias($module->pathToImages), 'type' => ImperaviGetAction::TYPE_IMAGES];
     }
     // upload image
     if ($module->uploadImage) {
         $actions['image-upload'] = ['class' => ImperaviUploadAction::className(), 'url' => Yii::getAlias($module->urlToImages), 'path' => Yii::getAlias($module->pathToImages)];
     }
     // add files that have already been uploaded
     if ($module->addFile) {
         $actions['files-get'] = ['class' => ImperaviGetAction::className(), 'url' => Yii::getAlias($module->urlToFiles), 'path' => Yii::getAlias($module->pathToFiles), 'type' => ImperaviGetAction::TYPE_FILES];
     }
     // upload file
     if ($module->uploadFile) {
         $actions['file-upload'] = ['class' => ImperaviUploadAction::className(), 'url' => Yii::getAlias($module->urlToFiles), 'path' => Yii::getAlias($module->pathToFiles)];
     }
     return $actions;
 }
Beispiel #2
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['images-get' => ['class' => GetAction::className(), 'url' => '/uploads/redactor/', 'path' => '@webroot/uploads/redactor', 'type' => GetAction::TYPE_IMAGES, 'options' => ['basePath' => Yii::getAlias('@webroot/uploads/redactor'), 'except' => ['.gitkeep']]], 'image-upload' => ['class' => UploadAction::className(), 'url' => '/uploads/redactor/', 'path' => 'uploads/redactor']];
 }
 public function actions()
 {
     return ['upload-image' => ['class' => UploadAction::className(), 'url' => Yii::$app->request->baseUrl . '/article/', 'path' => Yii::$app->basePath . '/web/article/'], 'images-get' => ['class' => GetAction::className(), 'type' => GetAction::TYPE_IMAGES, 'url' => Yii::$app->request->baseUrl . '/article/', 'path' => Yii::$app->basePath . '/web/article/']];
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['images-get' => ['class' => GetAction::className(), 'url' => '/images/', 'path' => '@app/web/images', 'type' => GetAction::TYPE_IMAGES], 'files-get' => ['class' => GetAction::className(), 'url' => '/files/', 'path' => '@app/web/files', 'type' => GetAction::TYPE_FILES], 'image-upload' => ['class' => UploadAction::className(), 'url' => '/images/', 'path' => '@app/web/images'], 'file-upload' => ['class' => UploadAction::className(), 'url' => '/files/', 'path' => '@app/web/files']];
 }
Beispiel #5
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     $baseUrl = '/uploads/redactor/news/' . Yii::$app->user->id . '/';
     return ['image-upload' => ['class' => UploadAction::className(), 'url' => $baseUrl . 'images/', 'path' => '@frontend/web' . $baseUrl . 'images/'], 'images-get' => ['class' => GetAction::className(), 'url' => $baseUrl . 'images/', 'path' => '@frontend/web' . $baseUrl . 'images/', 'type' => GetAction::TYPE_IMAGES], 'files-get' => ['class' => GetAction::className(), 'url' => $baseUrl . 'files/', 'path' => '@frontend/web' . $baseUrl . 'files/', 'type' => GetAction::TYPE_FILES], 'file-upload' => ['class' => UploadAction::className(), 'url' => $baseUrl . 'files/', 'path' => '@frontend/web' . $baseUrl . 'files/', 'uploadOnlyImage' => false]];
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['error' => ['class' => 'yii\\web\\ErrorAction'], 'fileapi-upload' => ['class' => FileAPIUpload::className(), 'path' => '@storage/tmp'], 'images-get' => ['class' => GetAction::className(), 'url' => Yii::getAlias('@storageUrl/images'), 'path' => '@storage/images', 'type' => GetAction::TYPE_IMAGES], 'files-get' => ['class' => GetAction::className(), 'url' => Yii::getAlias('@storageUrl/files'), 'path' => '@storage/files', 'type' => GetAction::TYPE_FILES], 'image-upload' => ['class' => UploadAction::className(), 'url' => Yii::getAlias('@storageUrl/images/' . date('m.y')), 'path' => '@storage/images/' . date('m.y')], 'file-upload' => ['class' => UploadAction::className(), 'url' => Yii::getAlias('@storageUrl/files/' . date('m.y')), 'path' => '@storage/files/' . date('m.y'), 'uploadOnlyImage' => false]];
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['imperavi-get' => ['class' => ImperaviGet::className(), 'url' => $this->module->contentUrl . '/cafedra', 'path' => $this->module->contentPath . '/cafedra'], 'imperavi-image-upload' => ['class' => ImperaviUpload::className(), 'url' => $this->module->contentUrl . '/cafedra', 'path' => $this->module->contentPath . '/cafedra'], 'imperavi-file-upload' => ['class' => ImperaviUpload::className(), 'url' => $this->module->fileUrl . '/cafedra', 'path' => $this->module->filePath . '/cafedra', 'uploadOnlyImage' => false], 'fileapi-upload' => ['class' => FileAPIUpload::className(), 'path' => $this->module->imagesTempPath . '/cafedra']];
 }