Navigation/DashboardPane: Properly register dashlets as children
refs #3542
This commit is contained in:
parent
37a972cf75
commit
4fdfb190ad
|
@ -314,9 +314,12 @@ class Module
|
|||
$navigation = new Navigation();
|
||||
foreach ($panes as $pane) {
|
||||
/** @var DashboardContainer $pane */
|
||||
$dashlets = array();
|
||||
$dashlets = [];
|
||||
foreach ($pane->getDashlets() as $dashletName => $dashletUrl) {
|
||||
$dashlets[$this->translate($dashletName)] = $dashletUrl;
|
||||
$dashlets[$dashletName] = [
|
||||
'label' => $this->translate($dashletName),
|
||||
'url' => $dashletUrl
|
||||
];
|
||||
}
|
||||
|
||||
$navigation->addItem(
|
||||
|
@ -326,7 +329,7 @@ class Module
|
|||
array(
|
||||
'label' => $this->translate($pane->getName()),
|
||||
'type' => 'dashboard-pane',
|
||||
'dashlets' => $dashlets
|
||||
'children' => $dashlets
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -62,19 +62,6 @@ class DashboardPane extends NavigationItem
|
|||
$this->setUrl(Url::fromPath('dashboard', array('pane' => $this->getName())));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function merge(NavigationItem $item)
|
||||
{
|
||||
parent::merge($item);
|
||||
|
||||
$this->setDashlets(array_merge(
|
||||
$this->getDashlets(false),
|
||||
$item->getDashlets(false)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set disabled state for pane
|
||||
*
|
||||
|
|
|
@ -77,8 +77,8 @@ class Dashboard extends AbstractWidget
|
|||
foreach ($navigation as $dashboardPane) {
|
||||
/** @var DashboardPane $dashboardPane */
|
||||
$pane = new Pane($dashboardPane->getLabel());
|
||||
foreach ($dashboardPane->getDashlets(false) as $title => $url) {
|
||||
$pane->addDashlet($title, $url);
|
||||
foreach ($dashboardPane->getChildren() as $dashlet) {
|
||||
$pane->addDashlet($dashlet->getLabel(), $dashlet->getUrl());
|
||||
}
|
||||
|
||||
$panes[] = $pane;
|
||||
|
|
Loading…
Reference in New Issue