aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 04:18:15 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 04:18:15 +0000
commit10b71502f8770c29a4d79266f1f242bd136e78ce (patch)
tree3d3d2a1ae186e17afb3b70de7a4e68f98a122cf6 /views
parentb5e2bf119e91ec16b9df6eb35ff58b13390fecef (diff)
downloadelgg-10b71502f8770c29a4d79266f1f242bd136e78ce.tar.gz
elgg-10b71502f8770c29a4d79266f1f242bd136e78ce.tar.bz2
Added 4 methods to ElggMenuItem: get/setLinkClass() and get/setItemClass(). This allows you to put classes on the a and li tags it generates.
git-svn-id: http://code.elgg.org/elgg/trunk@8313 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r--views/default/navigation/menu/elements/item.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php
index 5a9a8743d..7b07c9485 100644
--- a/views/default/navigation/menu/elements/item.php
+++ b/views/default/navigation/menu/elements/item.php
@@ -1,19 +1,28 @@
<?php
+/**
+ * A single element of a menu.
+ *
+ * @package Elgg.Core
+ * @subpackage Navigation
+ */
$item = $vars['item'];
-$class = '';
$link_class = 'elgg-menu-closed';
if ($item->getSelected()) {
- $class = 'class="elgg-state-selected"';
+ $item->setItemClass('elgg-state-selected');
$link_class = 'elgg-menu-opened';
}
-$link_vars = array();
-
$children = $item->getChildren();
if ($children) {
- $link_vars['class'] = "elgg-menu-parent $link_class";
+ $item->setLinkClass($link_class);
+ $item->setLinkClass('elgg-menu-parent');
+}
+
+$item_class = $item->getItemClass();
+if ($item_class) {
+ $class = "class=\"$item_class\"";
}
echo "<li $class>";