Exemplo n.º 1
0
 function showToolbar($current, $user)
 {
     $acl = EasyBlogACLHelper::getRuleSet();
     $config = EasyBlogHelper::getConfig();
     $joomlaVersion = EasyBlogHelper::getJoomlaVersion();
     $homeItemId = EasyBlogRouter::getItemid('latest');
     $logoutURL = base64_encode(EasyBlogRouter::_('index.php?option=com_easyblog&view=latest&Itemid=' . $homeItemId, false));
     $model = $this->getModel('Blogs');
     $total = $model->getTotalPending();
     $isTeamAdmin = EasyBlogHelper::isTeamAdmin();
     $totalTeamRequest = 0;
     if ($isTeamAdmin) {
         $teamModel = $this->getModel('TeamBlogs');
         $totalTeamRequest = $teamModel->getTotalRequest();
     }
     // @task: Get total draft entries
     $draftsModel = $this->getModel('Drafts');
     $totalDrafts = $draftsModel->getTotal();
     //get the logout link
     $logoutActionLink = '';
     if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
         $logoutActionLink = 'index.php?option=com_users&task=user.logout';
     } else {
         $logoutActionLink = 'index.php?option=com_user&task=logout';
     }
     // @task: Determine if the current user is a blogger or not.
     $isBlogger = EasyBlogHelper::isSiteAdmin() || $acl->rules->add_entry;
     $tpl = new CodeThemes('dashboard');
     $tpl->set('isBlogger', $isBlogger);
     $tpl->set('totalPending', $total);
     $tpl->set('user', $user);
     $tpl->set('current', $current);
     $tpl->set('acl', $acl);
     $tpl->set('config', $config);
     $tpl->set('logoutURL', $logoutURL);
     $tpl->set('logoutActionLink', $logoutActionLink);
     $tpl->set('isTeamAdmin', $isTeamAdmin);
     $tpl->set('totalTeamRequest', $totalTeamRequest);
     $tpl->set('totalDrafts', $totalDrafts);
     return $tpl->fetch('dashboard.toolbar.php');
 }