1. Documentation; 2. Actions access in AdminController and SettingController by enableSessionHistory; 3. Add "visible" menu parameter by enableSessionHistory; 4. Add blank line in end of file.
66 lines
2.1 KiB
PHP
Executable File
66 lines
2.1 KiB
PHP
Executable File
<?php
|
|
|
|
/*
|
|
* This file is part of the 2amigos/yii2-usuario project.
|
|
*
|
|
* (c) 2amigOS! <http://2amigos.us/>
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
use yii\helpers\Html;
|
|
use yii\widgets\Menu;
|
|
use Da\User\Module as UserModule;
|
|
use Da\User\Model\User;
|
|
|
|
/** @var User $user */
|
|
$user = Yii::$app->user->identity;
|
|
/** @var UserModule $module */
|
|
$module = Yii::$app->getModule('user');
|
|
$networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
|
|
|
|
?>
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">
|
|
<?= Html::img(
|
|
$user->profile->getAvatarUrl(24),
|
|
[
|
|
'class' => 'img-rounded',
|
|
'alt' => $user->username,
|
|
]
|
|
) ?>
|
|
<?= $user->username ?>
|
|
</h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
<?= Menu::widget(
|
|
[
|
|
'options' => [
|
|
'class' => 'nav nav-pills nav-stacked',
|
|
],
|
|
'items' => [
|
|
['label' => Yii::t('usuario', 'Profile'), 'url' => ['/user/settings/profile']],
|
|
['label' => Yii::t('usuario', 'Account'), 'url' => ['/user/settings/account']],
|
|
[
|
|
'label' => Yii::t('usuario', 'Session history'),
|
|
'url' => ['/user/settings/session-history'],
|
|
'visible' => $module->enableSessionHistory,
|
|
],
|
|
['label' => Yii::t('usuario', 'Privacy'),
|
|
'url' => ['/user/settings/privacy'],
|
|
'visible' => $module->enableGdprCompliance
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Networks'),
|
|
'url' => ['/user/settings/networks'],
|
|
'visible' => $networksVisible,
|
|
],
|
|
],
|
|
]
|
|
) ?>
|
|
</div>
|
|
</div>
|