Exemple #1
0
</a></li>
    <li role="presentation" class="active"><a href="<?php 
echo Url::to(['members/mods']);
?>
"><span class="glyphicon glyphicon-scissors"></span> <?php 
echo Yii::t('podium/view', 'Moderation Team');
?>
</a></li>
</ul>
<br>
<?php 
Pjax::begin();
echo PageSizer::widget();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'filterSelector' => 'select#per-page', 'tableOptions' => ['class' => 'table table-striped table-hover'], 'columns' => [['attribute' => 'username', 'label' => Yii::t('podium/view', 'Username') . Helper::sortOrder('username'), 'encodeLabel' => false, 'format' => 'raw', 'value' => function ($model) {
    return Html::a($model->podiumName, ['members/view', 'id' => $model->id, 'slug' => $model->podiumSlug], ['data-pjax' => '0']);
}], ['attribute' => 'role', 'label' => Yii::t('podium/view', 'Role') . Helper::sortOrder('role'), 'encodeLabel' => false, 'format' => 'raw', 'filter' => User::getModRoles(), 'value' => function ($model) {
    return Helper::roleLabel($model->role);
}], ['attribute' => 'created_at', 'label' => Yii::t('podium/view', 'Joined') . Helper::sortOrder('created_at'), 'encodeLabel' => false, 'value' => function ($model) {
    return Yii::$app->formatter->asDatetime($model->created_at);
}], ['class' => ActionColumn::className(), 'header' => Yii::t('podium/view', 'Actions'), 'contentOptions' => ['class' => 'text-right'], 'headerOptions' => ['class' => 'text-right'], 'template' => '{view}' . (!Yii::$app->user->isGuest ? ' {pm}' : ''), 'buttons' => ['view' => function ($url) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'View Member')]);
}, 'pm' => function ($url, $model) {
    if ($model->id !== User::loggedId()) {
        return Html::a('<span class="glyphicon glyphicon-envelope"></span>', ['messages/new', 'user' => $model->id], ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'Send Message')]);
    } else {
        return Html::a('<span class="glyphicon glyphicon-envelope"></span>', '#', ['class' => 'btn btn-xs disabled text-muted']);
    }
}]]]]);
Pjax::end();
?>
<div class="panel panel-default">