/** * Assign materials to skill level * * @param * @return */ function assignMaterial() { global $tpl, $ilUser, $ilCtrl, $ilTabs, $lng, $ilSetting; if (!$ilSetting->get("disable_personal_workspace")) { ilUtil::sendInfo($lng->txt("skmg_ass_materials_from_workspace") . " ยป <a href='ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace'>" . $lng->txt("personal_workspace") . "</a>"); } $ilCtrl->saveParameter($this, "skill_id"); $ilCtrl->saveParameter($this, "level_id"); $ilCtrl->saveParameter($this, "tref_id"); $ilCtrl->saveParameter($this, "basic_skill_id"); $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "assignMaterials")); // get ws tree include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; $tree = new ilWorkspaceTree($ilUser->getId()); // get access handler include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"; $acc_handler = new ilWorkspaceAccessHandler($tree); // get es explorer include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php"; $exp = new ilWorkspaceExplorer(ilWorkspaceExplorer::SEL_TYPE_CHECK, '', 'skill_wspexpand', $tree, $acc_handler); $exp->setTargetGet('wsp_id'); $exp->setFiltered(false); $exp->removeAllFormItemTypes(); $exp->addFormItemForType("file"); $exp->addFormItemForType("tstv"); $exp->addFormItemForType("excv"); if ($_GET['skill_wspexpand'] == '') { // not really used as session is already set [see above] $expanded = $tree->readRootId(); } else { $expanded = $_GET['skill_wspexpand']; } $exp->setCheckedItems(array((int) $_POST['wsp_id'])); $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'assignMaterial')); $exp->setPostVar('wsp_id[]'); $exp->setExpand($expanded); $exp->setOutput(0); // fill template $mtpl = new ilTemplate("tpl.materials_selection.html", true, true, "Services/Skill"); $mtpl->setVariable("EXP", $exp->getOutput()); // toolbars $tb = new ilToolbarGUI(); $tb->addFormButton($lng->txt("select"), "selectMaterial"); $tb->setFormAction($ilCtrl->getFormAction($this)); $tb->setOpenFormTag(true); $tb->setCloseFormTag(false); $mtpl->setVariable("TOOLBAR1", $tb->getHTML()); $tb->setOpenFormTag(false); $tb->setCloseFormTag(true); $mtpl->setVariable("TOOLBAR2", $tb->getHTML()); $tpl->setContent($mtpl->get()); }
/** * Insert file from personal workspace */ function insertFromWorkspace($a_cmd = "insert") { global $ilTabs, $tree, $ilCtrl, $tpl, $ilUser; if ($a_cmd == "insert") { $this->setTabs(); } else { $this->setItemTabs($a_cmd); } $ilTabs->setSubTabActive("cont_file_from_workspace"); // get ws tree include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; $tree = new ilWorkspaceTree($ilUser->getId()); // get access handler include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"; $acc_handler = new ilWorkspaceAccessHandler($tree); // get es explorer include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php"; $exp = new ilWorkspaceExplorer(ilWorkspaceExplorer::SEL_TYPE_RADIO, '', 'filelist_wspexpand', $tree, $acc_handler); $exp->setTargetGet('fl_wsp_id'); $exp->setFiltered(false); $exp->removeAllFormItemTypes(); // select link $exp->setTypeClickable("file"); $ilCtrl->setParameter($this, "subCmd", "selectFile"); $exp->setCustomLinkTarget($ilCtrl->getLinkTarget($this, $a_cmd)); // filter $exp->setFiltered(true); $exp->setFilterMode(IL_FM_POSITIVE); $exp->addFilter("wsrt"); $exp->addFilter("wfld"); $exp->addFilter("file"); // expand link $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace"); $exp->setParamsGet($ilCtrl->getParameterArray($this, $a_cmd)); if ($_GET['filelist_wspexpand'] == '') { $expanded = $tree->readRootId(); } else { $expanded = $_GET['filelist_wspexpand']; } $exp->setExpand($expanded); $exp->setOutput(0); $tpl->setContent($exp->getOutput()); }