aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/menu/elements/section.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/navigation/menu/elements/section.php')
-rw-r--r--views/default/navigation/menu/elements/section.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/views/default/navigation/menu/elements/section.php b/views/default/navigation/menu/elements/section.php
new file mode 100644
index 000000000..c0e9ba750
--- /dev/null
+++ b/views/default/navigation/menu/elements/section.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Menu group
+ *
+ * @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);
+ $section = elgg_extract('section', $vars);
+ echo '<h2>' . elgg_echo("menu:$name:header:$section") . '</h2>';
+}
+
+echo "<ul class=\"$class\">";
+foreach ($vars['items'] as $menu_item) {
+ echo elgg_view('navigation/menu/elements/item', array(
+ 'item' => $menu_item,
+ 'item_class' => $item_class,
+ ));
+}
+echo '</ul>';