diff --git a/backend/controllers/UserController.php b/backend/controllers/UserController.php index b47b564..cc4e60b 100644 --- a/backend/controllers/UserController.php +++ b/backend/controllers/UserController.php @@ -37,7 +37,7 @@ class UserController extends Controller { return [ 'access' => [ - 'class' => AccessControl::className(), + 'class' => AccessControl::class, 'rules' => [ [ 'actions' => ['create','view','index', 'update', 'delete'], @@ -56,7 +56,7 @@ class UserController extends Controller ], ], 'verbs' => [ - 'class' => VerbFilter::className(), + 'class' => VerbFilter::class, 'actions' => [ 'delete' => ['POST'], ], @@ -162,6 +162,7 @@ class UserController extends Controller $form->user_pic = UploadedFile::getInstance($form, 'user_pic'); $this->profile_service->edit(Yii::$app->user->id, $form); Yii::$app->session->setFlash('success', Yii::t('user', 'Profile is saved.')); + return $this->redirect(['/user/profile']); } catch (\DomainException $e) { Yii::$app->errorHandler->logException($e); Yii::$app->session->setFlash('error', $e->getMessage()); diff --git a/backend/controllers/SettingsController.php b/backend/controllers/settings/ListController.php similarity index 93% rename from backend/controllers/SettingsController.php rename to backend/controllers/settings/ListController.php index 25b7b2b..da83f0f 100644 --- a/backend/controllers/SettingsController.php +++ b/backend/controllers/settings/ListController.php @@ -4,7 +4,7 @@ * Date: 04.06.2018 */ -namespace backend\controllers; +namespace backend\controllers\settings; use backend\forms\SettingsSearch; @@ -18,7 +18,7 @@ use backend\components\ToggleAction; use Yii; use yii\web\NotFoundHttpException; -class SettingsController extends Controller +class ListController extends Controller { private $service; @@ -31,13 +31,13 @@ class SettingsController extends Controller { return [ 'verbs' => [ - 'class' => VerbFilter::className(), + 'class' => VerbFilter::class, 'actions' => [ 'delete' => ['POST'], ], ], 'access' => [ - 'class' => AccessControl::className(), + 'class' => AccessControl::class, 'rules' => [ [ 'actions' => ['create','view','index', 'update', 'delete', 'toggle'], @@ -57,7 +57,7 @@ class SettingsController extends Controller { return [ 'toggle' => [ - 'class' => ToggleAction::className(), + 'class' => ToggleAction::class, 'modelClass' => Settings::class, //'setFlash' => true, ] diff --git a/backend/messages/ru/main.php b/backend/messages/ru/main.php index 70d7c09..d0ef37f 100644 --- a/backend/messages/ru/main.php +++ b/backend/messages/ru/main.php @@ -35,5 +35,7 @@ return [ 'Modules' => 'Модули', 'Find modules' => 'Поиск модулей', 'Enable' => 'Включить', - 'Disable' => 'Отключить' + 'Disable' => 'Отключить', + 'Settings List' => 'Все настройки', + 'Create Setting' => 'Новый параметр', ]; \ No newline at end of file diff --git a/backend/messages/ru/user.php b/backend/messages/ru/user.php index 7c9a5ed..6e19f35 100644 --- a/backend/messages/ru/user.php +++ b/backend/messages/ru/user.php @@ -38,4 +38,5 @@ return [ 'User Picture' => 'Аватар', 'Registered: {date}' => 'Дата регистрации: {date}', 'Remember Me' => 'Запомнить меня', + 'Dashboard Language' => 'Язык панели управления', ]; \ No newline at end of file diff --git a/backend/views/layouts/header.php b/backend/views/layouts/header.php index 58d56d7..10ab7af 100644 --- a/backend/views/layouts/header.php +++ b/backend/views/layouts/header.php @@ -193,6 +193,23 @@ use core\components\avatar_generator\AvatarGenerator; --> + + +