Dashboard: no more view scripts

This commit is contained in:
Thomas Gelf 2017-07-03 15:19:43 +02:00
parent cea78db5af
commit eda559ce53
3 changed files with 9 additions and 21 deletions

View File

@ -26,11 +26,20 @@ class DashboardController extends ActionController
$this->addSingleTab($this->translate('Overview'));
}
$cntDashboards = 0;
foreach ($names as $name) {
$dashboard = Dashboard::loadByName($name, $this->db());
if ($dashboard->isAvailable()) {
$cntDashboards++;
$this->content()->add($dashboard);
}
}
if ($cntDashboards === 0) {
$msg = $this->translate(
'No dashboard available, you might have not enough permissions'
);
$this->content()->add($msg);
}
}
}

View File

@ -1,16 +0,0 @@
<div class="controls">
<?= $this->tabs ?>
</div>
<div class="content">
<?php if ($this->errorMessage): ?>
<p class="error"><?= $this->errorMessage ?></p>
<?php endif ?>
<?= $this->form ?>
<?php if (empty($this->dashboards)): ?>
<?= $this->translate('No dashboard available, you might have not enough permissions') ?>
<?php endif ?>
<?php foreach ($this->dashboards as $dashboard): ?>
<?= $dashboard ?>
<?php endforeach ?>
</div>

View File

@ -1,5 +0,0 @@
<a<?= $dashlet->renderClassAttribute()?> href="<?= $this->url($dashlet->getUrl()) ?>">
<?= $this->escape($dashlet->getTitle()) ?>
<?= $this->icon($this->dashlet->getIconName()) ?>
<p><?= $dashlet->getEscapedSummary() ?></p>
</a>