diff --git a/behaviors/SortableController.php b/behaviors/SortableController.php index a9cea11..ede6519 100644 --- a/behaviors/SortableController.php +++ b/behaviors/SortableController.php @@ -15,7 +15,7 @@ public function move($id, $direction, $condition = []) if($direction === 'up'){ $eq = '>'; $orderDir = 'ASC'; - } else{ + } else { $eq = '<'; $orderDir = 'DESC'; } diff --git a/controllers/InstallController.php b/controllers/InstallController.php index 4d2a949..cdc2429 100644 --- a/controllers/InstallController.php +++ b/controllers/InstallController.php @@ -2,6 +2,7 @@ namespace yii\easyii\controllers; use Yii; +use yii\easyii\helpers\Data; use yii\web\ServerErrorHttpException; use yii\easyii\helpers\WebConsole; @@ -185,7 +186,7 @@ private function insertSettings($installForm) private function installModules() { - $language = substr(Yii::$app->language, 0, 2); + $language = Data::getLocale(); foreach(glob(Yii::getAlias('@easyii'). DIRECTORY_SEPARATOR .'modules/*') as $module) { diff --git a/controllers/ModulesController.php b/controllers/ModulesController.php index 4545a45..05d8381 100644 --- a/controllers/ModulesController.php +++ b/controllers/ModulesController.php @@ -260,7 +260,7 @@ public function actionDelete($id) { if(($model = Module::findOne($id))){ $model->delete(); - } else{ + } else { $this->error = Yii::t('easyii', 'Not found'); } return $this->formatResponse(Yii::t('easyii', 'Module deleted')); diff --git a/controllers/SettingsController.php b/controllers/SettingsController.php index 0b3ff7d..4faf0ed 100644 --- a/controllers/SettingsController.php +++ b/controllers/SettingsController.php @@ -84,7 +84,7 @@ public function actionDelete($id) { if(($model = Setting::findOne($id))){ $model->delete(); - } else{ + } else { $this->error = Yii::t('easyii', 'Not found'); } return $this->formatResponse(Yii::t('easyii', 'Setting deleted'));