public function init()
 {
     $this->name = "Управление файлами хранилища";
     $this->modelShowAttribute = "src";
     $this->modelClassName = StorageFile::className();
     parent::init();
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFiles()
 {
     return $this->hasMany(StorageFile::className(), ['id' => 'storage_file_id'])->via('cmsContentElementFiles');
 }
Example #3
0
File: User.php Project: Liv1020/cms
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStorageFiles()
 {
     return $this->hasMany(StorageFile::className(), ['created_by' => 'id']);
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getImage()
 {
     return $this->hasOne(StorageFile::className(), ['id' => 'image_id']);
 }
Example #5
0
                '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)