Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
40 lines (36 sloc) 1.27 KB
<?php
defined('APP_DIR') or define('APP_DIR', __DIR__ . '/../app/');
include_once(APP_DIR . 'model/User.php');
include_once(APP_DIR . 'model/SecureMessage.php');
include_once(APP_DIR . 'include/http.php');
$data = User::authenticated();
$user = User::get($data->username);
$num_unread = SecureMessage::count_unread($user->id);
?>
<div class="user-button-container">
<!-- Dropdown Trigger -->
<a class='dropdown-button btn user-button'data-activates='dropdown1'>
<?php echo $data->username ?>
<?php if ($num_unread > 0) { ?>
<span class="notification-count">
<?php echo $num_unread ?>
</span>
<?php } ?>
</a>
<!-- Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'>
<li><a href="account.php">Account</a></li>
<li><a href ="user.php">User</a></li>
<?php if ($data->access == 'admin') { ?>
<li><a href ="admin.php">Admin</a></li>
<?php } ?>
<li class="divider"></li>
<li><a href="messages.php">
Messages
<span class="new badge menu-messages-count" data-badge-caption="">
<?php echo $num_unread ?>
</span>
</a></li>
<li><a href="logout.php">Sign out</a></li>
</ul>
</div>
You can’t perform that action at this time.