public function init() { $this->name = "Управление файлами хранилища"; $this->modelShowAttribute = "src"; $this->modelClassName = StorageFile::className(); parent::init(); }
/** * @return \yii\db\ActiveQuery */ public function getFiles() { return $this->hasMany(StorageFile::className(), ['id' => 'storage_file_id'])->via('cmsContentElementFiles'); }
/** * @return \yii\db\ActiveQuery */ public function getStorageFiles() { return $this->hasMany(StorageFile::className(), ['created_by' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getImage() { return $this->hasOne(StorageFile::className(), ['id' => 'image_id']); }
'style' => 'width: 100%; height: 800px;' ] ]); ?> <?php echo $form->fieldSetEnd(); ?> <?php echo $form->fieldSet(\Yii::t('skeeks/cms', 'File storage')); ?> <? $search = new \skeeks\cms\models\Search(\skeeks\cms\models\StorageFile::className()); $dataProvider = $search->getDataProvider(); $dataProvider->sort->defaultOrder = [ 'created_at' => SORT_DESC ]; ?> <?php echo \skeeks\cms\widgets\StorageFileManager::widget(['clientOptions' => ['completeUploadFile' => new \yii\web\JsExpression(<<<JS function(data) { _.delay(function() { \$.pjax.reload('#sx-storage-files', {}); }, 500)