Beispiel #1
0
					<?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) {
    return Html::a($model->registration_ip, "http://ipinfo.io/" . $model->registration_ip, ["target" => "_blank"]);
}, 'format' => 'raw', 'visible' => User::hasPermission('viewRegistrationIp'), 'options' => ['style' => 'width:100px']], ['value' => function (User $model) {
    return GhostHtml::a('Roles and permissions', ['/user/user-permission/set', 'id' => $model->id], ['class' => 'btn btn-sm btn-primary', 'data-pjax' => 0]);
}, 'format' => 'raw', 'visible' => User::canRoute('/user/user-permission/set'), 'options' => ['width' => '165px']], ['class' => 'kuzmiand\\users\\components\\StatusColumn', 'attribute' => 'status', 'optionsArray' => [[User::STATUS_ACTIVE, 'Active', 'success'], [User::STATUS_NEW, 'Inactive', 'warning'], [User::STATUS_BLOCKED, 'Blocked', 'danger']]], ['class' => 'yii\\grid\\CheckboxColumn', 'options' => ['style' => 'width:30px']], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'width:70px; text-align:center;']]]]);
?>

			<?php 
Pjax::end();
?>

		</div>
	</div>
</div>
Beispiel #2
0
$this->title = 'Permissions';
$this->params['breadcrumbs'][] = $this->title;
?>

<h2 class="lte-hide-title"><?php 
echo $this->title;
?>
</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']);
?>
Beispiel #3
0
    ?>
	<div class="alert alert-success text-center">
		<?php 
    echo Yii::$app->session->getFlash('success');
    ?>
	</div>
<?php 
}
?>

<p>
	<?php 
echo GhostHtml::a('Edit', ['update', 'id' => $role->name], ['class' => 'btn btn-sm btn-primary']);
?>
	<?php 
echo GhostHtml::a('Create', ['create'], ['class' => 'btn btn-sm btn-success']);
?>
</p>

<div class="row">
	<div class="col-sm-4">
		<div class="panel panel-default">
			<div class="panel-heading">
				<strong>
					<span class="glyphicon glyphicon-th"></span> <?php 
echo 'Child roles';
?>
				</strong>
			</div>
			<div class="panel-body">
				<?php