chg: [dashboard] views for widgets updated

pull/5635/head
iglocska 2020-03-02 23:07:23 +01:00
parent 44ff66445d
commit 1c915cd077
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 16 additions and 10 deletions

View File

@ -12,18 +12,19 @@
}
echo sprintf(
'<tr><td style="%s">%s</td><td style="%s">%s</td></tr>',
'text-align:right;width:33%;',
'text-align:right;width:33%;white-space:nowrap;',
h($entry),
'width:100%',
sprintf(
'<div title="%s" style="%s">%s</div>',
'<div title="%s" style="%s">%s%s</div>',
h($entry) . ': ' . h($count),
sprintf(
'background-color:%s; width:%s; color:white; text-align:center;',
(empty($data['colours'][$entry]) ? '#0088cc' : h($data['colours'][$entry])),
100 * h($value) / $max . '%;'
($max == 0 ? 0 : 100 * h($value) / $max) . '%;'
),
h($count)
h($count),
!empty($data['output_decorator']) ? '%' : ''
),
'&nbsp;'
);

View File

@ -1,9 +1,14 @@
<?php
foreach ($data as $element) {
echo sprintf(
'<div><span class="bold">%s</span>: <span class="blue">%s</span>%s</div>',
h($element['title']),
empty($element['value']) ? '' : h($element['value']),
empty($element['html']) ? '' : $element['html']
);
if (!empty($element['type']) && $element['type'] === 'gap') {
echo '<br />';
} else {
echo sprintf(
'<div><span class="bold">%s</span>: <span class="%s">%s</span>%s</div>',
h($element['title']),
empty($element['class']) ? 'blue' : h($element['class']),
!isset($element['value']) ? '' : h($element['value']),
empty($element['html']) ? '' : $element['html']
);
}
}