function getHTML()
 {
     global $ilCtrl, $ilSetting, $tpl, $lng, $ilHelp, $ilDB;
     $ilDB->useSlave(true);
     // both views are activated (show buttons)
     if ($ilSetting->get('disable_my_offers') == 0 && $ilSetting->get('disable_my_memberships') == 0) {
         /*			$ilCtrl->setParameter($this, 'block_type', $this->getBlockType());			
         			$ilCtrl->setParameter($this, 'view', self::VIEW_MY_OFFERS);
         			$this->addHeaderLink($ilCtrl->getLinkTarget($this, 'changeView'), $this->lng->txt('pd_my_offers'),
         				($this->view == self::VIEW_MY_OFFERS ? false : true) 
         			);
         			$ilCtrl->setParameter($this, 'view', self::VIEW_MY_MEMBERSHIPS);
         			$this->addHeaderLink($ilCtrl->getLinkTarget($this, 'changeView'), $this->lng->txt('pd_my_memberships'),
         				($this->view == self::VIEW_MY_MEMBERSHIPS ? false : true) 
         			);
         			$ilCtrl->clearParameters($this);*/
     }
     // workaround to show details row
     $this->setData(array("dummy"));
     include_once "Services/Object/classes/class.ilObjectListGUI.php";
     ilObjectListGUI::prepareJSLinks("", $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false), $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
     switch ((int) $this->view) {
         case self::VIEW_MY_MEMBERSHIPS:
             $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "crs_grp");
             if ($ilSetting->get('disable_my_offers') == 0) {
                 $tpl->setTitle($lng->txt("my_courses_groups"));
             }
             $this->setTitle($this->lng->txt('pd_my_memberships'));
             $this->setContent($this->getMembershipItemsBlockHTML());
             break;
         case self::VIEW_MY_OFFERS:
         default:
             $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "sel_items");
             if (!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views)) {
                 $this->setTitle($this->lng->txt('selected_items'));
             } else {
                 $this->setTitle($this->lng->txt('pd_my_offers'));
             }
             $this->setContent($this->getSelectedItemsBlockHTML());
             break;
     }
     if ($this->getContent() == "") {
         $this->setEnableDetailRow(false);
     }
     $ilCtrl->clearParametersByClass("ilpersonaldesktopgui");
     $ilCtrl->clearParameters($this);
     $ilDB->useSlave(false);
     return parent::getHTML();
 }
 public function addHeaderAction($a_redraw = false)
 {
     global $ilUser, $ilAccess, $tpl, $lng, $ilCtrl;
     include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
     $dispatcher = new ilCommonActionDispatcherGUI(ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $ilAccess, "dcl", $this->ref_id, $this->obj_id);
     include_once "Services/Object/classes/class.ilObjectListGUI.php";
     ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true), $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false), $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
     $lg = $dispatcher->initHeaderAction();
     //$lg->enableNotes(true);
     //$lg->enableComments(ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()), false);
     // notification
     if ($ilUser->getId() != ANONYMOUS_USER_ID && $this->object->getNotification() == 1) {
         include_once "./Services/Notification/classes/class.ilNotification.php";
         if (ilNotification::hasNotification(ilNotification::TYPE_DATA_COLLECTION, $ilUser->getId(), $this->obj_id)) {
             //Command Activate Notification
             $ilCtrl->setParameter($this, "ntf", 1);
             $lg->addCustomCommand($ilCtrl->getLinkTarget($this, "toggleNotification"), "dcl_notification_deactivate_dcl");
             $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.png"), $lng->txt("dcl_notification_activated"));
         } else {
             //Command Deactivate Notification
             $ilCtrl->setParameter($this, "ntf", 2);
             $lg->addCustomCommand($ilCtrl->getLinkTarget($this, "toggleNotification"), "dcl_notification_activate_dcl");
             $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_off.png"), $lng->txt("dcl_notification_deactivated"));
         }
         $ilCtrl->setParameter($this, "ntf", "");
     }
     if (!$a_redraw) {
         $tpl->setHeaderActionMenu($lg->getHeaderAction());
     } else {
         return $lg->getHeaderAction();
     }
     $tpl->setHeaderActionMenu($lg->getHeaderAction());
 }
 /**
  * Add header action menu
  * 
  * @param string $a_sub_type
  * @param int $a_sub_id
  * @return ilObjectListGUI
  */
 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
 {
     global $ilAccess;
     if (!$this->creation_mode && $this->object) {
         include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
         $dispatcher = new ilCommonActionDispatcherGUI(ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $ilAccess, $this->object->getType(), $this->ref_id, $this->object->getId());
         $dispatcher->setSubObject($a_sub_type, $a_sub_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();
         if (is_object($lg)) {
             // to enable add to desktop / remove from desktop
             if ($this instanceof ilDesktopItemHandling) {
                 $lg->setContainerObject($this);
             }
             // enable multi download
             $lg->enableMultiDownload(true);
             // comments settings are always on (for the repository)
             // should only be shown if active or permission to toggle
             include_once "Services/Notes/classes/class.ilNote.php";
             if ($ilAccess->checkAccess("write", "", $this->ref_id) || $ilAccess->checkAccess("edit_permissions", "", $this->ref_id) || ilNote::commentsActivated($this->object->getId(), 0, $this->object->getType())) {
                 $lg->enableComments(true);
             }
             $lg->enableNotes(true);
             $lg->enableTags(true);
         }
         return $lg;
     }
 }
 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();
     }
 }
 /**
  * Add header action menu
  * 
  * @param string $a_sub_type
  * @param int $a_sub_id
  * @return ilObjectListGUI
  */
 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
 {
     global $ilAccess;
     if ($this->id_type == self::WORKSPACE_NODE_ID) {
         if (!$this->creation_mode && $this->object_id) {
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $dispatcher = new ilCommonActionDispatcherGUI(ilCommonActionDispatcherGUI::TYPE_WORKSPACE, $this->getAccessHandler(), $this->getType(), $this->node_id, $this->object_id);
             $dispatcher->setSubObject($a_sub_type, $a_sub_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();
             if (is_object($lg)) {
                 // to enable add to desktop / remove from desktop
                 if ($this instanceof ilDesktopItemHandling) {
                     $lg->setContainerObject($this);
                 }
                 // for activation checks see ilObjectGUI
                 // $lg->enableComments(true);
                 $lg->enableNotes(true);
                 // $lg->enableTags(true);
             }
             return $lg;
         }
     } else {
         return parent::initHeaderAction();
     }
 }
 /**
  * Add header action
  */
 function addHeaderAction($a_redraw = false)
 {
     global $ilAccess, $tpl;
     include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
     $dispatcher = new ilCommonActionDispatcherGUI(ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $ilAccess, $this->lm->getType(), $_GET["ref_id"], $this->lm->getId());
     $dispatcher->setSubObject("pg", $this->getCurrentPageId());
     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($this->lm->publicNotes(), false);
     if ($this->lm->hasRating()) {
         $lg->enableRating(true, $this->lng->txt("lm_rating"), false, array("ilcommonactiondispatchergui", "ilratinggui"));
     }
     if (!$a_redraw) {
         $this->tpl->setVariable("HEAD_ACTION", $lg->getHeaderAction());
     } else {
         // we need to add onload code manually (rating, comments, etc.)
         return $lg->getHeaderAction() . $tpl->getOnLoadCodeForAsynch();
     }
 }
 /**
  * Render root folder
  */
 function renderObject()
 {
     global $ilTabs;
     include_once "Services/Object/classes/class.ilObjectListGUI.php";
     ilObjectListGUI::prepareJSLinks("", $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false), $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
     $ilTabs->activateTab("view_content");
     $ret = parent::renderObject();
     return $ret;
 }
 /**
  * Add header action
  */
 function addHeaderAction($a_redraw = false)
 {
     global $ilUser, $ilAccess;
     include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
     $dispatcher = new ilCommonActionDispatcherGUI(ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $ilAccess, $this->lm->getType(), $_GET["ref_id"], $this->lm->getId());
     $dispatcher->setSubObject("pg", $this->getCurrentPageId());
     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($this->lm->publicNotes(), false);
     if (!$a_redraw) {
         $this->tpl->setVariable("HEAD_ACTION", $lg->getHeaderAction());
     } else {
         return $lg->getHeaderAction();
     }
 }