<?php use app\base\widgets\ActionColumn\AdminActionColumn; use nagser\base\widgets\ActionColumn\ActionColumn; use nagser\base\widgets\GridView\GridView; use yii\bootstrap\Html; use yii\helpers\ArrayHelper; /** @var $dataProvider yii\data\ArrayDataProvider **/ $this->title = Yii::t('themes', 'Themes'); $this->params['breadcrumbs'][] = $this->title; ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['attribute' => 'preview', 'label' => Yii::t('themes', 'Preview'), 'format' => 'html', 'headerOptions' => ['style' => 'width: 220px;'], 'options' => ['style' => 'vertical-align: middle'], 'value' => function ($model) { return Html::img(Yii::$app->request->baseUrl . '/themes/' . ArrayHelper::getValue($model, 'dir') . '/preview.png', ['class' => 'img-responsive']); }], ['attribute' => 'name', 'label' => Yii::t('themes', 'Name'), 'vAlign' => GridView::ALIGN_MIDDLE], ['attribute' => 'link', 'label' => Yii::t('themes', 'Link to description'), 'value' => function ($model) { return Html::a(Yii::t('themes', 'Description'), ArrayHelper::getValue($model, 'link'), ['class' => 'btn btn-default btn-sm', 'target' => '_blank']); }, 'format' => 'raw', 'vAlign' => GridView::ALIGN_MIDDLE], ['class' => ActionColumn::className(), 'template' => '{copy} {delete}', 'buttons' => ['copy' => function ($url, $model) { return Html::a(Html::tag('i', '', ['class' => 'fa fa-files-o']), $url, ['class' => 'btn btn-default btn-sm jsOpen', 'data-title' => Yii::t('themes', 'Copy theme')]); }]]]]);
$this->params['breadcrumbs'][] = $this->title; ?> <p> <?php echo Html::a(Yii::t('user', 'New user'), ['/user/admin/create'], ['class' => 'btn btn-default']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'username', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'username']]]], ['attribute' => 'email', 'format' => 'email', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'email']]]], ['attribute' => 'registration_ip', 'value' => function ($model) { return $model->registration_ip == null ? '<span class="not-set">' . Yii::t('user', '(not set)') . '</span>' : $model->registration_ip; }, 'format' => 'html', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'registration_ip']]]], ['attribute' => 'created_at', 'value' => function ($model) { if (extension_loaded('intl')) { return Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$model->created_at]); } else { return date('Y-m-d G:i:s', $model->created_at); } }, 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'created_at', 'dateFormat' => 'php:Y-m-d', 'options' => ['class' => 'form-control']])], ['header' => Yii::t('user', 'Confirmation'), 'headerOptions' => ['class' => 'minWidth'], 'value' => function ($model) { if ($model->isConfirmed) { return '<div class="text-center"><span class="text-success">' . Yii::t('user', 'Confirmed') . '</span></div>'; } else { return Html::a(Yii::t('user', 'Confirm'), ['confirm', 'id' => $model->id], ['class' => 'btn btn-xs btn-success btn-block', 'data-method' => 'post', 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?')]); } }, 'format' => 'raw', 'visible' => Yii::$app->getModule('user')->enableConfirmation], ['header' => Yii::t('user', 'Block status'), 'headerOptions' => ['class' => 'minWidth'], 'value' => function ($model) { if ($model->isBlocked) { return Html::a(Yii::t('user', 'Unblock'), ['block', 'id' => $model->id], ['class' => 'btn btn-xs btn-success btn-block jsDialog', 'data-modal-type' => 'confirm', 'data-pjax' => true, 'data-confirm' => false, 'data-message' => Yii::t('user', 'Are you sure you want to unblock this user?')]); } else { return Html::a(Yii::t('user', 'Block'), ['block', 'id' => $model->id], ['class' => 'btn btn-xs btn-danger btn-block jsDialog', 'data-modal-type' => 'confirm', 'data-pjax' => true, 'data-confirm' => false, 'data-button-type' => 'POST', 'data-message' => Yii::t('user', 'Are you sure you want to block this user?')]); } }, 'format' => 'raw'], ['class' => 'nagser\\base\\widgets\\ActionColumn\\ActionColumn', 'template' => '{view} {delete}']]]);
<?php /** * @var $dataProvider array * @var $filterModel dektrium\rbac\models\Search * @var $this yii\web\View */ use app\base\widgets\ActionColumn\AdminActionColumn; use nagser\base\widgets\ActionColumn\ActionColumn; use yii\helpers\Url; use nagser\base\widgets\GridView\GridView; $this->title = Yii::t('rbac', 'Roles'); $this->params['breadcrumbs'][] = $this->title; ?> <?php $this->beginContent('@nagser/rbac/views/layout.php'); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $filterModel, 'columns' => [['attribute' => 'name', 'header' => Yii::t('rbac', 'Name'), 'options' => ['style' => 'width: 20%'], 'contentOptions' => ['style' => 'text-align: left'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'name']]]], ['attribute' => 'description', 'header' => Yii::t('rbac', 'Description'), 'options' => ['style' => 'width: 55%'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'description']]]], ['attribute' => 'rule_name', 'header' => Yii::t('rbac', 'Rule name'), 'options' => ['style' => 'width: 20%'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'rule_name']]]], ['class' => ActionColumn::className(), 'template' => '{update} {delete}', 'urlCreator' => function ($action, $model) { return Url::to(['/rbac/role/' . $action, 'name' => $model['name']]); }, 'options' => ['style' => 'width: 5%']]]]); ?> <?php $this->endContent();
<?php use nagser\base\widgets\GridView\GridView; /* @var $this yii\web\View */ /* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $modelSearch nagser\logger\models\LoggerSearch */ /* @var $model nagser\logger\models\LoggerRecord */ $this->title = Yii::t('logger', 'Logs list'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="logger-record-index"> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $modelSearch, 'columns' => [['label' => Yii::t('logger', 'Id'), 'value' => 'id', 'attribute' => 'id', 'headerOptions' => ['style' => 'width: 115px;'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'id']]]], ['label' => Yii::t('logger', 'Category'), 'value' => 'category', 'attribute' => 'category', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'category']]]], ['label' => Yii::t('logger', 'Level'), 'value' => 'level', 'attribute' => 'level', 'headerOptions' => ['style' => 'width: 115px;'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'level']]]], ['class' => \nagser\base\widgets\ActionColumn\ActionColumn::className(), 'template' => '{view} {delete}', 'viewOptions' => ['class' => 'btn btn-sm btn-default jsOpen']]]]); ?> </div>
<?php /* @var $this yii\web\View */ use nagser\base\widgets\GridView\GridView; /* @var $modelSearch nagser\gallery\models\GallerySearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('gallery', 'Gallery list'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="gallery-record-index"> <p style="margin-bottom: 10px;"><?php echo \yii\bootstrap\Html::a(Yii::t('gallery', 'Upload file'), ['update'], ['class' => 'btn btn-default']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $modelSearch, 'columns' => [['label' => '#', 'value' => 'id', 'attribute' => 'id', 'headerOptions' => ['style' => 'width: 115px;'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'id']]]], ['label' => Yii::t('gallery', 'Title'), 'value' => 'title', 'attribute' => 'title', 'headerOptions' => ['style' => 'width: 115px;'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'title']]]], ['label' => Yii::t('gallery', 'Type'), 'value' => 'type', 'attribute' => 'type', 'headerOptions' => ['style' => 'width: 115px;'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'type']]]], ['label' => Yii::t('gallery', 'Author'), 'value' => 'author_id', 'attribute' => 'author_id', 'headerOptions' => ['style' => 'width: 115px;'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'author_id']]]], ['label' => Yii::t('gallery', 'Updated'), 'value' => 'updated_at', 'attribute' => 'updated_at', 'headerOptions' => ['style' => 'width: 115px;'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'updated_at']]]], ['label' => Yii::t('gallery', 'Created'), 'value' => 'created_at', 'attribute' => 'created_at', 'headerOptions' => ['style' => 'width: 115px;'], 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['ajax' => ['colAlias' => 'created_at']]]], ['class' => \nagser\base\widgets\ActionColumn\ActionColumn::className()]]]); ?> </div>