migration to change setting name

This commit is contained in:
Faeze Moradi 2020-10-20 15:31:49 +02:00
parent aff41cd523
commit bf6d0c996f
2 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,42 @@
<?php
use yii\db\Migration;
/**
* Class m201020_130431_fix_default_file_setting_value
*/
class m201020_130431_fix_default_file_setting_value extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->update('setting', ['name' => 'excludeMediaFilesPreview'], ['name' => 'hideImageFileInfo', 'module_id' => 'file']);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
echo "m201020_130431_fix_default_file_setting_value cannot be reverted.\n";
return false;
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m201020_130431_fix_default_file_setting_value cannot be reverted.\n";
return false;
}
*/
}

View File

@ -6,6 +6,13 @@ use Yii;
/**
* FileSettingsForm
* @property integer $maxFileSize
* @property integer $maxPreviewImageWidth
* @property integer $maxPreviewImageHeight
* @property integer $excludeMediaFilesPreview Exclude media files from stream attachment list
* @property integer $useXSendfile
* @property string $allowedExtensions
*
* @since 0.5
*/
class FileSettingsForm extends \yii\base\Model
@ -56,7 +63,7 @@ class FileSettingsForm extends \yii\base\Model
'useXSendfile' => Yii::t('AdminModule.settings', 'Use X-Sendfile for File Downloads'),
'maxPreviewImageWidth' => Yii::t('AdminModule.settings', 'Maximum preview image width (in pixels, optional)'),
'maxPreviewImageHeight' => Yii::t('AdminModule.settings', 'Maximum preview image height (in pixels, optional)'),
'excludeMediaFilesPreview' => Yii::t('AdminModule.settings', 'Exclude media files in stream attachment list'),
'excludeMediaFilesPreview' => Yii::t('AdminModule.settings', 'Exclude media files from stream attachment list'),
'allowedExtensions' => Yii::t('AdminModule.settings', 'Allowed file extensions'),
];
}