From: Jan Schneider Date: Thu, 9 Dec 2010 11:11:52 +0000 (+0100) Subject: Update menu loading. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cdf8d00b9060c79d3e028eea62c005d2786c94ea;p=horde.git Update menu loading. --- diff --git a/vilma/domains/index.php b/vilma/domains/index.php index 4810289c1..eea068062 100644 --- a/vilma/domains/index.php +++ b/vilma/domains/index.php @@ -37,7 +37,7 @@ foreach ($domains as $id => $domain) { $template = $injector->createInstance('Horde_Template'); $template->setOption('gettext', true); $template->set('domains', $domains, true); -$template->set('menu', Vilma::getMenu('string')); +$template->set('menu', Horde::menu()); Horde::startBuffer(); $notification->notify(array('listeners' => 'status')); diff --git a/vilma/lib/Application.php b/vilma/lib/Application.php index cd137f879..732b6d343 100644 --- a/vilma/lib/Application.php +++ b/vilma/lib/Application.php @@ -88,4 +88,21 @@ class Vilma_Application extends Horde_Registry_Application return $perms; } + + /** + * Add additional items to the menu. + * + * @param Horde_Menu $menu The menu object. + */ + public function menu($menu) + { + $menu->add(Horde::url('domains/index.php'), _("_Domains"), 'domain.png'); + if ($GLOBALS['vilma']->curdomain) { + $domain = $GLOBALS['session']->get('vilma', 'domain'); + $menu->add(Horde::url('users/index.php')->add('domain_id', $domain['domain_id']), $domain['domain_name'], 'domain.png'); + $menu->add(Horde::url('users/edit.php'), _("New _Address"), 'user.png'); + } else { + $menu->add(Horde::url('domains/edit.php'), _("_New Domain"), 'domain.png'); + } + } } diff --git a/vilma/lib/Vilma.php b/vilma/lib/Vilma.php index f19bdb071..b9d137dc4 100644 --- a/vilma/lib/Vilma.php +++ b/vilma/lib/Vilma.php @@ -130,31 +130,4 @@ class Vilma $conf['mailboxes']['params']); return $driver; } - - /** - * Build Vilma's list of menu items. - */ - function getMenu($returnType = 'object') - { - $menu = new Horde_Menu(); - - $menu->add(Horde::url('domains/index.php'), _("_Domains"), 'domain.png'); - - if ($GLOBALS['vilma']->curdomain) { - $domain = $GLOBALS['session']->get('vilma', 'domain'); - $url = Horde::url('users/index.php'); - $tmp = Horde_Util::addParameter($url, 'domain_id', $domain['domain_id']); - $menu->add(Horde::url($tmp), _($domain['domain_name']), 'domain.png'); - $menu->add(Horde::url('users/edit.php'), _("New _Address"), 'user.png'); - } else { - $menu->add(Horde::url('domains/edit.php'), _("_New Domain"), 'domain.png'); - } - - if ($returnType == 'object') { - return $menu; - } else { - return $menu->render(); - } - } - } diff --git a/vilma/templates/common-header.inc b/vilma/templates/common-header.inc index 96299076e..1390c38ba 100644 --- a/vilma/templates/common-header.inc +++ b/vilma/templates/common-header.inc @@ -21,6 +21,7 @@ Horde::outputMetaTags(); Horde::includeScriptFiles(); Horde::includeFavicon(); Horde::includeStylesheetFiles(); +Horde::outputInlineScript(); ?> <?php echo htmlspecialchars($page_title) ?> diff --git a/vilma/templates/domains/index.html b/vilma/templates/domains/index.html index 6bef877c3..ae828028f 100644 --- a/vilma/templates/domains/index.html +++ b/vilma/templates/domains/index.html @@ -1,6 +1,4 @@ - + diff --git a/vilma/templates/users/index.html b/vilma/templates/users/index.html index 68a2d93e4..391af24e7 100644 --- a/vilma/templates/users/index.html +++ b/vilma/templates/users/index.html @@ -1,6 +1,4 @@ - + diff --git a/vilma/templates/virtuals/index.html b/vilma/templates/virtuals/index.html index 88294f7ab..4ea71fa90 100644 --- a/vilma/templates/virtuals/index.html +++ b/vilma/templates/virtuals/index.html @@ -1,6 +1,4 @@ - + diff --git a/vilma/users/index.php b/vilma/users/index.php index 4e1a5bc11..e4d6f5444 100644 --- a/vilma/users/index.php +++ b/vilma/users/index.php @@ -126,7 +126,7 @@ $template = $injector->createInstance('Horde_Template'); $template->setOption('gettext', true); $template->set('addresses', $addresses, true); $template->set('maxusers', $maxusers, true); -$template->set('menu', Vilma::getMenu('string')); +$template->set('menu', Horde::menu()); $template->set('tabs', $tabs->render()); Horde::startBuffer(); diff --git a/vilma/virtuals/index.php b/vilma/virtuals/index.php index fe347214a..22cca996a 100644 --- a/vilma/virtuals/index.php +++ b/vilma/virtuals/index.php @@ -56,7 +56,7 @@ $images = array('delete' => Horde::img('delete.png', _("Delete User")), 'edit' => Horde::img('edit.png', _("Edit User"))); $template->set('images', $images); -$template->set('menu', Vilma::getMenu('string')); +$template->set('menu', Horde::menu()); Horde::startBuffer(); $notification->notify(array('listeners' => 'status'));