* @var mixed $settings */ $m = Yii::$app->getModule('user'); $url = [$m->actionSettings[Module::ACTION_ADMIN_INDEX]]; $this->title = Yii::t('user', 'Manage User') . ' (' . $model->username . ')'; $this->params['breadcrumbs'][] = ['label' => Yii::t('user', 'Manage Users'), 'url' => $url]; $this->params['breadcrumbs'][] = $model->username; $list = Html::a($m->icon('list'), $url, ['class' => 'kv-action-btn', 'data-toggle' => 'tooltip', 'title' => Yii::t('user', 'View users listing')]); $editSettings = $m->getEditSettingsAdmin($model); $getKey = function ($key) use($model) { $settings = ['attribute' => $key, 'displayOnly' => true, 'format' => 'raw', 'value' => $model->{$key} ? '<samp>' . $model->{$key} . '</samp>' : null]; return $settings; }; $statusHtml = $model->getStatusHtml(); $attribs1 = [['group' => true, 'label' => $m->icon('tag') . ' ' . Yii::t('user', 'Account Details'), 'rowOptions' => ['class' => 'info']], 'id', 'username', 'email:email', ['attribute' => 'status', 'format' => 'raw', 'value' => empty($model->status_sec) ? $statusHtml : $statusHtml . ' ' . $model->getStatusSecHtml()], ['attribute' => 'created_on', 'format' => ['datetime', $m->datetimeDispFormat], 'labelColOptions' => ['style' => 'width:40%;text-align:right']]]; $attribs2 = [['group' => true, 'label' => $m->icon('time') . ' ' . Yii::t('user', 'User Log Information'), 'rowOptions' => ['class' => 'info']], ['attribute' => 'updated_on', 'format' => ['datetime', $m->datetimeDispFormat]], ['attribute' => 'last_login_ip', 'format' => 'raw', 'value' => $model->last_login_ip ? '<samp>' . $model->last_login_ip . '</samp>' : null], ['attribute' => 'last_login_on', 'value' => Module::displayAttrTime($model, 'last_login_on'), 'format' => ['datetime', $m->datetimeDispFormat], 'labelColOptions' => ['style' => 'width:40%;text-align:right']], ['attribute' => 'password_reset_on', 'value' => Module::displayAttrTime($model, 'password_reset_on'), 'format' => ['datetime', $m->datetimeDispFormat]], 'password_fail_attempts']; $attribs3 = null; if ($m->checkSettings($editSettings, 'showHiddenInfo')) { $attribs3 = [['group' => true, 'label' => $m->icon('lock') . ' ' . Yii::t('user', 'Hidden Information'), 'rowOptions' => ['class' => 'info']], $getKey('password_hash'), $getKey('auth_key'), $getKey('email_change_key'), $getKey('reset_key'), $getKey('activation_key')]; } ?> <div class="page-header"> <div class="pull-right"><?php echo AdminMenu::widget(['ui' => 'manage', 'user' => $model]); ?> </div> <h1><?php echo $this->title; ?> </h1> </div>
echo AdminMenu::widget(['ui' => 'list', 'user' => null]); ?> </div> <h1><?php echo $this->title; ?> </h1> </div> <div id="batch-status-out"></div> <div style="width:200px;float:right;margin:-10px auto;"> <?php echo Select2::widget(['name' => 'batch-status', 'value' => '', 'data' => $m->getValidStatuses(), 'addon' => ['append' => ['content' => Html::button(Html::icon('saved'), ['class' => 'btn btn-default', 'id' => 'btn-batch-update', 'title' => Yii::t('user', 'Go!')]), 'asButton' => true]], 'options' => ['id' => 'batch-status', 'placeholder' => Yii::t('user', 'Batch update...')]]); ?> </div> <div class="clearfix"></div> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'panel' => false, 'export' => false, 'options' => ['id' => 'user-grid'], 'columns' => [['attribute' => 'id', 'width' => '80px'], ['attribute' => 'username', 'width' => '120px', 'format' => 'raw', 'content' => function ($model) { return $model->getUserLink(); }], 'email:email', ['attribute' => 'status', 'format' => 'raw', 'hAlign' => 'center', 'content' => function ($model) { return $model->getStatusHtml(); }, 'filter' => $m->getPrimaryStatuses(), 'width' => '140px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['options' => ['placeholder' => Yii::t('user', 'Select...')], 'pluginOptions' => ['allowClear' => true]]], ['attribute' => 'status_sec', 'format' => 'raw', 'hAlign' => 'center', 'content' => function ($model) { return $model->getStatusSecHtml(); }, 'filter' => $m->getSecondaryStatuses(), 'width' => '140px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['options' => ['placeholder' => Yii::t('user', 'Select...')], 'pluginOptions' => ['allowClear' => true]]], ['attribute' => 'last_login_ip', 'format' => 'raw', 'hAlign' => 'center', 'width' => '130px', 'value' => function ($model) { return $model->last_login_ip ? '<samp>' . $model->last_login_ip . '</samp>' : null; }], ['attribute' => 'last_login_on', 'format' => ['datetime', $m->datetimeDispFormat], 'hAlign' => 'center', 'filter' => false, 'mergeHeader' => true, 'value' => function ($model) { return Module::displayAttrTime($model, 'last_login_on'); }], ['attribute' => 'created_on', 'hAlign' => 'center', 'format' => 'date', 'label' => Yii::t('user', 'Member Since'), 'filter' => false, 'mergeHeader' => true], ['class' => 'kartik\\grid\\CheckboxColumn', 'checkboxOptions' => function ($model) { if ($model->status == Module::STATUS_SUPERUSER) { return ['disabled' => 'disabled']; } }]]]);