Пример #1
0
 /**
  * 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());
         }
     }
 }