Skip to content
Snippets Groups Projects
Commit 528ffb50 authored by Matthew Juhl's avatar Matthew Juhl
Browse files

Create a mobile navigation view element

parent faf2840c
No related branches found
No related tags found
No related merge requests found
<?php
/**
* Elgg navigtion for UNL template college nav
* The standard elgg top toolbar
*
*/
?>
<?php
//set the current page tab
function setSelectedTab($linkPath)
{
if(stristr($_SERVER['REQUEST_URI'], $linkPath)){
return ' class="selected"';
}
}
?>
<?php
if (!isloggedin()) {
?>
<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>
<div class="message_action" style="margin-left:28px;font-size:1.3em;width:97px;">
or <a href="<?php echo $vars['url']; ?>pg/login" id="loginLink"><strong>Login</strong></a>
</div>
</div>
</div>
<?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?>
<div class="hidden">
<?php echo elgg_view('account/forms/login'); ?>
</div>
<?php }?>
<?php
if (isloggedin()) {
?>
<ul class="wdn_tabs disableSwitching">
<li>
<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>
</li>
<li <?php echo setSelectedTab('pg/dashboard/');?>>
<a href="<?php echo $vars['url']; ?>pg/dashboard/"><span><?php echo elgg_echo('dashboard'); ?></span></a>
</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) {
$requestURI = explode($vars['url'], $item->value);
$selectedTab = setSelectedTab($requestURI[1]);
echo "<li" . setSelectedTab($requestURI[1]) . "><a href=\"{$item->value}\"><span>" . $item->name . "";
if ($item->name == "Friends") {
$user = get_loggedin_user();
$count = get_entities_from_relationship('friendrequest', $user->guid, true, "", "", 0, "", 0, 0, true);
if(!empty($count)){
echo " <sup>" . $count . "</sup>";
}
}
echo"</span></a></li>";
}
}
?>
<?php
//allow people to extend this top menu
echo elgg_view('elgg_topbar/extend', $vars);
?>
<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>
<?php
// The administration link is for admin or site admin users only
if ($vars['user']->admin || $vars['user']->siteadmin) {
?>
<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>
<?php
}
?>
<li <?php echo setSelectedTab('action/logout');?>><a href="<?php echo $vars['url']; ?>action/logout"><span><?php echo elgg_echo('logout'); ?></span></a></li>
</ul>
<div id="elgg_topbar_container_search">
<form id="searchform" action="<?php echo $vars['url']; ?>search/" method="get">
<fieldset>
<label for="search_input">Search Planet Red</label>
<input type="text" id="search_input" name="tag" class="search_input" />
<input type="submit" value="Go" class="search_submit_button" />
</fieldset>
</form>
</div>
<?php
}
?>
<div class="clear"></div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment