PluginProbe
Disk Usage Insights / trunk
Disk Usage Insights vtrunk
trunk 1.0 1.10 1.11 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | src/Frontend/Table.php +20 -1 1.3trunk View file →
@@ -7,10 +7,12 @@
7 7 private /** @var array */ $columnNames = [];
8 8 private /** @var array */ $columnCss = [];
9 9 private /** @var array */ $percentBar = null; // [$colDisplay, $colSource]
10 10 private /** @var array */ $data = [];
11 + private /** @var array */ $vbarChart = [];
12 + private ?Pagination $pagination = null;
11 13
12 - public function __construct(string $headline, array $columnNames = null, array $columnCss = null)
14 + public function __construct(string $headline, array $columnNames = [], array $columnCss = [])
13 15 {
14 16 $this->headline = $headline;
15 17 if ($columnNames !== null) {
16 18 $this->columnNames = $columnNames;
@@ -27,13 +29,30 @@
27 29 }
28 30
29 31 public function output() {
30 32 $table = $this->data;
33 + $pagination = $this->pagination;
31 34 include __DIR__ . '/../../views/blocks/table.php';
32 35 }
33 36
34 37 public function withPercentBar(int $colDisplay, int $colSource): self {
35 38 $this->percentBar = [$colDisplay, $colSource];
39 +
40 + return $this;
41 + }
42 +
43 + public function withVbarChart(int $colSource): self {
44 + // vbar chart
45 + $this->vbarChart = [];
46 + foreach ($this->data as $row) {
47 + $this->vbarChart[] = floatval($row[$colSource]);
48 + }
49 +
50 + return $this;
51 + }
52 +
53 + public function withPagination(Pagination $pagination): self {
54 + $this->pagination = $pagination;
36 55
37 56 return $this;
38 57 }
39 58