[imp] Custom folder icons not shown in sidebar

Oliver Kuhl okuhl at netcologne.de
Fri Dec 9 02:48:50 PST 2005


Hi,

I use _imp_hook_mbox_icons() to set a custom icon for the INBOX.Spam
folder. This works fine in /imp/folders.php, but the icon is not changed
in the sidebar.

I looked into /imp/lib/Block/tree_folders.php and found out, that
$mbox_icons is never set, because the hook is called nowhere. After
inserting the hook call, $mbox_icons is there, but the value does not
fit. While in folders.php a complete <img> must be returned, in
tree_folders.php only the filename is needed, i.e. spam.png.

As workaround, I modified the hook-function to
_imp_hook_mbox_icons($filename_only = false) {[...]}, so the result
value fits now. But this really is an evil workaround, I think.

So what is your opinion about this issue? Should the hook always return
the filename only and the <img> will be generated in folders.php, or
should the hook maybe return an array with every information needed,
just like this?

         $newmailboxes['INBOX.Spam'] = array(
             'spam.png',
             _("Spam"),
             'width="16" height="16" style="vertical-align:middle"',
             $GLOBALS['registry']->getImageDir('imp').'/folders'
         );

         return $newmailboxes;

Whatever, the change must be made somewhere. Just to make sure, my patch
will fit you developer's ideas, please tell me how you think about it.

Regards,
    Ollie.


More information about the imp mailing list