update.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 yii\bootstrap4\Nav;
  11. /**
  12. * @var \yii\web\View $this
  13. * @var \dektrium\user\models\User $user
  14. * @var string $content
  15. */
  16. $this->title = Yii::t('user', 'Update user account');
  17. $this->params['breadcrumbs'][] = ['label' => Yii::t('user', 'Users'), 'url' => ['index']];
  18. $this->params['breadcrumbs'][] = $this->title;
  19. ?>
  20. <?= $this->render('/_alert', ['module' => Yii::$app->getModule('user')]) ?>
  21. <?= $this->render('_menu') ?>
  22. <div class="row mt-3">
  23. <div class="col-md-3">
  24. <div class="panel panel-default">
  25. <div class="panel-body">
  26. <?= Nav::widget([
  27. 'options' => [
  28. 'class' => 'nav nav-pills flex-column',
  29. ],
  30. 'items' => [
  31. [
  32. 'label' => Yii::t('user', 'Account details'),
  33. 'url' => ['/user/admin/update', 'id' => $user->id]
  34. ],
  35. [
  36. 'label' => Yii::t('user', 'Profile details'),
  37. 'url' => ['/user/admin/update-profile', 'id' => $user->id]
  38. ],
  39. ['label' => Yii::t('user', 'Information'), 'url' => ['/user/admin/info', 'id' => $user->id]],
  40. [
  41. 'label' => Yii::t('user', 'Assignments'),
  42. 'url' => ['/user/admin/assignments', 'id' => $user->id],
  43. 'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
  44. ],
  45. '<hr>',
  46. [
  47. 'label' => Yii::t('user', 'Confirm'),
  48. 'url' => ['/user/admin/confirm', 'id' => $user->id],
  49. 'visible' => !$user->isConfirmed,
  50. 'linkOptions' => [
  51. 'class' => 'text-success',
  52. 'data-method' => 'post',
  53. 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'),
  54. ],
  55. ],
  56. [
  57. 'label' => Yii::t('user', 'Block'),
  58. 'url' => ['/user/admin/block', 'id' => $user->id],
  59. 'visible' => !$user->isBlocked,
  60. 'linkOptions' => [
  61. 'class' => 'text-danger',
  62. 'data-method' => 'post',
  63. 'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'),
  64. ],
  65. ],
  66. [
  67. 'label' => Yii::t('user', 'Unblock'),
  68. 'url' => ['/user/admin/block', 'id' => $user->id],
  69. 'visible' => $user->isBlocked,
  70. 'linkOptions' => [
  71. 'class' => 'text-success',
  72. 'data-method' => 'post',
  73. 'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'),
  74. ],
  75. ],
  76. [
  77. 'label' => Yii::t('user', 'Delete'),
  78. 'url' => ['/user/admin/delete', 'id' => $user->id],
  79. 'linkOptions' => [
  80. 'class' => 'text-danger',
  81. 'data-method' => 'post',
  82. 'data-confirm' => Yii::t('user', 'Are you sure you want to delete this user?'),
  83. ],
  84. ],
  85. ],
  86. ]) ?>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="col-md-9">
  91. <div class="panel panel-default">
  92. <div class="panel-body">
  93. <?= $content ?>
  94. </div>
  95. </div>
  96. </div>
  97. </div>