anonymous()
last analyzed

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
nc 1
nop 2
dl 0
loc 3
c 0
b 0
f 0
1
<?php
2
3
use yii\grid\GridView;
4
use \yii\grid\ActionColumn;
5
use yii\helpers\Html;
6
use carono\exchange1c\widgets\Panel;
7
8
/**
9
 * @var \yii\data\ArrayDataProvider $dataProvider
10
 * @var \yii\web\View $this
11
 */
12
$this->title = "Список временных файлов ({$this->context->module->tmpDir})";
0 ignored issues
show
Bug introduced by
Accessing module on the interface yii\base\ViewContextInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
13
14
Panel::begin();
15
echo Html::a('Очистить всё', ['default/clear-tmp'], [
16
    'class' => ['btn btn-warning'],
17
    'data-confirm' => 'Очистить все временные файлы?'
18
]);
19
20
echo "<hr>";
21
22
echo GridView::widget([
23
    'dataProvider' => $dataProvider,
24
    'columns' => [
25
        'filename',
26
        'size:shortSize',
27
        [
28
            'class' => ActionColumn::class,
29
            'template' => '{download}',
30
            'buttons' => [
31
                'download' => function ($url, $data) {
32
                    $span = Html::tag('i', '', ['class' => 'glyphicon glyphicon-download-alt']);
33
                    return Html::a($span, ['default/download', 'file' => $data['filename']]);
34
                }
35
            ]
36
        ]
37
    ]
38
]);
39
Panel::end();