ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
memcachestat.tpl.php
Go to the documentation of this file.
1<?php
2
3$this->data['head'] = '<style type="text/css">
4 table.statustable td, table.statustable th {
5 border: 1px solid #eee;
6 padding: 2px 6px;
7 }
8 table.statustable {
9 border-collapse: collapse;
10 }
11 .bmax {
12 border: 1px solid #555;
13 background: #eee;
14 }
15 .bused {
16 border-right: 1px solid #555;
17 border-bottom: 1px solid #555;
18 color: white;
19 background: #833;
20 }
21</style>
22';
23
24
25
26$this->includeAtTemplateBase('includes/header.php');
27
28$title = $this->data['title'];
29$table = $this->data['table'];
30
31
32// Identify column headings
34foreach($table as $row_title => $row_data) {
35 foreach($row_data as $ct => $foo) {
36 if(!in_array($ct, $column_titles, true)) {
37 $column_titles[] = $ct;
38 }
39 }
40}
41
42?>
43
44<h2><?php echo htmlspecialchars($title); ?></h2>
45
46<table class="statustable">
47
48<tr>
49<th></th>
50<?php
51foreach($column_titles as $ct) {
52 echo '<th>' . htmlspecialchars($ct) . '</th>' . "\n";
53}
54?>
55</tr>
56
57<?php
58foreach($table as $row_title => $row_data) {
59 echo '<tr>' . "\n";
60 echo '<th class="rowtitle" style="text-align: right">' . $this->t($this->data['rowtitles'][$row_title]) . '</th>' . "\n";
61
62 foreach($column_titles as $ct) {
63 echo '<td>';
64
65 if(array_key_exists($ct, $row_data)) {
66 echo htmlspecialchars($row_data[$ct]);
67 }
68
69 echo '</td>' . "\n";
70 }
71
72 echo '</tr>' . "\n";
73}
74?>
75
76</table>
77
78<?php
79if (array_key_exists('bytes', $this->data['statsraw']) && array_key_exists('limit_maxbytes', $this->data['statsraw'])) {
80 foreach($this->data['statsraw']['bytes'] as $key => $row_data) {
81 echo ('<h3>Storage usage on [' . $key . ']</h3>');
82 $maxpix = 400;
83 $pix = floor($this->data['statsraw']['bytes'][$key]*$maxpix / $this->data['statsraw']['limit_maxbytes'][$key]);
84
85 echo('<div class="bmax" style="width: ' . $maxpix. 'px"><div class="bused" style="width: ' . $pix . 'px">
86 Used: ' . $table['bytes'][$key] . '
87 </div>Total available: ' . $table['limit_maxbytes'][$key] . '</div>');
88 }
89}
90
91$this->includeAtTemplateBase('includes/footer.php');
An exception for terminatinating execution or to throw for unit testing.
$key
Definition: croninfo.php:18
$column_titles
$this data['head']