From 3784fef62a8eb606713531baee75b6030239bff5 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 23 Mar 2010 14:41:55 +0000 Subject: Added selected class in navbar menu. git-svn-id: http://code.elgg.org/elgg/trunk@5478 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/navigation/site_nav.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'views') diff --git a/views/default/navigation/site_nav.php b/views/default/navigation/site_nav.php index 15b35a118..4a73d0084 100644 --- a/views/default/navigation/site_nav.php +++ b/views/default/navigation/site_nav.php @@ -10,6 +10,7 @@ $more = $nav_items['more']; $nav_html = ''; $more_nav_html = ''; +$context = get_context(); // sort more links alphabetically $more_sorted = array(); @@ -26,19 +27,21 @@ $item_count = 0; // if there are no featured items, display the standard tools in alphabetical order if ($featured) { foreach ($featured as $info) { + $selected = ($info->value->context == $context) ? 'class="selected"' : ''; $title = htmlentities($info->name, ENT_QUOTES, 'UTF-8'); $url = htmlentities($info->value->url, ENT_QUOTES, 'UTF-8'); - $nav_html .= "
  • $title
  • "; + $nav_html .= "
  • $title
  • "; } } elseif ($more) { for ($i=0; $i<6; $i++) { $info = $more[$i]; + $selected = ($info->value->context == $context) ? 'class="selected"' : ''; $title = htmlentities($info->name, ENT_QUOTES, 'UTF-8'); $url = htmlentities($info->value->url, ENT_QUOTES, 'UTF-8'); - $nav_html .= "
  • $title
  • "; + $nav_html .= "
  • $title
  • "; $more[$i]->used = TRUE; $item_count++; } @@ -49,10 +52,11 @@ foreach ($more as $info) { if ($info->used) { continue; } + $selected = ($info->value->context == $context) ? 'class="selected"' : ''; $title = htmlentities($info->name, ENT_QUOTES, 'UTF-8'); $url = htmlentities($info->value->url, ENT_QUOTES, 'UTF-8'); - $more_nav_html .= "
  • $title
  • \n"; + $more_nav_html .= "
  • $title
  • \n"; $item_count++; } -- cgit v1.2.3