aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/submenu_group.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-08 03:42:23 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-08 03:42:23 +0000
commitaa011b14603ba807121c811399685895a9c75d67 (patch)
tree26a2916749929b34f5295fa55ee4c7d62126e17d /views/default/navigation/submenu_group.php
parent7682706a46a20e3e58a9afd8ba208d5b0c040499 (diff)
downloadelgg-aa011b14603ba807121c811399685895a9c75d67.tar.gz
elgg-aa011b14603ba807121c811399685895a9c75d67.tar.bz2
Added new submenu system.
Added elgg_http_url_is_identical(). Moved canvas_header/submenu* to navigation/submenu*. Added UI test for submenu. git-svn-id: http://code.elgg.org/elgg/trunk@5982 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/navigation/submenu_group.php')
-rw-r--r--views/default/navigation/submenu_group.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/views/default/navigation/submenu_group.php b/views/default/navigation/submenu_group.php
new file mode 100644
index 000000000..08e417494
--- /dev/null
+++ b/views/default/navigation/submenu_group.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Elgg submenu group. Writes the <ul> for a submenu and passes items one by one
+ * to navigation/submenu_item
+ *
+ * @uses $vars['group_name']
+ * @uses $vars['items']
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$group = (isset($vars['group'])) ? $vars['group'] : 'default';
+$items = (isset($vars['items'])) ? $vars['items'] : array();
+$hidden = (isset($vars['hidden']) && $vars['hidden']) ? 'hidden' : '';
+$child = (isset($vars['child']) && $vars['child']) ? 'child' : '';
+
+echo "<ul class='submenu $group $hidden $child'>\n";
+
+foreach ($items as $item) {
+ $item_vars = array('item' => $item, 'group' => $group);
+ if (isset($item->vars) && is_array($item->vars)) {
+ $item_vars = array_merge($item->vars, $item_vars);
+ }
+
+ if (isset($item->children)) {
+ $child_vars = array(
+ 'group' => $group,
+ 'items' => $item->children,
+ // if this menu item is selected, make sure to display the full tree
+ // ie, don't hide it.
+ 'hidden' => !$item->selected,
+ 'child' => TRUE
+ );
+ $item_vars['children_html'] = elgg_view('navigation/submenu_group', $child_vars);
+ }
+
+ echo elgg_view('navigation/submenu_item', $item_vars);
+}
+
+echo "</ul>\n"; \ No newline at end of file