Ejemplo n.º 1
0
<?php

/**
 * Exemplatory aside menu
 * 
 * While this view file is subjective, the usage of GUIHelper is emphasised 
 * particularly in function of menu setup common to framework practises
 * 
 */
use yii\widgets\Menu;
use humanized\user\components\GUIHelper;
echo Menu::widget(['items' => GUIHelper::getMenuItems(), 'options' => ['class' => 'nav nav-pills nav-stacked', 'id' => 'navbar-id', 'style' => 'font-size: 14px;', 'data-tag' => 'yii2-menu']]);
Ejemplo n.º 2
0
<?php

$this->params['breadcrumbs'][] = 'User Administration';
$this->params['breadcrumbs'][] = 'User Management';
?>
<div class="row">
    <aside class="col-md-4">
        <div class="well">
            <blockquote><span class="glyphicon glyphicon-user"></span> User Administration</blockquote>
            <?php 
echo $this->render('_aside');
?>
        </div>
        <div class="well">
            <blockquote><span class="glyphicon glyphicon-plus"></span> Create New User</blockquote>

            <?php 
echo humanized\user\components\AccountCreateForm::widget(array_merge(['model' => $model, 'enableRBAC' => \Yii::$app->controller->module->params['enableRBAC'], 'enable' => \Yii::$app->user->can(\Yii::$app->controller->module->params['permissions']['create.account']), 'enableStatusDropdown' => \Yii::$app->controller->module->params['enableStatusCodes'] && \Yii::$app->user->can(\Yii::$app->controller->module->params['permissions']['verify.account']), 'statusDropdownData' => \humanized\user\components\GUIHelper::getStatusList(), 'forcePasswordGeneration' => \Yii::$app->controller->module->params['enableUserVerification']], \Yii::$app->controller->module->params['formOptions']));
?>

        </div>   
    </aside>

    <div class="col-md-8">
        <?php 
echo humanized\user\components\AccountGrid::widget(array_merge(['dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'enable' => \Yii::$app->controller->module->params['permissions']['access.dashboard'], 'canViewAccount' => Yii::$app->user->can(\Yii::$app->controller->module->params['permissions']['view.account']), 'canVerifyAccount' => \Yii::$app->user->can(\Yii::$app->controller->module->params['permissions']['verify.account']), 'canDeleteAccount' => \Yii::$app->user->can(\Yii::$app->controller->module->params['permissions']['delete.account']), 'displayCreatedAt' => \Yii::$app->controller->module->params['displayTimestamps'] || \Yii::$app->controller->module->params['displayCreatedAt'], 'displayUpdatedAt' => \Yii::$app->controller->module->params['displayTimestamps'] || \Yii::$app->controller->module->params['displayUpdatedAt'], 'displayStatusColumn' => \Yii::$app->controller->module->params['enableStatusCodes'], 'enableRBAC' => \Yii::$app->controller->module->params['enableRBAC']], \Yii::$app->controller->module->params['gridOptions']));
?>
    </div>
</div>
Ejemplo n.º 3
0
 private function _setupStatusAttributes()
 {
     if ($this->displayStatusFields && $this->model->hasAttribute('status')) {
         $this->_attributes[] = ['label' => 'Status', 'format' => 'html', 'value' => \humanized\user\components\GUIHelper::getStatusOutput((int) $this->model->status == 0)];
     }
 }
Ejemplo n.º 4
0
 private function _setupStatusColumns()
 {
     if ($this->searchModel->hasAttribute('status') && $this->displayStatusColumn) {
         $this->_columns[] = ['label' => 'Status', 'format' => 'html', 'value' => function ($model, $key, $index, $column) {
             $inactive = (int) $model['status'] == 0 ? TRUE : FALSE;
             return \humanized\user\components\GUIHelper::getStatusOutput($inactive);
         }];
     }
 }