function mmenu_get_icon_class in Mobile sliding menu 7.3
Same name and namespace in other branches
- 8 mmenu.module \mmenu_get_icon_class()
- 7.2 mmenu.module \mmenu_get_icon_class()
Get the icon class for the given path or block title.
Parameters
string $type: The type of the icon. Possible values: path or block.
string $value: The info of the given path or block.
Return value
string An icon class name.
2 calls to mmenu_get_icon_class()
- template_preprocess_mmenu in ./
mmenu.module - Processes variables for mmenu.tpl.php.
- theme_mmenu_tree in ./
mmenu.module - Returns HTML for a wrapper for a mmenu tree.
File
- ./
mmenu.module, line 1345 - Primarily Drupal hooks and global API functions to manipulate mmenus.
Code
function mmenu_get_icon_class($type = 'path', $value = '') {
$icons = mmenu_icon_list();
$class = '';
switch ($type) {
case 'path':
$value = trim($value, '/');
$class = isset($icons['path'][$value]) ? $icons['path'][$value] : 'icon-list2';
break;
case 'block':
foreach ($icons['block'] as $block) {
if ($block['module'] == $value['module'] && $block['delta'] == $value['delta']) {
return $block['icon_class'];
}
}
$class = 'icon-list2';
break;
}
return $class;
}