mirror of
https://github.com/Icinga/icingaweb2-module-graphite.git
synced 2026-05-28 04:34:57 -04:00
show/legend: modularize view scripts
This commit is contained in:
parent
1ca48e88b1
commit
b6097ec27b
2 changed files with 21 additions and 19 deletions
20
application/views/scripts/show/legend.phtml
Normal file
20
application/views/scripts/show/legend.phtml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<ul class="legend">
|
||||
<?php foreach ($this->template->getDatasources() as $ds): ?>
|
||||
<?php if ($ds->isEnabled()): ?>
|
||||
<li><div class="color" style="background-color: <?= $this->escape($ds->getColorCss()) ?>"></div> <?= $this->qlink(
|
||||
$ds->getName(),
|
||||
$this->url()->with('disableDatasource', $ds->getPath()),
|
||||
null,
|
||||
array('title' => $this->translate('Click to disable'))
|
||||
) ?></span></li>
|
||||
<?php else: ?>
|
||||
<li class="disabled"><div class="color"></div> <?= $this->qlink(
|
||||
$ds->getName(),
|
||||
$this->url()->with('enableDatasource', $ds->getPath()),
|
||||
null,
|
||||
array('title' => $this->translate('Click to enable'))
|
||||
) ?></span></li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
|
|
@ -12,25 +12,7 @@
|
|||
|
||||
<div class="content">
|
||||
<?php if (is_array($this->images)): ?>
|
||||
<ul class="legend">
|
||||
<?php foreach ($this->template->getDatasources() as $ds): ?>
|
||||
<?php if ($ds->isEnabled()): ?>
|
||||
<li><div class="color" style="background-color: <?= $this->escape($ds->getColorCss()) ?>"></div> <?= $this->qlink(
|
||||
$ds->getName(),
|
||||
$this->url()->with('disableDatasource', $ds->getPath()),
|
||||
null,
|
||||
array('title' => $this->translate('Click to disable'))
|
||||
) ?></span></li>
|
||||
<?php else: ?>
|
||||
<li class="disabled"><div class="color"></div> <?= $this->qlink(
|
||||
$ds->getName(),
|
||||
$this->url()->with('enableDatasource', $ds->getPath()),
|
||||
null,
|
||||
array('title' => $this->translate('Click to enable'))
|
||||
) ?></span></li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?= $this->render('show/legend.phtml') ?>
|
||||
<?php foreach ($this->images as $title => $url): ?>
|
||||
<img src="<?= $url ?>" alt="" width="<?= $this->width ?>" height="<?= $this->height ?>" />
|
||||
<?php endforeach ?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue