render() public method

Return the rendered representation of the menu items.
public render ( ) : Horde_View_Sidebar
return Horde_View_Sidebar Sidebar view of menu elements.
示例#1
0
文件: Hylax.php 项目: horde/horde
 function getMenu($returnType = 'object')
 {
     global $registry;
     $menu = new Horde_Menu();
     $menu->addArray(array('url' => Horde::url('summary.php'), 'text' => _("Summary"), 'icon' => 'fax.png'));
     $menu->addArray(array('url' => Horde::url('folder.php'), 'text' => _("Folders"), 'icon' => 'folder.png'));
     $menu->addArray(array('url' => Horde::url('compose.php'), 'text' => _("Compose"), 'icon' => 'compose.png'));
     if ($returnType == 'object') {
         return $menu;
     } else {
         return $menu->render();
     }
 }
示例#2
0
 /**
  * Returns the sidebar for the current application.
  *
  * @param string $app  The application to generate the menu for. Defaults
  *                     to the current app.
  *
  * @return Horve_View_Sidebar  The sidebar.
  */
 public static function sidebar($app = null)
 {
     global $registry;
     if (empty($app)) {
         $app = $registry->getApp();
     }
     $menu = new Horde_Menu();
     $registry->callAppMethod($app, 'menu', array('args' => array($menu)));
     $sidebar = $menu->render();
     $registry->callAppMethod($app, 'sidebar', array('args' => array($sidebar)));
     return $sidebar;
 }