Пример #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());
 }
 /**
  * Move node: select target (via explorer)
  */
 function showMoveIntoObjectTree()
 {
     global $ilTabs, $tree;
     $ilTabs->clearTargets();
     if (!$_SESSION['clipboard']['shared']) {
         $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this));
     } else {
         $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'share'));
     }
     $mode = $_SESSION['clipboard']['cmd'];
     ilUtil::sendInfo($this->lng->txt('msg_' . $mode . '_clipboard'));
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.paste_into_multiple_objects.html', "Services/Object");
     // move/copy in personal workspace
     if (!$_SESSION['clipboard']['wsp2repo']) {
         require_once 'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
         $exp = new ilWorkspaceExplorer(ilWorkspaceExplorer::SEL_TYPE_RADIO, '', 'paste_' . $mode . '_wspexpand', $this->tree, $this->getAccessHandler());
         $exp->setTargetGet('wsp_id');
         if ($_GET['paste_' . $mode . '_wspexpand'] == '') {
             // not really used as session is already set [see above]
             $expanded = $this->tree->readRootId();
         } else {
             $expanded = $_GET['paste_' . $mode . '_wspexpand'];
         }
     } else {
         require_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
         $exp = new ilPasteIntoMultipleItemsExplorer(ilPasteIntoMultipleItemsExplorer::SEL_TYPE_RADIO, '', 'paste_' . $mode . '_repexpand');
         $exp->setTargetGet('ref_id');
         if ($_GET['paste_' . $mode . '_repexpand'] == '') {
             $expanded = $tree->readRootId();
         } else {
             $expanded = $_GET['paste_' . $mode . '_repexpand'];
         }
     }
     $exp->setCheckedItems(array((int) $_POST['node']));
     $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'showMoveIntoObjectTree'));
     $exp->setPostVar('node');
     $exp->setExpand($expanded);
     $exp->setOutput(0);
     $this->tpl->setVariable('OBJECT_TREE', $exp->getOutput());
     unset($exp);
     $this->tpl->setVariable('FORM_TARGET', '_top');
     $this->tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, 'performPasteIntoMultipleObjects'));
     $this->tpl->setVariable('CMD_SUBMIT', 'performPasteIntoMultipleObjects');
     $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('paste'));
 }
 /**
  * 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());
 }