<?php
$notification_alert     = Wo_CountNotifications(array(
    'unread' => true,
    'data' => 'all'
));
$messages_alert         = Wo_CountMessages(array(
    'new' => true
));
$followers_alert        = Wo_CountFollowRequests();
$hidden_class           = '';
$messages_hidden_class  = '';
$followers_hidden_class = '';
if ($notification_alert == 0) {
    $hidden_class = ' hidden';
}
if ($messages_alert == 0) {
    $messages_hidden_class = ' hidden';
}
if ($followers_alert == 0) {
    $followers_hidden_class = ' hidden';
}
?>
<ul class="nav navbar-nav navbar-right <?php echo Wo_RightToLeft('pull-right');?>">
   <li class="dropdown notification-container" onclick="Wo_OpenNotificationsMenu();">
      <span class="new-update-alert<?php echo $hidden_class;?>">
      <?php echo $notification_alert?>
      </span>
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
      <i class="fa fa-bell"></i>
      </a>
      <ul class="dropdown-menu clearfix notifications-dropdown" role="menu" id="notification-list">
         <span class="notification-loading-progress header-loading-sppiner"> 
         <i class="fa fa-spin progress-icon" data-icon="spin"></i>
         </span>
      </ul>
   </li>
   <li class="dropdown requests-container" onclick="Wo_OpenRequestsMenu();">
      <span class="new-update-alert<?php echo $followers_hidden_class;?>">
      <?php echo $followers_alert?>
      </span>
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
      <i class="fa fa-users"></i>
      </a>
      <ul class="dropdown-menu request-list clearfix notifications-dropdown" role="menu" id="requests-list">
         <span class="requests-loading header-loading-sppiner"> 
         <i class="fa fa-spin progress-icon" data-icon="spin"></i>
         </span>
      </ul>
   </li>
   <li class="messages-notification-container">
      <span class="new-update-alert<?php echo $messages_hidden_class;?>">
      <?php echo $messages_alert;?>
      </span>
      <a href="<?php echo Wo_SeoLink('index.php?tab1=messages'); ?>">
      <i class="fa fa-comments"></i>
      </a>
   <li class="dropdown">
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
         <div class="user-avatar <?php echo Wo_RightToLeft('pull-left'); ?>">
            <img id="updateImage-<?php echo $wo['user']['user_id']?>" src="<?php echo $wo['user']['avatar'];?>" alt="<?php echo $wo['user']['name'];?> Profile Picture">
         </div>
         <span id="user-full-name" class="User-Name">
         <?php echo $wo['user']['name'];?>
         </span>
         <span class="caret"></span>
      </a>
      <ul class="dropdown-menu" role="menu">
         <li id="dropdown-search-link">
            <a href="<?php echo Wo_SeoLink('index.php?tab1=search');?>">
            <i class="fa fa-search"></i> <?php echo $wo['lang']['search']; ?>
            </a>
         </li>
         <li>
            <a id="update-username" href="<?php echo Wo_SeoLink('index.php?tab1=timeline&u=' . $wo['user']['username'] . ''); ?>">
            <i class="fa fa-user fa-fw"></i> <?php echo $wo['lang']['my_profile']; ?>
            </a>
         </li>
         <li>
            <a id="update-username" href="<?php echo Wo_SeoLink('index.php?tab1=pages'); ?>">
            <i class="fa fa-flag fa-fw"></i> <?php echo $wo['lang']['my_pages']; ?>
            </a>
         </li>
         <li>
            <a href="<?php echo Wo_SeoLink('index.php?tab1=saved-posts');?>">
            <i class="fa fa-pencil-square-o fa-fw"></i> <?php echo $wo['lang']['saved_posts']; ?>
            </a>
         </li>
         <li>
            <a href="<?php echo Wo_SeoLink('index.php?tab1=setting'); ?>">
            <i class="fa fa-cog fa-fw"></i> <?php echo $wo['lang']['setting']; ?>
            </a>
         </li>
         <?php  if(Wo_IsAdmin($wo['user']['user_id']) === true) { ?>
         <li>
            <a href="<?php echo Wo_SeoLink('index.php?tab1=admin'); ?>">
            <i class="fa fa-bar-chart fa-fw"></i> <?php echo $wo['lang']['admin_area']; ?>
            </a>
         </li>
         <?php } ?>
         <li class="divider"></li>
         <li>
            <a href="<?php echo Wo_SeoLink('index.php?tab1=logout'); ?>">
            <i class="fa fa-sign-out fa-fw"></i> <?php echo $wo['lang']['log_out']; ?>
            </a>
         </li>
      </ul>
   </li>
</ul>