/** * 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()); }
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 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); }
/** * 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(); }
/** * add Mail to Member button to toolbar * * @param ilToolbarGUI $ilToolbar * @param string $back_cmd * @param bool $a_separator */ protected function addMailToMemberButton($ilToolbar, $back_cmd = null, $a_separator = false) { global $ilAccess, $ilUser, $rbacsystem; include_once 'Services/Mail/classes/class.ilMail.php'; $mail = new ilMail($ilUser->getId()); if (($ilAccess->checkAccess('write', '', $this->object->getRefId()) or $this->object->getMailToMembersType() == ilObjGroup::MAIL_ALLOWED_ALL) and $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())) { if ($a_separator) { $ilToolbar->addSeparator(); } if ($back_cmd) { $this->ctrl->setParameter($this, "back_cmd", $back_cmd); } $ilToolbar->addButton($this->lng->txt("mail_members"), $this->ctrl->getLinkTarget($this, 'mailMembers')); } }
/** * 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')); }