function manageObject() { global $ilUser, $objDefinition, $ilCtrl, $lng; $objects = array(); $this->manage = true; $this->setAvailableDetailLevels(1, 1); $top_tb = new ilToolbarGUI(); $top_tb->setFormAction($ilCtrl->getFormAction($this)); $top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions")); if ($this->view == self::VIEW_MY_OFFERS) { $top_tb->addFormButton($lng->txt("remove"), "confirmRemove"); } else { $top_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove"); } $top_tb->addSeparator(); $top_tb->addFormButton($lng->txt("cancel"), "getHTML"); $top_tb->setCloseFormTag(false); $bot_tb = new ilToolbarGUI(); $bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), $lng->txt("actions")); if ($this->view == self::VIEW_MY_OFFERS) { $bot_tb->addFormButton($lng->txt("remove"), "confirmRemove"); } else { $bot_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove"); } $bot_tb->addSeparator(); $bot_tb->addFormButton($lng->txt("cancel"), "getHTML"); $bot_tb->setOpenFormTag(false); return $top_tb->getHTML() . $this->getHTML() . $bot_tb->getHTML(); /* if($this->view == self::VIEW_MY_OFFERS) { return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML(); foreach($ilUser->getDesktopItems() as $item) { $objects[] = $item; } } else { $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes( array("cat", "crs", "grp", "fold")); foreach($objtype_groups as $grpdata) { foreach($this->getObjectsByMembership($grpdata["objs"]) as $item) { $objects[] = $item; } } } include_once "Services/PersonalDesktop/classes/class.ilPDSelectedItemsTableGUI.php"; $tbl = new ilPDSelectedItemsTableGUI($this, "manage", $objects, $this->view, ($ilUser->getPref("pd_order_items") == 'location')); return $tbl->getHTML(); */ }
function editPublicSection() { global $ilTabs, $ilToobar, $ilAccess; if (!$ilAccess->checkAccessOfUser(ANONYMOUS_USER_ID, "read", "", $this->object->getRefId())) { ilUtil::sendInfo($this->lng->txt("cont_anonymous_user_missing_perm")); } $this->setTabs(); $this->setSubTabs("public_section"); $ilTabs->setTabActive("settings"); switch ($this->object->getType()) { case "lm": $gui_class = "ilobjlearningmodulegui"; break; case "dlb": $gui_class = "ilobjdlbookgui"; break; } $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_public_selector.html", "Modules/LearningModule"); // get learning module object $this->lm_obj = new ilObjLearningModule($this->ref_id, true); // public mode $my_toolbar = new ilToolbarGUI(); $modes = array("complete" => $this->lng->txt("all_pages"), "selected" => $this->lng->txt("selected_pages_only")); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $si = new ilSelectInputGUI($this->lng->txt("choose_public_mode"), "lm_public_mode"); $si->setOptions($modes); $si->setValue($this->object->getPublicAccessMode()); $my_toolbar->addInputItem($si, true); $my_toolbar->setOpenFormTag(false); $my_toolbar->setCloseFormTag(false); $my_toolbar->addFormButton($this->lng->txt("save"), "savePublicSection"); $this->tpl->setVariable("TOOLBAR", $my_toolbar->getHTML()); $this->tpl->setVariable("FORMACTION", $this->ctrl->getLinkTarget($this, "savePublicSection")); if ($this->object->getPublicAccessMode() == "selected") { $this->tpl->setCurrentBlock("select_pages"); require_once "./Modules/LearningModule/classes/class.ilPublicSectionSelector.php"; $exp = new ilPublicSectionSelector($this->ctrl->getLinkTarget($this, "view"), $this->object, $gui_class); $exp->setTargetGet("obj_id"); // build html-output $exp->setOutput(0); $output = $exp->getOutput(); // get page ids foreach ($exp->format_options as $node) { if (!$node["container"]) { $pages[] = $node["child"]; } } $js_pages = ilUtil::array_php2js($pages); $this->tpl->setVariable("EXPLORER", $output); $this->tpl->setVariable("ONCLICK", $js_pages); $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all")); $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all")); $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save")); $this->tpl->parseCurrentBlock(); } }
/** * 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()); }
/** * Show paste tree */ public function showPasteTreeObject() { global $ilTabs, $ilToolbar; $ilTabs->setTabActive('view_content'); if (!in_array($_SESSION['clipboard']['cmd'], array('link', 'copy', 'cut'))) { $message = __METHOD__ . ": Unknown action."; $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING); } $cmd = $_SESSION['clipboard']['cmd']; // $exp = $this->getTreeSelectorGUI($cmd); if ($exp->handleCommand()) { return; } $output = $exp->getHTML(); $txt_var = $cmd == "copy" ? "copy" : "paste"; // toolbars $t = new ilToolbarGUI(); $t->setFormAction($this->ctrl->getFormAction($this, "performPasteIntoMultipleObjects")); $t->addFormButton($this->lng->txt($txt_var), "performPasteIntoMultipleObjects"); $t->addSeparator(); $t->addFormButton($this->lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard"); $t->addFormButton($this->lng->txt("cancel"), "cancelMoveLink"); $t->setCloseFormTag(false); $t->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), " "); $output = $t->getHTML() . $output; $t->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), " "); $t->setCloseFormTag(true); $t->setOpenFormTag(false); $output .= "<br />" . $t->getHTML(); $this->tpl->setContent($output); }
function manageObject() { global $ilUser, $objDefinition, $ilCtrl, $lng; $objects = array(); $this->manage = true; $this->setAvailableDetailLevels(1, 1); $top_tb = new ilToolbarGUI(); $top_tb->setFormAction($ilCtrl->getFormAction($this)); $top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions")); if ($this->view == self::VIEW_SELECTED_ITEMS) { $top_tb->addFormButton($lng->txt("remove"), "confirmRemove"); } else { $top_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove"); } $top_tb->addSeparator(); $top_tb->addFormButton($lng->txt("cancel"), "getHTML"); $top_tb->setCloseFormTag(false); $bot_tb = new ilToolbarGUI(); $bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions")); if ($this->view == self::VIEW_SELECTED_ITEMS) { $bot_tb->addFormButton($lng->txt("remove"), "confirmRemove"); } else { $bot_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove"); } $bot_tb->addSeparator(); $bot_tb->addFormButton($lng->txt("cancel"), "getHTML"); $bot_tb->setOpenFormTag(false); return $top_tb->getHTML() . $this->getHTML() . $bot_tb->getHTML(); }
/** * Show target selection */ public function showTargetSelectionTree() { global $ilTabs, $ilToolbar, $ilCtrl, $tree, $tpl, $objDefinition, $lng; $this->tpl = $tpl; if ($objDefinition->isContainer($this->getType())) { ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard_container')); } else { ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard')); } // include_once "./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php"; $exp = new ilRepositorySelectorExplorerGUI($this, "showTargetSelectionTree"); $exp->setTypeWhiteList(array("root", "cat", "grp", "crs", "fold")); $exp->setSelectMode("target", false); if ($exp->handleCommand()) { return; } $output = $exp->getHTML(); // toolbars $t = new ilToolbarGUI(); $t->setFormAction($ilCtrl->getFormAction($this, "saveTarget")); if ($objDefinition->isContainer($this->getType())) { $t->addFormButton($lng->txt("btn_next"), "saveTarget"); } else { $t->addFormButton($lng->txt("paste"), "saveTarget"); } $t->addSeparator(); $t->addFormButton($lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard"); $t->addFormButton($lng->txt("cancel"), "cancel"); $t->setCloseFormTag(false); $t->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), " "); $output = $t->getHTML() . $output; $t->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), " "); $t->setCloseFormTag(true); $t->setOpenFormTag(false); $output .= "<br />" . $t->getHTML(); $this->tpl->setContent($output); return; // old implementation $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.paste_into_multiple_objects.html', "Services/Object"); include_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php'; $exp = new ilPasteIntoMultipleItemsExplorer(ilPasteIntoMultipleItemsExplorer::SEL_TYPE_RADIO, 'ilias.php?baseClass=ilRepositoryGUI&cmd=goto', 'paste_copy_repexpand'); // Target selection should check for create permission $required_perm = 'visible'; $create_perm = 'create_' . ilObject::_lookupType($this->getSource(), true); if ($create_perm) { $required_perm .= ',' . $create_perm; } $exp->setRequiredFormItemPermission($required_perm); $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'showTargetSelectionTree')); $exp->setTargetGet('ref_id'); $exp->setPostVar('target'); $exp->highlightNode($_GET['ref_id']); $exp->setCheckedItems(array((int) $_POST['target'])); // Filter to container foreach (array('cat', 'root', 'crs', 'grp', 'fold') as $container) { /* if($this->getType() == 'crs' and $container == 'crs') { continue; } */ $sub = $objDefinition->getSubObjects($container); if (!isset($sub[$this->getType()])) { $exp->removeFormItemForType($container); } } if ($_GET['paste_copy_repexpand'] == '') { $expanded = $tree->readRootId(); } else { $expanded = $_GET['paste_copy_repexpand']; } $this->tpl->setVariable('FORM_TARGET', '_self'); $this->tpl->setVariable('FORM_ACTION', $ilCtrl->getFormAction($this, 'copySelection')); $exp->setExpand($expanded); // build html-output $exp->setOutput(0); $output = $exp->getOutput(); $this->tpl->setVariable('OBJECT_TREE', $output); $this->tpl->setVariable('CMD_SUBMIT', 'saveTarget'); if ($objDefinition->isContainer($this->getType())) { $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('btn_next')); } else { if (!$objDefinition->isPlugin($this->getType())) { $submit = $this->lng->txt('obj_' . $this->getType() . '_duplicate'); } else { // get plugin instance include_once "Services/Component/classes/class.ilPlugin.php"; $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType())); $submit = $plugin->txt('obj_' . $this->getType() . '_duplicate'); } $this->tpl->setVariable('TXT_SUBMIT', $submit); } $ilToolbar->addButton($this->lng->txt('cancel'), $ilCtrl->getLinkTarget($this, 'cancel')); }