Commit 83c3e54afc36ff65212d908fc006acd4db026203

Authored by Yarik
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 10 use artbox\core\models\UserData;
11 11 use artbox\core\widgets\FeedbackWidget;
12 12 use artbox\core\widgets\FlashWidget;
  13 + use noam148\imagemanager\components\ImageManagerGetPath;
13 14 use yii\bootstrap\Html;
14 15 use yii\web\UrlManager;
15 16 use yii\web\View;
... ... @@ -26,6 +27,11 @@
26 27 * @var UserData $userData
27 28 */
28 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 36 <?php $this->beginPage(); ?>
31 37 <!DOCTYPE html>
... ... @@ -72,7 +78,7 @@
72 78 <?php
73 79 echo Html::a(
74 80 Html::img(
75   - 'http://placehold.it/128x128',
  81 + ( empty( $avatar ) ? 'http://placehold.it/128x128' : $avatar ),
76 82 [
77 83 'alt' => $userData->fullname,
78 84 'title' => \Yii::t('core', 'Change image'),
... ... @@ -171,7 +177,12 @@
171 177 <ul class="nav navbar-nav navbar-right">
172 178 <li class="">
173 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 186 <span class=" fa fa-angle-down"></span>
176 187 </a>
177 188 <ul class="dropdown-menu dropdown-usermenu pull-right">
... ...
composer.json
... ... @@ -18,8 +18,6 @@
18 18 "minimum-stability": "stable",
19 19 "require": {
20 20 "php": ">=7.0",
21   - "artweb/artbox-core": "@dev",
22   - "artweb/artbox-gentelella": "@dev",
23 21 "yiisoft/yii2": "~2.0",
24 22 "yiisoft/yii2-bootstrap": "~2.0",
25 23 "yiisoft/yii2-swiftmailer": "~2.0",
... ... @@ -28,7 +26,8 @@
28 26 "yii2tech/filedb": "~1.0",
29 27 "hiqdev/yii2-asset-pnotify": "~2.0",
30 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 32 "require-dev": {
34 33 "yiisoft/yii2-debug": "~2.0.0",
... ... @@ -46,6 +45,12 @@
46 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 54 "repositories": [
50 55 {
51 56 "type": "vcs",
... ...