DashboardPane: Order dashlets alphabetically

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-16 15:31:41 +02:00
parent 1e39ec668a
commit 54d08f99e8

View File

@ -33,11 +33,21 @@ class DashboardPane extends NavigationItem
/** /**
* Return this pane's dashlets * Return this pane's dashlets
* *
* @param bool $order Whether to order the dashlets first
*
* @return array * @return array
*/ */
public function getDashlets() public function getDashlets($order = true)
{ {
return $this->dashlets ?: array(); if ($this->dashlets === null) {
return array();
}
if ($order) {
ksort($this->dashlets);
}
return $this->dashlets;
} }
/** /**
@ -56,8 +66,8 @@ class DashboardPane extends NavigationItem
parent::merge($item); parent::merge($item);
$this->setDashlets(array_merge( $this->setDashlets(array_merge(
$this->getDashlets(), $this->getDashlets(false),
$item->getDashlets() $item->getDashlets(false)
)); ));
} }
} }