unl_nav.php 3.28 KB
Newer Older
1
2
3
4
5
6
7
8
<?php

	/**
	 * Elgg navigtion for UNL template college nav
	 * The standard elgg top toolbar
	 * 
	 */
?>
9
10
11
12
13
<?php 
	//set the current page tab
	function setSelectedTab($linkPath) 
	{
		if(stristr($_SERVER['REQUEST_URI'], $linkPath)){
14
			return ' class="selected"';
15
16
17
		}
	}
?>
Seth Meranda's avatar
Seth Meranda committed
18
19
20
<?php
     if (!isloggedin()) {
?>
21
22
23
24
25
26
27
28
29
<div class="wdn_notice" id="officialMessage">
	<div class="message">
		<div class="message_sale">
			<h4>Planet Red is <strong>your</strong> UNL Social Network.</h4>
			<h6>Put Yourself on the Map</h6>
		</div>
		<div class="message_action">
			<a href="<?php echo $vars['url']; ?>account/register.php" title="Register to join Planet Red"><span>Join now</span></a>
		</div>
30
		<div class="message_action" style="margin-left:28px;font-size:1.3em;width:97px;">
31
		 	or <a href="<?php echo $vars['url']; ?>pg/login" id="loginLink"><strong>Login</strong></a>
32
33
34
		 </div>
	</div>
</div>
35

36
37

<?php //This is the login details hidden with CSS and displayed in the colorbox. With CAS enabled this comes from cas_auth_unl views folder?>
38
<div class="hidden">
39
	<?php echo elgg_view('account/forms/login'); ?>
40
</div>
41

42
<?php }?>
43
44
45
<?php
     if (isloggedin()) {
?>
46
47
<ul class="wdn_tabs disableSwitching">
	<li>
48
        <a href="<?php echo $_SESSION['user']->getURL(); ?>" ><span style="background:url('<?php echo $_SESSION['user']->getIcon('topbar'); ?>') no-repeat; padding-left:20px;">Profile</span></a>
49
    </li>
50
    <li <?php echo setSelectedTab('pg/dashboard/');?>>
51
        <a href="<?php echo $vars['url']; ?>pg/dashboard/"><span><?php echo elgg_echo('dashboard'); ?></span></a>
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
	</li>
<?php

        // recreate tools menu compatible with UNL template
	 
		$menu = get_register('menu');
		
		

		if (is_array($menu) && sizeof($menu) > 0) {
			$alphamenu = array();
			foreach($menu as $item) {
				$alphamenu[$item->name] = $item;
			}
			ksort($alphamenu);
			
			foreach($alphamenu as $item) {
69
70
71
				$requestURI = explode($vars['url'], $item->value);
				$selectedTab = setSelectedTab($requestURI[1]);
				echo "<li" . setSelectedTab($requestURI[1]) . "><a href=\"{$item->value}\"><span>" . $item->name . "</span></a></li>";
72
			}
73
74
75
76
77
78
79
80
81
82
		}
?>

        	
       
		<?php
		//allow people to extend this top menu
		echo elgg_view('elgg_topbar/extend', $vars);
		?>
		
83
		<li <?php echo setSelectedTab('pg/settings/');?>><a href="<?php echo $vars['url']; ?>pg/settings/" class="usersettings"><span><?php echo elgg_echo('settings'); ?></span></a></li>
84
85
86
87
88
89
90
91
		
		<?php
		
			// The administration link is for admin or site admin users only
			if ($vars['user']->admin || $vars['user']->siteadmin) { 
		
		?>
		
92
			<li <?php echo setSelectedTab('pg/admin/');?>><a href="<?php echo $vars['url']; ?>pg/admin/" class="usersettings"><span><?php echo elgg_echo("admin"); ?></span></a></li>
93
94
95
96
97
98
99
100
101
102
		
		<?php
		
				}
		
		?>




103
		<li <?php echo setSelectedTab('action/logout');?>><a href="<?php echo $vars['url']; ?>action/logout"><span><?php echo elgg_echo('logout'); ?></span></a></li>
104
105


106
107
108
</ul>
<div id="elgg_topbar_container_search">
<form id="searchform" action="<?php echo $vars['url']; ?>search/" method="get">
109
<fieldset>
110
<label for="search_input">Search Planet Red</label>
111
	<input type="text" id="search_input" name="tag" class="search_input" />
112
113
	<input type="submit" value="Go" class="search_submit_button" />
</fieldset>
114
</form>
115
</div>
116
117
118
119
120
121
122
123

<?php
    }
?>




124
<div class="clear"></div>