Exemple #1
0
</h2>

<div class="panel panel-default">
	<div class="panel-body">
		<div class="row">
			<div class="col-sm-6">
				<p>
					<?php 
echo GhostHtml::a('<span class="glyphicon glyphicon-plus-sign"></span> Create', ['create'], ['class' => 'btn btn-success']);
?>
				</p>
			</div>

			<div class="col-sm-6 text-right">
				<?php 
echo GridPageSize::widget(['pjaxId' => 'permission-grid-pjax']);
?>
			</div>
		</div>

		<?php 
Pjax::begin(['id' => 'permission-grid-pjax']);
?>

		<?php 
echo GridView::widget(['id' => 'permission-grid', 'dataProvider' => $dataProvider, 'pager' => ['options' => ['class' => 'pagination pagination-sm'], 'hideOnSinglePage' => true, 'lastPageLabel' => '>>', 'firstPageLabel' => '<<'], 'filterModel' => $searchModel, 'layout' => '{items}<div class="row"><div class="col-sm-8">{pager}</div><div class="col-sm-4 text-right">{summary}</div></div>', 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'options' => ['style' => 'width:30px']], ['attribute' => 'description', 'value' => function ($model) {
    if ($model->name == Yii::$app->getModule('user')->commonPermissionName) {
        return Html::a($model->description, ['view', 'id' => $model->name], ['data-pjax' => 0, 'class' => 'label label-primary']);
    } else {
        return Html::a($model->description, ['view', 'id' => $model->name], ['data-pjax' => 0]);
    }
Exemple #2
0
 */
use kuzmiand\users\grid_page_size\GridPageSize;
use yii\helpers\Html;
use yii\web\View;
?>
<div class="form-inline pull-right">
	<?php 
if ($this->context->enableClearFilters) {
    ?>

		<span style="display: none" id="<?php 
    echo ltrim($this->context->gridId, '#');
    ?>
-clear-filters-btn" class="btn btn-sm btn-default">
			<?php 
    echo GridPageSize::t('app', 'Clear filters');
    ?>
		</span>
	<?php 
}
?>


	<?php 
echo $this->context->text;
?>

	<?php 
echo Html::dropDownList('grid-page-size', \Yii::$app->request->cookies->getValue('_grid_page_size', 20), $this->context->dropDownOptions, ['class' => 'form-control input-sm']);
?>
</div>
Exemple #3
0
 /**
  * Multilingual support
  */
 public function init()
 {
     parent::init();
     $this->registerTranslations();
     $this->text = $this->text ? $this->text : GridPageSize::t('app', 'Records per page');
 }
Exemple #4
0
</h2>

<div class="panel panel-default">
	<div class="panel-body">
		<div class="row">
			<div class="col-sm-6">
				<p>
					<?php 
echo GhostHtml::a('<span class="glyphicon glyphicon-plus-sign"></span> ' . 'Create', ['create'], ['class' => 'btn btn-success']);
?>
				</p>
			</div>

			<div class="col-sm-6 text-right">
				<?php 
echo GridPageSize::widget(['pjaxId' => 'role-grid-pjax']);
?>
			</div>
		</div>

		<?php 
Pjax::begin(['id' => 'role-grid-pjax']);
?>

		<?php 
echo GridView::widget(['id' => 'role-grid', 'dataProvider' => $dataProvider, 'pager' => ['options' => ['class' => 'pagination pagination-sm'], 'hideOnSinglePage' => true, 'lastPageLabel' => '>>', 'firstPageLabel' => '<<'], 'filterModel' => $searchModel, 'layout' => '{items}<div class="row"><div class="col-sm-8">{pager}</div><div class="col-sm-4 text-right">{summary}</div></div>', 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'options' => ['style' => 'width:30px']], ['attribute' => 'description', 'value' => function (Role $model) {
    return Html::a($model->description, ['view', 'id' => $model->name], ['data-pjax' => 0]);
}, 'format' => 'raw'], 'name', ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'width:70px; text-align:center;']]]]);
?>

		<?php 
Exemple #5
0
	<div class="panel panel-default">
		<div class="panel-body">

			<div class="row">
				<div class="col-sm-6">
					<p>
						<?php 
echo GhostHtml::a('<span class="glyphicon glyphicon-plus-sign"></span> ' . 'Create', ['/user-management/user/create'], ['class' => 'btn btn-success']);
?>
					</p>
				</div>

				<div class="col-sm-6 text-right">
					<?php 
echo GridPageSize::widget(['pjaxId' => 'user-grid-pjax']);
?>
				</div>
			</div>


			<?php 
Pjax::begin(['id' => 'user-grid-pjax']);
?>

			<?php 
echo GridView::widget(['id' => 'user-grid', 'dataProvider' => $dataProvider, 'pager' => ['options' => ['class' => 'pagination pagination-sm'], 'hideOnSinglePage' => true, 'lastPageLabel' => '>>', 'firstPageLabel' => '<<'], 'filterModel' => $searchModel, 'layout' => '{items}<div class="row"><div class="col-sm-8">{pager}</div><div class="col-sm-4 text-right">{summary}' . GridBulkActions::widget(['gridId' => 'user-grid', 'actions' => [Url::to(['bulk-activate', 'attribute' => 'status']) => GridBulkActions::t('app', 'Activate'), Url::to(['bulk-deactivate', 'attribute' => 'status']) => GridBulkActions::t('app', 'Deactivate'), '----' => [Url::to(['bulk-delete']) => GridBulkActions::t('app', 'Delete')]]]) . '</div></div>', 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'options' => ['style' => 'width:30px']], ['class' => 'kuzmiand\\users\\components\\StatusColumn', 'attribute' => 'superadmin', 'visible' => Yii::$app->user->identity->isSuperadmin, 'options' => ['style' => 'width:100px']], ['attribute' => 'username', 'value' => function (User $model) {
    return Html::a($model->username, ['view', 'id' => $model->id], ['data-pjax' => 0]);
}, 'format' => 'raw', 'options' => ['style' => 'width:auto']], ['attribute' => 'email', 'format' => 'raw', 'visible' => User::hasPermission('viewUserEmail'), 'options' => ['style' => 'width:auto']], ['attribute' => 'gridRoleSearch', 'filter' => ArrayHelper::map(Role::getAvailableRoles(Yii::$app->user->identity->isSuperAdmin), 'name', 'description'), 'value' => function (User $model) {
    return implode(', ', ArrayHelper::map($model->roles, 'name', 'description'));
}, 'format' => 'raw', 'visible' => User::hasPermission('viewUserRoles')], ['attribute' => 'registration_ip', 'value' => function (User $model) {