function menu_icons_get_active_icon in Menu Icons 6
Return the path to the menu icon for the currently active item Useful for providing context-sensitive image blocks
Parameters
inheret If set to true, and the active item doesn't have: an icon, the next-highest parent with an icon will be returned.
File
- ./
menu_icons.module, line 295 - Module to associate icons with menu items
Code
function menu_icons_get_active_icon($inherit = TRUE) {
foreach (array_reverse(menu_get_active_trail()) as $menu) {
if ($menu['mlid'] && ($path = menu_icons_get_path($menu['mlid']))) {
return array(
'path' => $path,
'title' => $menu['title'],
);
}
else {
if (!$inherit) {
if (variable_get('menu_icons_default_icon', '')) {
return array(
'path' => variable_get('menu_icons_default_icon', ''),
'title' => 'default',
);
}
}
}
}
if (variable_get('menu_icons_default_icon', '')) {
return array(
'path' => variable_get('menu_icons_default_icon', ''),
'title' => 'default',
);
}
}