Commit 83c3e54afc36ff65212d908fc006acd4db026203
1 parent
7309bdd7
Language
Showing
2 changed files
with
21 additions
and
5 deletions
Show diff stats
backend/views/layouts/main.php
@@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
10 | use artbox\core\models\UserData; | 10 | use artbox\core\models\UserData; |
11 | use artbox\core\widgets\FeedbackWidget; | 11 | use artbox\core\widgets\FeedbackWidget; |
12 | use artbox\core\widgets\FlashWidget; | 12 | use artbox\core\widgets\FlashWidget; |
13 | + use noam148\imagemanager\components\ImageManagerGetPath; | ||
13 | use yii\bootstrap\Html; | 14 | use yii\bootstrap\Html; |
14 | use yii\web\UrlManager; | 15 | use yii\web\UrlManager; |
15 | use yii\web\View; | 16 | use yii\web\View; |
@@ -26,6 +27,11 @@ | @@ -26,6 +27,11 @@ | ||
26 | * @var UserData $userData | 27 | * @var UserData $userData |
27 | */ | 28 | */ |
28 | $userData = $user->ensureExistance(); | 29 | $userData = $user->ensureExistance(); |
30 | + /** | ||
31 | + * @var ImageManagerGetPath $imageManager | ||
32 | + */ | ||
33 | + $imageManager = \Yii::$app->get('imagemanager'); | ||
34 | + $avatar = $imageManager->getImagePath($userData->image, 128, 128); | ||
29 | ?> | 35 | ?> |
30 | <?php $this->beginPage(); ?> | 36 | <?php $this->beginPage(); ?> |
31 | <!DOCTYPE html> | 37 | <!DOCTYPE html> |
@@ -72,7 +78,7 @@ | @@ -72,7 +78,7 @@ | ||
72 | <?php | 78 | <?php |
73 | echo Html::a( | 79 | echo Html::a( |
74 | Html::img( | 80 | Html::img( |
75 | - 'http://placehold.it/128x128', | 81 | + ( empty( $avatar ) ? 'http://placehold.it/128x128' : $avatar ), |
76 | [ | 82 | [ |
77 | 'alt' => $userData->fullname, | 83 | 'alt' => $userData->fullname, |
78 | 'title' => \Yii::t('core', 'Change image'), | 84 | 'title' => \Yii::t('core', 'Change image'), |
@@ -171,7 +177,12 @@ | @@ -171,7 +177,12 @@ | ||
171 | <ul class="nav navbar-nav navbar-right"> | 177 | <ul class="nav navbar-nav navbar-right"> |
172 | <li class=""> | 178 | <li class=""> |
173 | <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> | 179 | <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
174 | - <img src="http://placehold.it/128x128" alt=""><?= $user->username ?> | 180 | + <?php |
181 | + echo Html::img( | ||
182 | + ( empty( $avatar ) ? 'http://placehold.it/128x128' : $avatar ) | ||
183 | + ); | ||
184 | + echo $user->username; | ||
185 | + ?> | ||
175 | <span class=" fa fa-angle-down"></span> | 186 | <span class=" fa fa-angle-down"></span> |
176 | </a> | 187 | </a> |
177 | <ul class="dropdown-menu dropdown-usermenu pull-right"> | 188 | <ul class="dropdown-menu dropdown-usermenu pull-right"> |
composer.json
@@ -18,8 +18,6 @@ | @@ -18,8 +18,6 @@ | ||
18 | "minimum-stability": "stable", | 18 | "minimum-stability": "stable", |
19 | "require": { | 19 | "require": { |
20 | "php": ">=7.0", | 20 | "php": ">=7.0", |
21 | - "artweb/artbox-core": "@dev", | ||
22 | - "artweb/artbox-gentelella": "@dev", | ||
23 | "yiisoft/yii2": "~2.0", | 21 | "yiisoft/yii2": "~2.0", |
24 | "yiisoft/yii2-bootstrap": "~2.0", | 22 | "yiisoft/yii2-bootstrap": "~2.0", |
25 | "yiisoft/yii2-swiftmailer": "~2.0", | 23 | "yiisoft/yii2-swiftmailer": "~2.0", |
@@ -28,7 +26,8 @@ | @@ -28,7 +26,8 @@ | ||
28 | "yii2tech/filedb": "~1.0", | 26 | "yii2tech/filedb": "~1.0", |
29 | "hiqdev/yii2-asset-pnotify": "~2.0", | 27 | "hiqdev/yii2-asset-pnotify": "~2.0", |
30 | "hiqdev/yii2-asset-icheck": "~1.0", | 28 | "hiqdev/yii2-asset-icheck": "~1.0", |
31 | - "google/apiclient": "^2.0" | 29 | + "google/apiclient": "^2.0", |
30 | + "2amigos/yii2-highcharts-widget": "~1.0" | ||
32 | }, | 31 | }, |
33 | "require-dev": { | 32 | "require-dev": { |
34 | "yiisoft/yii2-debug": "~2.0.0", | 33 | "yiisoft/yii2-debug": "~2.0.0", |
@@ -46,6 +45,12 @@ | @@ -46,6 +45,12 @@ | ||
46 | "bower-asset-library": "vendor/bower" | 45 | "bower-asset-library": "vendor/bower" |
47 | } | 46 | } |
48 | }, | 47 | }, |
48 | + "autoload": { | ||
49 | + "psr-4": { | ||
50 | + "artbox\\core\\": "artweb/artbox-core/", | ||
51 | + "artbox\\gentelella\\": "artweb/artbox-gentelella/" | ||
52 | + } | ||
53 | + }, | ||
49 | "repositories": [ | 54 | "repositories": [ |
50 | { | 55 | { |
51 | "type": "vcs", | 56 | "type": "vcs", |