/** * list fields */ public function listFields() { // Show tables require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php"; $tables = $this->parent_obj->object->getTables(); foreach ($tables as $table) { $options[$table->getId()] = $table->getTitle(); } include_once './Services/Form/classes/class.ilSelectInputGUI.php'; $table_selection = new ilSelectInputGUI('', 'table_id'); $table_selection->setOptions($options); $table_selection->setValue($this->table_id); $this->toolbar->setFormAction($this->ctrl->getFormActionByClass("ilDataCollectionFieldListGUI", "doTableSwitch")); $this->toolbar->addText($this->lng->txt("dcl_table")); $this->toolbar->addInputItem($table_selection); $this->toolbar->addFormButton($this->lng->txt('change'), 'doTableSwitch'); $this->toolbar->addSeparator(); $this->toolbar->addButton($this->lng->txt("dcl_add_new_table"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "create")); $this->toolbar->addSeparator(); $this->ctrl->setParameterByClass("ildatacollectiontableeditgui", "table_id", $this->table_id); $this->toolbar->addButton($this->lng->txt("dcl_table_settings"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "edit")); $this->toolbar->addButton($this->lng->txt("dcl_delete_table"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "confirmDelete")); $this->toolbar->addButton($this->lng->txt("dcl_add_new_field"), $this->ctrl->getLinkTargetByClass("ildatacollectionfieldeditgui", "create")); // requested not to implement this way... // $tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js"); require_once './Modules/DataCollection/classes/class.ilDataCollectionFieldListTableGUI.php'; $list = new ilDataCollectionFieldListTableGUI($this, $this->ctrl->getCmd(), $this->table_id); $this->tpl->setContent($list->getHTML()); }
/** * Get toolbar * * @return object toolbar */ function getToolbar() { global $ilCtrl, $lng; // toolbar $tb = new ilToolbarGUI(); $tb->setFormAction($ilCtrl->getFormAction($this)); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $options = array("Rect" => $lng->txt("cont_Rect"), "Circle" => $lng->txt("cont_Circle"), "Poly" => $lng->txt("cont_Poly"), "Marker" => $lng->txt("cont_marker")); $si = new ilSelectInputGUI($lng->txt("cont_trigger_area"), "shape"); $si->setOptions($options); $tb->addInputItem($si, true); $tb->addFormButton($lng->txt("add"), "addNewArea"); return $tb; }
public function appendToolbarSwitch(ilToolbarGUI $toolbar, $a_obj_type, $a_ref_id) { include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateSettings.php'; $tpls = ilDidacticTemplateSettings::getInstanceByObjectType($a_obj_type)->getTemplates(); if (!count($tpls)) { return false; } // Add template switch $toolbar->addText($this->lng->txt('didactic_selected_tpl_option')); // Show template options $options = array(0 => $this->lng->txt('didactic_default_type')); foreach ($tpls as $tpl) { $options[$tpl->getId()] = $tpl->getTitle(); } include_once './Services/Form/classes/class.ilSelectInputGUI.php'; include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php'; $tpl_selection = new ilSelectInputGUI('', 'tplid'); $tpl_selection->setOptions($options); $tpl_selection->setValue(ilDidacticTemplateObjSettings::lookupTemplateId($this->getParentObject()->object->getRefId())); $toolbar->addInputItem($tpl_selection); // Apply templates switch $toolbar->addFormButton($this->lng->txt('change'), 'confirmTemplateSwitch'); return true; }
/** * 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 Sequencing */ function showSequencing() { global $tpl, $lng, $ilTabs, $ilToolbar, $ilCtrl; $ilTabs->setTabActive("sahs_sequencing"); include_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php"; if (!$this->object->getSequencingExpertMode()) { $ilToolbar->addButton($lng->txt("sahs_activate_expert_mode"), $ilCtrl->getLinkTarget($this, "confirmExpertMode")); } else { include_once "./Services/UIComponent/NestedList/classes/class.ilNestedList.php"; $list = new ilNestedList(); $t = $this->object->getTree(); $root_node = $t->getNodeData($t->getRootId()); $nodes = $this->object->getTree()->getSubtree($root_node); foreach ($nodes as $node) { if (in_array($node["type"], array("", "chap", "sco"))) { $ntpl = new ilTemplate("tpl.seq_node.html", true, true, "Modules/Scorm2004"); $ntpl->setVariable("NODE_ID", $node["child"]); if ($node["type"] == "") { $ntpl->setVariable("TITLE", $this->object->getTitle()); $item = new ilSCORM2004Item($this->object->getId(), true); } else { $ntpl->setVariable("TITLE", $node["title"]); $item = new ilSCORM2004Item($node["child"]); } $ntpl->setVariable("SEQ_INFO", ilUtil::prepareFormOutput($item->exportAsXML(false))); $list->addListNode($ntpl->get(), $node["child"], $node["parent"]); } } $tb = new ilToolbarGUI(); $tb->addFormButton($lng->txt("save"), "saveSequencing"); $ftpl = new ilTemplate("tpl.sequencing.html", true, true, "Modules/Scorm2004"); $ftpl->setVariable("CONTENT", $list->getHTML()); $ftpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this)); $ftpl->setVariable("TB", $tb->getHTML()); $tpl->setContent($ftpl->get()); } }
/** * show selection screen for print view */ function showPrintViewSelection() { global $ilUser, $lng; include_once "./Modules/LearningModule/classes/class.ilLMPage.php"; if (!$this->lm->isActivePrintView()) { return; } include_once "./Modules/LearningModule/classes/class.ilStructureObject.php"; //$this->tpl = new ilTemplate("tpl.lm_toc.html", true, true, true); $this->tpl->setCurrentBlock("ContentStyle"); if (!$this->offlineMode()) { $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId())); } else { $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content_style/content.css"); } $this->tpl->parseCurrentBlock(); $this->renderPageTitle(); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $this->tpl->getStandardTemplate(); $this->tpl->setVariable("TABS", $this->lm_gui->setilLMMenu($this->offlineMode(), $this->getExportFormat(), "print", true)); $this->ilLocator(); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_print_selection.html", "Modules/LearningModule"); // set title header $this->tpl->setTitle($this->lm->getTitle()); $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg")); /*$this->tpl->setVariable("TXT_BACK", $this->lng->txt("back")); $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]); $this->tpl->setVariable("LINK_BACK", $this->ctrl->getLinkTargetByClass("illmpresentationgui", ""));*/ $this->ctrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]); $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormaction($this)); $nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId())); if (!is_array($_POST["item"])) { if ($_GET["obj_id"] != "") { $_POST["item"][$_GET["obj_id"]] = "y"; } else { $_POST["item"][1] = "y"; } } $this->initPrintViewSelectionForm(); foreach ($nodes as $node) { // check page activation $active = ilLMPage::_lookupActive($node["obj_id"], $this->lm->getType(), $this->lm_set->get("time_scheduled_page_activation")); if ($node["type"] == "pg" && !$active) { continue; } $text = $img_scr = $img_alt = ""; $disabled = false; $checked = false; switch ($node["type"]) { // page case "pg": $text = ilLMPageObject::_getPresentationTitle($node["obj_id"], $this->lm->getPageHeader(), $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), false, 0, $this->lang); if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && $this->lm_gui->object->getPublicAccessMode() == "selected") { if (!ilLMObject::_isPagePublic($node["obj_id"])) { $disabled = true; $text .= " (" . $this->lng->txt("cont_no_access") . ")"; } } $img_src = ilUtil::getImagePath("icon_pg.svg"); $img_alt = $lng->txt("icon") . " " . $lng->txt("pg"); break; // learning module // learning module case "du": $text = $this->lm->getTitle(); $img_src = ilUtil::getImagePath("icon_lm.svg"); $img_alt = $lng->txt("icon") . " " . $lng->txt("obj_lm"); break; // chapter // chapter case "st": $text = ilStructureObject::_getPresentationTitle($node["obj_id"], $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), 0, $this->lang); if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && $this->lm_gui->object->getPublicAccessMode() == "selected") { if (!ilLMObject::_isPagePublic($node["obj_id"])) { $disabled = true; $text .= " (" . $this->lng->txt("cont_no_access") . ")"; } } $img_src = ilUtil::getImagePath("icon_st.svg"); $img_alt = $lng->txt("icon") . " " . $lng->txt("st"); break; } if (!ilObjContentObject::_checkPreconditionsOfPage($this->lm->getRefId(), $this->lm->getId(), $node["obj_id"])) { $text .= " (" . $this->lng->txt("cont_no_access") . ")"; } $this->nl->addListNode($node["obj_id"], $text, $node["parent"], $checked, $disabled, $img_src, $img_alt); } // check for free page if ($_GET["obj_id"] > 0 && !$this->lm_tree->isInTree($_GET["obj_id"])) { $text = ilLMPageObject::_getPresentationTitle($_GET["obj_id"], $this->lm->getPageHeader(), $this->lm->isActiveNumbering(), $this->lm_set->get("time_scheduled_page_activation"), false, 0, $this->lang); if (($ilUser->getId() == ANONYMOUS_USER_ID || $this->needs_to_be_purchased) && $this->lm_gui->object->getPublicAccessMode() == "selected") { if (!ilLMObject::_isPagePublic($_GET["obj_id"])) { $disabled = true; $text .= " (" . $this->lng->txt("cont_no_access") . ")"; } } $img_src = ilUtil::getImagePath("icon_pg.svg"); $id = $_GET["obj_id"]; $checked = true; $this->nl->addListNode($id, $text, 0, $checked, $disabled, $img_src, $img_alt); } $f = $this->form->getHTML(); // submit toolbar $tb = new ilToolbarGUI(); $tb->addFormButton($lng->txt("cont_show_print_view"), "showPrintView"); $this->tpl->setVariable("TOOLBAR", $tb->getHTML()); $this->tpl->setVariable("ITEM_SELECTION", $f); $this->tpl->show(); }
/** * Put admin panel into template: * - creation selector * - admin view on/off button */ function fillAdminPanel() { global $lng, $ilHelp; $adm_view_cmp = $adm_cmds = $adm_view = false; $toolb = new ilToolbarGUI(); // admin panel commands if (count($this->admin_panel_commands) > 0) { foreach ($this->admin_panel_commands as $cmd) { $toolb->addFormButton($cmd["txt"], $cmd["cmd"]); } $adm_cmds = true; } elseif ($this->admin_panel_commands_toolbar instanceof ilToolbarGUI) { $toolb = $this->admin_panel_commands_toolbar; $adm_cmds = true; } // Add arrow if desired if ($this->admin_panel_arrow) { $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions")); } if ($adm_cmds) { $this->fillPageFormAction(); $this->setCurrentBlock("adm_view_components"); $this->setVariable("ADM_PANEL1", $toolb->getHTML()); $this->parseCurrentBlock(); $adm_view_cmp = true; } // admin view button if ($this->page_actions != "") { $this->setVariable("PAGE_ACTIONS", $this->page_actions); $adm_view = true; } // creation selector // see: ilObjectAddNewItemGUI // placeholder "SELECT_OBJTYPE_REPOS" still needed! if ($adm_cmds and $this->admin_panel_bottom) { $this->setCurrentBlock("adm_view_components2"); if ($this->admin_panel_arrow) { $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions")); } $this->setVariable("ADM_PANEL2", $toolb->getHTML()); $this->parseCurrentBlock(); } }
/** * Put admin panel into template: * - creation selector * - admin view on/off button */ function fillAdminPanel() { global $lng, $ilHelp; $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view = false; $toolb = new ilToolbarGUI(); // admin panel commands if (count($this->admin_panel_commands) > 0) { foreach ($this->admin_panel_commands as $cmd) { $toolb->addFormButton($cmd["txt"], $cmd["cmd"]); } $adm_cmds = true; } elseif ($this->admin_panel_commands_toolbar instanceof ilToolbarGUI) { $toolb = $this->admin_panel_commands_toolbar; $adm_cmds = true; } // Add arrow if desired if ($this->admin_panel_arrow) { $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions")); } if ($adm_cmds) { $this->fillPageFormAction(); $this->setCurrentBlock("adm_view_components"); $this->setVariable("ADM_PANEL1", $toolb->getHTML()); $this->parseCurrentBlock(); $adm_view_cmp = true; } // admin view button if ($this->page_actions != "") { $this->setVariable("PAGE_ACTIONS", $this->page_actions); $adm_view = true; } // creation selector if (is_array($this->creation_selector)) { $this->setCurrentBlock("add_commands"); if ($adm_cmds) { $this->setVariable("ADD_COM_WIDTH", 'width="1"'); } include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($lng->txt("cntr_add_new_item")); $selection->setId("item_creation"); $selection->setHeaderIcon(ilUtil::getImagePath("cmd_add_s.png")); $selection->setItemLinkClass("xsmall"); $selection->setUseImages(true); foreach ($this->creation_selector["options"] as $item) { $link = $this->page_form_action . "&new_type=" . $item["value"]; $link = str_replace("cmd=post", "cmd=" . $this->creation_selector["command"], $link); $ttip = ilHelp::getObjCreationTooltipText($item["value"]); $selection->addItem($item["title"], $item["value"], $link, $item["img"], $item["title"], "", "", false, "", $ttip, "right center", "left center", false); } $this->setVariable("SELECT_OBJTYPE_REPOS", $selection->getHTML()); $this->setVariable("CENTER_COL_CLASS", trim($this->right_content) != "" ? "one_side_col" : ""); $this->parseCurrentBlock(); $creation_selector = true; } if ($adm_cmds and $this->admin_panel_bottom) { $this->setCurrentBlock("adm_view_components2"); if ($this->admin_panel_arrow) { $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), $lng->txt("actions")); } $this->setVariable("ADM_PANEL2", $toolb->getHTML()); $this->parseCurrentBlock(); } }
/** * Get confirmation screen HTML. * * @return string HTML code. */ public final function getHTML() { global $lng; ilUtil::sendQuestion($this->getHeaderText()); include_once "./Services/Utilities/classes/class.ilConfirmationTableGUI.php"; // delete/handle items if (count($this->item) > 0) { $ctab = new ilConfirmationTableGUI($this->use_images); $ctab->setData($this->item); // other buttons foreach ($this->buttons as $b) { $ctab->addCommandButton($b["cmd"], $b["txt"]); } $ctab->addCommandButton($this->confirm_cmd, $this->confirm_txt); $ctab->addCommandButton($this->cancel_cmd, $this->cancel_txt); $ctab->setFormAction($this->getFormAction()); foreach ($this->hidden_item as $hidden_item) { $ctab->addHiddenInput($hidden_item["var"], $hidden_item["value"]); } if ($this->form_name) { $ctab->setFormName($this->form_name); } return $ctab->getHTML(); } else { $tb = new ilToolbarGUI(); $tb->setFormAction($this->getFormAction()); if ($this->hidden_item) { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; foreach ($this->hidden_item as $hidden_item) { $hiddenInput = new ilHiddenInputGUI($hidden_item['var']); $hiddenInput->setValue($hidden_item['value']); $tb->addInputItem($hiddenInput); } } $tb->addFormButton($this->confirm_txt, $this->confirm_cmd); $tb->addFormButton($this->cancel_txt, $this->cancel_cmd); return $tb->getHTML(); } }
/** * 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); }
/** * @return ilToolbarGUI */ private function buildSkillSelectorToolbarGUI() { require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php'; $skillSelectorToolbarGUI = new ilToolbarGUI(); $skillSelectorToolbarGUI->setFormAction($this->ctrl->getFormAction($this)); $skillSelectorToolbarGUI->addFormButton($this->lng->txt('qpl_save_skill_assigns_update'), self::CMD_UPDATE_SKILL_QUEST_ASSIGNS); $skillSelectorToolbarGUI->addFormButton($this->lng->txt('qpl_cancel_skill_assigns_update'), self::CMD_SHOW_SKILL_QUEST_ASSIGNS); return $skillSelectorToolbarGUI; }
/** * Shows a card * Implemented here to ensure a common look & feel for all training modes * This method needs $_GET["card_id"] to be set */ protected function showCard() { $card_id = (int) $_GET["card_id"]; $this->ctrl->saveParameter($this, "card_id"); $tpl = $this->plugin->getTemplate("tpl.training_show_card.html"); // show the status text if ($text = $this->getTrainingStatusText()) { $tpl->setVariable("TRAINING_STATUS_TEXT", $text); } // show the flashcard $this->plugin->includeClass("class.ilFlashcardGUI.php"); $card = $this->object->getCard($card_id); if (!is_object($card)) { $tpl->setVariable("CARD_PRESENTATION", $this->plugin->txt('card_is_deleted')); } else { $card_gui = new ilFlashcardGUI($this, $this->object->getCard($card_id)); $tpl->setVariable("CARD_PRESENTATION", $card_gui->getCardForTrainingHTML()); } // show the training actions for the card require_once "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"; $toolbar = new ilToolbarGUI(); $toolbar->setFormAction($this->ctrl->getFormAction($this)); $actions = $this->getCardActions($card_id); foreach ($actions as $action) { $toolbar->addFormButton($action["txt"], $action["cmd"]); } if (count($actions) > 1) { $toolbar->addSeparator(); } $toolbar->addFormButton($this->txt("cancel_training"), "cancelTraining"); $tpl->setVariable("CARD_ACTIONS", $toolbar->getHTML()); $this->tpl->setContent($tpl->get()); }
/** * show administration panel */ function showAdministrationPanel(&$tpl) { global $ilAccess, $lng; $lng->loadLanguageModule('cntr'); if ($this->isActiveAdministrationPanel()) { // #11545 $GLOBALS['tpl']->setPageFormAction($this->ctrl->getFormAction($this)); include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php'; $toolbar = new ilToolbarGUI(); $this->ctrl->setParameter($this, "type", ""); $this->ctrl->setParameter($this, "item_ref_id", ""); if (!$_SESSION["clipboard"]) { if ($this->object->gotItems()) { $toolbar->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions")); $toolbar->addFormButton($this->lng->txt('delete_selected_items'), 'delete'); $toolbar->addFormButton($this->lng->txt('move_selected_items'), 'cut'); $toolbar->addFormButton($this->lng->txt('copy_selected_items'), 'copy'); $toolbar->addFormButton($this->lng->txt('link_selected_items'), 'link'); // add download button if multi download enabled $folder_set = new ilSetting("fold"); if ($folder_set->get("enable_multi_download") == true) { $toolbar->addSeparator(); $toolbar->addFormButton($this->lng->txt('download_selected_items'), 'download'); } } if ($this->object->getType() == 'crs') { if ($this->object->gotItems()) { $toolbar->addSeparator(); } $toolbar->addButton($this->lng->txt('cntr_adopt_content'), $this->ctrl->getLinkTargetByClass('ilObjectCopyGUI', 'initSourceSelection')); } } else { /*$GLOBALS["tpl"]->addAdminPanelCommand("paste", $this->lng->txt("paste_clipboard_items")); if($_SESSION["clipboard"]["cmd"] == "link") { $GLOBALS["tpl"]->addAdminPanelCommand("initAndDisplayLinkIntoMultipleObjects", $this->lng->txt("paste_clipboard_items_into_multiple_objects")); }*/ $toolbar->addFormButton($this->lng->txt('clear_clipboard'), 'clear'); if ($this->isMultiDownloadEnabled()) { $toolbar->addSeparator(); $toolbar->addFormButton($this->lng->txt('download_selected_items'), 'download'); } } $GLOBALS['tpl']->addAdminPanelToolbar($toolbar, $this->object->gotItems() ? true : false, $this->object->gotItems() ? true : false); } else { if ($this->edit_order) { if ($this->object->gotItems() and $ilAccess->checkAccess("write", "", $this->object->getRefId())) { include_once './Services/Container/classes/class.ilContainer.php'; if ($this->object->getOrderType() == ilContainer::SORT_MANUAL) { // #11843 $GLOBALS['tpl']->setPageFormAction($this->ctrl->getFormAction($this)); include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php'; $toolbar = new ilToolbarGUI(); $this->ctrl->setParameter($this, "type", ""); $this->ctrl->setParameter($this, "item_ref_id", ""); $toolbar->addFormButton($this->lng->txt('sorting_save'), 'saveSorting'); $GLOBALS['tpl']->addAdminPanelToolbar($toolbar, true, false); /* $GLOBALS["tpl"]->addAdminPanelCommand("saveSorting", $this->lng->txt('sorting_save')); // button should appear at bottom, too $GLOBALS["tpl"]->admin_panel_bottom = true; */ } } } else { if ($this->isMultiDownloadEnabled()) { // #11843 $GLOBALS['tpl']->setPageFormAction($this->ctrl->getFormAction($this)); include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php'; $toolbar = new ilToolbarGUI(); $this->ctrl->setParameter($this, "type", ""); $this->ctrl->setParameter($this, "item_ref_id", ""); $toolbar->addFormButton($this->lng->txt('download_selected_items'), 'download'); $GLOBALS['tpl']->addAdminPanelToolbar($toolbar, $this->object->gotItems() ? true : false, $this->object->gotItems() ? true : false); } } } }
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(); }
/** * Get toolbar * * @return object toolbar */ function getToolbar() { global $ilCtrl, $lng, $tpl; // toolbar $tb = new ilToolbarGUI(); $tb->setFormAction($ilCtrl->getFormAction($this)); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $options = array("WholePicture" => $lng->txt("cont_WholePicture"), "Rect" => $lng->txt("cont_Rect"), "Circle" => $lng->txt("cont_Circle"), "Poly" => $lng->txt("cont_Poly")); $si = new ilSelectInputGUI($lng->txt("cont_shape"), "shape"); $si->setOptions($options); $tb->addInputItem($si, true); $tb->addFormButton($lng->txt("cont_add_area"), "addNewArea"); // highlight mode /* if (strtolower(get_class($this)) == "ilimagemapeditorgui") { $st_item = $this->media_object->getMediaItem("Standard"); $tb->addSeparator(); $options = ilMapArea::getAllHighlightModes(); $hl = new ilSelectInputGUI($lng->txt("cont_highlight_mode"), "highlight_mode"); $hl->setOptions($options); // $hl->setValue($st_item->getHighlightMode()); $tb->addInputItem($hl, true); $options = ilMapArea::getAllHighlightClasses(); $hc = new ilSelectInputGUI($lng->txt("cont_highlight_class"), "highlight_class"); $hc->setOptions($options); // $hc->setValue($st_item->getHighlightClass()); $tb->addInputItem($hc, false); $tb->addFormButton($lng->txt("cont_set"), "setHighlight"); }*/ return $tb; }
function linkChecker() { global $ilias, $ilUser, $tpl; $this->__initLinkChecker(); $this->setTabs(); $this->setContentSubTabs("link_check"); require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php'; $toolbar = new ilToolbarGUI(); if ((bool) $ilias->getSetting('cron_web_resource_check')) { include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php'; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message'); $chb->setValue(1); $chb->setChecked((bool) ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(), $this->object->getId())); $chb->setOptionTitle($this->lng->txt('link_check_message_b')); $toolbar->addInputItem($chb); $toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck'); $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck')); } $tgui = new ilLinkCheckerTableGUI($this, 'linkChecker'); $tgui->setLinkChecker($this->link_checker_obj)->setRowHandler($this)->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck'); return $tpl->setContent($tgui->prepareHTML()->getHTML() . $toolbar->getHTML()); }
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(); */ }
/** * 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')); }