Add custom menu items.
authorJan Schneider <jan@horde.org>
Mon, 1 Mar 2010 13:29:15 +0000 (14:29 +0100)
committerJan Schneider <jan@horde.org>
Mon, 1 Mar 2010 13:29:15 +0000 (14:29 +0100)
kronolith/index.php
kronolith/templates/index/index.inc

index ae8dba2..05e7efc 100644 (file)
@@ -17,6 +17,7 @@ if (!$prefs->getValue('dynamic_view') || !$browser->hasFeature('xmlhttpreq') ||
 }
 
 /* Load Ajax interface. */
+$menu = new Horde_Menu();
 $help_link = Horde::getServiceLink('help', 'kronolith');
 if ($help_link) {
     $help_link = Horde::widget($help_link, _("Help"), 'helplink', 'help', Horde::popupJs($help_link, array('urlencode' => true)) . 'return false;');
index 8dd3213..6cb8d71 100644 (file)
@@ -7,7 +7,15 @@
     <?php if (count($GLOBALS['conf']['menu']['apps'])): ?>
     <div id="kronolithApplications">
       <ul>
-        <li class="kronolithApplicationSelected"><a href="#" id="kronolithApplication-kronolith" title="<?php echo $GLOBALS['registry']->get('name') ?>"><img src="<?php echo $GLOBALS['registry']->get('icon') ?>" /> <?php echo $GLOBALS['registry']->get('name') ?></a></li>
+        <?php foreach ($menu->getSiteLinks() as $key => $menu_item): ?>
+        <?php if ($menu_item == 'separator'): ?>
+      </ul>
+      <span class="kronolithSeparator">|</span>
+      <ul>
+        <?php else: ?>
+        <li><a href="<?php echo $menu_item['url'] ?>" title="<?php echo $menu_item['text'] ?>" id="kronolithMenu-<?php echo $key ?>"><img src="<?php echo $menu_item['icon_path'] . '/' . $menu_item['icon'] ?>" alt="<?php echo $menu_item['text'] ?>" /> <?php echo $menu_item['text'] ?></a></li>
+        <?php endif; ?>
+        <?php endforeach; ?>
         <?php foreach ($GLOBALS['conf']['menu']['apps'] as $app): ?>
         <?php if ($GLOBALS['registry']->hasAjaxView($app)): ?>
         <li><a href="<?php echo $GLOBALS['registry']->get('webroot', $app) ?>" id="kronolithApplication-<?php echo $app ?>" title="<?php echo $GLOBALS['registry']->get('name', $app) ?>"><img src="<?php echo $GLOBALS['registry']->get('icon', $app) ?>" /> <?php echo $GLOBALS['registry']->get('name', $app) ?></a></li>