Dashlet: allow to hide regardless of permissions

This commit is contained in:
Thomas Gelf 2016-12-14 12:34:02 +01:00
parent a6962dc326
commit 24bb170889
2 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,7 @@ if ($description !== null): ?>
<?php endif ?>
<ul class="main-actions" data-base-target="_next">
<?php foreach ($dashboard->dashlets() as $dashlet): ?>
<?php if (! $dashlet->shouldBeShown()) { continue; } ?>
<li>
<?= $dashlet->render() ?>
</li>

View File

@ -151,6 +151,11 @@ abstract class Dashlet
return true;
}
public function shouldBeShown()
{
return true;
}
public function getSummary()
{
$result = '';