예제 #1
0
 protected function renderWorkspaceExplorer($a_cmd)
 {
     global $ilUser;
     include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
     include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
     require_once 'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
     $tree = new ilWorkspaceTree($ilUser->getId());
     $access_handler = new ilWorkspaceAccessHandler($tree);
     $exp = new ilWorkspaceExplorer(ilWorkspaceExplorer::SEL_TYPE_RADIO, '', 'exc_wspexpand', $tree, $access_handler);
     $exp->setTargetGet('wsp_id');
     if ($a_cmd == "selectBlog") {
         $exp->removeAllFormItemTypes();
         $exp->addFilter('blog');
         $exp->addFormItemForType('blog');
     }
     if ($_GET['exc_wspexpand'] == '') {
         // not really used as session is already set [see above]
         $expanded = $tree->readRootId();
     } else {
         $expanded = $_GET['exc_wspexpand'];
     }
     $exp->setExpandTarget($this->ctrl->getLinkTarget($this, $a_cmd));
     $exp->setPostVar('node');
     $exp->setExpand($expanded);
     $exp->setOutput(0);
     return $exp->getOutput();
 }
 /**
  * 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&amp;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());
 }