Do not add the stat DOM if the stat is not available

This commit is contained in:
Hadi Nategh 2019-06-05 10:22:14 +02:00
parent 534edde475
commit e87655394d

View File

@ -638,8 +638,8 @@ abstract class Framework extends Framework\Extra
return '<span title="'.Accounts::format_username().'" class="avatar"><img src="'.Egw::link('/api/avatar.php', array(
'account_id' => $GLOBALS['egw_info']['user']['account_id'],
)).'"/>'.
'<span class="'.$stat['class'].'"/>'.$stat['body'].'</span>';
)).'"/>'.(!empty($stat) ?
'<span class="'.$stat['class'].'">'.$stat['body'].'</span>' : '').'</span>';
}
/**
@ -1185,7 +1185,7 @@ abstract class Framework extends Framework\Extra
{
$this->_add_topmenu_info_item(self::_get_notification_bell(), 'notifications');
}
if (is_array(($current_user = $this->_current_users()))) $this->_add_topmenu_item($current_user);
$this->_add_topmenu_info_item($vars['quick_add'], 'quick_add');
$this->_add_topmenu_info_item($this->_print_menu(), 'print_title');