/** * Get multi language form */ function getMultiLangForm() { global $tpl, $lng, $ilCtrl, $ilUser; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // master language include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php"; $options = ilMDLanguageItem::_getLanguages(); $si = new ilSelectInputGUI($lng->txt("cont_master_lang"), "master_lang"); $si->setOptions($options); $si->setValue($ilUser->getLanguage()); $form->addItem($si); // additional languages include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php"; $options = ilMDLanguageItem::_getLanguages(); $options = array("" => $lng->txt("please_select")) + $options; $si = new ilSelectInputGUI($lng->txt("cont_additional_langs"), "additional_langs"); $si->setOptions($options); $si->setMulti(true); $form->addItem($si); $form->addCommandButton("saveMultilingualitySettings", $lng->txt("save")); $form->addCommandButton("cancel", $lng->txt("cancel")); $form->setTitle($lng->txt("cont_activate_multi_lang")); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
/** * Fill table row */ protected function fillRow($a_set) { global $lng; $this->nr++; if (!$a_set["default"] && $a_set["lang"] != $this->master_lang) { $this->tpl->setCurrentBlock("cb"); $this->tpl->setVariable("CB_NR", $this->nr); $this->tpl->parseCurrentBlock(); } if ($this->master_lang == "") { $this->tpl->setCurrentBlock("rb"); $this->tpl->setVariable("RB_NR", $this->nr); if ($a_set["default"]) { $this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\""); } $this->tpl->parseCurrentBlock(); } else { if ($a_set["lang"] == $this->master_lang) { $this->tpl->setVariable("MASTER_LANG", $lng->txt("obj_master_lang")); } } if ($this->incl_desc) { $this->tpl->setCurrentBlock("desc_row"); $this->tpl->setVariable("VAL_DESC", ilUtil::prepareFormOutput($a_set["desc"])); $this->tpl->setVariable("DNR", $this->nr); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("NR", $this->nr); // lang selection include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php'; $languages = ilMDLanguageItem::_getLanguages(); $this->tpl->setVariable("LANG_SELECT", ilUtil::formSelect($a_set["lang"], "lang[" . $this->nr . "]", $languages, false, true)); $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"])); }
/** * shows language select box */ function showLangSel($a_name, $a_value = "") { $tpl = new ilTemplate("tpl.lang_selection.html", true, true, "Services/MetaData"); $languages = ilMDLanguageItem::_getLanguages(); foreach ($languages as $code => $text) { $tpl->setCurrentBlock("lg_option"); $tpl->setVariable("VAL_LG", $code); $tpl->setVariable("TXT_LG", $text); if ($a_value != "" && $a_value == $code) { $tpl->setVariable("SELECTED", "selected"); } $tpl->parseCurrentBlock(); } $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select")); $tpl->setVariable("SEL_NAME", $a_name); $return = $tpl->get(); unset($tpl); return $return; }
/** * Get multi language form */ function getMultiLangForm($a_add = false) { global $tpl, $lng, $ilCtrl, $ilUser; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // master language if (!$a_add) { include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php"; $options = ilMDLanguageItem::_getLanguages(); $si = new ilSelectInputGUI($lng->txt("obj_master_lang"), "master_lang"); $si->setOptions($options); $si->setValue($ilUser->getLanguage()); $form->addItem($si); } // additional languages if ($a_add) { include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php"; $options = ilMDLanguageItem::_getLanguages(); $options = array("" => $lng->txt("please_select")) + $options; $si = new ilSelectInputGUI($lng->txt("obj_additional_langs"), "additional_langs"); $si->setOptions($options); $si->setMulti(true); $form->addItem($si); } if ($a_add) { $form->setTitle($lng->txt("obj_add_languages")); $form->addCommandButton("saveLanguages", $lng->txt("save")); $form->addCommandButton("listTranslations", $lng->txt("cancel")); } else { if ($this->getTitleDescrOnlyMode()) { $form->setTitle($lng->txt("obj_activate_content_lang")); } else { $form->setTitle($lng->txt("obj_activate_multilang")); } $form->addCommandButton("saveContentTranslationActivation", $lng->txt("save")); $form->addCommandButton("listTranslations", $lng->txt("cancel")); } $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
/** * edit header title form * * @access private */ function changeHeaderTitleObject() { global $rbacsystem, $styleDefinition; $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html", "Modules/SystemFolder"); $array_push = true; if ($_SESSION["error_post_vars"]) { $_SESSION["translation_post"] = $_SESSION["error_post_vars"]; $_GET["mode"] = "session"; $array_push = false; } // load from db if edit category is called the first time if ($_GET["mode"] != "session") { $data = $this->object->getHeaderTitleTranslations(); $_SESSION["translation_post"] = $data; $array_push = false; } elseif ($_GET["entry"] != 0) { array_splice($_SESSION["translation_post"]["Fobject"], $_GET["entry"], 1, array()); if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"]) { $_SESSION["translation_post"]["default_language"] = ""; } } $data = $_SESSION["translation_post"]; // add additional translation form if (!$_GET["entry"] and $array_push) { $count = array_push($data["Fobject"], array("title" => "", "desc" => "")); } else { $count = count($data["Fobject"]); } // stripslashes in form? $strip = isset($_SESSION["translation_post"]) ? true : false; foreach ($data["Fobject"] as $key => $val) { // add translation button if ($key == $count - 1) { $this->tpl->setCurrentBlock("addTranslation"); $this->tpl->setVariable("TXT_ADD_TRANSLATION", $this->lng->txt("add_translation") . " >>"); $this->tpl->parseCurrentBlock(); } // remove translation button if ($key != 0) { $this->tpl->setCurrentBlock("removeTranslation"); $this->tpl->setVariable("TXT_REMOVE_TRANSLATION", $this->lng->txt("remove_translation")); $this->ctrl->setParameter($this, "entry", $key); $this->ctrl->setParameter($this, "mode", "edit"); $this->tpl->setVariable("LINK_REMOVE_TRANSLATION", $this->ctrl->getLinkTarget($this, "removeTranslation")); $this->tpl->parseCurrentBlock(); } // lang selection $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html", "Services/MetaData"); $this->tpl->setVariable("SEL_NAME", "Fobject[" . $key . "][lang]"); include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php'; $languages = ilMDLanguageItem::_getLanguages(); foreach ($languages as $code => $language) { $this->tpl->setCurrentBlock("lg_option"); $this->tpl->setVariable("VAL_LG", $code); $this->tpl->setVariable("TXT_LG", $language); if ($code == $val["lang"]) { $this->tpl->setVariable("SELECTED", "selected=\"selected\""); } $this->tpl->parseCurrentBlock(); } // object data $this->tpl->setCurrentBlock("obj_form"); if ($key == 0) { $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title")); } else { $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation") . " " . $key); } if ($key == $data["default_language"]) { $this->tpl->setVariable("CHECKED", "checked=\"checked\""); } $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title")); $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc")); $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default")); $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language")); $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"], $strip)); $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"])); $this->tpl->setVariable("NUM", $key); $this->tpl->parseCurrentBlock(); } // global $this->tpl->setCurrentBlock("adm_content"); $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel")); $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save")); $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle"); $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field")); }
/** * Init edit form * * @param int $a_mode Edit Mode */ public function initEditForm($a_mode = "edit") { global $lng, $ilCtrl, $ilUser; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); if ($a_mode != "add_file") { // title $ti = new ilTextInputGUI($lng->txt("title"), "flst_title"); $ti->setMaxLength(80); $ti->setSize(40); $form->addItem($ti); // language require_once "Services/MetaData/classes/class.ilMDLanguageItem.php"; $lang = ilMDLanguageItem::_getLanguages(); $si = new ilSelectInputGUI($lng->txt("language"), "flst_language"); $si->setOptions($lang); $form->addItem($si); } if (in_array($a_mode, array("create", "add_file"))) { // file $fi = new ilFileInputGUI($lng->txt("file"), "file"); $fi->setRequired(true); $form->addItem($fi); } else { if (in_array($a_mode, array("select_file"))) { // file $ne = new ilNonEditableValueGUI($lng->txt("file"), ""); if (isset($_GET["file_ref_id"])) { include_once "./Modules/File/classes/class.ilObjFile.php"; $file_obj = new ilObjFile((int) $_GET["file_ref_id"]); if (is_object($file_obj)) { // ref id as hidden input $hi = new ilHiddenInputGUI("file_ref_id"); $hi->setValue((int) $_GET["file_ref_id"]); $form->addItem($hi); $ne->setValue($file_obj->getTitle()); } } else { if (isset($_GET["fl_wsp_id"])) { // we need the object id for the instance include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; $tree = new ilWorkspaceTree($ilUser->getId()); $node = $tree->getNodeData((int) $_GET["fl_wsp_id"]); include_once "./Modules/File/classes/class.ilObjFile.php"; $file_obj = new ilObjFile($node["obj_id"], false); if (is_object($file_obj)) { // ref id as hidden input $hi = new ilHiddenInputGUI("file_ref_id"); $hi->setValue("wsp_" . (int) $node["obj_id"]); $form->addItem($hi); $ne->setValue($file_obj->getTitle()); } $this->tpl->parseCurrentBlock(); } } $form->addItem($ne); } } switch ($a_mode) { case "edit": $ti->setValue($this->content_obj->getListTitle()); $si->setValue($this->content_obj->getLanguage()); $form->addCommandButton("saveProperties", $lng->txt("save")); $form->addCommandButton("cancelUpdate", $lng->txt("cancel")); $form->setTitle($lng->txt("cont_edit_file_list_properties")); break; case "create": case "select_file": if ($_SESSION["il_text_lang_" . $_GET["ref_id"]] != "") { $s_lang = $_SESSION["il_text_lang_" . $_GET["ref_id"]]; } else { $s_lang = $ilUser->getLanguage(); } $si->setValue($s_lang); $form->addCommandButton("create_flst", $lng->txt("save")); $form->addCommandButton("cancelCreate", $lng->txt("cancel")); $form->setTitle($lng->txt("cont_insert_file_list")); break; case "add_file": $form->addCommandButton("insertNewFileItem", $lng->txt("save")); $form->addCommandButton("editFiles", $lng->txt("cancel")); $form->setTitle($lng->txt("cont_insert_file_item")); break; } $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
/** * Edit term */ function editTerm() { global $ilTabs; $this->getTemplate(); $this->displayLocator(); $this->setTabs(); $ilTabs->activateTab("properties"); $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm()); $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png")); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm")); $form->setTitle($this->lng->txt("cont_edit_term")); $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term"); $term->setRequired(true); $term->setValue($this->term->getTerm()); $form->addItem($term); $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language"); $lang->setRequired(true); $lang->setOptions(ilMDLanguageItem::_getLanguages()); $lang->setValue($this->term->getLanguage()); $form->addItem($lang); // taxonomy if ($this->glossary->getTaxonomyId() > 0) { include_once "./Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php"; $tax_node_assign = new ilTaxAssignInputGUI($this->glossary->getTaxonomyId()); $tax_node_assign->setCurrentValues("glo", "term", $this->term->getId()); $form->addItem($tax_node_assign); } $form->addCommandButton("updateTerm", $this->lng->txt("save")); $this->tpl->setContent($form->getHTML()); $this->quickList(); }
/** * edit paragraph form */ function edit($a_insert = false) { global $ilUser, $ilias; // add paragraph edit template $tpl = new ilTemplate("tpl.paragraph_edit.html", true, true, "Services/COPage"); // help text $this->insertHelp($tpl); // operations if ($a_insert) { $tpl->setCurrentBlock("commands"); $tpl->setVariable("BTN_NAME", "create_par"); $tpl->setVariable("BTN_TEXT", $this->lng->txt("save")); $tpl->setVariable("BTN_CANCEL", "cancelCreate"); $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel")); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("commands2"); $tpl->setVariable("BTN_NAME", "create_par"); $tpl->setVariable("BTN_TEXT", $this->lng->txt("save")); $tpl->setVariable("BTN_CANCEL", "cancelCreate"); $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel")); $tpl->parseCurrentBlock(); $tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_insert_par")); } else { $tpl->setCurrentBlock("commands"); $tpl->setVariable("BTN_NAME", "update"); $tpl->setVariable("BTN_TEXT", $this->lng->txt("save")); $tpl->setVariable("BTN_CANCEL", "cancelUpdate"); $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel")); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("commands2"); $tpl->setVariable("BTN_NAME", "update"); $tpl->setVariable("BTN_TEXT", $this->lng->txt("save")); $tpl->setVariable("BTN_CANCEL", "cancelUpdate"); $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel")); $tpl->parseCurrentBlock(); $tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_edit_par")); } // language and characteristic selection $s_char = $this->determineCharacteristic($a_insert); if (!$a_insert) { if (key($_POST["cmd"]) == "update") { $s_lang = $_POST["par_language"]; } else { $s_lang = $this->content_obj->getLanguage(); } } else { if (key($_POST["cmd"]) == "create_par") { $s_lang = $_POST["par_language"]; } else { if ($_SESSION["il_text_lang_" . $_GET["ref_id"]] != "") { $s_lang = $_SESSION["il_text_lang_" . $_GET["ref_id"]]; } else { $s_lang = $ilUser->getLanguage(); } } } $this->insertStyleSelectionList($tpl, $s_char); // $this->insertCharacteristicTable($tpl, $s_char); $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); $tpl->setVariable("PAR_TA_NAME", "par_content"); $tpl->setVariable("BB_MENU", $this->getBBMenu()); $this->tpl->addJavascript("./Services/COPage/phpBB/3_0_5/editor.js"); $this->tpl->addJavascript("./Services/COPage/js/paragraph_editing.js"); $this->setStyle(); $this->displayValidationError(); $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language")); $tpl->setVariable("TXT_ANCHOR", $this->lng->txt("cont_anchor")); require_once "Services/MetaData/classes/class.ilMDLanguageItem.php"; $lang = ilMDLanguageItem::_getLanguages(); $select_lang = ilUtil::formSelect($s_lang, "par_language", $lang, false, true); $tpl->setVariable("SELECT_LANGUAGE", $select_lang); $tpl->setVariable("TXT_CHARACTERISTIC", $this->lng->txt("cont_characteristic")); // $select_char = ilUtil::formSelect ($s_char, // "par_characteristic",$this->chars,false,true); // $tpl->setVariable("SELECT_CHARACTERISTIC", $select_char); if (key($_POST["cmd"]) == "update" || key($_POST["cmd"]) == "create_par") { $s_text = ilUtil::stripSlashes($_POST["par_content"], false); // prevent curly brackets from being swallowed up by template engine $s_text = str_replace("{", "{", $s_text); $s_text = str_replace("}", "}", $s_text); } else { if (!$a_insert) { $s_text = $this->content_obj->xml2output($this->content_obj->getText()); } } $tpl->setVariable("PAR_TA_CONTENT", $s_text); $tpl->parseCurrentBlock(); $this->tpl->setContent($tpl->get()); return $tpl->get(); }
/** * Init properties form */ function initPropertiesForm($a_mode = "edit") { global $ilCtrl, $lng, $tpl, $ilUser; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($ilCtrl->getFormAction($this)); if ($a_mode == "create") { $this->form->setTitle($this->lng->txt("cont_insert_table")); } else { $this->form->setTitle($this->lng->txt("cont_table_properties")); } if ($a_mode == "create") { $nr = array(); for ($i = 1; $i <= 20; $i++) { $nr[$i] = $i; } // cols $cols = new ilSelectInputGUI($this->lng->txt("cont_nr_cols"), "nr_cols"); $cols->setOptions($nr); $cols->setValue(2); $this->form->addItem($cols); // rows $rows = new ilSelectInputGUI($this->lng->txt("cont_nr_rows"), "nr_rows"); $rows->setOptions($nr); $rows->setValue(2); $this->form->addItem($rows); } // width $width = new ilTextInputGUI($this->lng->txt("cont_table_width"), "width"); $width->setSize(6); $width->setMaxLength(6); $this->form->addItem($width); // border $border = new ilTextInputGUI($this->lng->txt("cont_table_border"), "border"); $border->setValue("1px"); $border->setSize(6); $border->setMaxLength(6); $this->form->addItem($border); // padding $padding = new ilTextInputGUI($this->lng->txt("cont_table_cellpadding"), "padding"); $padding->setValue("2px"); $padding->setSize(6); $padding->setMaxLength(6); $this->form->addItem($padding); // spacing (deprecated, only hidden) $spacing = new ilHiddenInputGUI("spacing"); $spacing->setValue("0px"); $this->form->addItem($spacing); /*$spacing = new ilTextInputGUI($this->lng->txt("cont_table_cellspacing"), "spacing"); $spacing->setValue("0px"); $spacing->setSize(6); $spacing->setMaxLength(6); $this->form->addItem($spacing);*/ // table templates and table classes require_once "./Services/Form/classes/class.ilAdvSelectInputGUI.php"; $char_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"), "characteristic"); $chars = $this->getCharacteristics(); $templates = $this->getTemplateOptions(); $chars = array_merge($templates, $chars); if (is_object($this->content_obj)) { if ($chars[$a_seleted_value] == "" && $this->content_obj->getClass() != "") { $chars = array_merge(array($this->content_obj->getClass() => $this->content_obj->getClass()), $chars); } } foreach ($chars as $k => $char) { if (strpos($k, ":") > 0) { $t = explode(":", $k); $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both;" class="small">' . $char . "</div>"; } else { $html = '<table class="ilc_table_' . $k . '"><tr><td class="small">' . $char . '</td></tr></table>'; } $char_prop->addOption($k, $char, $html); } $char_prop->setValue("StandardTable"); $this->form->addItem($char_prop); $nr = array(); for ($i = 0; $i <= 3; $i++) { $nr[$i] = $i; } // row header $rh = new ilSelectInputGUI($this->lng->txt("cont_nr_row_header"), "row_header"); $rh->setOptions($nr); $rh->setValue(1); $this->form->addItem($rh); // row footer $rf = new ilSelectInputGUI($this->lng->txt("cont_nr_row_footer"), "row_footer"); $rf->setOptions($nr); $rf->setValue(0); $this->form->addItem($rf); // col header $ch = new ilSelectInputGUI($this->lng->txt("cont_nr_col_header"), "col_header"); $ch->setOptions($nr); $ch->setValue(0); $this->form->addItem($ch); // col footer $cf = new ilSelectInputGUI($this->lng->txt("cont_nr_col_footer"), "col_footer"); $cf->setOptions($nr); $cf->setValue(0); $this->form->addItem($cf); if ($a_mode == "create") { // first row style require_once "./Services/Form/classes/class.ilAdvSelectInputGUI.php"; $fr_style = new ilAdvSelectInputGUI($this->lng->txt("cont_first_row_style"), "first_row_style"); $this->setBasicTableCellStyles(); $this->getCharacteristicsOfCurrentStyle("table_cell"); $chars = $this->getCharacteristics(); $options = array_merge(array("" => $this->lng->txt("none")), $chars); foreach ($options as $k => $option) { $html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k . '">' . $option . '</td></tr></table>'; $fr_style->addOption($k, $option, $html); } $fr_style->setValue(""); $this->form->addItem($fr_style); } // alignment $align_opts = array("Left" => $lng->txt("cont_left"), "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"), "LeftFloat" => $lng->txt("cont_left_float"), "RightFloat" => $lng->txt("cont_right_float")); $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align"); $align->setOptions($align_opts); $align->setValue("Center"); $this->form->addItem($align); // caption $caption = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption"); $caption->setSize(60); $this->form->addItem($caption); // caption align $ca_opts = array("top" => $lng->txt("cont_top"), "bottom" => $lng->txt("cont_bottom")); $ca = new ilSelectInputGUI($this->lng->txt("cont_align"), "cap_align"); $ca->setOptions($ca_opts); $caption->addSubItem($ca); // import if ($a_mode == "create") { // import table $import = new ilRadioGroupInputGUI($this->lng->txt("cont_paste_table"), "import_type"); $op = new ilRadioOption($this->lng->txt("cont_html_table"), "html"); $import->addOption($op); $op2 = new ilRadioOption($this->lng->txt("cont_spreadsheet_table"), "spreadsheet"); $import_data = new ilTextAreaInputGUI("", "import_table"); $import_data->setRows(8); $import_data->setCols(50); $op2->addSubItem($import_data); $import->addOption($op2); $import->setValue("html"); $this->form->addItem($import); } // language if ($_SESSION["il_text_lang_" . $_GET["ref_id"]] != "") { $s_lang = $_SESSION["il_text_lang_" . $_GET["ref_id"]]; } else { $s_lang = $ilUser->getLanguage(); } require_once "Services/MetaData/classes/class.ilMDLanguageItem.php"; $lang = ilMDLanguageItem::_getLanguages(); $language = new ilSelectInputGUI($this->lng->txt("language"), "language"); $language->setOptions($lang); $language->setValue($s_lang); $this->form->addItem($language); if ($a_mode == "create") { $this->form->addCommandButton("create_tab", $lng->txt("save")); $this->form->addCommandButton("cancelCreate", $lng->txt("cancel")); } else { $this->form->addCommandButton("saveProperties", $lng->txt("save")); } }
function setTemplateText($s_lang, $s_proglang) { $this->tpl->setVariable("TXT_CREATEFILE", $this->lng->txt("create_download_link")); $this->tpl->setVariable("TXT_DOWNLOADTITLE", $this->lng->txt("cont_download_title")); $this->tpl->setVariable("TXT_IMPORTFILE", $this->lng->txt("import_file")); $this->tpl->setVariable("TXT_UPLOAD_BTN", $this->lng->txt("import")); $this->tpl->setVariable("TXT_SUBCHARACTERISTIC", $this->lng->txt("cont_src")); $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language")); $this->tpl->setVariable("TXT_SHOWLINENUMBERS", $this->lng->txt("cont_show_line_numbers")); $this->tpl->setVariable("TXT_AUTOINDENT", $this->lng->txt("cont_autoindent")); $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); require_once "Services/MetaData/classes/class.ilMDLanguageItem.php"; $lang = ilMDLanguageItem::_getLanguages(); $select_lang = ilUtil::formSelect($s_lang, "par_language", $lang, false, true); $this->tpl->setVariable("SELECT_LANGUAGE", $select_lang); $prog_langs = $this->readProgLangs(); $select_subchar = ilUtil::formSelect($s_proglang, "par_subcharacteristic", $prog_langs, false, true); $this->tpl->setVariable("SELECT_SUBCHARACTERISTIC", $select_subchar); }
/** * list terms */ function listTerms() { global $ilUser, $ilToolbar, $lng, $ilCtrl, $tpl; if ($_GET["show_tax"]) { $this->showTaxonomy(); } // term include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ti = new ilTextInputGUI($lng->txt("cont_new_term"), "new_term"); $ti->setMaxLength(80); $ti->setSize(20); $ilToolbar->addInputItem($ti, true); // language $this->lng->loadLanguageModule("meta"); $lang = ilMDLanguageItem::_getLanguages(); if ($_SESSION["il_text_lang_" . $_GET["ref_id"]] != "") { $s_lang = $_SESSION["il_text_lang_" . $_GET["ref_id"]]; } else { $s_lang = $ilUser->getLanguage(); } include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $si = new ilSelectInputGUI($lng->txt("language"), "term_language"); $si->setOptions($lang); $si->setValue($s_lang); $ilToolbar->addInputItem($si, true); $ilToolbar->setFormAction($ilCtrl->getFormAction($this)); $ilToolbar->addFormButton($lng->txt("glo_add_new_term"), "addTerm"); //$select_language = ilUtil::formSelect ($s_lang, "term_language",$lang,false,true); //$this->tpl->setVariable("SELECT_LANGUAGE", $select_language); if (is_object($this->tax)) { $ilToolbar->addSeparator(); if ($_GET["show_tax"]) { $ilToolbar->addButton($lng->txt("glo_hide_taxonomy"), $ilCtrl->getLinkTarget($this, "deactTaxonomy")); } else { $ilToolbar->addButton($lng->txt("glo_show_taxonomy"), $ilCtrl->getLinkTarget($this, "actTaxonomy")); } } include_once "./Modules/Glossary/classes/class.ilTermListTableGUI.php"; $tab = new ilTermListTableGUI($this, "listTerms", $this->tax_node); $tpl->setContent($tab->getHTML()); }
function initEditForm() { $this->lng->loadLanguageModule($this->object->getType()); $this->setEditTabs(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt($this->object->getType() . "_edit")); // title/description $trans = $this->object->getTranslations(); $def = $trans["Fobject"][0]; // default $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setSize(min(40, ilObject::TITLE_LENGTH)); $title->setMaxLength(ilObject::TITLE_LENGTH); $title->setValue($def["title"]); $form->addItem($title); if (sizeof($trans["Fobject"]) > 1) { include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php'; $languages = ilMDLanguageItem::_getLanguages(); $title->setInfo($this->lng->txt("language") . ": " . $languages[$def["lang"]] . ' <a href="' . $this->ctrl->getLinkTarget($this, "editTranslations") . '">» ' . $this->lng->txt("cat_more_translations") . '</a>'); unset($languages); } $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "desc"); $desc->setRows(2); $desc->setCols(40); $desc->setValue($def["desc"]); $form->addItem($desc); // Show didactic template type $this->initDidacticTemplate($form); // presentation $pres = new ilFormSectionHeaderGUI(); $pres->setTitle($this->lng->txt('obj_presentation')); $form->addItem($pres); $form = $this->initSortingForm($form, array(ilContainer::SORT_TITLE, ilContainer::SORT_CREATION, ilContainer::SORT_MANUAL)); // icon settings // $this->showCustomIconsEditing(1, $form, false); // Edit ecs export settings include_once 'Modules/Category/classes/class.ilECSCategorySettings.php'; $ecs = new ilECSCategorySettings($this->object); $ecs->addSettingsToForm($form, 'cat'); // services $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($this->lng->txt('obj_features')); $form->addItem($sh); include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php'; ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $form, array(ilObjectServiceSettingsGUI::INFO_TAB_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY, ilObjectServiceSettingsGUI::TAXONOMIES)); $form->addCommandButton("update", $this->lng->txt("save")); // $form->addCommandButton("addTranslation", $this->lng->txt("add_translation")); return $form; }
/** * Get edit term form * * @param * @return */ function getEditTermForm() { global $ilTabs, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm")); $form->setTitle($this->lng->txt("cont_edit_term")); $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term"); $term->setRequired(true); $term->setValue($this->term->getTerm()); $form->addItem($term); $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language"); $lang->setRequired(true); $lang->setOptions(ilMDLanguageItem::_getLanguages()); $lang->setValue($this->term->getLanguage()); $form->addItem($lang); // taxonomy if ($this->glossary->getTaxonomyId() > 0) { include_once "./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php"; $tax_node_assign = new ilTaxSelectInputGUI($this->glossary->getTaxonomyId(), "tax_node", true); include_once "./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php"; $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId()); $assgnmts = $ta->getAssignmentsOfItem($this->term->getId()); $node_ids = array(); foreach ($assgnmts as $a) { $node_ids[] = $a["node_id"]; } $tax_node_assign->setValue($node_ids); $form->addItem($tax_node_assign); } // advanced metadata include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php'; $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'glo', $this->glossary->getId(), 'term', $this->term->getId()); $this->record_gui->setPropertyForm($form); $this->record_gui->setSelectedOnly(true); $this->record_gui->parse(); $form->addCommandButton("updateTerm", $this->lng->txt("save")); return $form; }
/** * List subtitls files * * @param * @return */ function listSubtitleFilesObject() { global $ilToolbar, $tpl, $ilCtrl, $lng, $ilUser; $this->setPropertiesSubTabs("subtitles"); // upload file $ilToolbar->setFormAction($ilCtrl->getFormAction($this), true); include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($lng->txt("mob_subtitle_file") . " (.srt)", "subtitle_file"); $fi->setSuffixes(array("srt")); $ilToolbar->addInputItem($fi, true); // language include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php"; $options = ilMDLanguageItem::_getLanguages(); $si = new ilSelectInputGUI($this->lng->txt("mob_language"), "language"); $si->setOptions($options); $si->setValue($ilUser->getLanguage()); $ilToolbar->addInputItem($si, true); $ilToolbar->addFormButton($lng->txt("upload"), "uploadSubtitleFile"); include_once "./Services/MediaObjects/classes/class.ilMobSubtitleTableGUI.php"; $tab = new ilMobSubtitleTableGUI($this, "listSubtitleFiles", $this->object); $tpl->setContent($tab->getHTML()); }
/** * initiates property form GUI class * * @param string $a_title * @param string $a_cmd * @param string $a_cmd_cancel * @return ilPropertyFormGUI form class */ function initPropertyForm($a_title, $a_cmd, $a_cmd_cancel) { include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTitle($a_title); $form->setFormAction($this->ctrl->getFormAction($this, $a_cmd)); $form->addCommandButton($a_cmd_cancel, $this->lng->txt("cancel")); $form->addCommandButton($a_cmd, $this->lng->txt("save")); require_once "Services/MetaData/classes/class.ilMDLanguageItem.php"; $lang_var = ilMDLanguageItem::_getLanguages(); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $lang = new ilSelectInputGUI($this->lng->txt("language"), "par_language"); $lang->setOptions($lang_var); $form->addItem($lang); $prog_langs = $this->readProgLangs(); $code_style = new ilSelectInputGUI($this->lng->txt("cont_src"), "par_subcharacteristic"); $code_style->setOptions($prog_langs); $form->addItem($code_style); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $line_number = new ilCheckboxInputGUI($this->lng->txt("cont_show_line_numbers"), "par_showlinenumbers"); $form->addItem($line_number); $indent = new ilCheckboxInputGUI($this->lng->txt("cont_autoindent"), "par_autoindent"); $form->addItem($indent); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $code = new ilTextAreaInputGUI("", "par_content"); $code->setRows(12); $form->addItem($code); include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $downlaod_title = new ilTextInputGUI($this->lng->txt("cont_download_title"), "par_downloadtitle"); $downlaod_title->setSize(40); $form->addItem($downlaod_title); include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $file = new ilFileInputGUI($this->lng->txt("import_file"), "userfile"); $form->addItem($file); return $form; }