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 ?> <?php endif ?>
<ul class="main-actions" data-base-target="_next"> <ul class="main-actions" data-base-target="_next">
<?php foreach ($dashboard->dashlets() as $dashlet): ?> <?php foreach ($dashboard->dashlets() as $dashlet): ?>
<?php if (! $dashlet->shouldBeShown()) { continue; } ?>
<li> <li>
<?= $dashlet->render() ?> <?= $dashlet->render() ?>
</li> </li>

View File

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