Dashboard: make it easier to override behavior
This commit is contained in:
parent
24bb170889
commit
34be3801ce
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue