Dashboard: make it easier to override behavior

This commit is contained in:
Thomas Gelf 2016-12-14 12:34:40 +01:00
parent 24bb170889
commit 34be3801ce
1 changed files with 20 additions and 8 deletions

View File

@ -86,20 +86,32 @@ abstract class Dashboard implements Countable
public function dashlets()
{
if ($this->dashlets === null) {
if ($this->dashletNames === null) {
$this->dashlets = Dashlet::loadAll($this);
} else {
$this->dashlets = Dashlet::loadByNames(
$this->dashletNames,
$this
);
}
$this->loadDashlets();
$this->fetchDashletSummaries();
}
return $this->dashlets;
}
public function loadDashlets()
{
$names = $this->getDashletNames();
if (empty($names)) {
$this->dashlets = array();
} else {
$this->dashlets = Dashlet::loadByNames(
$this->dashletNames,
$this
);
}
}
public function getDashletNames()
{
return $this->dashletNames;
}
protected function fetchDashletSummaries()
{
$types = array();