diff options
author | cash <cash.costello@gmail.com> | 2011-12-08 19:28:56 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2011-12-08 19:28:56 -0500 |
commit | cb20d84a4ce17c8071e8f474b82341ec1aec083d (patch) | |
tree | c1ddfac4481b6999c7202969bae2eb3291ebbd09 /views/default/navigation/menu/elements | |
parent | e4067b9e9146de425dc391bbe3767a9ca3e4e602 (diff) | |
download | elgg-cb20d84a4ce17c8071e8f474b82341ec1aec083d.tar.gz elgg-cb20d84a4ce17c8071e8f474b82341ec1aec083d.tar.bz2 |
added the ability to pass a class to be applied to all menu item <li> elements
Diffstat (limited to 'views/default/navigation/menu/elements')
-rw-r--r-- | views/default/navigation/menu/elements/item.php | 6 | ||||
-rw-r--r-- | views/default/navigation/menu/elements/section.php | 17 |
2 files changed, 17 insertions, 6 deletions
diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php index 5d6a7e367..22383ce0b 100644 --- a/views/default/navigation/menu/elements/item.php +++ b/views/default/navigation/menu/elements/item.php @@ -4,6 +4,9 @@ * * @package Elgg.Core * @subpackage Navigation + * + * @uses $vars['item'] ElggMenuItem + * @uses $vars['item_class'] Additional CSS class for the menu item */ $item = $vars['item']; @@ -21,6 +24,9 @@ if ($children) { } $item_class = $item->getItemClass(); +if (isset($vars['item_class']) && $vars['item_class']) { + $item_class .= ' ' . $vars['item_class']; +} echo "<li class=\"$item_class\">"; echo $item->getContent(); diff --git a/views/default/navigation/menu/elements/section.php b/views/default/navigation/menu/elements/section.php index 92a259776..c0e9ba750 100644 --- a/views/default/navigation/menu/elements/section.php +++ b/views/default/navigation/menu/elements/section.php @@ -2,15 +2,17 @@ /** * Menu group * - * @uses $vars['items'] - * @uses $vars['class'] - * @uses $vars['name'] - * @uses $vars['section'] - * @uses $vars['show_section_headers'] + * @uses $vars['items'] Array of menu items + * @uses $vars['class'] Additional CSS class for the section + * @uses $vars['name'] Name of the menu + * @uses $vars['section'] The section name + * @uses $vars['item_class'] Additional CSS class for each menu item + * @uses $vars['show_section_headers'] Do we show headers for each section */ $headers = elgg_extract('show_section_headers', $vars, false); $class = elgg_extract('class', $vars, ''); +$item_class = elgg_extract('item_class', $vars, ''); if ($headers) { $name = elgg_extract('name', $vars); @@ -20,6 +22,9 @@ if ($headers) { echo "<ul class=\"$class\">"; foreach ($vars['items'] as $menu_item) { - echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); + echo elgg_view('navigation/menu/elements/item', array( + 'item' => $menu_item, + 'item_class' => $item_class, + )); } echo '</ul>'; |