/**
  * Add materials to a question
  */
 public function addMaterial()
 {
     global $tree, $ilTabs, $ilToolbar;
     $ilTabs->activateTab("material");
     $ilToolbar->addButton($this->lng->txt("cancel"), $this->ctrl->getLinkTarget($this, "material"));
     if (strlen($_SESSION["link_new_type"]) || !$this->material(true)) {
         include_once "./Modules/SurveyQuestionPool/classes/class.ilMaterialExplorer.php";
         switch ($_POST["internalLinkType"]) {
             case "lm":
                 $_SESSION["link_new_type"] = "lm";
                 $_SESSION["search_link_type"] = "lm";
                 break;
             case "glo":
                 $_SESSION["link_new_type"] = "glo";
                 $_SESSION["search_link_type"] = "glo";
                 break;
             case "st":
                 $_SESSION["link_new_type"] = "lm";
                 $_SESSION["search_link_type"] = "st";
                 break;
             case "pg":
                 $_SESSION["link_new_type"] = "lm";
                 $_SESSION["search_link_type"] = "pg";
                 break;
         }
         $exp = new ilMaterialExplorer($this, 'addMaterial', $_SESSION["link_new_type"]);
         $exp->setPathOpen((int) $_GET["ref_id"]);
         if (!$exp->handleCommand()) {
             include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
             $panel = ilPanelGUI::getInstance();
             $panel->setHeading($this->lng->txt("select_object_to_link"));
             $panel->setBody($exp->getHTML());
             $this->tpl->setContent($panel->getHTML());
         }
     }
 }
 /**
  * Add materials to a question
  */
 public function addMaterial()
 {
     global $tree;
     if (strlen($_SESSION["link_new_type"]) || !$this->material(true)) {
         include_once "./Modules/SurveyQuestionPool/classes/class.ilMaterialExplorer.php";
         switch ($_POST["internalLinkType"]) {
             case "lm":
                 $_SESSION["link_new_type"] = "lm";
                 $_SESSION["search_link_type"] = "lm";
                 break;
             case "glo":
                 $_SESSION["link_new_type"] = "glo";
                 $_SESSION["search_link_type"] = "glo";
                 break;
             case "st":
                 $_SESSION["link_new_type"] = "lm";
                 $_SESSION["search_link_type"] = "st";
                 break;
             case "pg":
                 $_SESSION["link_new_type"] = "lm";
                 $_SESSION["search_link_type"] = "pg";
                 break;
         }
         ilUtil::sendInfo($this->lng->txt("select_object_to_link"));
         $exp = new ilMaterialExplorer($this->ctrl->getLinkTarget($this, 'addMaterial'), get_class($this));
         // expand current path (if no specific node given)
         if (!$_GET["expand"]) {
             $path = $tree->getPathId($_GET["ref_id"]);
             $exp->setForceOpenPath($path);
         } else {
             $exp->setExpand($_GET["expand"]);
         }
         $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'addMaterial'));
         $exp->setTargetGet("ref_id");
         $exp->setRefId($_GET["ref_id"]);
         $exp->addFilter($_SESSION["link_new_type"]);
         $exp->setSelectableType($_SESSION["link_new_type"]);
         // build html-output
         $exp->setOutput(0);
         $this->tpl->addBlockFile("ADM_CONTENT", "explorer", "tpl.il_svy_qpl_explorer.html", "Modules/SurveyQuestionPool");
         $this->tpl->setVariable("EXPLORER_TREE", $exp->getOutput());
         $this->tpl->setVariable("BUTTON_CANCEL", $this->lng->txt("cancel"));
         $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     }
 }