Esempio n. 1
0
<?php 
\yii\widgets\Pjax::begin();
?>

<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'format' => 'raw', 'value' => function ($data) {
    return Html::a(Html::encode($data->id), ["admin/update", "id" => $data->id]);
}], ['attribute' => 'username', 'format' => 'raw', 'value' => function ($data) {
    return Html::a(UHtml::markSearch($data, "username"), ["admin/view", "id" => $data->id]);
}], ['attribute' => 'email', 'format' => 'raw', 'value' => function ($data) {
    return Html::a(UHtml::markSearch($data, "email"), "mailto:" . $data->email);
}], 'create_at', 'lastvisit_at', ['attribute' => 'superuser', 'value' => function ($data) {
    return User::itemAlias("AdminStatus", $data->superuser);
}, 'filter' => User::itemAlias("AdminStatus")], ['attribute' => 'status', 'value' => function ($data) {
    return User::itemAlias("UserStatus", $data->status);
}, 'filter' => User::itemAlias("UserStatus")], ['class' => 'yii\\grid\\ActionColumn', 'header' => Module::t('Actions')]]]);
?>

<?php 
\yii\widgets\Pjax::end();
?>

<?php 
//$this->widget('zii.widgets.grid.CGridView', array(
//    'id'=>'user-grid',
//    'dataProvider'=>$model->search(),
//    'filter'=>$model,
//    'columns'=>array(
//        array(
//            'name' => 'id',
//            'type'=>'raw',
Esempio n. 2
0
?>

        <?php 
echo $form->field($model, 'password')->passwordInput(['maxlength' => true]);
?>

        <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>

        <?php 
echo $form->field($model, 'superuser')->dropDownList(User::itemAlias('AdminStatus'));
?>

        <?php 
echo $form->field($model, 'status')->dropDownList(User::itemAlias('UserStatus'));
?>

        <?php 
$profileFields = Profile::getFields();
if ($profileFields) {
    foreach ($profileFields as $field) {
        echo $field->renderField($profile, $form);
    }
}
?>
        <div class="form-group">
            <?php 
echo Html::submitButton($model->isNewRecord ? Module::t('Create') : Module::t('Save'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>
Esempio n. 3
0
?>

<h1><?php 
echo Module::t('View User') . ' "' . $model->username . '"';
?>
</h1>

<?php 
$attributes = ['id', 'username'];
$profileFields = ProfileField::find()->forOwner()->sort()->all();
if ($profileFields) {
    foreach ($profileFields as $field) {
        $val = '';
        if ($field->widgetView($model->profile)) {
            $val = $field->widgetView($model->profile);
        } else {
            if ($field->range) {
                $val = Profile::range($field->range, $model->profile->getAttribute($field->varname));
            } else {
                $val = $model->profile->getAttribute($field->varname);
            }
        }
        $type = 'html';
        if ($field->field_type == "DATE" || $field->widget == "UWjuidate") {
            $type = 'date';
        }
        array_push($attributes, ['label' => Module::t($field->title), 'name' => $field->varname, 'format' => $type, 'value' => $val]);
    }
}
array_push($attributes, 'password', 'email:email', 'activkey', 'create_at:date', 'lastvisit_at:date', ['attribute' => 'superuser', 'value' => User::itemAlias("AdminStatus", $model->superuser)], ['attribute' => 'status', 'value' => User::itemAlias("UserStatus", $model->status)]);
echo DetailView::widget(['model' => $model, 'attributes' => $attributes]);