当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObjectGUI::initHeaderAction方法代码示例

本文整理汇总了PHP中ilObjectGUI::initHeaderAction方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjectGUI::initHeaderAction方法的具体用法?PHP ilObjectGUI::initHeaderAction怎么用?PHP ilObjectGUI::initHeaderAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilObjectGUI的用法示例。


在下文中一共展示了ilObjectGUI::initHeaderAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initHeaderAction

 /**
  * 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();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:34,代码来源:class.ilObject2GUI.php

示例2: initHeaderAction

 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
 {
     /**
      * @var $ilUser ilObjUser
      */
     global $ilUser;
     $lg = parent::initHeaderAction();
     // Workaround: Do not show "desktop actions" in thread view
     if ($this->objCurrentTopic->getId()) {
         $container_obj = null;
         $lg->setContainerObject($container_obj);
     }
     if ($lg instanceof ilObjForumListGUI) {
         if ($ilUser->getId() != ANONYMOUS_USER_ID && $this->ilias->getSetting('forum_notification') != 0) {
             $is_user_allowed_to_deactivate_notification = $this->isUserAllowedToDeactivateNotification();
             $frm = $this->object->Forum;
             $frm->setForumId($this->object->getId());
             $frm->setForumRefId($this->object->getRefId());
             $frm->setMDB2Wherecondition('top_frm_fk = %s ', array('integer'), array($frm->getForumId()));
             $frm_notificiation_enabled = $frm->isForumNotificationEnabled($ilUser->getId());
             if ($this->objCurrentTopic->getId()) {
                 $this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
             }
             if ($this->isParentObjectCrsOrGrp()) {
                 // special behaviour for CRS/GRP-Forum notification!!
                 if ($frm_notificiation_enabled && $is_user_allowed_to_deactivate_notification) {
                     $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'disableForumNotification'), "forums_disable_forum_notification");
                 } else {
                     $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'enableForumNotification'), "forums_enable_forum_notification");
                 }
             } else {
                 if ($frm_notificiation_enabled) {
                     $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'disableForumNotification'), "forums_disable_forum_notification");
                 } else {
                     $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'enableForumNotification'), "forums_enable_forum_notification");
                 }
             }
             $topic_notification_enabled = false;
             if ($this->objCurrentTopic->getId()) {
                 $topic_notification_enabled = $this->objCurrentTopic->isNotificationEnabled($ilUser->getId());
                 if ($topic_notification_enabled) {
                     $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'toggleThreadNotification'), "forums_disable_notification");
                 } else {
                     $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'toggleThreadNotification'), "forums_enable_notification");
                 }
             }
             $this->ctrl->setParameter($this, 'thr_pk', '');
             if ($frm_notificiation_enabled || $topic_notification_enabled) {
                 $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.svg"), $this->lng->txt("frm_notification_activated"));
             } else {
                 $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_off.svg"), $this->lng->txt("frm_notification_deactivated"));
             }
         }
     }
     return $lg;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:56,代码来源:class.ilObjForumGUI.php

示例3: initHeaderAction

 /**
  * Add file manager link
  * @param <type> $a_sub_type
  * @param <type> $a_sub_id
  *
  */
 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
 {
     $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
     // begin-patch fm
     include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
     if (ilFMSettings::getInstance()->isEnabled()) {
         if ($lg instanceof ilObjectListGUI) {
             $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'fileManagerLaunch'), 'fm_start', '_blank');
         }
     }
     // end-patch fm
     return $lg;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:19,代码来源:class.ilContainerGUI.php

示例4: initHeaderAction

 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
 {
     /**
      * @var $ilUser ilObjUser
      */
     global $ilUser;
     $lg = parent::initHeaderAction();
     // Workaround: Do not show "desktop actions" in thread view
     if ($this->objCurrentTopic->getId()) {
         $container_obj = null;
         $lg->setContainerObject($container_obj);
     }
     if ($lg instanceof ilObjForumListGUI) {
         include_once 'Modules/Forum/classes/class.ilForumNotification.php';
         $frm_noti = new ilForumNotification((int) $_GET['ref_id']);
         $frm_noti->setUserId($ilUser->getId());
         $user_toggle = $frm_noti->isUserToggleNotification();
         // Notification button
         $notificiation_enabled = false;
         if ($ilUser->getId() != ANONYMOUS_USER_ID && $this->ilias->getSetting('forum_notification') != 0 && $user_toggle != 1) {
             $frm = $this->object->Forum;
             $frm->setForumId($this->object->getId());
             $frm->setForumRefId($this->object->getRefId());
             $frm->setMDB2Wherecondition('top_frm_fk = %s ', array('integer'), array($frm->getForumId()));
             if ($this->objCurrentTopic->getId()) {
                 $this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
             }
             if ($frm->isForumNotificationEnabled($ilUser->getId())) {
                 $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'disableForumNotification'), "forums_disable_forum_notification");
                 $notificiation_enabled = true;
             } else {
                 $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'enableForumNotification'), "forums_enable_forum_notification");
             }
             if ($this->objCurrentTopic->getId()) {
                 if ($this->objCurrentTopic->isNotificationEnabled($ilUser->getId())) {
                     $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'toggleThreadNotification'), "forums_disable_notification");
                     $notificiation_enabled = true;
                 } else {
                     $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'toggleThreadNotification'), "forums_enable_notification");
                 }
             }
             $this->ctrl->setParameter($this, 'thr_pk', '');
             if ($notificiation_enabled) {
                 $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_on.png"), $this->lng->txt("frm_notification_activated"));
             } else {
                 $lg->addHeaderIcon("not_icon", ilUtil::getImagePath("notification_off.png"), $this->lng->txt("frm_notification_deactivated"));
             }
         }
     }
     return $lg;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:51,代码来源:class.ilObjForumGUI.php


注:本文中的ilObjectGUI::initHeaderAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。