From 0392da871d2923ae81322d7cfa1947d909a69a8e Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 17 Jul 2009 15:15:05 -0600 Subject: [PATCH] Add getSiteLinks() --- framework/Core/lib/Horde/Menu.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/framework/Core/lib/Horde/Menu.php b/framework/Core/lib/Horde/Menu.php index 5e54896a2..2c9cbc48a 100644 --- a/framework/Core/lib/Horde/Menu.php +++ b/framework/Core/lib/Horde/Menu.php @@ -277,14 +277,26 @@ class Horde_Menu */ public function addSiteLinks() { + foreach ($this->getSiteLinks() as $menuitem) { + $this->addArray($menuitem); + } + } + + /** + * Get the list of site links to add to the menu. + * + * @return array A list of menu items to add. + */ + public function getSiteLinks() + { if (is_readable($this->_menufile)) { include $this->_menufile; if (isset($_menu) && is_array($_menu)) { - foreach ($_menu as $menuitem) { - $this->addArray($menuitem); - } + return $_menu; } } + + return array(); } /** -- 2.11.0