update.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /*
  3. * This file is part of the Dektrium project.
  4. *
  5. * (c) Dektrium project <http://github.com/dektrium>
  6. *
  7. * For the full copyright and license information, please view the LICENSE.md
  8. * file that was distributed with this source code.
  9. */
  10. use dektrium\user\models\User;
  11. use yii\bootstrap\Nav;
  12. use yii\web\View;
  13. /**
  14. * @var View $this
  15. * @var User $user
  16. * @var string $content
  17. */
  18. $this->title = Yii::t('user', 'Update user account');
  19. $this->params['breadcrumbs'][] = ['label' => Yii::t('user', 'Users'), 'url' => ['index']];
  20. $this->params['breadcrumbs'][] = $this->title;
  21. ?>
  22. <?= $this->render('/_alert', [
  23. 'module' => Yii::$app->getModule('user'),
  24. ]) ?>
  25. <?= $this->render('_menu') ?>
  26. <div class="row">
  27. <div class="col-md-3">
  28. <div class="panel panel-default">
  29. <div class="panel-body">
  30. <?= Nav::widget([
  31. 'options' => [
  32. 'class' => 'nav-pills nav-stacked',
  33. ],
  34. 'items' => [
  35. ['label' => Yii::t('user', 'Account details'), 'url' => ['/user/admin/update', 'id' => $user->id]],
  36. ['label' => Yii::t('user', 'Profile details'), 'url' => ['/user/admin/update-profile', 'id' => $user->id]],
  37. // ['label' => Yii::t('user', 'Information'), 'url' => ['/user/admin/info', 'id' => $user->id]],
  38. [
  39. 'label' => Yii::t('user', 'Assignments'),
  40. 'url' => ['/user/admin/assignments', 'id' => $user->id],
  41. 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
  42. ],
  43. '<hr>',
  44. [
  45. 'label' => Yii::t('user', 'Confirm'),
  46. 'url' => ['/user/admin/confirm', 'id' => $user->id],
  47. 'visible' => !$user->isConfirmed,
  48. 'linkOptions' => [
  49. 'class' => 'text-success',
  50. 'data-method' => 'post',
  51. 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'),
  52. ],
  53. ],
  54. [
  55. 'label' => Yii::t('user', 'Block'),
  56. 'url' => ['/user/admin/block', 'id' => $user->id],
  57. 'visible' => !$user->isBlocked,
  58. 'linkOptions' => [
  59. 'class' => 'text-danger',
  60. 'data-method' => 'post',
  61. 'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'),
  62. ],
  63. ],
  64. [
  65. 'label' => Yii::t('user', 'Unblock'),
  66. 'url' => ['/user/admin/block', 'id' => $user->id],
  67. 'visible' => $user->isBlocked,
  68. 'linkOptions' => [
  69. 'class' => 'text-success',
  70. 'data-method' => 'post',
  71. 'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'),
  72. ],
  73. ],
  74. [
  75. 'label' => Yii::t('user', 'Delete'),
  76. 'url' => ['/user/admin/delete', 'id' => $user->id],
  77. 'linkOptions' => [
  78. 'class' => 'text-danger',
  79. 'data-method' => 'post',
  80. 'data-confirm' => Yii::t('user', 'Are you sure you want to delete this user?'),
  81. ],
  82. ],
  83. ],
  84. ]) ?>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="col-md-9">
  89. <div class="panel panel-default">
  90. <div class="panel-body">
  91. <?= $content ?>
  92. </div>
  93. </div>
  94. </div>
  95. </div>