예제 #1
0
파일: index.php 프로젝트: ratbird/hope
 /**
  * redirect to correct page (overview or newest entries),
  * depending on whether there are any entries.
  */
 function enter_seminar_action()
 {
     if (ForumPerm::has('fav_entry', $this->getId()) && ForumVisit::getCount($this->getId(), ForumVisit::getVisit($this->getId())) > 0) {
         $this->redirect(PluginEngine::getLink('coreforum/index/newest'));
     } else {
         $this->redirect(PluginEngine::getLink('coreforum/index/index'));
     }
 }
예제 #2
0
 function getIconNavigation($course_id, $last_visit, $user_id = null)
 {
     if (!$this->isActivated($course_id)) {
         return;
     }
     $this->setupAutoload();
     if ($GLOBALS['perm']->have_studip_perm('user', $course_id)) {
         $num_entries = ForumVisit::getCount($course_id, ForumVisit::getVisit($course_id));
         $text = ForumHelpers::getVisitText($num_entries, $course_id);
     } else {
         $num_entries = 0;
         $text = 'Forum';
     }
     $navigation = new Navigation('forum', PluginEngine::getURL($this, array(), 'index/enter_seminar'));
     $navigation->setBadgeNumber($num_entries);
     if ($num_entries > 0) {
         $navigation->setImage(Icon::create('forum+new', 'attention', ["title" => $text]));
     } else {
         $navigation->setImage(Icon::create('forum', 'inactive', ["title" => $text]));
     }
     return $navigation;
 }