actionFilter() public static method

public static actionFilter ( ) : array
return array
示例#1
0
<?php

/* @var $panel yii\debug\panels\LogPanel */
/* @var $searchModel yii\debug\models\search\Log */
/* @var $dataProvider yii\data\ArrayDataProvider */
use bedezign\yii2\audit\Audit;
use bedezign\yii2\audit\models\AuditTrailSearch;
use yii\helpers\Html;
use yii\grid\GridView;
echo Html::tag('h1', $panel->name);
echo GridView::widget(['dataProvider' => $dataProvider, 'id' => 'log-panel-detailed-grid', 'options' => ['class' => 'detail-grid-view table-responsive'], 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view}', 'buttons' => ['view' => function ($url, $model) {
    return Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-eye-open']), ['trail/view', 'id' => $model->id]);
}], 'options' => ['width' => '30px']], ['attribute' => 'id', 'options' => ['width' => '80px']], ['attribute' => 'user_id', 'label' => Yii::t('audit', 'User ID'), 'class' => 'yii\\grid\\DataColumn', 'value' => function ($data) {
    return Audit::getInstance()->getUserIdentifier($data->user_id);
}, 'options' => ['width' => '150px'], 'format' => 'raw'], ['attribute' => 'action', 'filter' => AuditTrailSearch::actionFilter(), 'options' => ['width' => '150px']], ['attribute' => 'model', 'options' => ['width' => '150px']], ['attribute' => 'model_id', 'options' => ['width' => '80px']], ['attribute' => 'field', 'options' => ['width' => '100px']], ['label' => Yii::t('audit', 'Diff'), 'value' => function ($data) {
    return $data->getDiffHtml();
}, 'format' => 'raw']]]);
示例#2
0
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('audit', 'Trails');
$this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Audit'), 'url' => ['default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary">
    <div class="box-header" style="cursor: pointer;">
        <i class="fa fa-th-list"></i>
        <h3 class="box-title"><?php 
echo Html::encode($this->title);
?>
</h3>
    </div>
    <div class="box-body">
        <div class="audit-trail">


            <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view}'], 'id', ['attribute' => 'entry_id', 'class' => 'yii\\grid\\DataColumn', 'value' => function ($data) {
    return $data->entry_id ? Html::a($data->entry_id, ['entry/view', 'id' => $data->entry_id]) : '';
}, 'format' => 'raw'], ['attribute' => 'user_id', 'label' => Yii::t('audit', 'User ID'), 'class' => 'yii\\grid\\DataColumn', 'value' => function ($data) {
    return Audit::getInstance()->getUserIdentifier($data->user_id);
}, 'format' => 'raw'], ['attribute' => 'action', 'filter' => AuditTrailSearch::actionFilter()], 'model', 'model_id', 'field', ['label' => Yii::t('audit', 'Diff'), 'value' => function ($model) {
    return $model->getDiffHtml();
}, 'format' => 'raw'], ['attribute' => 'created', 'options' => ['width' => '150px']]]]);
?>
        </div>
    </div>
</div>

示例#3
0
文件: audit.php 项目: minpppst/rsc
use bedezign\yii2\audit\Audit;
use yii\helpers\Html;
use yii\grid\GridView;
use bedezign\yii2\audit\models\AuditTrailSearch;
use bedezign\yii2\audit\models\AuditEntrySearch;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('audit', 'Entradas');
$this->params['breadcrumbs'][] = ['label' => Yii::t('audit', 'Configuracion'), 'url' => ['/site/configuracion']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="audit-entry-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'user_id', 'filter' => AuditEntrySearch::userFilter(), 'label' => 'Usuarios', 'class' => 'yii\\grid\\DataColumn', 'value' => function ($data) {
    return $data->obtener_nombre($data->user_id);
}, 'format' => 'raw'], 'ip', ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'route', 'label' => 'Lugar De Entrada', 'filter' => AuditEntrySearch::routeFilter(), 'format' => 'html', 'value' => function ($data) {
    return HTML::tag('span', '', ['title' => \yii\helpers\Url::to([$data->route]), 'class' => 'glyphicon glyphicon-link']) . ' ' . $data->route;
}], ['attribute' => 'trails', 'label' => 'Accion BD', 'filter' => AuditTrailSearch::actionFilter(), 'value' => function ($data) {
    return $data->trails ? $data->trails[0]['action'] : '';
}, 'contentOptions' => ['class' => 'text-right']], ['attribute' => 'created', 'label' => 'Fecha', 'options' => ['width' => '150px']]]]);
?>
</div>