aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/submenu_item.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/navigation/submenu_item.php')
-rw-r--r--views/default/navigation/submenu_item.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/views/default/navigation/submenu_item.php b/views/default/navigation/submenu_item.php
new file mode 100644
index 000000000..c64f8a679
--- /dev/null
+++ b/views/default/navigation/submenu_item.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Elgg submenu item. Displays the <li> part of a submenu.
+ *
+ * @uses $vars['group']
+ * @uses $vars['item']
+ * @uses $vars['children_html']
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$group = (isset($vars['group'])) ? $vars['group'] : 'default';
+$item = (isset($vars['item'])) ? $vars['item'] : FALSE;
+$children_html = (isset($vars['children_html'])) ? $vars['children_html'] : FALSE;
+
+
+if ($item) {
+ $has_children = (isset($item->children) && $item->children) ? TRUE : FALSE;
+ $selected = (isset($item->selected) && $item->selected == TRUE) ? 'class="selected"' : '';
+ $js = (isset($vars['js'])) ? $vars['js'] : '';
+
+ $child_indicator = '';
+ if ($has_children) {
+ if ($selected) {
+ $child_indicator = '<span class="close_child">-</span>';
+ $child_indicator .= '<span class="hidden open_child">+</span>';
+ } else {
+ $child_indicator = '<span class="hidden close_child">-</span>';
+ $child_indicator .= '<span class="open_child">+</span>';
+ }
+
+ $child_indicator = "<span class=\"child_indicator\">$child_indicator </span>";
+ }
+
+ $url = htmlentities($item->url);
+ $text = $child_indicator . htmlentities($item->text);
+}
+?>
+<li <?php echo $selected; ?>><a href="<?php echo $url; ?>" <?php echo $js; ?>><?php echo $text; ?></a><?php echo $children_html; ?></li>