aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/menu/default.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/navigation/menu/default.php')
-rw-r--r--views/default/navigation/menu/default.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/views/default/navigation/menu/default.php b/views/default/navigation/menu/default.php
new file mode 100644
index 000000000..006deb3ea
--- /dev/null
+++ b/views/default/navigation/menu/default.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Default menu
+ *
+ * @uses $vars['name'] Name of the menu
+ * @uses $vars['menu'] Array of menu items
+ * @uses $vars['class'] Additional CSS class for the menu
+ * @uses $vars['item_class'] Additional CSS class for each menu item
+ * @uses $vars['show_section_headers'] Do we show headers for each section?
+ */
+
+// we want css classes to use dashes
+$vars['name'] = preg_replace('/[^a-z0-9\-]/i', '-', $vars['name']);
+$headers = elgg_extract('show_section_headers', $vars, false);
+$item_class = elgg_extract('item_class', $vars, '');
+
+$class = "elgg-menu elgg-menu-{$vars['name']}";
+if (isset($vars['class'])) {
+ $class .= " {$vars['class']}";
+}
+
+foreach ($vars['menu'] as $section => $menu_items) {
+ echo elgg_view('navigation/menu/elements/section', array(
+ 'items' => $menu_items,
+ 'class' => "$class elgg-menu-{$vars['name']}-$section",
+ 'section' => $section,
+ 'name' => $vars['name'],
+ 'show_section_headers' => $headers,
+ 'item_class' => $item_class,
+ ));
+}