aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/toolbox.php
blob: 2a96d34b2047edff749672b893a4b0a1b98d160c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php

	/**
	 * Elgg standard toolbox
	 * The standard user toolbox that displays a users menu options
	 * This will be populated depending on the plugins active - only plugin navigation will appear here
	 * 
	 * @package Elgg
	 * @subpackage Core
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Curverider Ltd
	 * @copyright Curverider Ltd 2008
	 * @link http://elgg.org/
	 * 
	 */
	 
		$menu = get_register('menu');

		if (is_array($menu) && sizeof($menu) > 0) {
		
?>
<div class="elggtoolbar">
<ul class="drawers">

<?php

			foreach($menu as $item) {
				
?>

	<li class="drawer">
		<h2 class="drawer-handle"><?php echo $item->name ?></h2>
<?php

				if (sizeof($item->children) > 0 ) {
					echo "<ul>";
					foreach($item->children as $subitem) {
?>
		<li>
			<a href="<?php echo $subitem->value ?>"><?php echo $subitem->name; ?></a>
		</li>
<?php
					}
					echo "</ul>";
					
				}

?>
	</li>

<?php
				
			}

?>

</ul>    
</div>

<?php

		}

?>

<script type="text/javascript">
$(document).ready(function () {
	$('li.drawer ul:not(:first)').hide();
	
	$('h2.drawer-handle').click(function () {	
		$('li.drawer ul:visible').slideUp('medium').prev().removeClass('open');
		$(this).addClass('open').next().slideDown('fast');
	return false;
	});
});
</script>