ConversationsHooks::base_render_before PHP Method

base_render_before() public method

Add 'Inbox' to global menu.
Since: 2.0.0
public base_render_before ( $Sender )
    public function base_render_before($Sender)
    {
        // Add the menu options for conversations
        if ($Sender->Menu && Gdn::session()->isValid()) {
            $Inbox = t('Inbox');
            $CountUnreadConversations = val('CountUnreadConversations', Gdn::session()->User);
            if (is_numeric($CountUnreadConversations) && $CountUnreadConversations > 0) {
                $Inbox .= ' <span class="Alert">' . $CountUnreadConversations . '</span>';
            }
            $Sender->Menu->addLink('Conversations', $Inbox, '/messages/all', false, array('Standard' => true));
        }
    }