Skip to content

Commit

Permalink
Add topbar example.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jan 20, 2017
1 parent 39a2f72 commit 8425ef1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions skeleton/lib/Application.php
Expand Up @@ -157,4 +157,32 @@ public function sidebar($sidebar)
'bar'
);
}

/**
* Add node(s) to the topbar tree.
*
* @param Horde_Tree_Renderer_Base $tree Tree object.
* @param string $parent The current parent element.
* @param array $params Additional parameters.
*
* @throws Horde_Exception
*/
public function topbarCreate(Horde_Tree_Renderer_Base $tree, $parent = null,
array $params = array())
{
switch ($params['id']) {
case 'menu':
$tree->addNode(array(
'id' => $parent . '__sub',
'parent' => $parent,
'label' => _("Sub Item"),
'expanded' => false,
'params' => array(
'icon' => Horde_Themes::img('add.png'),
'url' => Horde::url('item.php'),
),
));
break;
}
}
}

0 comments on commit 8425ef1

Please sign in to comment.