Needs review
Project:
Menu Icons
Version:
6.x-2.4
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2011 at 11:51 UTC
Updated:
8 Nov 2011 at 11:51 UTC
For anybody who needs the icons inline, i have created the following code, you can add this in your template.php in your themes folder
function YOURTHEMENAME_menu_item_link($link) {
if (empty($link['localized_options'])) {
$link['localized_options'] = array();
}
// you could leave $link['menu_name'] == 'primary-links' out if you want all menu's to have inline icons
if($link['menu_name'] == 'primary-links' and module_exists('menu_icons') and module_exists('imagecache')) {
if(isset($link['localized_options']['menu_icon'])) {
if($link['localized_options']['menu_icon']['enable'] == '1') {
if ($link['localized_options']['menu_icon']['path']
&& file_exists($link['localized_options']['menu_icon']['path'])) {
$picture = '<div class="menu-icon">'.
theme('imagecache', $link['localized_options']['menu_icon']['imagecache_preset'], $link['localized_options']['menu_icon']['path'])
.'</div>';
}
}
}
}
return $picture.l($link['title'], $link['href'], $link['localized_options']);
}
I have not fully tested this code, but at my site its working fine.