diff --git a/lib/User/resources/views/admin/_account.php b/lib/User/resources/views/admin/_account.php index af4dcef..a6a4178 100644 --- a/lib/User/resources/views/admin/_account.php +++ b/lib/User/resources/views/admin/_account.php @@ -1,36 +1,28 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - use yii\bootstrap\ActiveForm; use yii\helpers\Html; -/* +/** * @var yii\web\View $this - * @var dektrium\user\models\User $user + * @var \Da\User\Model\User $user */ - ?> -beginContent('@dektrium/user/views/admin/update.php', ['user' => $user]) ?> +beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?> - 'horizontal', - 'enableAjaxValidation' => true, - 'enableClientValidation' => false, - 'fieldConfig' => [ - 'horizontalCssClasses' => [ - 'wrapper' => 'col-sm-9', + 'horizontal', + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'fieldConfig' => [ + 'horizontalCssClasses' => [ + 'wrapper' => 'col-sm-9', + ], ], - ], -]); ?> + ] +); ?> render('_user', ['form' => $form, 'user' => $user]) ?> diff --git a/lib/User/resources/views/admin/_assignments.php b/lib/User/resources/views/admin/_assignments.php index 50f93ba..08b777d 100644 --- a/lib/User/resources/views/admin/_assignments.php +++ b/lib/User/resources/views/admin/_assignments.php @@ -1,31 +1,24 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - use dektrium\rbac\widgets\Assignments; /** - * @var yii\web\View $this - * @var dektrium\user\models\User $user + * @var yii\web\View $this + * @var \Da\User\Model\User $user */ ?> -beginContent('@dektrium/user/views/admin/update.php', ['user' => $user]) ?> +beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?> - [ - 'class' => 'alert-info alert-dismissible', - ], - 'body' => Yii::t('user', 'You can assign multiple roles or permissions to user by using the form below'), -]) ?> + [ + 'class' => 'alert-info alert-dismissible', + ], + 'body' => Yii::t('user', 'You can assign multiple roles or permissions to user by using the form below'), + ] +) ?> $user->id]) ?> diff --git a/lib/User/resources/views/admin/_info.php b/lib/User/resources/views/admin/_info.php index 03345a6..c2a5e0d 100644 --- a/lib/User/resources/views/admin/_info.php +++ b/lib/User/resources/views/admin/_info.php @@ -1,21 +1,12 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - /** - * @var yii\web\View - * @var dektrium\user\models\User + * @var yii\web\View $this + * @var \Da\User\Model\User $user */ ?> -beginContent('@dektrium/user/views/admin/update.php', ['user' => $user]) ?> +beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?> @@ -32,10 +23,10 @@ isConfirmed): ?> + 'user', + 'Confirmed at {0, date, MMMM dd, YYYY HH:mm}', + [$user->confirmed_at] + ) ?> @@ -44,10 +35,10 @@ isBlocked): ?> diff --git a/lib/User/resources/views/admin/_menu.php b/lib/User/resources/views/admin/_menu.php index efe0bf0..d837955 100644 --- a/lib/User/resources/views/admin/_menu.php +++ b/lib/User/resources/views/admin/_menu.php @@ -1,56 +1,49 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - use yii\bootstrap\Nav; ?> - [ - 'class' => 'nav-tabs', - 'style' => 'margin-bottom: 15px', - ], - 'items' => [ - [ - 'label' => Yii::t('user', 'Users'), - 'url' => ['/user/admin/index'], + [ + 'class' => 'nav-tabs', + 'style' => 'margin-bottom: 15px', ], - [ - 'label' => Yii::t('user', 'Roles'), - 'url' => ['/rbac/role/index'], - 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), - ], - [ - 'label' => Yii::t('user', 'Permissions'), - 'url' => ['/rbac/permission/index'], - 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), - ], - [ - 'label' => Yii::t('user', 'Create'), - 'items' => [ - [ - 'label' => Yii::t('user', 'New user'), - 'url' => ['/user/admin/create'], - ], - [ - 'label' => Yii::t('user', 'New role'), - 'url' => ['/rbac/role/create'], - 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), - ], - [ - 'label' => Yii::t('user', 'New permission'), - 'url' => ['/rbac/permission/create'], - 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), + 'items' => [ + [ + 'label' => Yii::t('user', 'Users'), + 'url' => ['/user/admin/index'], + ], + [ + 'label' => Yii::t('user', 'Roles'), + 'url' => ['/rbac/role/index'], + 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), + ], + [ + 'label' => Yii::t('user', 'Permissions'), + 'url' => ['/rbac/permission/index'], + 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), + ], + [ + 'label' => Yii::t('user', 'Create'), + 'items' => [ + [ + 'label' => Yii::t('user', 'New user'), + 'url' => ['/user/admin/create'], + ], + [ + 'label' => Yii::t('user', 'New role'), + 'url' => ['/rbac/role/create'], + 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), + ], + [ + 'label' => Yii::t('user', 'New permission'), + 'url' => ['/rbac/permission/create'], + 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), + ], ], ], ], - ], -]) ?> + ] +) ?> diff --git a/lib/User/resources/views/admin/_profile.php b/lib/User/resources/views/admin/_profile.php index b19012c..6faea30 100644 --- a/lib/User/resources/views/admin/_profile.php +++ b/lib/User/resources/views/admin/_profile.php @@ -1,37 +1,30 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - use yii\bootstrap\ActiveForm; use yii\helpers\Html; /** - * @var yii\web\View $this - * @var dektrium\user\models\User $user - * @var dektrium\user\models\Profile $profile + * @var yii\web\View $this + * @var \Da\User\Model\User $user + * @var \Da\User\Model\Profile $profile */ ?> -beginContent('@dektrium/user/views/admin/update.php', ['user' => $user]) ?> +beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?> - 'horizontal', - 'enableAjaxValidation' => true, - 'enableClientValidation' => false, - 'fieldConfig' => [ - 'horizontalCssClasses' => [ - 'wrapper' => 'col-sm-9', + 'horizontal', + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'fieldConfig' => [ + 'horizontalCssClasses' => [ + 'wrapper' => 'col-sm-9', + ], ], - ], -]); ?> + ] +); ?> field($profile, 'name') ?> field($profile, 'public_email') ?> diff --git a/lib/User/resources/views/admin/_user.php b/lib/User/resources/views/admin/_user.php index 757b50b..fc52dc7 100644 --- a/lib/User/resources/views/admin/_user.php +++ b/lib/User/resources/views/admin/_user.php @@ -1,17 +1,7 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - /** - * @var yii\widgets\ActiveForm $form - * @var dektrium\user\models\User $user + * @var yii\widgets\ActiveForm $form + * @var \Da\User\Model\User $user */ ?> diff --git a/lib/User/resources/views/admin/create.php b/lib/User/resources/views/admin/create.php index 57036d4..62ee260 100644 --- a/lib/User/resources/views/admin/create.php +++ b/lib/User/resources/views/admin/create.php @@ -1,21 +1,12 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - use yii\bootstrap\ActiveForm; use yii\bootstrap\Nav; use yii\helpers\Html; /** - * @var yii\web\View $this - * @var dektrium\user\models\User $user + * @var yii\web\View $this + * @var \Da\User\Model\User $user */ $this->title = Yii::t('user', 'Create a user account'); @@ -24,9 +15,12 @@ $this->params['breadcrumbs'][] = $this->title; ?> -render('/_alert', [ - 'module' => Yii::$app->getModule('user'), -]) ?> +render( + '/_alert', + [ + 'module' => Yii::$app->getModule('user'), + ] +) ?> render('_menu') ?> @@ -34,22 +28,30 @@ $this->params['breadcrumbs'][] = $this->title;
- [ - 'class' => 'nav-pills nav-stacked', - ], - 'items' => [ - ['label' => Yii::t('user', 'Account details'), 'url' => ['/user/admin/create']], - ['label' => Yii::t('user', 'Profile details'), 'options' => [ - 'class' => 'disabled', - 'onclick' => 'return false;', - ]], - ['label' => Yii::t('user', 'Information'), 'options' => [ - 'class' => 'disabled', - 'onclick' => 'return false;', - ]], - ], - ]) ?> + [ + 'class' => 'nav-pills nav-stacked', + ], + 'items' => [ + ['label' => Yii::t('user', 'Account details'), 'url' => ['/user/admin/create']], + [ + 'label' => Yii::t('user', 'Profile details'), + 'options' => [ + 'class' => 'disabled', + 'onclick' => 'return false;', + ] + ], + [ + 'label' => Yii::t('user', 'Information'), + 'options' => [ + 'class' => 'disabled', + 'onclick' => 'return false;', + ] + ], + ], + ] + ) ?>
@@ -60,16 +62,18 @@ $this->params['breadcrumbs'][] = $this->title; . . - 'horizontal', - 'enableAjaxValidation' => true, - 'enableClientValidation' => false, - 'fieldConfig' => [ - 'horizontalCssClasses' => [ - 'wrapper' => 'col-sm-9', + 'horizontal', + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'fieldConfig' => [ + 'horizontalCssClasses' => [ + 'wrapper' => 'col-sm-9', + ], ], - ], - ]); ?> + ] + ); ?> render('_user', ['form' => $form, 'user' => $user]) ?> diff --git a/lib/User/resources/views/admin/index.php b/lib/User/resources/views/admin/index.php index 1a730b8..bf2a2e4 100644 --- a/lib/User/resources/views/admin/index.php +++ b/lib/User/resources/views/admin/index.php @@ -1,15 +1,6 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - -use dektrium\user\models\UserSearch; +use Da\User\Search\UserSearch; use yii\data\ActiveDataProvider; use yii\grid\GridView; use yii\helpers\Html; @@ -26,82 +17,99 @@ $this->title = Yii::t('user', 'Manage users'); $this->params['breadcrumbs'][] = $this->title; ?> -render('/_alert', [ - 'module' => Yii::$app->getModule('user'), -]) ?> +render( + '/_alert', + [ + 'module' => Yii::$app->getModule('user'), + ] +) ?> render('/admin/_menu') ?> - $dataProvider, - 'filterModel' => $searchModel, - 'layout' => "{items}\n{pager}", - 'columns' => [ - 'username', - 'email:email', - [ - 'attribute' => 'registration_ip', - 'value' => function ($model) { - return $model->registration_ip == null - ? '' . Yii::t('user', '(not set)') . '' - : $model->registration_ip; - }, - 'format' => 'html', - ], - [ - 'attribute' => 'created_at', - 'value' => function ($model) { - if (extension_loaded('intl')) { - return Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$model->created_at]); - } else { - return date('Y-m-d G:i:s', $model->created_at); - } - }, - ], - [ - 'header' => Yii::t('user', 'Confirmation'), - 'value' => function ($model) { - if ($model->isConfirmed) { - return '
+ $dataProvider, + 'filterModel' => $searchModel, + 'layout' => "{items}\n{pager}", + 'columns' => [ + 'username', + 'email:email', + [ + 'attribute' => 'registration_ip', + 'value' => function ($model) { + return $model->registration_ip == null + ? '' . Yii::t('user', '(not set)') . '' + : $model->registration_ip; + }, + 'format' => 'html', + ], + [ + 'attribute' => 'created_at', + 'value' => function ($model) { + if (extension_loaded('intl')) { + return Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$model->created_at]); + } else { + return date('Y-m-d G:i:s', $model->created_at); + } + }, + ], + [ + 'header' => Yii::t('user', 'Confirmation'), + 'value' => function ($model) { + if ($model->isConfirmed) { + return '
' . Yii::t('user', 'Confirmed') . '
'; - } else { - return Html::a(Yii::t('user', 'Confirm'), ['confirm', 'id' => $model->id], [ - 'class' => 'btn btn-xs btn-success btn-block', - 'data-method' => 'post', - 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'), - ]); - } - }, - 'format' => 'raw', - 'visible' => Yii::$app->getModule('user')->enableConfirmation, + } else { + return Html::a( + Yii::t('user', 'Confirm'), + ['confirm', 'id' => $model->id], + [ + 'class' => 'btn btn-xs btn-success btn-block', + 'data-method' => 'post', + 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'), + ] + ); + } + }, + 'format' => 'raw', + 'visible' => Yii::$app->getModule('user')->enableConfirmation, + ], + [ + 'header' => Yii::t('user', 'Block status'), + 'value' => function ($model) { + if ($model->isBlocked) { + return Html::a( + Yii::t('user', 'Unblock'), + ['block', 'id' => $model->id], + [ + 'class' => 'btn btn-xs btn-success btn-block', + 'data-method' => 'post', + 'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'), + ] + ); + } else { + return Html::a( + Yii::t('user', 'Block'), + ['block', 'id' => $model->id], + [ + 'class' => 'btn btn-xs btn-danger btn-block', + 'data-method' => 'post', + 'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'), + ] + ); + } + }, + 'format' => 'raw', + ], + [ + 'class' => 'yii\grid\ActionColumn', + 'template' => '{update} {delete}', + ], ], - [ - 'header' => Yii::t('user', 'Block status'), - 'value' => function ($model) { - if ($model->isBlocked) { - return Html::a(Yii::t('user', 'Unblock'), ['block', 'id' => $model->id], [ - 'class' => 'btn btn-xs btn-success btn-block', - 'data-method' => 'post', - 'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'), - ]); - } else { - return Html::a(Yii::t('user', 'Block'), ['block', 'id' => $model->id], [ - 'class' => 'btn btn-xs btn-danger btn-block', - 'data-method' => 'post', - 'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'), - ]); - } - }, - 'format' => 'raw', - ], - [ - 'class' => 'yii\grid\ActionColumn', - 'template' => '{update} {delete}', - ], - ], -]); ?> + ] +); ?> diff --git a/lib/User/resources/views/admin/update.php b/lib/User/resources/views/admin/update.php index 7fb4606..9737309 100644 --- a/lib/User/resources/views/admin/update.php +++ b/lib/User/resources/views/admin/update.php @@ -1,22 +1,13 @@ - * - * For the full copyright and license information, please view the LICENSE.md - * file that was distributed with this source code. - */ - -use dektrium\user\models\User; +use Da\User\Model\User; use yii\bootstrap\Nav; use yii\web\View; /** - * @var View $this - * @var User $user - * @var string $content + * @var View $this + * @var User $user + * @var string $content */ $this->title = Yii::t('user', 'Update user account'); @@ -25,9 +16,12 @@ $this->params['breadcrumbs'][] = $this->title; ?> -render('/_alert', [ - 'module' => Yii::$app->getModule('user'), -]) ?> +render( + '/_alert', + [ + 'module' => Yii::$app->getModule('user'), + ] +) ?> render('_menu') ?> @@ -35,67 +29,71 @@ $this->params['breadcrumbs'][] = $this->title;
- [ - 'class' => 'nav-pills nav-stacked', - ], - 'items' => [ - [ - 'label' => Yii::t('user', 'Account details'), - 'url' => ['/user/admin/update', 'id' => $user->id] + [ + 'class' => 'nav-pills nav-stacked', ], - [ - 'label' => Yii::t('user', 'Profile details'), - 'url' => ['/user/admin/update-profile', 'id' => $user->id] - ], - ['label' => Yii::t('user', 'Information'), 'url' => ['/user/admin/info', 'id' => $user->id]], - [ - 'label' => Yii::t('user', 'Assignments'), - 'url' => ['/user/admin/assignments', 'id' => $user->id], - 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']), - ], - '
', - [ - 'label' => Yii::t('user', 'Confirm'), - 'url' => ['/user/admin/confirm', 'id' => $user->id], - 'visible' => !$user->isConfirmed, - 'linkOptions' => [ - 'class' => 'text-success', - 'data-method' => 'post', - 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'), + 'items' => [ + [ + 'label' => Yii::t('user', 'Account details'), + 'url' => ['/user/admin/update', 'id' => $user->id] + ], + [ + 'label' => Yii::t('user', 'Profile details'), + 'url' => ['/user/admin/update-profile', 'id' => $user->id] + ], + [ + 'label' => Yii::t('user', 'Information'), + 'url' => ['/user/admin/info', 'id' => $user->id] + ], + [ + 'label' => Yii::t('user', 'Assignments'), + 'url' => ['/user/admin/assignments', 'id' => $user->id], + ], + '
', + [ + 'label' => Yii::t('user', 'Confirm'), + 'url' => ['/user/admin/confirm', 'id' => $user->id], + 'visible' => !$user->isConfirmed, + 'linkOptions' => [ + 'class' => 'text-success', + 'data-method' => 'post', + 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'), + ], + ], + [ + 'label' => Yii::t('user', 'Block'), + 'url' => ['/user/admin/block', 'id' => $user->id], + 'visible' => !$user->isBlocked, + 'linkOptions' => [ + 'class' => 'text-danger', + 'data-method' => 'post', + 'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'), + ], + ], + [ + 'label' => Yii::t('user', 'Unblock'), + 'url' => ['/user/admin/block', 'id' => $user->id], + 'visible' => $user->isBlocked, + 'linkOptions' => [ + 'class' => 'text-success', + 'data-method' => 'post', + 'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'), + ], + ], + [ + 'label' => Yii::t('user', 'Delete'), + 'url' => ['/user/admin/delete', 'id' => $user->id], + 'linkOptions' => [ + 'class' => 'text-danger', + 'data-method' => 'post', + 'data-confirm' => Yii::t('user', 'Are you sure you want to delete this user?'), + ], ], ], - [ - 'label' => Yii::t('user', 'Block'), - 'url' => ['/user/admin/block', 'id' => $user->id], - 'visible' => !$user->isBlocked, - 'linkOptions' => [ - 'class' => 'text-danger', - 'data-method' => 'post', - 'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'), - ], - ], - [ - 'label' => Yii::t('user', 'Unblock'), - 'url' => ['/user/admin/block', 'id' => $user->id], - 'visible' => $user->isBlocked, - 'linkOptions' => [ - 'class' => 'text-success', - 'data-method' => 'post', - 'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'), - ], - ], - [ - 'label' => Yii::t('user', 'Delete'), - 'url' => ['/user/admin/delete', 'id' => $user->id], - 'linkOptions' => [ - 'class' => 'text-danger', - 'data-method' => 'post', - 'data-confirm' => Yii::t('user', 'Are you sure you want to delete this user?'), - ], - ], - ], - ]) ?> + ] + ) ?>
: confirmed_at] - ) ?> : blocked_at] - ) ?> + 'user', + 'Blocked at {0, date, MMMM dd, YYYY HH:mm}', + [$user->blocked_at] + ) ?>