Exemple #1
0
use yii\helpers\Html;
use common\components\grid\GridView;
use common\components\grid\SerialColumn;
use yii\helpers\VarDumper;
use yii\log\Logger;
use Stringy\StaticStringy as Stringy;
?>
<a href="#yii-debug-toolbar" class="scroll-to-top-link" style="display: none;"><?php 
echo Yii::t('common', 'Scroll to top');
?>
</a>

<h1>Log Messages</h1>

<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'id' => 'dblog-panel-detailed-grid', 'options' => ['class' => 'detail-grid-view table-responsive'], 'filterModel' => $searchModel, 'filterUrl' => $panel->getUrl(), 'columns' => [['class' => SerialColumn::className()], ['attribute' => 'timestamp', 'value' => function ($data) {
    if (isset($data['time'])) {
        $timeInSeconds = $data['time'] / 1000;
        $millisecondsDiff = (int) (($timeInSeconds - (int) $timeInSeconds) * 1000);
        return date('H:i:s.', $timeInSeconds) . sprintf('%03d', $millisecondsDiff);
    } else {
        return $data['timestamp'];
    }
}, 'headerOptions' => ['class' => 'sort-numerical text-align-center'], 'footerOptions' => ['class' => 'sort-numerical text-align-center font-weight-bold th'], 'contentOptions' => ['class' => 'nowrap font-size-10px text-align-center']], ['attribute' => 'level', 'value' => function ($data) {
    switch ($data['level']) {
        case Logger::LEVEL_ERROR:
            $class = 'label label-danger';
            break;
        case Logger::LEVEL_WARNING:
            $class = 'label label-warning';
            break;
Exemple #2
0
$this->title = Yii::t('frontend-site', 'Posts');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="articles-admin">
    <h1>
        <?php 
echo Html::encode($this->title);
?>
        <span class="pull-right"><?php 
echo Html::a('<i class="fa fa-plus"></i> ' . Yii::t('frontend-site', 'New Post'), ['create'], ['class' => 'btn btn-success']);
?>
</span>
    </h1>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => SerialColumn::className()], ['attribute' => 'user_id', 'value' => function ($data) {
    return $data->getAuthorName();
}], ['attribute' => 'title'], ['attribute' => 'status', 'filter' => $searchModel->statusList, 'filterInputOptions' => ['class' => 'form-control chosen-select', 'id' => null, 'prompt' => ' All '], 'value' => function ($data) {
    return $data->getStatusName($data->status);
}, 'contentOptions' => function ($model, $key, $index, $column) {
    return ['class' => CssHelper::articleStatusCss($model->statusName)];
}], ['attribute' => 'category', 'filter' => $searchModel->categoryList, 'filterInputOptions' => ['class' => 'form-control chosen-select', 'id' => null, 'prompt' => ' All '], 'value' => function ($data) {
    return $data->getCategoryName($data->category);
}, 'contentOptions' => function ($model, $key, $index, $column) {
    return ['class' => CssHelper::articleCategoryCss($model->categoryName)];
}], ['class' => ActionColumn::className(), 'buttons' => ['update' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['class' => 'btn btn-xs btn-default', 'title' => Yii::t('common', 'Edit'), 'data-pjax' => '0']);
}]]]]);
?>
</div>
Exemple #3
0
use yii\helpers\VarDumper;
use yii\log\Logger;
use Stringy\StaticStringy as Stringy;
/** @var DbLog $searchModel */
$searchModel = DbLog::getInstance();
$this->title = Yii::t('backend', 'Application DB Log Messages');
?>

<div class="backend-application-logs-index">
    <h1><?php 
echo $this->title;
?>
</h1>

<?php 
echo GridView::widget(['dataProvider' => $searchModel->search(Yii::$app->request->queryParams), 'filterModel' => $searchModel, 'columns' => [['class' => SerialColumn::className()], ['attribute' => 'timestamp', 'value' => function ($data) {
    if (isset($data['time'])) {
        $timeInSeconds = $data['time'] / 1000;
        $millisecondsDiff = (int) (($timeInSeconds - (int) $timeInSeconds) * 1000);
        return date('H:i:s.', $timeInSeconds) . sprintf('%03d', $millisecondsDiff);
    } else {
        return $data['timestamp'];
    }
}, 'headerOptions' => ['class' => 'sort-numerical text-align-center'], 'footerOptions' => ['class' => 'sort-numerical text-align-center font-weight-bold th'], 'contentOptions' => ['class' => 'nowrap font-size-10px text-align-center']], ['attribute' => 'level', 'value' => function ($data) {
    switch ($data['level']) {
        case Logger::LEVEL_ERROR:
            $class = 'label label-danger';
            break;
        case Logger::LEVEL_WARNING:
            $class = 'label label-warning';
            break;
Exemple #4
0
$this->title = Yii::t('backend', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="backend-user-index">
    <h1><?php 
echo Html::encode($this->title);
?>
        <span class="pull-right">
            <?php 
echo Html::a(Yii::t('backend', 'Create User'), ['create'], ['class' => 'btn btn-success']);
?>
        </span>
    </h1>

    <?php 
echo GridView::widget(['dataProvider' => $searchModel->search(Yii::$app->request->queryParams), 'filterModel' => $searchModel, 'summary' => false, 'columns' => [['class' => SerialColumn::className()], ['attribute' => 'username'], ['attribute' => 'email'], ['attribute' => 'status', 'filter' => $searchModel->statusList, 'filterInputOptions' => DataColumn::$filterOptionsForChosenSelect, 'value' => function ($data) {
    return '<span class="' . CssHelper::statusCssLabel($data->statusName) . '">' . $data->statusName . '</span>';
}, 'format' => 'html', 'contentOptions' => ['class' => 'text-align-center']], ['attribute' => 'item_name', 'filter' => $searchModel->rolesList, 'filterInputOptions' => DataColumn::$filterOptionsForChosenSelect, 'value' => function ($data) {
    return $data->roleName;
}, 'contentOptions' => function ($model, $key, $index, $column) {
    return ['class' => 'text-align-center ' . CssHelper::roleCss($model->roleName)];
}], ['class' => ActionColumn::className(), 'template' => '{view} {update} {delete}', 'buttons' => ['view' => function ($url, $model, $key) {
    return Html::a('', $url, ['title' => Yii::t('backend', 'View user'), 'class' => 'glyphicon glyphicon-eye-open']);
}, 'update' => function ($url, $model, $key) {
    return Html::a('', $url, ['title' => Yii::t('backend', 'Manage user'), 'class' => 'glyphicon glyphicon-user']);
}, 'delete' => function ($url, $model, $key) {
    return Html::a('', $url, ['title' => Yii::t('backend', 'Delete user'), 'class' => 'glyphicon glyphicon-trash text-danger margin-left-10px', 'data' => ['confirm' => Yii::t('backend', 'Are you sure you want to delete this user?'), 'method' => 'post']]);
}]]]]);
?>
</div>