Copyright 1999-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Chuck Hagenbuch (chuck@horde.org)
Автор: Jon Parise (jon@horde.org)
Пример #1
0
 /**
  * @param Horde_Menu  $menu  A menu object
  */
 public function menu($menu)
 {
     global $conf, $injector;
     if (empty($this->highlight) && basename($_SERVER['PHP_SELF']) == 'index.php') {
         $this->highlight = 'sesha-list';
     }
     $menu->add(Horde::url('list.php'), _("_List Stock"), 'sesha-list', null, null, null, $this->highlight == 'sesha-list' ? 'current' : null);
     /* Search. */
     $menu->add(Horde::url('search.php'), _("_Search"), 'sesha-search', null, null, null, $this->highlight == 'sesha-search' ? 'current' : null);
     if (Sesha::isAdmin(Horde_Perms::READ) || $perms->hasPermission('sesha:addStock', $GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
         $menu->add(Horde::url('admin.php'), _("Administration"), 'sesha-admin');
     }
 }
Пример #2
0
 /**
  * Output the menu.
  *
  * @param string $page  The current page ('compose', 'folders', 'mailbox',
  *                                        'message', 'search').
  * @param array $items  Additional menu items to add to the menu. First
  *                      element is label, second is URL to link to.
  *
  * @return string  The menu.
  */
 public function getMenu($page, $items = array())
 {
     if (!in_array($page, array('mailbox', 'message')) || !$this->indices->mailbox->inbox) {
         $items[] = array(_("Inbox"), IMP_Minimal_Mailbox::url(array('mailbox' => 'INBOX')));
     }
     if (!in_array($page, array('compose', 'search')) && IMP_Compose::canCompose()) {
         $items[] = array(_("New Message"), IMP_Minimal_Compose::url());
     }
     if (!in_array($page, array('folders', 'search')) && $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->access(IMP_Imap::ACCESS_FOLDERS)) {
         $items[] = array(_("Folders"), IMP_Minimal_Folders::url());
     }
     $items[] = array(_("Log out"), $GLOBALS['registry']->getServiceLink('logout', 'imp')->setRaw(false));
     $menu = new Horde_Menu();
     foreach ($menu->getSiteLinks() as $menuitem) {
         if ($menuitem != 'separator') {
             $items[] = array($menuitem['text'], $menuitem['url']);
         }
     }
     return $items;
 }
Пример #3
0
 /**
  * Builds Koward's list of menu items.
  */
 public function getMenu()
 {
     $menu = new Horde_Menu();
     if ($this->koward->hasAccess('object/listall')) {
         $menu->add($this->urlFor(array('controller' => 'object', 'action' => 'listall')), _("_Objects"), 'user.png');
     }
     if ($this->koward->hasAccess('object/add', Koward::PERM_EDIT)) {
         $menu->add($this->urlFor(array('controller' => 'object', 'action' => 'add')), _("_Add"), 'plus.png');
     }
     if ($this->koward->hasAccess('object/search')) {
         $menu->add($this->urlFor(array('controller' => 'object', 'action' => 'search')), _("_Search"), 'search.png');
     }
     if (!empty($this->koward->conf['koward']['menu']['queries'])) {
         $menu->add(Horde::url('Queries'), _("_Queries"), 'query.png');
     }
     if (!empty($this->koward->conf['koward']['menu']['test'])) {
         $menu->add($this->urlFor(array('controller' => 'check', 'action' => 'show')), _("_Test"), 'problem.png');
     }
     if ($GLOBALS['registry']->getAuth()) {
         $menu->add($this->urlFor(array('controller' => 'index', 'action' => 'logout')), _("_Logout"), 'logout.png');
     }
     return $menu;
 }
Пример #4
0
 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();
     }
 }
Пример #5
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;
 }
Пример #6
0
 /**
  */
 public function menu(Horde_Menu $menu)
 {
     $menu->add(Horde::url('source.php'), _("_Browse"), 'luxor.png');
 }