aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-16 23:32:45 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-16 23:32:45 +0000
commit472aa15c24655c4d978019edaa4669700964325d (patch)
tree225509f18b563d1bce89f661a1b76ac469c461d3 /views/default/navigation
parent05edae9a09b52f4e0aad5c1a6bdfa17eae4426cb (diff)
downloadelgg-472aa15c24655c4d978019edaa4669700964325d.tar.gz
elgg-472aa15c24655c4d978019edaa4669700964325d.tar.bz2
Sticky menu items, but also, much more intelligent context detection. Plugin authors need not bother with set_context() any more - the context should be set automatically. This is overruled by page handling settings, if set, which use the first element of the URL to determine context. Fixes #32
git-svn-id: https://code.elgg.org/elgg/trunk@940 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/navigation')
-rw-r--r--views/default/navigation/toolbox.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/views/default/navigation/toolbox.php b/views/default/navigation/toolbox.php
index 6ee04f00b..91a96d1fb 100644
--- a/views/default/navigation/toolbox.php
+++ b/views/default/navigation/toolbox.php
@@ -25,13 +25,14 @@
<ul class="drawers">
<?php
-
+
+ $key = 0;
foreach($menu as $item) {
?>
<li class="drawer">
- <h2 class="drawer-handle"><?php echo $item->name ?></h2>
+ <h2 id="nav_<?php echo $contexts[$key]; ?>" class="drawer-handle"><?php echo $item->name ?></h2>
<?php
if (sizeof($item->children) > 0 ) {
@@ -50,7 +51,8 @@
?>
</li>
-<?php
+<?php
+ $key++;
}
@@ -62,7 +64,21 @@
<?php
}
-
+
+ if (in_array(get_context(),$contexts)) {
+ $key = array_search(get_context(),$contexts);
?>
+<script language="javascript">
+ $(document).ready(function(){
+ $('h2#nav_<?php echo $contexts[$key]; ?>').click();
+ });
+</script>
+
+
+<?php
+
+ }
+
+?> \ No newline at end of file