Ejemplo n.º 1
0
 public function addNavlink($navlinks)
 {
     load_textdomain('private_messages', dirname(__FILE__) . '/lang/' . $this->feather->user->language . '/private-messages.mo');
     if (!$this->feather->user->is_guest) {
         $nbUnread = Model\PrivateMessages::countUnread($this->feather->user->id);
         $count = $nbUnread > 0 ? ' (' . $nbUnread . ')' : '';
         $navlinks[] = '4 = <a href="' . $this->feather->urlFor('Conversations.home') . '">PMS' . $count . '</a>';
         if ($nbUnread > 0) {
             $this->hooks->bind('header.toplist', function ($toplists) {
                 $toplists[] = '<li class="reportlink"><span><strong><a href="' . $this->feather->urlFor('Conversations.home', ['inbox_id' => 1]) . '">' . __('Unread messages', 'private_messages') . '</a></strong></span></li>';
                 return $toplists;
             });
         }
     }
     return $navlinks;
 }
Ejemplo n.º 2
0
 public function addNavlink($navlinks)
 {
     translate('private_messages', 'private-messages');
     if (!User::get()->is_guest) {
         $nbUnread = Model\PrivateMessages::countUnread(User::get()->id);
         $count = $nbUnread > 0 ? ' (' . $nbUnread . ')' : '';
         $navlinks[] = '4 = <a href="' . Router::pathFor('Conversations.home') . '">PMS' . $count . '</a>';
         if ($nbUnread > 0) {
             Container::get('hooks')->bind('header.toplist', function ($toplists) {
                 $toplists[] = '<li class="reportlink"><span><strong><a href="' . Router::pathFor('Conversations.home', ['inbox_id' => 1]) . '">' . __('Unread messages', 'private_messages') . '</a></strong></span></li>';
                 return $toplists;
             });
         }
     }
     return $navlinks;
 }