[dev] patch for Menu.php

Nuno Loureiro nuno at co.sapo.pt
Sat Sep 13 16:58:58 PDT 2003


Hi!

I added 2 more keys to the menu items array. An 'id' and an 'active'.

One advantage of this, is to allow you to do things like this (so you
can give more freedom to the designer to change the menu):

--php--
$items = $menu->getMenu();
foreach ($items as $k => $v) {
    if (!strstr($v['id'], 'app:')) {
        $template->set('mitem_' . $v['id'], array($v),
isset($v['active']) );
    } else {
        $itemapps[] = $v;
    }
}

--template--
   <table border="0" width="100%">
        <tr>
        <loop:mitem_mailbox>
        <td align="center" nowrap="nowrap" valign="<tag:menu_view />"
class="<tag:mitem_mailbox.status />"><a href="<tag:mitem_mailbox.url
/>"  onmouseout="window.status='';"
onmouseover="window.status='<tag:mitem_mailbox.text />'; return true;"
class="menuitem" accesskey="<tag:mitem_mailbox.accesskey />"
target="<tag:mitem_mailbox.targ
et />"><tag:mitem_mailbox.button /></a>&nbsp;</td>
        </loop:mitem_mailbox>
        <loop:mitem_empty_trash>
        <if:mitem_empty_trash.active>
        <td align="center" nowrap="nowrap" valign="<tag:menu_view />"
class="<tag:mitem_empty_trash.status />"><a
href="<tag:mitem_empty_trash.url />"  onmouseout="windo
w.status='';" onmouseover="window.status='<tag:mitem_empty_trash.text
/>'; return true;" class="menuitem"
accesskey="<tag:mitem_empty_trash.accesskey />" target="<tag:mi
tem_empty_trash.target />"><tag:mitem_empty_trash.button
/></a>&nbsp;</td>
        </if:mitem_empty_trash.active>
        </loop:mitem_empty_trash>
     ....etc...

-nuno


-- 
Nuno Loureiro <nuno at co.sapo.pt>
PTM.com - http://www.sapo.pt/
PGP fingerprint = 8A32 5174 E80C 2D40 9075 405E C107 6592 054A 4D05
-------------- next part --------------
A non-text attachment was scrubbed...
Name: menu.diff
Type: text/x-patch
Size: 2730 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20030914/dc574c89/menu.bin


More information about the dev mailing list