/**
  * 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());
 }