Move users online to top navbar

merge-requests/34/head
Mike Koch 7 years ago
parent 910e753314
commit 660c28e2f8

@ -265,4 +265,8 @@ div.ticket-info {
.box-header h1.box-title {
width: 100%;
cursor: pointer;
}
.black {
color: black;
}

@ -43,12 +43,6 @@ if (defined('AUTOFOCUS'))
<?php
}
// Users online
if (defined('SHOW_ONLINE'))
{
hesk_printOnline();
}
// The closing div here is to close the content area on each page. Annoying, but necessary.
if (defined('ADMIN_PAGE')) {
echo '

@ -188,7 +188,14 @@ $mails = mfh_get_mail_headers_for_dropdown($_SESSION['id'], $hesk_settings, $hes
</li>
</ul>
</li>
<?php endif; ?>
<?php
endif;
// Users online
if (defined('SHOW_ONLINE')) {
hesk_printOnline();
}
?>
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope-o"></i>

@ -33,34 +33,44 @@ function hesk_initOnline($user_id)
} // END hesk_initOnline()
function hesk_printOnline()
{
function hesk_printOnline() {
global $hesk_settings, $hesklang;
echo '
&nbsp;<br />&nbsp;
<div class="online">
<table border="0">
<tr>
<td valign="top"><img src="../img/online_on.png" width="16" height="16" alt="'.$hesklang['onlinep'].'" title="'.$hesklang['onlinep'].'" style="vertical-align:text-bottom" /></td>
<td>
';
$i = '';
foreach ($hesk_settings['users_online'] as $tmp)
{
$i .= '<span class="online" ' . ($tmp['isadmin'] ? 'style="font-style:italic;"' : '') . '>';
$i .= ($tmp['id'] == $_SESSION['id']) ? $tmp['name'] : '<a href="mail.php?a=new&id='.$tmp['id'].'">' . $tmp['name'] . '</a>';
$i .= '</span>, ';
}
echo substr($i,0,-2);
echo '
</td>
</tr>
</table>
</div>';
?>
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-users"></i>
<span class="label label-danger"><?php echo count($hesk_settings['users_online']); ?></span>
</a>
<ul class="dropdown-menu">
<li class="header"><?php echo $hesklang['onlinep']; ?></li>
<li>
<ul class="menu">
<?php foreach ($hesk_settings['users_online'] as $tmp): ?>
<li>
<?php $link = ($tmp['id'] == $_SESSION['id']) ? '' : ' href="mail.php?a=new&id='.$tmp['id'].'"'; ?>
<a<?php echo $link; ?>>
<div class="pull-left">
<i class="fa fa-user fa-2x black"></i>
</div>
<h4><?php echo $tmp['name']; ?></h4>
<?php
if ($tmp['isadmin']): ?>
<p>
<span class="label label-default">
<?php echo $hesklang['administrator']; ?>
</span>
</p>
<?php elseif ($tmp['id'] == $_SESSION['id']): ?>
<!--<span class="badge badge-default">You</span>-->
<?php endif; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</li>
</ul>
</li>
<?php
} // END hesk_printOnline()

Loading…
Cancel
Save