aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/site_nav.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-23 14:41:55 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-23 14:41:55 +0000
commit3784fef62a8eb606713531baee75b6030239bff5 (patch)
treea314d2dca1a0b5db360376f1bd99749ad35f2158 /views/default/navigation/site_nav.php
parentcbbcef18b03d025f04b1a455c8ea9fb265b0a65f (diff)
downloadelgg-3784fef62a8eb606713531baee75b6030239bff5.tar.gz
elgg-3784fef62a8eb606713531baee75b6030239bff5.tar.bz2
Added selected class in navbar menu.
git-svn-id: http://code.elgg.org/elgg/trunk@5478 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/navigation/site_nav.php')
-rw-r--r--views/default/navigation/site_nav.php10
1 files changed, 7 insertions, 3 deletions
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 .= "<li><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>";
+ $nav_html .= "<li $selected><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>";
}
} 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 .= "<li><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>";
+ $nav_html .= "<li $selected><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>";
$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 .= "<li><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>\n";
+ $more_nav_html .= "<li $selected><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>\n";
$item_count++;
}