protected function initHeaderAction($sub_type = null, $sub_id = null, $a_is_preview = false) { global $ilUser, $ilCtrl; if (!$this->obj_id) { return false; } $sub_type = $sub_id = null; if ($_GET["blpg"]) { $sub_type = "blp"; $sub_id = $_GET["blpg"]; } $lg = parent::initHeaderAction($sub_type, $sub_id); if ($a_is_preview) { $lg->enableComments(false); $lg->enableNotes(false); $lg->enableTags(false); include_once "./Services/Notification/classes/class.ilNotification.php"; if (ilNotification::hasNotification(ilNotification::TYPE_BLOG, $ilUser->getId(), $this->obj_id)) { $ilCtrl->setParameter($this, "ntf", 1); $link = $ilCtrl->getLinkTarget($this, "setNotification"); $ilCtrl->setParameter($this, "ntf", ""); $lg->addCustomCommand($link, "blog_notification_toggle_off"); $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.png"), $this->lng->txt("blog_notification_activated")); } else { $ilCtrl->setParameter($this, "ntf", 2); $link = $ilCtrl->getLinkTarget($this, "setNotification"); $ilCtrl->setParameter($this, "ntf", ""); $lg->addCustomCommand($link, "blog_notification_toggle_on"); $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_off.png"), $this->lng->txt("blog_notification_deactivated")); } // #11758 if ($this->mayContribute()) { $ilCtrl->setParameter($this, "prvm", ""); $ilCtrl->setParameter($this, "bmn", ""); $ilCtrl->setParameter($this, "blpg", ""); $link = $ilCtrl->getLinkTarget($this, ""); $ilCtrl->setParameter($this, "blpg", $sub_id); $ilCtrl->setParameter($this, "bmn", $this->month); $lg->addCustomCommand($link, "blog_edit"); // #11868 if ($sub_id && $this->mayContribute($sub_id)) { $link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit"); $lg->addCustomCommand($link, "blog_edit_posting"); } $ilCtrl->setParameter($this, "prvm", "fsc"); } $ilCtrl->setParameter($this, "ntf", ""); } return $lg; }
protected function initHeaderAction($a_sub_type = null, $a_sub_id = null) { $lg = parent::initHeaderAction($a_sub_type, $a_sub_id); if (is_object($lg)) { if ($this->object->hasRating()) { $lg->enableRating(true, null, false, array("ilcommonactiondispatchergui", "ilratinggui")); } } return $lg; }