class CMP_ConsoleAvatar extends OW_Component
{
public function render()
{
$userId = OW::getUser()->getId();
return '<a class="console-avatar" href="'.BOL_UserService::getInstance()->getUserUrl($userId).'"><img src="'.BOL_AvatarService::getInstance()->getAvatarUrl($userId).'"></a>';
}
}
function console_add_avatar(BASE_CLASS_ConsoleItemCollector $event)
{
if(OW::getUser()->isAuthenticated())
{
$item = new CMP_ConsoleAvatar();
$event->addItem($item, 2);
}
}
OW::getEventManager()->bind('console.collect_items', 'console_add_avatar');
Though avatar will be positioned before Username for admins and after it for simple users (unfortunately it cannot be fixed even by changing item order with additional check OW::getUser()->isAdmin() for now).
P.S. You can just install the plugin I attached below:
EXAMPLE -----
.ow_mailbox_items_list a.ow_console_item_link, .ow_notification_list a.ow_console_item_link {font-size: 0px !important;}
.ow_mailbox_items_list {background: url(images/mailbox.png) no-repeat center !important; height: 25px !important; width: 25px !important;}
.ow_notification_list {background: url(images/nofification.png) no-repeat center !important; height: 25px !important; width: 25px !important;}