public function addToForm() { global $lng; $def = $this->getADT()->getCopyOfDefinition(); $selection = $this->getADT()->getSelection(); $options = $def->getOptions(); asort($options); // ? if (!$this->isRequired()) { $options = array("" => "-") + $options; } else { if ($this->getADT()->isNull()) { $options = array("" => $lng->txt("please_select")) + $options; } } if (!(bool) $this->force_radio) { $select = new ilSelectInputGUI($this->getTitle(), $this->getElementId()); $select->setOptions($options); } else { $select = new ilRadioGroupInputGUI($this->getTitle(), $this->getElementId()); foreach ($options as $value => $caption) { $option = new ilRadioOption($caption, $value); if (is_array($this->option_infos) && array_key_exists($value, $this->option_infos)) { $option->setInfo($this->option_infos[$value]); } $select->addOption($option); } } $this->addBasicFieldProperties($select, $def); $select->setValue($selection); $this->addToParentElement($select); }
/** * Init Filter */ function initFilter() { global $lng, $ilUser; // period $per = $_SESSION["news_pd_news_per"] != "" ? $_SESSION["news_pd_news_per"] : ilNewsItem::_lookupUserPDPeriod($ilUser->getId()); $news_set = new ilSetting("news"); $allow_shorter_periods = $news_set->get("allow_shorter_periods"); $allow_longer_periods = $news_set->get("allow_longer_periods"); $default_per = ilNewsItem::_lookupDefaultPDPeriod(); $options = array(2 => sprintf($lng->txt("news_period_x_days"), 2), 3 => sprintf($lng->txt("news_period_x_days"), 3), 5 => sprintf($lng->txt("news_period_x_days"), 5), 7 => $lng->txt("news_period_1_week"), 14 => sprintf($lng->txt("news_period_x_weeks"), 2), 30 => $lng->txt("news_period_1_month"), 60 => sprintf($lng->txt("news_period_x_months"), 2), 120 => sprintf($lng->txt("news_period_x_months"), 4), 180 => sprintf($lng->txt("news_period_x_months"), 6), 366 => $lng->txt("news_period_1_year")); $unset = array(); foreach ($options as $k => $opt) { if (!$allow_shorter_periods && $k < $default_per) { $unset[$k] = $k; } if (!$allow_longer_periods && $k > $default_per) { $unset[$k] = $k; } } foreach ($unset as $k) { unset($options[$k]); } include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $si = new ilSelectInputGUI($this->lng->txt("news_time_period"), "news_per"); $si->setOptions($options); $si->setValue($per); $this->addFilterItem($si); // related to... $si = new ilSelectInputGUI($this->lng->txt("context"), "news_ref_id"); $si->setOptions($this->contexts); $si->setValue($this->selected_context); $this->addFilterItem($si); }
/** * list fields */ public function listFields() { global $tpl, $lng, $ilCtrl, $ilToolbar; // 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); $ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilDataCollectionFieldListGUI", "doTableSwitch")); $ilToolbar->addText($lng->txt("dcl_table")); $ilToolbar->addInputItem($table_selection); $ilToolbar->addFormButton($lng->txt('change'), 'doTableSwitch'); $ilToolbar->addSeparator(); $ilToolbar->addButton($lng->txt("dcl_add_new_table"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "create")); $ilToolbar->addSeparator(); $ilCtrl->setParameterByClass("ildatacollectiontableeditgui", "table_id", $this->table_id); $ilToolbar->addButton($lng->txt("dcl_table_settings"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "edit")); $ilToolbar->addButton($lng->txt("dcl_delete_table"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "confirmDelete")); $ilToolbar->addButton($lng->txt("dcl_add_new_field"), $ilCtrl->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, $ilCtrl->getCmd(), $this->table_id); $tpl->setContent($list->getHTML()); }
private function getDeveloperRubricCardFormCommandRow($form_action) { global $ilUser; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; //configure the command row $rubric_commandrow_tpl = new ilTemplate('tpl.lp_rubricform_commandrow.html', true, true, 'Services/Tracking'); $select_prop = new ilSelectInputGUI('Title', 'selected_cmdrubric'); $options = array('behavior_1' => $this->lng->txt('rubric_option_behavior_1'), 'behavior_2' => $this->lng->txt('rubric_option_behavior_2'), 'behavior_3' => $this->lng->txt('rubric_option_behavior_3'), 'behavior_4' => $this->lng->txt('rubric_option_behavior_4'), 'behavior_5' => $this->lng->txt('rubric_option_behavior_5'), 'add_group' => $this->lng->txt('rubric_option_add_group'), 'del_group' => $this->lng->txt('rubric_option_del_group'), 'add_criteria' => $this->lng->txt('rubric_option_add_criteria'), 'del_criteria' => $this->lng->txt('rubric_option_del_criteria')); $select_prop->setOptions($options); $rubric_commandrow_tpl->setVariable('RURBRIC_COMMANDROW_SELECT', $select_prop->render()); $rubric_commandrow_tpl->setVariable('RUBRIC_SAVE', $this->lng->txt('save')); $rubric_commandrow_tpl->setVariable('RUBRIC_EXECUTE', $this->lng->txt('execute')); $rubric_commandrow_tpl->setVariable('FORM_ACTION', $form_action); $rubric_commandrow_tpl->setVariable('PASSING_GRADE_VALUE', "{$this->passing_grade}"); if (!is_null($this->rubric_locked)) { $rubric_commandrow_tpl->setVariable('RUBRIC_DISABLED', 'disabled'); $rubric_commandrow_tpl->setVariable('RUBRIC_LOCK', $this->lng->txt('rubric_card_unlock')); $tmp_user = ilObjectFactory::getInstanceByObjId($this->rubric_owner, false); if ($this->rubric_owner !== $ilUser->getId()) { $rubric_commandrow_tpl->setVariable('USER_LOCK', 'disabled'); } ilUtil::sendInfo($this->lng->txt('rubric_locked_info') . ' ' . $tmp_user->getFullName() . ' ' . $this->rubric_locked); } else { $rubric_commandrow_tpl->setVariable('RUBRIC_LOCK', $this->lng->txt('rubric_card_lock')); } $rubric_commandrow_tpl->setVariable('EXPORT', $this->lng->txt('rubric_option_export_pdf')); return $rubric_commandrow_tpl; }
/** * Edit news settings. */ public function editSettings() { global $ilCtrl, $lng, $ilSetting, $ilTabs, $ilToolbar; $ilTabs->activateTab("settings"); if (OH_REF_ID > 0) { ilUtil::sendInfo("This installation is used for online help authoring. Help modules cannot be imported."); return; } if ($this->checkPermissionBool("write")) { // help file include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($lng->txt("help_help_file"), "help_file"); $fi->setSuffixes(array("zip")); $ilToolbar->addInputItem($fi, true); $ilToolbar->addFormButton($lng->txt("upload"), "uploadHelpFile"); $ilToolbar->addSeparator(); // help mode include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $options = array("" => $lng->txt("help_tooltips_and_help"), "1" => $lng->txt("help_help_only"), "2" => $lng->txt("help_tooltips_only")); $si = new ilSelectInputGUI($this->lng->txt("help_mode"), "help_mode"); $si->setOptions($options); $si->setValue($ilSetting->get("help_mode")); $ilToolbar->addInputItem($si); $ilToolbar->addFormButton($lng->txt("help_set_mode"), "setMode"); } $ilToolbar->setFormAction($ilCtrl->getFormAction($this), true); include_once "./Services/Help/classes/class.ilHelpModuleTableGUI.php"; $tab = new ilHelpModuleTableGUI($this, "editSettings"); $this->tpl->setContent($tab->getHTML()); }
protected function initForm() { $this->setTitle($this->pl->txt('form_title')); $te = new ilSelectInputGUI($this->txt(self::F_UDF_FIELD_ID), self::F_UDF_FIELD_ID); $te->setDisabled(!$this->is_new); $te->setRequired(true); $te->setOptions(ilUDFCheck::getDefinitionData()); $this->addItem($te); if (!$this->is_new) { $te = new ilHiddenInputGUI($this->txt(self::F_UDF_FIELD_ID), self::F_UDF_FIELD_ID); $this->addItem($te); switch (ilUDFCheck::getDefinitionTypeForId($this->object->getUdfFieldId())) { case ilUDFCheck::TYPE_TEXT: $se = new ilTextInputGUI($this->pl->txt(self::F_CHECK_VALUE), self::F_CHECK_VALUE); $this->addItem($se); break; case ilUDFCheck::TYPE_SELECT: $se = new ilSelectInputGUI($this->pl->txt(self::F_CHECK_VALUE), self::F_CHECK_VALUE); $se->setOptions(ilUDFCheck::getDefinitionValuesForId($this->object->getUdfFieldId())); $this->addItem($se); break; } } $this->addCommandButtons(); }
public function parse($scoSelected, $report, $reports) { global $ilCtrl, $lng; $lng->loadLanguageModule("scormtrac"); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($ilCtrl->getFormAction($this->parent_obj)); $options = array("all" => $lng->txt("all")); $scos = $this->parent_obj->object->getTrackedItems(); foreach ($scos as $row) { $options[$row->getId()] = $row->getTitle(); } $si = new ilSelectInputGUI($lng->txt("chapter"), "scoSelected"); $si->setOptions($options); $si->setValue($scoSelected); $this->form->addItem($si); $options = array("choose" => $lng->txt("please_choose")); for ($i = 0; $i < count($reports); $i++) { $options[$reports[$i]] = $lng->txt(strtolower($reports[$i])); } $si = new ilSelectInputGUI($lng->txt("report"), "report"); $si->setOptions($options); $si->setValue($report); $this->form->addItem($si); $this->form->addCommandButton($this->parent_cmd, $lng->txt("apply_filter")); }
/** * 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; }
/** * List templates */ function listTemplates() { // list pages include_once "./Modules/Wiki/classes/class.ilWikiPage.php"; $pages = ilWikiPage::getAllPages($this->wiki->getId()); $options = array("" => $this->lng->txt("please_select")); foreach ($pages as $p) { //if (!in_array($p["id"], $ipages_ids)) //{ $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true); //} } $this->toolbar->setFormAction($this->ctrl->getFormAction($this)); $this->toolbar->setOpenFormTag(true); $this->toolbar->setCloseFormTag(false); if (count($options) > 0) { include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $si = new ilSelectInputGUI($this->lng->txt("wiki_pages"), "templ_page_id"); $si->setOptions($options); $this->toolbar->addInputItem($si); $this->toolbar->addFormButton($this->lng->txt("wiki_add_template"), "add"); $this->toolbar->addSeparator(); } // empty page as template? include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php"; $cb = new ilCheckboxInputGUI($this->lng->txt("wiki_empty_page_template"), "empty_page_templ"); $cb->setChecked($this->wiki->getEmptyPageTemplate()); $this->toolbar->addInputItem($cb, true); $this->toolbar->addFormButton($this->lng->txt("save"), "saveTemplateSettings"); include_once "./Modules/Wiki/classes/class.ilWikiPageTemplatesTableGUI.php"; $tab = new ilWikiPageTemplatesTableGUI($this, "listTemplates", $this->wiki->getId()); $tab->setOpenFormTag(false); $tab->setCloseFormTag(true); $this->tpl->setContent($tab->getHTML()); }
/** * Add all fields to the form */ protected function initForm() { $this->setFormAction($this->ctrl->getFormAction($this->parent_gui)); $this->setTitle($this->lng->txt('orgu_settings')); $item = new ilTextInputGUI($this->lng->txt('title'), 'title'); $item->setRequired(true); $item->setValue($this->obj_orgu->getTitle()); $this->addItem($item); $item = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $item->setValue($this->obj_orgu->getDescription()); $this->addItem($item); $item = new ilFormSectionHeaderGUI(); $item->setTitle($this->lng->txt('orgu_type')); $this->addItem($item); $types = ilOrgUnitType::getAllTypes(); $options = array(0 => ''); /** @var ilOrgUnitType $type */ foreach ($types as $type) { $options[$type->getId()] = $type->getTitle(); } asort($options); $item = new ilSelectInputGUI($this->lng->txt('orgu_type'), 'orgu_type'); $item->setOptions($options); $item->setValue($this->obj_orgu->getOrgUnitTypeId()); $this->addItem($item); $item = new ilFormSectionHeaderGUI(); $item->setTitle($this->lng->txt('ext_id')); $this->addItem($item); $item = new ilTextInputGUI($this->lng->txt('ext_id'), 'ext_id'); $item->setValue($this->obj_orgu->getImportId()); $this->addItem($item); $this->addCommandButton('updateSettings', $this->lng->txt('save')); }
private function populateNewQuestionSelectionRuleInputs() { $availablePools = $this->questionSetConfig->getSelectableQuestionPools(); require_once 'Services/Form/classes/class.ilSelectInputGUI.php'; $poolSelection = new ilSelectInputGUI(null, 'quest_pool_id'); $poolSelection->setOptions($this->buildSourcePoolSelectOptionsArray($availablePools)); $this->addInputItem($poolSelection, true); $this->addFormButton($this->lng->txt('tst_rnd_quest_set_tb_add_pool_btn'), ilTestRandomQuestionSetConfigGUI::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM); }
public function build() { $this->setFormAction($this->ctrl->getFormAction($this->parentGUI)); $select = new ilSelectInputGUI($this->lng->txt("tst_analysis"), self::SKILL_PROFILE_PARAM); $select->setOptions($this->buildEvaluationModeOptionsArray()); $select->setValue($this->getSelectedEvaluationMode()); $this->addInputItem($select, true); $this->addFormButton($this->lng->txt("select"), $this->parentCMD); }
protected function viewToolbar($a_is_initial = false) { global $ilToolbar, $lng, $ilCtrl; $current_figure = (int) $_POST["fig"]; $current_time_frame = (string) $_POST["tfr"]; $current_scope = (int) $_POST["scp"]; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $view = new ilSelectInputGUI($lng->txt("wiki_stat_figure"), "fig"); $view->setOptions($this->page_id ? ilWikiStat::getFigureOptionsPage() : ilWikiStat::getFigureOptions()); if ($current_figure) { $view->setValue($current_figure); } else { if ($a_is_initial) { // default $current_figure = $this->page_id ? ilWikiStat::KEY_FIGURE_WIKI_PAGE_CHANGES : ilWikiStat::KEY_FIGURE_WIKI_NUM_PAGES; } } $ilToolbar->addInputItem($view, true); $options = array(); include_once "Services/Calendar/classes/class.ilCalendarUtil.php"; $lng->loadLanguageModule("dateplaner"); foreach (ilWikiStat::getAvailableMonths($this->wiki_id) as $month) { $parts = explode("-", $month); $options[$month] = ilCalendarUtil::_numericMonthToString((int) $parts[1]) . " " . $parts[0]; } krsort($options); $tframe = new ilSelectInputGUI($lng->txt("month"), "tfr"); $tframe->setOptions($options); if ($current_time_frame) { $tframe->setValue($current_time_frame); } else { if ($a_is_initial) { $current_time_frame = array_shift(array_keys($options)); // default } } $ilToolbar->addInputItem($tframe, true); $scope = new ilSelectInputGUI($lng->txt("wiki_stat_scope"), "scp"); $scope->setOptions(array(1 => "1 " . $lng->txt("month"), 2 => "2 " . $lng->txt("months"), 3 => "3 " . $lng->txt("months"), 4 => "4 " . $lng->txt("months"), 5 => "5 " . $lng->txt("months"), 6 => "6 " . $lng->txt("months"))); if ($current_scope) { $scope->setValue($current_scope); } else { if ($a_is_initial) { $current_scope = 1; // default } } $ilToolbar->addInputItem($scope, true); $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "view")); $ilToolbar->addFormButton($lng->txt("show"), "view"); if ($current_figure && $current_time_frame && $current_scope) { $ilToolbar->addSeparator(); $ilToolbar->addFormButton($lng->txt("export"), "export"); return array("figure" => $current_figure, "month" => $current_time_frame, "scope" => $current_scope); } }
public function build() { $availablePools = $this->testOBJ->getAvailableQuestionpools(true, $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired(), false, true, true); require_once 'Services/Form/classes/class.ilSelectInputGUI.php'; $poolSelection = new ilSelectInputGUI(null, 'quest_pool_id'); $poolSelection->setOptions($this->buildSourcePoolSelectOptionsArray($availablePools)); $this->addInputItem($poolSelection, true); $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI)); $this->addFormButton($this->lng->txt('tst_rnd_quest_set_tb_add_pool_btn'), ilTestRandomQuestionSetConfigGUI::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM); }
/** * 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 addToForm() { global $lng; $def = $this->getADT()->getCopyOfDefinition(); $options = $def->getOptions(); asort($options); // ? $lng->loadLanguageModule("search"); $options = array("" => $lng->txt("search_any")) + $options; $select = new ilSelectInputGUI($this->getTitle(), $this->getElementId()); $select->setOptions($options); $select->setValue($this->getADT()->getSelection()); $this->addToParentElement($select); }
function showPersonalData() { // user_id $this->user_obj->getId() // all $this->psc_obj = new ilPaymentShoppingCart($this->user_obj); if (!count($items = $this->psc_obj->getEntries($this->pm_id))) { $this->tpl->setVariable("HEADER", $this->lng->txt('pay_bmf_your_order')); $this->tpl->touchBlock("stop_floating"); ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty')); } else { $this->tpl->setVariable("HEADER", $this->lng->txt('pay_step1')); $this->tpl->setVariable("TITLE", $this->lng->txt('pay_bmf_personal_data')); $this->tpl->setVariable("DESCRIPTION", $this->lng->txt('pay_bmf_description_personal_data')); $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $oForm = new ilPropertyFormGUI(); $oForm->setFormAction($this->ctrl->getFormAction($this, 'getPersonalData')); $oForm->setTitle($this->lng->txt('pay_bmf_personal_data')); $oFirstname = new ilNonEditableValueGUI($this->lng->txt('firstname')); $oFirstname->setValue($this->user_obj->getFirstname()); $oForm->addItem($oFirstname); $oLastname = new ilNonEditableValueGUI($this->lng->txt('lastname')); $oLastname->setValue($this->user_obj->getLastname()); $oForm->addItem($oLastname); $oStreet = new ilTextInputGUI($this->lng->txt('street'), 'street'); $oStreet->setValue($this->error != '' && isset($_POST['street']) ? ilUtil::prepareFormOutput($_POST['street'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['street'], true)); $oForm->addItem($oStreet); $oHouseNumber = new ilTextInputGUI($this->lng->txt('pay_bmf_house_number'), 'house_number'); $oHouseNumber->setValue($this->error != '' && isset($_POST['house_number']) ? ilUtil::prepareFormOutput($_POST['house_number'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['house_number'], true)); $oForm->addItem($oHouseNumber); $oPoBox = new ilTextInputGUI($this->lng->txt('pay_bmf_or') . ' ' . $this->lng->txt('pay_bmf_po_box'), 'po_box'); $oPoBox->setValue($this->error != '' && isset($_POST['po_box']) ? ilUtil::prepareFormOutput($_POST['po_box'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['po_box'], true)); $oForm->addItem($oPoBox); $oZipCode = new ilTextInputGUI($this->lng->txt('zipcode'), 'zipcode'); $oZipCode->setValue($this->error != '' && isset($_POST['zipcode']) ? ilUtil::prepareFormOutput($_POST['zipcode'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['zipcode'], true)); $oForm->addItem($oZipCode); $oCity = new ilTextInputGUI($this->lng->txt('city'), 'city'); $oCity->setValue($this->error != '' && isset($_POST['city']) ? ilUtil::prepareFormOutput($_POST['city'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['city'], true)); $oForm->addItem($oCity); $oCountry = new ilSelectInputGUI($this->lng->txt('country'), 'country'); $oCountry->setOptions($this->__getCountries()); $oCountry->setValue($this->error != '' && isset($_POST['country']) ? $_POST['country'] : $_SESSION['bmf']['personal_data']['country']); $oForm->addItem($oCountry); $oEmail = new ilNonEditableValueGUI($this->lng->txt('email')); $oEmail->setValue($this->user_obj->getEmail()); $oForm->addItem($oEmail); $oForm->addcommandButton('getPersonalData', ucfirst($this->lng->txt('next'))); $this->tpl->setVariable('FORM', $oForm->getHTML()); } }
/** * add the configuration elements to a property form * @param object property form */ public function addFormProperties(ilPropertyFormGUI $a_form) { global $lng; $lng->loadLanguageModule('adve'); $availability = new ilRadioGroupInputGUI($lng->txt('char_selector'), 'char_selector_availability'); $inactive = new ilRadioOption($lng->txt('char_selector_inactive'), ilCharSelectorConfig::INACTIVE); $inactive->setInfo($lng->txt('char_selector_inactive_info_' . $this->config->getContext())); $inherit = new ilRadioOption($lng->txt('char_selector_inherit'), ilCharSelectorConfig::INHERIT); $inherit->setInfo($lng->txt('char_selector_inherit_info_' . $this->config->getContext())); $enabled = new ilRadioOption($lng->txt('char_selector_enabled'), ilCharSelectorConfig::ENABLED); $enabled->setInfo($lng->txt('char_selector_enabled_info_' . $this->config->getContext())); $disabled = new ilRadioOption($lng->txt('char_selector_disabled'), ilCharSelectorConfig::DISABLED); $disabled->setInfo($lng->txt('char_selector_disabled_info_' . $this->config->getContext())); $blocks = new ilSelectInputGUI($lng->txt('char_selector_blocks'), 'char_selector_blocks'); $blocks->setInfo($lng->txt('char_selector_blocks_info')); $blocks->setOptions($this->config->getBlockOptions()); $blocks->setMulti(true); $enabled->addSubItem($blocks); $custom_items = new ilTextAreaInputGUI($lng->txt('char_selector_custom_items'), 'char_selector_custom_items'); $tpl = new ilTemplate("tpl.char_selector_custom_info.html", true, true, "Services/UIComponent/CharSelector"); $tpl->setVariable('1', $lng->txt('char_selector_custom_items_info1')); $tpl->setVariable('2a', $lng->txt('char_selector_custom_items_info2a')); $tpl->setVariable('2b', $lng->txt('char_selector_custom_items_info2b')); $tpl->setVariable('3a', $lng->txt('char_selector_custom_items_info3a')); $tpl->setVariable('3b', $lng->txt('char_selector_custom_items_info3b')); $tpl->setVariable('4a', $lng->txt('char_selector_custom_items_info4a')); $tpl->setVariable('4b', $lng->txt('char_selector_custom_items_info4b')); $tpl->setVariable('5a', $lng->txt('char_selector_custom_items_info5a')); $tpl->setVariable('5b', $lng->txt('char_selector_custom_items_info5b')); $tpl->setVariable('6a', $lng->txt('char_selector_custom_items_info6a')); $tpl->setVariable('6b', $lng->txt('char_selector_custom_items_info6b')); $custom_items->setInfo($tpl->get()); $enabled->addSubItem($custom_items); switch ($this->config->getContext()) { case ilCharSelectorConfig::CONTEXT_ADMIN: $availability->addOption($inactive); $availability->addOption($enabled); $availability->addOption($disabled); $a_form->addItem($availability); break; case ilCharSelectorConfig::CONTEXT_USER: case ilCharSelectorConfig::CONTEXT_TEST: $availability->addOption($inherit); $availability->addOption($enabled); $availability->addOption($disabled); $a_form->addItem($availability); break; } }
/** * List Records * * */ public function listRecords() { global $ilTabs, $tpl, $lng, $ilCtrl, $ilToolbar; // Show tables require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php"; if (ilObjDataCollection::_hasWriteAccess($this->parent_obj->ref_id)) { $tables = $this->parent_obj->object->getTables(); } else { $tables = $this->parent_obj->object->getVisibleTables(); } foreach ($tables as $table) { $options[$table->getId()] = $table->getTitle(); } $tpl->addCss("./Modules/DataCollection/css/dcl_reference_hover.css"); if (count($options) > 0) { include_once './Services/Form/classes/class.ilSelectInputGUI.php'; $table_selection = new ilSelectInputGUI('', 'table_id'); $table_selection->setOptions($options); $table_selection->setValue($this->table_id); $ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilDataCollectionRecordListGUI", "doTableSwitch")); $ilToolbar->addText($lng->txt("dcl_table")); $ilToolbar->addInputItem($table_selection); $ilToolbar->addFormButton($lng->txt('change'), 'doTableSwitch'); $ilToolbar->addSeparator(); } if (($this->table_obj->getExportEnabled() || $this->table_obj->hasPermissionToFields($this->parent_obj->ref_id)) && count($this->table_obj->getExportableFields())) { $ilToolbar->addButton($lng->txt('dcl_export_table_excel'), $ilCtrl->getFormActionByClass("ildatacollectionrecordlistgui", "exportExcel")); } if ($this->table_obj->hasPermissionToAddRecord($this->parent_obj->ref_id) && $this->table_obj->hasCustomFields()) { $ilCtrl->setParameterByClass("ildatacollectionrecordeditgui", "record_id", null); $ilToolbar->addButton($lng->txt("dcl_import_records .xls"), $ilCtrl->getFormActionByClass("ildatacollectionrecordlistgui", "showImportExcel")); $ilToolbar->addButton($lng->txt("dcl_add_new_record"), $ilCtrl->getFormActionByClass("ildatacollectionrecordeditgui", "create"), "", "", "", "", "submit emphsubmit"); // #11502 } // requested not to implement this way... //$tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js"); $tpl->addJavaScript("Modules/DataCollection/js/datacollection.js"); if (count($this->table_obj->getRecordFields()) == 0) { ilUtil::sendInfo($lng->txt("dcl_no_fields_yet") . " " . ($this->table_obj->hasPermissionToFields($this->parent_obj->ref_id) ? $lng->txt("dcl_create_fields") : "")); } $list = new ilDataCollectionRecordListTableGUI($this, $ilCtrl->getCmd(), $this->table_obj); $tpl->getStandardTemplate(); $tpl->setPermanentLink("dcl", $this->parent_obj->ref_id); if ($desc = $this->table_obj->getDescription()) { $desc = "<div class='ilDclTableDescription'>{$desc}</div>"; } $tpl->setContent($desc . $list->getHTML()); }
public function initSettingsForm($a_mode = 'edit') { $this->settings_form = new ilPropertyFormGUI(); $this->settings_form->setTitle($this->lng->txt('payment_news_settings')); $oSelectBox = new ilSelectInputGUI($this->lng->txt('payment_news_archive_period'), 'archive_period'); $oSelectBox->setInfo($this->lng->txt('payment_news_archive_period_info')); $options = array(); for ($i = 5; $i <= 100; $i += 5) { $options[$i] = $i; } $oSelectBox->setOptions($options); $this->settings_form->addItem($oSelectBox); $this->settings_form->addCommandButton('saveSettings', $this->lng->txt('save')); $this->settings_form->addCommandButton('showNews', $this->lng->txt('cancel')); $this->settings_form->setFormAction($this->ctrl->getFormaction($this, 'saveSettings')); }
/** * Init filter */ function initFilter() { global $lng; // roles $option[0] = $lng->txt('assigned_roles'); $option[1] = $lng->txt('all_roles'); $option[2] = $lng->txt('all_global_roles'); $option[3] = $lng->txt('all_local_roles'); $option[4] = $lng->txt('internal_local_roles_only'); $option[5] = $lng->txt('non_internal_local_roles_only'); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $si = new ilSelectInputGUI($lng->txt("roles"), "role_filter"); $si->setOptions($option); $this->addFilterItem($si); $si->readFromSession(); $this->filter["role_filter"] = $si->getValue(); }
public function build() { if ($this->isTestResultButtonEnabled()) { $link = ilLinkButton::getInstance(); // always returns a new instance $link->setUrl($this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'outUserResultsOverview')); $link->setCaption($this->lng->txt("tst_show_results"), false); $this->addButtonInstance($link); $this->addSeparator(); } $this->setFormAction($this->ctrl->getFormAction($this->parentGUI)); $select = new ilSelectInputGUI($this->lng->txt("tst_analysis"), self::SKILL_PROFILE_PARAM); $select->setOptions($this->buildEvaluationModeOptionsArray()); $select->setValue($this->getSelectedEvaluationMode()); $this->addInputItem($select, true); $this->addFormButton($this->lng->txt("select"), $this->parentCMD); }
/** * Init filter */ public function initFilter() { require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php'; require_once 'Services/Form/classes/class.ilSelectInputGUI.php'; require_once 'Services/Form/classes/class.ilRadioOption.php'; foreach ($this->taxIds as $taxId) { $postvar = "tax_{$taxId}"; $inp = new ilTaxSelectInputGUI($taxId, $postvar, true); $this->addFilterItem($inp); $inp->readFromSession(); $this->filter[$postvar] = $inp->getValue(); } $inp = new ilSelectInputGUI($this->lng->txt('tst_question_answer_status'), 'question_answer_status'); $inp->setOptions(array(ilAssQuestionList::ANSWER_STATUS_FILTER_ALL_NON_CORRECT => $this->lng->txt('tst_question_answer_status_all_non_correct'), ilAssQuestionList::ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY => $this->lng->txt('tst_question_answer_status_non_answered'), ilAssQuestionList::ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY => $this->lng->txt('tst_question_answer_status_wrong_answered'))); $this->addFilterItem($inp); $inp->readFromSession(); $this->filter['question_answer_status'] = $inp->getValue(); }
public function initFilter() { $this->setDisableFilterHiding(true); include_once 'Services/Form/classes/class.ilSelectInputGUI.php'; $available_questions = new ilSelectInputGUI($this->lng->txt('question'), 'question'); $select_questions = array(); if (!$this->getParentObject()->object->isRandomTest()) { $questions = $this->getParentObject()->object->getTestQuestions(); } else { $questions = $this->getParentObject()->object->getPotentialRandomTestQuestions(); } $scoring = ilObjAssessmentFolder::_getManualScoring(); foreach ($questions as $data) { include_once 'Modules/TestQuestionPool/classes/class.assQuestion.php'; $info = assQuestion::_getQuestionInfo($data['question_id']); $type = $info["question_type_fi"]; if (in_array($type, $scoring)) { $maxpoints = assQuestion::_getMaximumPoints($data["question_id"]); if ($maxpoints == 1) { $maxpoints = ' (' . $maxpoints . ' ' . $this->lng->txt('point') . ')'; } else { $maxpoints = ' (' . $maxpoints . ' ' . $this->lng->txt('points') . ')'; } $select_questions[$data["question_id"]] = $data['title'] . $maxpoints . ' [' . $this->lng->txt('question_id_short') . ': ' . $data["question_id"] . ']'; } } if (!$select_questions) { $select_questions[0] = $this->lng->txt('tst_no_scorable_qst_available'); } $available_questions->setOptions(array('' => $this->lng->txt('please_choose')) + $select_questions); $this->addFilterItem($available_questions); $available_questions->readFromSession(); $this->filter['question'] = $available_questions->getValue(); $pass = new ilSelectInputGUI($this->lng->txt('pass'), 'pass'); $passes = array(); $max_pass = $this->getParentObject()->object->getMaxPassOfTest(); for ($i = 1; $i <= $max_pass; $i++) { $passes[$i] = $i; } $pass->setOptions($passes); $this->addFilterItem($pass); $pass->readFromSession(); $this->filter['pass'] = $pass->getValue(); }
/** * initRecordListViewdefinitionForm * */ public function initForm() { global $lng, $ilCtrl, $ilToolbar; // Show tables require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php"; $arrTables = ilDataCollectionTable::getAll($this->obj_id); foreach ($arrTables as $table) { $options[$table['id']] = $table['title']; } include_once './Services/Form/classes/class.ilSelectInputGUI.php'; $table_selection = new ilSelectInputGUI('', 'table_id'); $table_selection->setOptions($options); $table_selection->setValue($this->table_id); $ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilDataCollectionRecordListViewdefinitionGUI", "doTableSwitch")); $ilToolbar->addInputItem($table_selection); $ilToolbar->addFormButton($lng->txt('change'), 'doTableSwitch'); // Form require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($ilCtrl->getFormAction($this), "save"); $this->form->addCommandButton('save', $lng->txt('dcl_listviewdefinition_update')); $this->form->addCommandButton('cancel', $lng->txt('cancel')); //Table-ID $hidden_prop = new ilHiddenInputGUI("table_id"); $hidden_prop->setValue($this->table_id); $this->form->addItem($hidden_prop); //Get fields require_once "./Modules/DataCollection/classes/class.ilDataCollectionField.php"; $fields = ilDataCollectionField::getAll($this->table_id); $tabledefinition = array("id" => array("title" => $lng->txt("id")), "table_id" => array("title" => $lng->txt("dcl_table_id")), "create_date" => array("title" => $lng->txt("create_date")), "last_update" => array("title" => $lng->txt("last_update")), "owner" => array("title" => $lng->txt("owner"))); //Array zusammenführen foreach ($fields as $key => $value) { $tabledefinition[$key] = $value; } foreach ($tabledefinition as $key => $field) { $chk_prop = new ilCheckboxInputGUI($field['title'], 'visible_' . $key); $chk_prop->setOptionTitle($lng->txt('visible')); $text_prop = new ilTextInputGUI($lng->txt('dcl_field_ordering'), 'order_' . $key); $chk_prop->addSubItem($text_prop); $this->form->addItem($chk_prop); } $this->form->setTitle($lng->txt('dcl_view_viewdefinition')); }
public function initFilter() { global $lng; $this->setDisableFilterHiding(true); include_once 'Services/Form/classes/class.ilSelectInputGUI.php'; $participantStatus = new ilSelectInputGUI($lng->txt('tst_participant_status'), 'participant_status'); $statusOptions = array(); $statusOptions[ilTestScoringGUI::PART_FILTER_ALL_USERS] = $lng->txt("all_users"); $statusOptions[ilTestScoringGUI::PART_FILTER_ACTIVE_ONLY] = $lng->txt("usr_active_only"); $statusOptions[ilTestScoringGUI::PART_FILTER_INACTIVE_ONLY] = $lng->txt("usr_inactive_only"); $statusOptions[ilTestScoringGUI::PART_FILTER_MANSCORING_DONE] = $lng->txt("manscoring_done"); $statusOptions[ilTestScoringGUI::PART_FILTER_MANSCORING_NONE] = $lng->txt("manscoring_none"); //$statusOptions[ ilTestScoringGUI::PART_FILTER_MANSCORING_PENDING ] = $lng->txt("manscoring_pending"); $participantStatus->setOptions($statusOptions); $this->addFilterItem($participantStatus); $participantStatus->readFromSession(); if (!$participantStatus->getValue()) { $participantStatus->setValue(ilTestScoringGUI::PART_FILTER_ALL_USERS); } }
/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { global $lng, $ilCtrl; $pl = $this->getPluginObject(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // Setting for the ephorus logging $ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging"); $ephorus_logging->setValue(1); $ephorus_logging->setInfo($pl->txt("ephorus_logging_description")); $form->addItem($ephorus_logging); // Setting for the hand-in code $handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code"); $handin_code->setRequired(true); $form->addItem($handin_code); // Setting for the hand-in address $handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address"); $handin_address->setSize(80); $handin_address->setRequired(true); $form->addItem($handin_address); // Setting for the index address $index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address"); $index_address->setSize(80); $index_address->setRequired(true); $form->addItem($index_address); // Setting for the processtype $processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype"); $processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private"))); $processtype->setInfo($pl->txt("default_processtype_description")); $form->addItem($processtype); // Setting for the disclosure $disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure"); $disclosure->setCols(79); $disclosure->setRows(4); $form->addItem($disclosure); $form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection")); $form->setTitle($pl->txt("ephorus_plugin_configuration")); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
public function build() { $this->setId('tst_results_toolbar'); $this->addButton($this->lng->txt('print'), 'javascript:window.print();'); if (strlen($this->getPdfExportLinkTarget())) { require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php'; $link = ilLinkButton::getInstance(); // always returns a new instance $link->setUrl($this->getPdfExportLinkTarget()); $link->setCaption($this->getPdfExportLabel(), false); $link->setOmitPreventDoubleSubmission(true); $this->addButtonInstance($link); } if (strlen($this->getCertificateLinkTarget())) { $this->addButton($this->lng->txt('certificate'), $this->getCertificateLinkTarget()); } if (strlen($this->getShowBestSolutionsLinkTarget())) { $this->addSeparator(); $this->addButton($this->lng->txt('tst_btn_show_best_solutions'), $this->getShowBestSolutionsLinkTarget()); } elseif (strlen($this->getHideBestSolutionsLinkTarget())) { $this->addSeparator(); $this->addButton($this->lng->txt('tst_btn_hide_best_solutions'), $this->getHideBestSolutionsLinkTarget()); } if (count($this->getParticipantSelectorOptions())) { $this->addSeparator(); require_once 'Services/Form/classes/class.ilSelectInputGUI.php'; $sel = new ilSelectInputGUI('', 'active_id'); $sel->setOptions($this->getParticipantSelectorOptionsWithHintOption()); $this->addInputItem($sel); require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php'; $link = ilLinkButton::getInstance(); // always returns a new instance $link->setUrl('#'); $link->setId('ilTestResultParticipantJumper'); $link->setCaption($this->lng->txt('tst_res_jump_to_participant_btn'), false); $this->addButtonInstance($link); $this->tpl->addJavaScript('Modules/Test/js/ilTestResultParticipantSelector.js'); } }
public function showTopicsSettings() { $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $genSet = ilPaymentSettings::_getInstance(); $genSetData = $genSet->getAll(); $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'saveTopicsSettings')); $form->setTitle($this->lng->txt('pays_general_settings')); $form->addCommandButton('saveTopicsSettings', $this->lng->txt('save')); // use topics $formItem = new ilCheckboxInputGUI($this->lng->txt('enable_topics'), 'enable_topics'); $formItem->setChecked((int) $genSetData['enable_topics']); $formItem->setInfo($this->lng->txt('enable_topics_info')); $form->addItem($formItem); // default sorting type $formItem = new ilSelectInputGUI($this->lng->txt('pay_topics_default_sorting_type'), 'topics_sorting_type'); $formItem->setValue($genSetData['topics_sorting_type']); $options = array(1 => $this->lng->txt('pay_topics_sort_by_title'), 2 => $this->lng->txt('pay_topics_sort_by_date'), 3 => $this->lng->txt('pay_topics_sort_manually')); $formItem->setOptions($options); $form->addItem($formItem); // default sorting direction $formItem = new ilSelectInputGUI($this->lng->txt('pay_topics_default_sorting_direction'), 'topics_sorting_direction'); $formItem->setValue($genSetData['topics_sorting_direction']); $options = array('asc' => $this->lng->txt('sort_asc'), 'desc' => $this->lng->txt('sort_desc')); $formItem->setOptions($options); $form->addItem($formItem); // topics custom sorting $formItem = new ilCheckboxInputGUI($this->lng->txt('pay_topics_allow_custom_sorting'), 'topics_allow_custom_sorting'); $formItem->setChecked((int) $genSetData['topics_allow_custom_sorting']); $formItem->setInfo($this->lng->txt('pay_topics_allow_custom_sorting_info')); $form->addItem($formItem); // show topics filter $formItem = new ilCheckboxInputGUI($this->lng->txt('show_topics_filter'), 'show_topics_filter'); $formItem->setChecked((int) $genSetData['show_topics_filter']); $formItem->setInfo($this->lng->txt('show_topics_filter_info')); $form->addItem($formItem); $this->tpl->setVariable('FORM', $form->getHTML()); return true; }
public static function getGeneralSettingsForm() { global $lng; $form = new ilPropertyFormGUI(); require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php'; $channels = ilNotificationDatabaseHandler::getAvailableChannels(array(), true); $options = array('set_by_user' => $lng->txt('set_by_user'), 'set_by_admin' => $lng->txt('set_by_admin')); /** * @todo dirty... */ $form->restored_values = array(); $store_values = array(); foreach ($channels as $channel) { $chb = new ilCheckboxInputGUI($lng->txt('enable_' . $channel['name']), 'enable_' . $channel['name']); $store_values[] = 'enable_' . $channel['name']; $select = new ilSelectInputGUI($lng->txt('config_type'), 'notifications[' . $channel['name'] . ']'); $select->setOptions($options); $select->setValue($channel['config_type']); $chb->addSubItem($select); /** * @todo dirty... */ $form->restored_values['notifications[' . $channel['name'] . ']'] = $channel['config_type']; require_once $channel['include']; // let the channel display their own settings below the "enable channel" // checkbox $result = call_user_func(array($channel['handler'], 'showSettings'), $chb); if ($result) { $store_values = array_merge($result, $store_values); } $form->addItem($chb); } /** * @todo dirty... */ $form->store_values = $store_values; return $form; }