function addHeaderAction($a_redraw = false) { global $ilUser, $ilAccess; $wiki_id = $this->getPageObject()->getParentId(); $page_id = $this->getPageObject()->getId(); include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php"; $dispatcher = new ilCommonActionDispatcherGUI(ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $ilAccess, "wiki", $_GET["ref_id"], $wiki_id); $dispatcher->setSubObject("wpg", $page_id); include_once "Services/Object/classes/class.ilObjectListGUI.php"; ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true), $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false), $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)); $lg = $dispatcher->initHeaderAction(); $lg->enableNotes(true); $lg->enableComments(ilObjWiki::_lookupPublicNotes($wiki_id), false); // rating if (ilObjWiki::_lookupRating($wiki_id) && $this->getPageObject()->getRating() && $this->getPageObject()->old_nr == 0) { $lg->enableRating(true, $this->lng->txt("wiki_rate_page"), ilObjWiki::_lookupRatingCategories($wiki_id), array("ilcommonactiondispatchergui", "ilratinggui")); } // notification if ($ilUser->getId() != ANONYMOUS_USER_ID) { include_once "./Services/Notification/classes/class.ilNotification.php"; if (ilNotification::hasNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $wiki_id)) { $this->ctrl->setParameter($this, "ntf", 1); $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki"); $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.png"), $this->lng->txt("wiki_notification_activated")); } else { $this->ctrl->setParameter($this, "ntf", 2); $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki"); if (ilNotification::hasNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $page_id)) { $this->ctrl->setParameter($this, "ntf", 3); $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page"); $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.png"), $this->lng->txt("wiki_page_notification_activated")); } else { $this->ctrl->setParameter($this, "ntf", 4); $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page"); $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_off.png"), $this->lng->txt("wiki_notification_deactivated")); } } $this->ctrl->setParameter($this, "ntf", ""); } if (!$a_redraw) { $this->tpl->setHeaderActionMenu($lg->getHeaderAction()); } else { return $lg->getHeaderAction(); } }
/** * Side column */ static function renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp = null) { global $tpl, $lng; if ($a_wpg_id > 0 && !$a_wp) { include_once "./Modules/Wiki/classes/class.ilWikiPage.php"; $a_wp = ilWikiPage($a_wpg_id); } // search block include_once "./Modules/Wiki/classes/class.ilWikiSearchBlockGUI.php"; $wiki_search_block = new ilWikiSearchBlockGUI(); $rcontent = $wiki_search_block->getHTML(); // quick navigation if ($a_wpg_id > 0) { // include_once("./Modules/Wiki/classes/class.ilWikiSideBlockGUI.php"); // $wiki_side_block = new ilWikiSideBlockGUI(); // $wiki_side_block->setPageObject($a_wp); // $rcontent.= $wiki_side_block->getHTML(); // rating $wiki_id = ilObject::_lookupObjId($a_wiki_ref_id); if (ilObjWiki::_lookupRating($wiki_id) && $a_wp->getRating()) { include_once "./Services/Rating/classes/class.ilRatingGUI.php"; $rgui = new ilRatingGUI(); $rgui->setObject($wiki_id, "wiki", $a_wpg_id, "wpg"); $rgui->enableCategories(ilObjWiki::_lookupRatingCategories($wiki_id)); $rgui->setYourRatingText("#"); $rcontent .= $rgui->getBlockHTML($lng->txt("wiki_rate_page")); } // advanced metadata include_once "./Modules/Wiki/classes/class.ilWikiAdvMetaDataBlockGUI.php"; if (ilWikiAdvMetaDataBlockGUI::isActive($wiki_id)) { $rec_ids = ilWikiAdvMetaDataBlockGUI::getRecords($wiki_id); foreach ($rec_ids as $record) { $advmd_pages_block = new ilWikiAdvMetaDataBlockGUI($record); $advmd_pages_block->setObject($a_wiki_ref_id, $wiki_id, $a_wpg_id); $rcontent .= $advmd_pages_block->getHTML(); } } } // important pages // if (ilObjWiki::_lookupImportantPages(ilObject::_lookupObjId($a_wiki_ref_id))) // { include_once "./Modules/Wiki/classes/class.ilWikiImportantPagesBlockGUI.php"; $imp_pages_block = new ilWikiImportantPagesBlockGUI(); $rcontent .= $imp_pages_block->getHTML(); // } // wiki functions block if ($a_wpg_id > 0) { include_once "./Modules/Wiki/classes/class.ilWikiFunctionsBlockGUI.php"; $wiki_functions_block = new ilWikiFunctionsBlockGUI(); $wiki_functions_block->setPageObject($a_wp); $rcontent .= $wiki_functions_block->getHTML(); } $tpl->setRightContent($rcontent); }