public function addToForm() { $def = $this->getADT()->getCopyOfDefinition(); if (!$this->isMulti()) { $text = new ilTextInputGUI($this->getTitle(), $this->getElementId()); if ($def->getMaxLength()) { $max = $def->getMaxLength(); $size = $text->getSize(); $text->setMaxLength($max); if ($size && $max < $size) { $text->setSize($max); } } } else { $text = new ilTextAreaInputGUI($this->getTitle(), $this->getElementId()); if ($this->multi_rows) { $text->setRows($this->multi_rows); } if ($this->multi_cols) { $text->setCols($this->multi_cols); } } $this->addBasicFieldProperties($text, $def); $text->setValue($this->getADT()->getText()); $this->addToParentElement($text); }
/** * Init form. * * @param string $a_mode edit mode */ public function initForm($a_mode = "edit") { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // title $ti = new ilTextInputGUI($lng->txt("title"), "title"); $ti->setMaxLength(200); $ti->setSize(50); $ti->setRequired(true); $this->form->addItem($ti); // order nr $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr"); $ni->setMaxLength(6); $ni->setSize(6); $ni->setRequired(true); $this->form->addItem($ni); // save and cancel commands if ($a_mode == "create") { $this->form->addCommandButton("save", $lng->txt("save")); $this->form->addCommandButton("cancelSave", $lng->txt("cancel")); $this->form->setTitle($lng->txt("skmg_create_skll")); } else { $this->form->addCommandButton("update", $lng->txt("save")); $this->form->setTitle($lng->txt("skmg_edit_skll")); } $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
public function addToForm() { $text = new ilTextInputGUI($this->getTitle(), $this->getElementId()); $text->setSize(20); $text->setMaxLength(512); $text->setSubmitFormOnEnter(true); $text->setValue($this->getADT()->getText()); $this->addToParentElement($text); }
/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { global $lng, $ilCtrl, $ilDB; $pl = $this->getPluginObject(); $this->getPluginObject()->includeClass('class.ilOpenmeetingsConfig.php'); $this->object = ilOpenmeetingsConfig::getInstance(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTitle($pl->txt("openmeetings_plugin_configuration")); $this->form->setFormAction($ilCtrl->getFormAction($this)); $this->form->addCommandButton("save", $lng->txt("save")); // url (text) $ti = new ilTextInputGUI($pl->txt("url"), "frmurl"); $ti->setRequired(true); $ti->setMaxLength(256); $ti->setSize(60); $this->form->addItem($ti); // port (text) $ti = new ilTextInputGUI($pl->txt("port"), "frmport"); $ti->setRequired(true); $ti->setMaxLength(10); $ti->setSize(10); $this->form->addItem($ti); // appname $ti = new ilTextInputGUI($pl->txt("appname"), "frmappname"); $ti->setRequired(true); $ti->setMaxLength(32); $ti->setSize(20); $this->form->addItem($ti); // username (text) $ti = new ilTextInputGUI($pl->txt("username"), "frmusername"); $ti->setRequired(true); $ti->setMaxLength(256); $ti->setSize(20); $this->form->addItem($ti); // password (text) $ti = new ilPasswordInputGUI($pl->txt("password"), "frmpassword"); $ti->setRequired(true); $ti->setMaxLength(256); $ti->setSize(20); $ti->setRetype(false); $this->form->addItem($ti); foreach ($this->fields as $key => $item) { $field = new $item["type"]($this->plugin_object->txt('conf_' . $key), $key); $field->setInfo($this->plugin_object->txt($item["info"])); if (is_array($item["subelements"])) { foreach ($item["subelements"] as $subkey => $subitem) { $subfield = new $subitem["type"]($this->plugin_object->txt('conf_' . $key . "_" . $subkey), $subkey); $subfield->setInfo($this->plugin_object->txt($subitem["info"])); $field->addSubItem($subfield); } } $this->form->addItem($field); } return $this->form; }
/** * Init filter */ function initFilter() { global $lng, $rbacreview, $ilUser; // title include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ti = new ilTextInputGUI($lng->txt("title"), "title"); $ti->setMaxLength(64); $ti->setSize(20); $ti->setValidationRegexp('/^[^%]+$/is'); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["title"] = $ti->getValue(); }
/** * Init Social Bookmark edit/create Form * * @param ilObjectGUI $formhandlerObject taken as form target * @param int $mode "create" / "edit" */ public static function _initForm($formhandlerObject, $mode = "create", $id = 0) { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setMultipart(true); // File Title $in_title = new ilTextInputGUI($lng->txt("title"), "title"); $in_title->setMaxLength(128); $in_title->setSize(40); $in_title->setRequired(true); $form->addItem($in_title); // Link $in_link = new ilTextInputGUI($lng->txt("link"), "link"); $in_link->setMaxLength(300); $in_link->setSize(40); $in_link->setRequired(true); $in_link->setInfo($lng->txt('socialbm_link_description')); $form->addItem($in_link); // File $in_file = new ilFileInputGUI($lng->txt("file"), "image_file"); $in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png')); $form->addItem($in_file); // Activate on submit $in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate"); $in_activate->setValue('1'); $form->addItem($in_activate); // save and cancel commands if ($mode == "create") { $form->addCommandButton("createSocialBookmark", $lng->txt("create")); $form->addCommandButton("editSocialBookmarks", $lng->txt("cancel")); $form->setTitle($lng->txt("adm_social_bm_create")); $in_file->setRequired(true); } else { if ($mode == "update") { $in_hidden = new ilHiddenInputGUI("sbm_id", $id); $form->addItem($in_hidden); $form->addCommandButton("updateSocialBookmark", $lng->txt("update")); $form->addCommandButton("cancel", $lng->txt("cancel")); $form->setTitle($lng->txt("adm_social_bm_edit")); $in_file->setRequired(false); } } $form->setTableWidth("60%"); $form->setFormAction($ilCtrl->getFormAction($formhandlerObject)); return $form; }
/** * 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 1 (a checkbox) $cb = new ilCheckboxInputGUI($pl->txt("setting_1"), "setting_1"); $form->addItem($cb); // setting 2 (text) $ti = new ilTextInputGUI($pl->txt("setting_2"), "setting_2"); $ti->setRequired(true); $ti->setMaxLength(10); $ti->setSize(10); $form->addItem($ti); $form->addCommandButton("save", $lng->txt("save")); $form->setTitle($pl->txt("example_plugin_configuration")); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
/** * Init filter */ public function initFilter() { global $lng; $this->setDisableFilterHiding(true); // object type selection include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $si = new ilSelectInputGUI($lng->txt("obj_type"), "type"); $si->setOptions($this->getPossibleTypes(true, false, true)); $this->addFilterItem($si); $si->readFromSession(); if (!$si->getValue()) { $si->setValue("crs"); } $this->filter["type"] = $si->getValue(); // title/description include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query"); $ti->setMaxLength(64); $ti->setSize(20); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["query"] = $ti->getValue(); // read_count/spent_seconds $si = new ilSelectInputGUI($lng->txt("trac_figure"), "figure"); $si->setOptions(array("read_count" => $lng->txt("trac_read_count"), "spent_seconds" => $lng->txt("trac_spent_seconds"))); $this->addFilterItem($si); $si->readFromSession(); if (!$si->getValue()) { $si->setValue("read_count"); } $this->filter["measure"] = $si->getValue(); // year/month $si = new ilSelectInputGUI($lng->txt("year") . " / " . $lng->txt("month"), "yearmonth"); $si->setOptions($this->getMonthsFilter()); $this->addFilterItem($si); $si->readFromSession(); if (!$si->getValue()) { $si->setValue(date("Y-m")); } $this->filter["yearmonth"] = $si->getValue(); }
/** * get html * * @access public * @param * @return */ public function initForm() { $rec = new ilSelectInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->setRequired(true); $rec->setOptions(array(0 => $this->lng->txt('cal_no_recurrence'), ilCalendarRecurrence::FREQ_DAILY => $this->lng->txt('cal_rec_daily'), ilCalendarRecurrence::FREQ_WEEKLY => $this->lng->txt('cal_rec_weekly'), ilCalendarRecurrence::FREQ_MONTHLY => $this->lng->txt('cal_rec_monthly'), ilCalendarRecurrence::FREQ_YEARLY => $this->lng->txt('cal_rec_yearly'))); $rec->setValue($this->recurrence->getFrequenceType()); $this->form->addItem($rec); // DAILY part $interval = new ilTextInputGUI($this->lng->txt('interval'), 'interval'); $interval->setSize(2); $interval->setMaxLength(3); $interval->setValue($this->recurrence->getInterval() ? $this->recurrence->getInterval() : 1); $interval->setInfo($this->lng->txt('interval_info')); $rec->addSubItem($interval); // Weekly $check = new ilCheckboxInputGUI($this->lng->txt('Su_short'), 'w_day[0]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Mo_short'), 'w_day[1]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Tu_short'), 'w_day[2]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('We_short'), 'w_day[3]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Th_short'), 'w_day[4]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Fr_short'), 'w_day[5]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Sa_short'), 'w_day[6]'); $check->setChecked(true); $rec->addSubItem($check); }
/** * Init filter */ function initFilter() { global $lng, $rbacreview, $ilUser, $ilDB; // term include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ti = new ilTextInputGUI($lng->txt("cont_term"), "term"); $ti->setMaxLength(64); $ti->setSize(20); $ti->setSubmitFormOnEnter(true); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["term"] = $ti->getValue(); // definition if ($ilDB->getDBType() != "oracle") { include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ti = new ilTextInputGUI($lng->txt("cont_definition"), "defintion"); $ti->setMaxLength(64); $ti->setSize(20); $ti->setSubmitFormOnEnter(true); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["definition"] = $ti->getValue(); } }
public function showTopicForm() { $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); if ($this->objCurrentTopic->getId()) { $this->ctrl->setParameter($this, 'topic_id', $this->objCurrentTopic->getId()); } $form->setFormAction($this->ctrl->getFormAction($this, 'saveTopic')); $form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ? 'edit_topic' : 'new_topic')); $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setValue($this->objCurrentTopic->getTitle()); $title->setRequired(true); $form->addItem($title); $sorting = new ilTextInputGUI($this->lng->txt('pay_sorting_value'), 'sorting'); $sorting->setValue($this->objCurrentTopic->getSorting()); $sorting->setMaxLength(11); $sorting->setSize(11); $form->addItem($sorting); $form->addCommandButton('saveTopic', $this->lng->txt('save')); $form->addCommandButton('showTopicsList', $this->lng->txt('cancel')); $this->tpl->setVariable('FORM', $form->getHTML()); return true; }
private function initVatForm($a_type = 'create') { $this->form = new ilPropertyFormGUI(); if ($a_type == 'edit') { $this->ctrl->setParameter($this, 'vat_id', $_GET['vat_id']); $this->form->setFormAction($this->ctrl->getFormAction($this, 'updateVat')); $this->form->setTitle($this->lng->txt('payment_edit_vat')); } else { $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveVat')); $this->form->setTitle($this->lng->txt('payment_add_vat')); } $oTitle = new ilTextInputGUI($this->lng->txt('title'), 'vat_title'); $oTitle->setMaxLength(255); $oTitle->setSize(40); $oTitle->setRequired(true); $oTitle->setInfo($this->lng->txt('payment_vat_title_info')); $this->form->addItem($oTitle); $oRate = new ilTextInputGUI($this->lng->txt('vat_rate'), 'vat_rate'); $oRate->setMaxLength(5); $oRate->setSize(5); $oRate->setRequired(true); $oRate->setInfo($this->lng->txt('payment_vat_rate_info')); $this->form->addItem($oRate); if ($a_type == 'edit') { $this->form->addCommandButton('updateVat', $this->lng->txt('save')); } else { $this->form->addCommandButton('saveVat', $this->lng->txt('save')); } $this->form->addCommandButton('vats', $this->lng->txt('cancel')); }
public function initFormSearch() { global $ilCtrl; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'search')); $this->form->setTitle($this->getTitle()); $this->form->addCommandButton('performSearch', $this->lng->txt('search')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for'); $kind->setValue($this->search_type); $this->form->addItem($kind); // Users $users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr'); // UDF include_once 'Services/Search/classes/class.ilUserSearchOptions.php'; foreach (ilUserSearchOptions::_getSearchableFieldsInfo(!$this->isSearchableCheckEnabled()) as $info) { switch ($info['type']) { case FIELD_TYPE_UDF_SELECT: case FIELD_TYPE_SELECT: $sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]"); $sel->setOptions($info['values']); $users->addSubItem($sel); break; case FIELD_TYPE_UDF_TEXT: case FIELD_TYPE_TEXT: if (isset($info['autoComplete']) and $info['autoComplete']) { $ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']); $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]"); $ul->setDataSource($ilCtrl->getLinkTarget($this, "doUserAutoComplete", "", true)); $ul->setSize(30); $ul->setMaxLength(120); $users->addSubItem($ul); } else { $txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]"); $txt->setSize(30); $txt->setMaxLength(120); $users->addSubItem($txt); } break; } } $kind->addOption($users); // Role $roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role'); $role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]'); $role->setSize(30); $role->setMaxLength(120); $roles->addSubItem($role); $kind->addOption($roles); // Course $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs'); $group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]'); $group->setSize(30); $group->setMaxLength(120); $groups->addSubItem($group); $kind->addOption($groups); // Group $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp'); $group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]'); $group->setSize(30); $group->setMaxLength(120); $groups->addSubItem($group); $kind->addOption($groups); }
/** * Build property form * @param string $a_mode * @param int $id * @return object */ function initForm($a_mode = "create", $id = NULL) { global $lng, $ilCtrl; $lng->loadLanguageModule("dateplaner"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form_gui = new ilPropertyFormGUI(); $title = new ilTextInputGUI($lng->txt("title"), "title"); $title->setRequired(true); $title->setSize(40); $title->setMaxLength(120); $form_gui->addItem($title); /* $type = new ilRadioGroupInputGUI($lng->txt("book_schedule_type"), "type"); $type->setRequired(true); $form_gui->addItem($type); $fix = new ilRadioOption($lng->txt("book_schedule_type_fix"), "fix"); $fix->setInfo($lng->txt("book_schedule_type_fix_info")); $type->addOption($fix); $flex = new ilRadioOption($lng->txt("book_schedule_type_flexible"), "flexible"); $flex->setInfo($lng->txt("book_schedule_type_flexible_info")); $type->addOption($flex); $raster = new ilNumberInputGUI($lng->txt("book_schedule_raster"), "raster"); $raster->setRequired(true); $raster->setInfo($lng->txt("book_schedule_raster_info")); $raster->setMinValue(1); $raster->setSize(3); $raster->setMaxLength(3); $raster->setSuffix($lng->txt("book_minutes")); $flex->addSubItem($raster); $rent_min = new ilNumberInputGUI($lng->txt("book_schedule_rent_min"), "rent_min"); $rent_min->setInfo($lng->txt("book_schedule_rent_info")); $rent_min->setMinValue(1); $rent_min->setSize(3); $rent_min->setMaxLength(3); $flex->addSubItem($rent_min); $rent_max = new ilNumberInputGUI($lng->txt("book_schedule_rent_max"), "rent_max"); $rent_max->setInfo($lng->txt("book_schedule_rent_info")); $rent_max->setMinValue(1); $rent_max->setSize(3); $rent_max->setMaxLength(3); $flex->addSubItem($rent_max); $break = new ilNumberInputGUI($lng->txt("book_schedule_break"), "break"); $break->setInfo($lng->txt("book_schedule_break_info")); $break->setMinValue(1); $break->setSize(3); $break->setMaxLength(3); $flex->addSubItem($break); */ include_once "Modules/BookingManager/classes/class.ilScheduleInputGUI.php"; $definition = new ilScheduleInputGUI($lng->txt("book_schedule_days"), "days"); $definition->setInfo($lng->txt("book_schedule_days_info")); $definition->setRequired(true); $form_gui->addItem($definition); $deadline = new ilNumberInputGUI($lng->txt("book_deadline"), "deadline"); $deadline->setInfo($lng->txt("book_deadline_info")); $deadline->setSuffix($lng->txt("book_hours")); $deadline->setMinValue(0); $deadline->setSize(3); $deadline->setMaxLength(3); $form_gui->addItem($deadline); if ($a_mode == "edit") { $form_gui->setTitle($lng->txt("book_edit_schedule")); $item = new ilHiddenInputGUI('schedule_id'); $item->setValue($id); $form_gui->addItem($item); include_once 'Modules/BookingManager/classes/class.ilBookingSchedule.php'; $schedule = new ilBookingSchedule($id); $title->setValue($schedule->getTitle()); $deadline->setValue($schedule->getDeadline()); /* if($schedule->getRaster()) { $type->setValue("flexible"); $raster->setValue($schedule->getRaster()); $rent_min->setValue($schedule->getMinRental()); $rent_max->setValue($schedule->getMaxRental()); $break->setValue($schedule->getAutoBreak()); } else { $type->setValue("fix"); } */ $definition->setValue($schedule->getDefinitionBySlots()); $form_gui->addCommandButton("update", $lng->txt("save")); } else { $form_gui->setTitle($lng->txt("book_add_schedule")); $form_gui->addCommandButton("save", $lng->txt("save")); $form_gui->addCommandButton("render", $lng->txt("cancel")); } $form_gui->setFormAction($ilCtrl->getFormAction($this)); return $form_gui; }
/** * Init object edit form * * @return ilPropertyFormGUI */ protected function initEditForm() { global $lng, $ilCtrl; $lng->loadLanguageModule($this->object->getType()); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "update")); $form->setTitle($this->lng->txt($this->object->getType() . "_edit")); // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setSize(min(40, ilObject::TITLE_LENGTH)); $ti->setMaxLength(ilObject::TITLE_LENGTH); $ti->setRequired(true); $form->addItem($ti); // description $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc"); $ta->setCols(40); $ta->setRows(2); $form->addItem($ta); $this->initEditCustomForm($form); $form->addCommandButton("update", $this->lng->txt("save")); //$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel")); return $form; }
public function initForm($a_as_multi_assignment = FALSE) { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('crs_loc_tst_assignment')); $form->setFormAction($this->ctrl->getFormAction($this->getGUI())); if ($a_as_multi_assignment) { $form->addCommandButton('saveMultiTestAssignment', $this->lng->txt('save')); } else { $form->addCommandButton('saveTest', $this->lng->txt('save')); } switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl')); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl')); break; } $assignable = $this->getAssignableTests(); $cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'), 'mode'); $cr_mode->setRequired(true); $cr_mode->setValue(self::TEST_NEW); $new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'), self::TEST_NEW); switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info")); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info")); break; } // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setMaxLength(128); $ti->setSize(40); $ti->setRequired(true); $new->addSubItem($ti); // description $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc"); $ta->setCols(40); $ta->setRows(2); $new->addSubItem($ta); // Question assignment type include_once './Modules/Test/classes/class.ilObjTest.php'; $this->lng->loadLanguageModule('assessment'); $qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'), 'qtype'); $qst->setRequired(true); $random = new ilRadioOption($this->lng->txt('tst_question_set_type_random'), ilObjTest::QUESTION_SET_TYPE_RANDOM); $qst->addOption($random); $fixed = new ilRadioOption($this->lng->txt('tst_question_set_type_fixed'), ilObjTest::QUESTION_SET_TYPE_FIXED); $qst->addOption($fixed); $new->addSubItem($qst); $cr_mode->addOption($new); // assign existing $existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'), self::TEST_ASSIGN); switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info")); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info")); break; } if (!$assignable) { $existing->setDisabled(true); } $cr_mode->addOption($existing); $options = array(); $options[''] = $this->lng->txt('select_one'); foreach ((array) $assignable as $tst_ref_id) { $tst_obj_id = ilObject::_lookupObjId($tst_ref_id); $options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id); } $selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'), 'tst'); $selectable->setRequired(true); $selectable->setOptions($options); $existing->addSubItem($selectable); $form->addItem($cr_mode); if ($a_as_multi_assignment) { include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php'; $assignments = ilLOTestAssignments::getInstance($this->getContainer()->getId()); include_once './Modules/Course/classes/class.ilCourseObjective.php'; $objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainer()->getId(), FALSE); $options = array(); $options[''] = $this->lng->txt('select_one'); foreach ($objective_ids as $oid) { $already_assigned_tst = $assignments->getTestByObjective($oid, $this->getTestType()); if (!$already_assigned_tst) { $options[$oid] = ilCourseObjective::lookupObjectiveTitle($oid); } } $objective = new ilSelectInputGUI($this->lng->txt('crs_objectives'), 'objective'); $objective->setRequired(TRUE); $objective->setOptions($options); $form->addItem($objective); } return $form; }
/** * Show export IDs overview * * @param * @return */ function showTooltipList() { global $tpl, $ilToolbar, $ilCtrl, $lng; $this->setTabs(); $this->setContentSubTabs("help_tooltips"); $ilToolbar->setFormAction($ilCtrl->getFormAction($this)); include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ti = new ilTextInputGUI($this->lng->txt("help_tooltip_id"), "tooltip_id"); $ti->setMaxLength(200); $ti->setSize(20); $ilToolbar->addInputItem($ti, true); $ilToolbar->addFormButton($lng->txt("add"), "addTooltip"); $ilToolbar->addSeparator(); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $options = ilHelp::getTooltipComponents(); if (ilSession::get("help_tt_comp") != "") { $options[ilSession::get("help_tt_comp")] = ilSession::get("help_tt_comp"); } $si = new ilSelectInputGUI($this->lng->txt("help_component"), "help_tt_comp"); $si->setOptions($options); $si->setValue(ilSession::get("help_tt_comp")); $ilToolbar->addInputItem($si, true); $ilToolbar->addFormButton($lng->txt("help_filter"), "filterTooltips"); include_once "./Modules/LearningModule/classes/class.ilHelpTooltipTableGUI.php"; $tbl = new ilHelpTooltipTableGUI($this, "showTooltipList", ilSession::get("help_tt_comp")); $tpl->setContent($tbl->getHTML()); }
function initAddPageLayoutForm() { global $lng, $ilCtrl; $lng->loadLanguageModule("content"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form_gui = new ilPropertyFormGUI(); $form_gui->setFormAction($ilCtrl->getFormAction($this)); $form_gui->setTitle($lng->txt("sty_create_pgl")); include_once "Services/Form/classes/class.ilRadioMatrixInputGUI.php"; $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title"); $title_input->setSize(50); $title_input->setMaxLength(128); $title_input->setValue($this->layout_object->title); $title_input->setTitle($lng->txt("title")); $title_input->setRequired(true); $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc"); $desc_input->setValue($this->layout_object->description); $desc_input->setRows(3); $desc_input->setCols(37); // special page? $options = array("0" => $lng->txt("cont_layout_template"), "1" => $lng->txt("cont_special_page")); $si = new ilSelectInputGUI($this->lng->txt("type"), "special_page"); $si->setOptions($options); // modules $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module"); // $mods->setRequired(true); foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) { $mod = new ilCheckboxOption($mod_caption, $mod_id); $mods->addOption($mod); } $ttype_input = new ilSelectInputGUI($lng->txt("sty_based_on"), "pgl_template"); $arr_templates = ilPageLayout::getLayouts(); $arr_templates1 = ilPageLayout::getLayouts(false, true); foreach ($arr_templates1 as $v) { $arr_templates[] = $v; } $options = array(); $options['-1'] = $lng->txt("none"); foreach ($arr_templates as $templ) { $templ->readObject(); $key = $templ->getId(); $value = $templ->getTitle(); $options[$key] = $value; } $ttype_input->setOptions($options); $ttype_input->setValue(-1); $ttype_input->setRequired(true); $desc_input->setTitle($lng->txt("description")); $desc_input->setRequired(false); $form_gui->addItem($title_input); $form_gui->addItem($desc_input); $form_gui->addItem($si); $form_gui->addItem($mods); $form_gui->addItem($ttype_input); $form_gui->addCommandButton("createPg", $lng->txt("save")); $form_gui->addCommandButton("cancelCreate", $lng->txt("cancel")); return $form_gui; }
/** * FORM NewsItem: Init form. * * @param int $a_mode Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE) */ public function initFormNewsItem($a_mode) { global $lng, $ilTabs; $ilTabs->clearTargets(); //$this->setTabs(); $lng->loadLanguageModule("news"); include "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form_gui = new ilPropertyFormGUI(); // Property Title $text_input = new ilTextInputGUI($lng->txt("news_news_item_title"), "news_title"); $text_input->setInfo(""); $text_input->setRequired(true); $text_input->setMaxLength(200); $this->form_gui->addItem($text_input); // Property Content $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content"), "news_content"); $text_area->setInfo(""); $text_area->setRequired(false); $this->form_gui->addItem($text_area); // Property Visibility $radio_group = new ilRadioGroupInputGUI($lng->txt("news_news_item_visibility"), "news_visibility"); $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users"); $radio_group->addOption($radio_option); $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public"); $radio_group->addOption($radio_option); $radio_group->setInfo($lng->txt("news_news_item_visibility_info")); $radio_group->setRequired(false); $radio_group->setValue("users"); $this->form_gui->addItem($radio_group); // Property ContentLong $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content_long"), "news_content_long"); $text_area->setInfo($lng->txt("news_news_item_content_long_info")); $text_area->setRequired(false); $text_area->setCols("40"); $text_area->setRows("8"); $text_area->setUseRte(true); $this->form_gui->addItem($text_area); // save and cancel commands if (in_array($a_mode, array(IL_FORM_CREATE, IL_FORM_RE_CREATE))) { $this->form_gui->addCommandButton("saveNewsItem", $lng->txt("save")); $this->form_gui->addCommandButton("cancelSaveNewsItem", $lng->txt("cancel")); } else { $this->form_gui->addCommandButton("updateNewsItem", $lng->txt("save")); $this->form_gui->addCommandButton("cancelUpdateNewsItem", $lng->txt("cancel")); } $this->form_gui->setTitle($lng->txt("news_news_item_head")); $this->form_gui->setFormAction($this->ctrl->getFormAction($this)); $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_news.png")); $news_set = new ilSetting("news"); if (!$news_set->get("enable_rss_for_internal")) { $this->form_gui->removeItemByPostVar("news_visibility"); } else { $nv = $this->form_gui->getItemByPostVar("news_visibility"); if (is_object($nv)) { $nv->setValue(ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"])); } } }
/** * list files */ function renameFileForm() { global $lng, $ilCtrl; if (!isset($_POST["file"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } if (count($_POST["file"]) > 1) { $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"), $this->ilias->error_obj->MESSAGE); } if (ilUtil::stripSlashes($_POST["file"][0]) == "..") { $this->ilias->raiseError($this->lng->txt("select_a_file"), $this->ilias->error_obj->MESSAGE); } $cur_subdir = str_replace(".", "", ilUtil::stripSlashes($_GET["cdir"])); $file = !empty($cur_subdir) ? $this->main_dir . "/" . $cur_subdir . "/" . ilUtil::stripSlashes($_POST["file"][0]) : $this->main_dir . "/" . ilUtil::stripSlashes($_POST["file"][0]); $this->ctrl->setParameter($this, "old_name", ilUtil::stripSlashes($_POST["file"][0])); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // file/dir name $ti = new ilTextInputGUI($this->lng->txt("name"), "new_name"); $ti->setMaxLength(200); $ti->setSize(40); $ti->setValue(ilUtil::stripSlashes($_POST["file"][0])); $form->addItem($ti); // save and cancel commands $form->addCommandButton("renameFile", $lng->txt("rename")); $form->addCommandButton("cancelRename", $lng->txt("cancel")); $form->setFormAction($ilCtrl->getFormAction($this, "renameFile")); if (@is_dir($file)) { $form->setTitle($this->lng->txt("cont_rename_dir")); } else { $form->setTitle($this->lng->txt("rename_file")); } $this->tpl->setContent($form->getHTML()); }
/** * init general settings form * @return */ protected function initFormGeneralSettings() { global $ilSetting; $this->setSubTabs('settings'); $this->tabs_gui->setTabActive('settings'); $this->tabs_gui->setSubTabActive('general_settings'); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveGeneralSettings')); $this->form->setTitle($this->lng->txt('general_settings')); $lua = new ilCheckboxInputGUI($this->lng->txt('enable_local_user_administration'), 'lua'); $lua->setInfo($this->lng->txt('enable_local_user_administration_info')); $lua->setValue(1); $this->form->addItem($lua); $lrua = new ilCheckboxInputGUI($this->lng->txt('restrict_user_access'), 'lrua'); $lrua->setInfo($this->lng->txt('restrict_user_access_info')); $lrua->setValue(1); $this->form->addItem($lrua); // enable alphabetical navigation in user administration $alph = new ilCheckboxInputGUI($this->lng->txt('user_adm_enable_alpha_nav'), 'user_adm_alpha_nav'); //$alph->setInfo($this->lng->txt('restrict_user_access_info')); $alph->setValue(1); $this->form->addItem($alph); // account codes $code = new ilCheckboxInputGUI($this->lng->txt("user_account_code_setting"), "user_reactivate_code"); $code->setInfo($this->lng->txt('user_account_code_setting_info')); $this->form->addItem($code); // delete own account $own = new ilCheckboxInputGUI($this->lng->txt("user_allow_delete_own_account"), "user_own_account"); $this->form->addItem($own); $own_email = new ilEMailInputGUI($this->lng->txt("user_delete_own_account_notification_email"), "user_own_account_email"); $own->addSubItem($own_email); // BEGIN SESSION SETTINGS // create session handling radio group $ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type'); // first option, fixed session duration $fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), ilSession::SESSION_HANDLING_FIXED); // create session reminder subform $cb = new ilCheckboxInputGUI($this->lng->txt("session_reminder"), "session_reminder_enabled"); $expires = ilSession::getSessionExpireValue(); $time = ilFormat::_secondsToString($expires, true); $cb->setInfo($this->lng->txt("session_reminder_info") . "<br />" . sprintf($this->lng->txt('session_reminder_session_duration'), $time)); $fixed->addSubItem($cb); // add session handling to radio group $ssettings->addOption($fixed); // second option, session control $ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), ilSession::SESSION_HANDLING_LOAD_DEPENDENT); // add session control subform require_once 'Services/Authentication/classes/class.ilSessionControl.php'; // this is the max count of active sessions // that are getting started simlutanously $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_count'), 'session_max_count'); $sub_ti->setMaxLength(5); $sub_ti->setSize(5); $sub_ti->setInfo($this->lng->txt('session_max_count_info')); if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { $sub_ti->setDisabled(true); } $ldsh->addSubItem($sub_ti); // after this (min) idle time the session can be deleted, // if there are further requests for new sessions, // but max session count is reached yet $sub_ti = new ilTextInputGUI($this->lng->txt('session_min_idle'), 'session_min_idle'); $sub_ti->setMaxLength(5); $sub_ti->setSize(5); $sub_ti->setInfo($this->lng->txt('session_min_idle_info')); if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { $sub_ti->setDisabled(true); } $ldsh->addSubItem($sub_ti); // after this (max) idle timeout the session expires // and become invalid, so it is not considered anymore // when calculating current count of active sessions $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle'), 'session_max_idle'); $sub_ti->setMaxLength(5); $sub_ti->setSize(5); $sub_ti->setInfo($this->lng->txt('session_max_idle_info')); if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { $sub_ti->setDisabled(true); } $ldsh->addSubItem($sub_ti); // this is the max duration that can elapse between the first and the secnd // request to the system before the session is immidietly deleted $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle_after_first_request'), 'session_max_idle_after_first_request'); $sub_ti->setMaxLength(5); $sub_ti->setSize(5); $sub_ti->setInfo($this->lng->txt('session_max_idle_after_first_request_info')); if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { $sub_ti->setDisabled(true); } $ldsh->addSubItem($sub_ti); // add session control to radio group $ssettings->addOption($ldsh); // add radio group to form if ($ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { // just shows the status wether the session //setting maintenance is allowed by setup $this->form->addItem($ssettings); } else { // just shows the status wether the session //setting maintenance is allowed by setup $ti = new ilNonEditableValueGUI($this->lng->txt('session_config'), "session_config"); $ti->setValue($this->lng->txt('session_config_maintenance_disabled')); $ssettings->setDisabled(true); $ti->addSubItem($ssettings); $this->form->addItem($ti); } // END SESSION SETTINGS $this->lng->loadLanguageModule('ps'); $pass = new ilFormSectionHeaderGUI(); $pass->setTitle($this->lng->txt('ps_password_settings')); $this->form->addItem($pass); // password generation $cb = new ilCheckboxInputGUI($this->lng->txt("passwd_generation"), "passwd_auto_generate"); $cb->setChecked($ilSetting->get("passwd_auto_generate")); $cb->setInfo($this->lng->txt("passwd_generation_info")); $this->form->addItem($cb); $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_change_on_first_login_enabled'), 'password_change_on_first_login_enabled'); $check->setInfo($this->lng->txt('ps_password_change_on_first_login_enabled_info')); $this->form->addItem($check); include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php'; $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_must_not_contain_loginame'), 'password_must_not_contain_loginame'); $check->setInfo($this->lng->txt('ps_password_must_not_contain_loginame_info')); $this->form->addItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled'); //$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled')); $check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info')); $this->form->addItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled'); //$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled')); $check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info')); $this->form->addItem($check); $text = new ilNumberInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length'); $text->setInfo($this->lng->txt('ps_password_min_length_info')); $text->setSize(1); $text->setMaxLength(2); $this->form->addItem($text); $text = new ilNumberInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length'); $text->setInfo($this->lng->txt('ps_password_max_length_info')); $text->setSize(2); $text->setMaxLength(3); $this->form->addItem($text); $text = new ilNumberInputGUI($this->lng->txt('ps_password_uppercase_chars_num'), 'password_ucase_chars_num'); $text->setInfo($this->lng->txt('ps_password_uppercase_chars_num_info')); $text->setMinValue(0); $text->setSize(2); $text->setMaxLength(3); $this->form->addItem($text); $text = new ilNumberInputGUI($this->lng->txt('ps_password_lowercase_chars_num'), 'password_lowercase_chars_num'); $text->setInfo($this->lng->txt('ps_password_lowercase_chars_num_info')); $text->setMinValue(0); $text->setSize(2); $text->setMaxLength(3); $this->form->addItem($text); $text = new ilNumberInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age'); $text->setInfo($this->lng->txt('ps_password_max_age_info')); $text->setSize(2); $text->setMaxLength(3); $this->form->addItem($text); // password assistance $cb = new ilCheckboxInputGUI($this->lng->txt("enable_password_assistance"), "password_assistance"); $cb->setInfo($this->lng->txt("password_assistance_info")); $this->form->addItem($cb); $pass = new ilFormSectionHeaderGUI(); $pass->setTitle($this->lng->txt('ps_security_protection')); $this->form->addItem($pass); $text = new ilNumberInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts'); $text->setInfo($this->lng->txt('ps_login_max_attempts_info')); $text->setSize(1); $text->setMaxLength(2); $this->form->addItem($text); // prevent login from multiple pcs at the same time $objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins'); $objCb->setValue(1); $objCb->setInfo($this->lng->txt('ps_prevent_simultaneous_logins_info')); $this->form->addItem($objCb); $log = new ilFormSectionHeaderGUI(); $log->setTitle($this->lng->txt('loginname_settings')); $this->form->addItem($log); $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname'); $chbChangeLogin->setValue(1); $this->form->addItem($chbChangeLogin); $chbCreateHistory = new ilCheckboxInputGUI($this->lng->txt('history_loginname'), 'create_history_loginname'); $chbCreateHistory->setInfo($this->lng->txt('loginname_history_info')); $chbCreateHistory->setValue(1); $chbChangeLogin->addSubItem($chbCreateHistory); $chbReuseLoginnames = new ilCheckboxInputGUI($this->lng->txt('reuse_of_loginnames_contained_in_history'), 'reuse_of_loginnames'); $chbReuseLoginnames->setValue(1); $chbReuseLoginnames->setInfo($this->lng->txt('reuse_of_loginnames_contained_in_history_info')); $chbChangeLogin->addSubItem($chbReuseLoginnames); $chbChangeBlockingTime = new ilNumberInputGUI($this->lng->txt('loginname_change_blocking_time'), 'loginname_change_blocking_time'); $chbChangeBlockingTime->allowDecimals(true); $chbChangeBlockingTime->setSuffix($this->lng->txt('days')); $chbChangeBlockingTime->setInfo($this->lng->txt('loginname_change_blocking_time_info')); $chbChangeBlockingTime->setSize(10); $chbChangeBlockingTime->setMaxLength(10); $chbChangeLogin->addSubItem($chbChangeBlockingTime); $this->form->addCommandButton('saveGeneralSettings', $this->lng->txt('save')); }
/** * Init/create property form for fields * @return */ protected function initFieldForm($a_mode) { if ($this->form instanceof ilPropertyFormGUI) { return true; } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); switch ($a_mode) { case self::MODE_CREATE: $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('ps_cdf_add_field')); $this->form->addCommandButton('saveField', $this->lng->txt('save')); $this->form->addCommandButton('listFields', $this->lng->txt('cancel')); break; case self::MODE_UPDATE: $this->ctrl->setParameter($this, 'field_id', (int) $_REQUEST['field_id']); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('ps_cdf_edit_field')); $this->form->addCommandButton('updateField', $this->lng->txt('save')); $this->form->addCommandButton('listFields', $this->lng->txt('cancel')); break; } // Name $na = new ilTextInputGUI($this->lng->txt('ps_cdf_name'), 'na'); $na->setSize(32); $na->setMaxLength(255); $na->setRequired(true); $this->form->addItem($na); // Type $ty = new ilRadioGroupInputGUI($this->lng->txt('ps_field_type'), 'ty'); $ty->setRequired(true); $this->form->addItem($ty); // Text type $ty_te = new ilRadioOption($this->lng->txt('ps_type_txt_long'), IL_CDF_TYPE_TEXT); $ty->addOption($ty_te); // Select Type $ty_se = new ilRadioOption($this->lng->txt('ps_type_select_long'), IL_CDF_TYPE_SELECT); $ty->addOption($ty_se); // Select Type Values include_once './Services/Form/classes/class.ilSelectBuilderInputGUI.php'; $ty_se_mu = new ilSelectBuilderInputGUI($this->lng->txt('ps_cdf_value'), 'va'); $ty_se_mu->setAllowMove(true); $ty_se_mu->setRequired(true); $ty_se_mu->setSize(32); $ty_se_mu->setMaxLength(128); $ty_se->addSubItem($ty_se_mu); // Required $re = new ilCheckboxInputGUI($this->lng->txt('ps_cdf_required'), 're'); $re->setValue(1); $this->form->addItem($re); }
/** * Init form * @param int $a_mode * @return */ protected function initFormSequence($a_mode) { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDomEvent(); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); switch ($a_mode) { case self::MODE_CREATE: $this->form->setTitle($this->lng->txt('cal_ch_add_sequence')); $this->form->addCommandButton('saveSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; /* case self::MODE_UPDATE: $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence')); $this->form->addCommandButton('updateSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; */ /* case self::MODE_UPDATE: $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence')); $this->form->addCommandButton('updateSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; */ case self::MODE_MULTI: $this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence')); $this->form->addCommandButton('updateMulti', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; } // in case of existing groups show a selection include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php'; if (count($options = ilConsultationHourGroups::getGroupSelectOptions($this->getUserId()))) { $group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'), 'grp'); $group->setOptions($options); $group->setRequired(false); $this->form->addItem($group); } // Title $ti = new ilTextInputGUI($this->lng->txt('title'), 'ti'); $ti->setSize(32); $ti->setMaxLength(128); $ti->setRequired(true); $this->form->addItem($ti); if ($a_mode != self::MODE_MULTI) { // Start include_once './Services/Form/classes/class.ilDateTimeInputGUI.php'; $dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'), 'st'); $dur->setShowTime(true); $dur->setMinuteStepSize(5); $this->form->addItem($dur); // Duration $du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'), 'du'); $du->setShowMinutes(true); $du->setShowHours(true); $this->form->addItem($du); // Number of appointments $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'), 'ap'); $nu->setInfo($this->lng->txt('cal_ch_num_appointments_info')); $nu->setSize(2); $nu->setMaxLength(2); $nu->setRequired(true); $nu->setMinValue(1); $this->form->addItem($nu); // Recurrence include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php'; $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->setEnabledSubForms(array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY)); $this->form->addItem($rec); } // Number of bookings $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'), 'bo'); $nu->setSize(2); $nu->setMaxLength(2); $nu->setMinValue(1); $nu->setRequired(true); $this->form->addItem($nu); // Deadline $dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'), 'dead'); $dead->setInfo($this->lng->txt('cal_ch_deadline_info')); $dead->setShowMinutes(false); $dead->setShowHours(true); $dead->setShowDays(true); $this->form->addItem($dead); // Location $lo = new ilTextInputGUI($this->lng->txt('cal_where'), 'lo'); $lo->setSize(32); $lo->setMaxLength(128); $this->form->addItem($lo); // Description $de = new ilTextAreaInputGUI($this->lng->txt('description'), 'de'); $de->setRows(10); $de->setCols(60); $this->form->addItem($de); // Target Object $tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'), 'tgt'); $tgt->setInfo($this->lng->txt('cal_ch_target_object_info')); $tgt->setSize(16); $tgt->setMaxLength(128); $this->form->addItem($tgt); }
/** * init edit/create category form * * @access protected * @return */ protected function initFormCategory($a_mode) { global $rbacsystem, $ilUser; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Calendar/classes/class.ilCalendarCategory.php'; include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo((int) $_GET['category_id']); $this->form = new ilPropertyFormGUI(); #$this->form->setTableWidth('40%'); switch ($a_mode) { case 'edit': $category = new ilCalendarCategory((int) $_GET['category_id']); $this->form->setTitle($this->lng->txt('cal_edit_category')); $this->ctrl->saveParameter($this, array('seed', 'category_id')); $this->form->setFormAction($this->ctrl->getFormAction($this)); if ($this->isEditable()) { $this->form->addCommandButton('update', $this->lng->txt('save')); /* if($cat_info['type'] == ilCalendarCategory::TYPE_USR) { $this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share')); } $this->form->addCommandButton('confirmDelete',$this->lng->txt('delete')); */ $this->form->addCommandButton('manage', $this->lng->txt('cancel')); } break; case 'create': $this->editable = true; $category = new ilCalendarCategory(0); $this->ctrl->saveParameter($this, array('category_id')); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('cal_add_category')); $this->form->addCommandButton('save', $this->lng->txt('save')); $this->form->addCommandButton('manage', $this->lng->txt('cancel')); break; } // Calendar name $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'), 'title'); if ($a_mode == 'edit') { $title->setDisabled(!$this->isEditable()); } $title->setRequired(true); $title->setMaxLength(64); $title->setSize(32); $title->setValue($category->getTitle()); $this->form->addItem($title); include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; if ($a_mode == 'create' and $rbacsystem->checkAccess('edit_event', ilCalendarSettings::_getInstance()->getCalendarSettingsId())) { $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'), 'type'); $type->setValue($category->getType()); $type->setRequired(true); $opt = new ilRadioOption($this->lng->txt('cal_type_personal'), ilCalendarCategory::TYPE_USR); $type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('cal_type_system'), ilCalendarCategory::TYPE_GLOBAL); $type->addOption($opt); $type->setInfo($this->lng->txt('cal_type_info')); $this->form->addItem($type); } $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'), 'color'); $color->setValue($category->getColor()); if (!$this->isEditable()) { $color->setDisabled(true); } $color->setRequired(true); $this->form->addItem($color); $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl'); $location->setDisabled($a_mode == 'edit'); $location_local = new ilRadioOption($this->lng->txt('cal_type_local'), ilCalendarCategory::LTYPE_LOCAL); $location->addOption($location_local); $location_remote = new ilRadioOption($this->lng->txt('cal_type_remote'), ilCalendarCategory::LTYPE_REMOTE); $location->addOption($location_remote); $location->setValue($category->getLocationType()); $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url'); $url->setDisabled($a_mode == 'edit'); $url->setValue($category->getRemoteUrl()); $url->setMaxLength(500); $url->setSize(60); $url->setRequired(true); $location_remote->addSubItem($url); $user = new ilTextInputGUI($this->lng->txt('username'), 'remote_user'); $user->setDisabled($a_mode == 'edit'); $user->setValue($category->getRemoteUser()); $user->setMaxLength(50); $user->setSize(20); $user->setRequired(false); $location_remote->addSubItem($user); $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'remote_pass'); $pass->setDisabled($a_mode == 'edit'); $pass->setValue($category->getRemotePass()); $pass->setMaxLength(50); $pass->setSize(20); $pass->setRetype(false); $pass->setInfo($this->lng->txt('remote_pass_info')); $location_remote->addSubItem($pass); $this->form->addItem($location); }
/** * init auth mode determinitation form * * @access protected */ protected function initAuthModeDetermination() { if (is_object($this->form)) { return true; } // Are there any authentication methods that support automatic determination ? include_once 'Services/Authentication/classes/class.ilAuthModeDetermination.php'; $det = ilAuthModeDetermination::_getInstance(); if ($det->getCountActiveAuthModes() <= 1) { return false; } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTableWidth('100%'); $this->form->setTitle($this->lng->txt('auth_auth_settings')); $this->form->addCommandButton('updateAuthModeDetermination', $this->lng->txt('save')); require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php'; $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym'); $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth')); $cap->setValue(1); if (!ilCaptchaUtil::checkFreetype()) { $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage()); } $cap->setChecked(ilCaptchaUtil::isActiveForLogin()); $this->form->addItem($cap); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt('auth_auth_mode_determination')); $this->form->addItem($header); $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'), 'kind'); $kind->setInfo($this->lng->txt('auth_mode_determination_info')); $kind->setValue($det->getKind()); $kind->setRequired(true); $option_user = new ilRadioOption($this->lng->txt('auth_by_user'), 0); $kind->addOption($option_user); $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'), 1); include_once 'Services/Authentication/classes/class.ilAuthUtils.php'; $auth_sequenced = $det->getAuthModeSequence(); $counter = 1; foreach ($auth_sequenced as $auth_mode) { switch ($auth_mode) { case AUTH_LDAP: $text = $this->lng->txt('auth_ldap'); break; case AUTH_RADIUS: $text = $this->lng->txt('auth_radius'); break; case AUTH_LOCAL: $text = $this->lng->txt('auth_local'); break; case AUTH_SOAP: $text = $this->lng->txt('auth_soap'); break; case AUTH_APACHE: $text = $this->lng->txt('auth_apache'); break; // begin-patch auth_plugin // begin-patch auth_plugin default: foreach (ilAuthUtils::getAuthPlugins() as $pl) { $option = $pl->getMultipleAuthModeOptions($auth_mode); $text = $option[$auth_mode]['txt']; } break; // end-patch auth_plugin } $pos = new ilTextInputGUI($text, 'position[' . $auth_mode . ']'); $pos->setValue($counter++); $pos->setSize(1); $pos->setMaxLength(1); $option_determination->addSubItem($pos); } $kind->addOption($option_determination); $this->form->addItem($kind); return true; }
/** * Init filter */ function initFilter() { global $lng, $rbacreview, $ilUser; // title include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ti = new ilTextInputGUI($lng->txt("survey_question_title"), "title"); $ti->setMaxLength(64); $ti->setValidationRegexp('/^[^%]+$/is'); $ti->setSize(20); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["title"] = $ti->getValue(); // description $ti = new ilTextInputGUI($lng->txt("description"), "description"); $ti->setMaxLength(64); $ti->setValidationRegexp('/^[^%]+$/is'); $ti->setSize(20); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["description"] = $ti->getValue(); // author $ti = new ilTextInputGUI($lng->txt("author"), "author"); $ti->setMaxLength(64); $ti->setValidationRegexp('/^[^%]+$/is'); $ti->setSize(20); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["author"] = $ti->getValue(); // questiontype include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php"; $types = ilObjSurveyQuestionPool::_getQuestionTypes(); $options = array(); $options[""] = $lng->txt('filter_all_question_types'); foreach ($types as $translation => $row) { $options[$row['type_tag']] = $translation; } $si = new ilSelectInputGUI($this->lng->txt("question_type"), "type"); $si->setOptions($options); $this->addFilterItem($si); $si->readFromSession(); $this->filter["type"] = $si->getValue(); // questionpool text $ti = new ilTextInputGUI($lng->txt("survey_question_pool_title"), "spl_txt"); $ti->setMaxLength(64); $ti->setSize(20); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["spl_txt"] = $ti->getValue(); // questionpool select $options = array(); $options[""] = $lng->txt('filter_all_questionpools'); natcasesort($this->questionpools); foreach ($this->questionpools as $obj_id => $title) { $options[$obj_id] = $title; } $si = new ilSelectInputGUI($this->lng->txt("survey_available_question_pools"), "spl"); $si->setOptions($options); $this->addFilterItem($si); $si->readFromSession(); $this->filter["type"] = $si->getValue(); }
/** * Init assignment form. * * @param int $a_mode "create"/"edit" */ public function initAssignmentForm($a_mode = "create") { global $lng, $ilCtrl, $ilSetting; // init form $lng->loadLanguageModule("form"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTableWidth("600px"); if ($a_mode == "edit") { $this->form->setTitle($lng->txt("exc_edit_assignment")); } else { $this->form->setTitle($lng->txt("exc_new_assignment")); } $this->form->setFormAction($ilCtrl->getFormAction($this)); // type include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; $types = array(ilExAssignment::TYPE_UPLOAD => $this->lng->txt("exc_type_upload"), ilExAssignment::TYPE_UPLOAD_TEAM => $this->lng->txt("exc_type_upload_team"), ilExAssignment::TYPE_TEXT => $this->lng->txt("exc_type_text")); if (!$ilSetting->get('disable_wsp_blogs')) { $types[ilExAssignment::TYPE_BLOG] = $this->lng->txt("exc_type_blog"); } if ($ilSetting->get('user_portfolios')) { $types[ilExAssignment::TYPE_PORTFOLIO] = $this->lng->txt("exc_type_portfolio"); } if (sizeof($types) > 1) { $ty = new ilSelectInputGUI($this->lng->txt("exc_assignment_type"), "type"); $ty->setOptions($types); $ty->setRequired(true); } else { $ty = new ilHiddenInputGUI("type"); $ty->setValue(ilExAssignment::TYPE_UPLOAD); } $this->form->addItem($ty); // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setMaxLength(200); $ti->setRequired(true); $this->form->addItem($ti); // start time y/n $cb = new ilCheckboxInputGUI($this->lng->txt("exc_start_time"), "start_time_cb"); $this->form->addItem($cb); // start time $edit_date = new ilDateTimeInputGUI("", "start_time"); $edit_date->setShowTime(true); $cb->addSubItem($edit_date); // deadline y/n $dcb = new ilCheckboxInputGUI($this->lng->txt("exc_deadline"), "deadline_cb"); $dcb->setChecked(true); $this->form->addItem($dcb); // Deadline $edit_date = new ilDateTimeInputGUI($lng->txt(""), "deadline"); $edit_date->setShowTime(true); $dcb->addSubItem($edit_date); // mandatory $cb = new ilCheckboxInputGUI($this->lng->txt("exc_mandatory"), "mandatory"); $cb->setInfo($this->lng->txt("exc_mandatory_info")); $cb->setChecked(true); $this->form->addItem($cb); // Work Instructions $desc_input = new ilTextAreaInputGUI($lng->txt("exc_instruction"), "instruction"); $desc_input->setRows(20); $desc_input->setUseRte(true); $desc_input->setRteTagSet("mini"); $this->form->addItem($desc_input); // files if ($a_mode == "create") { $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files'); $files->setFilenames(array(0 => '')); $this->form->addItem($files); } // peer review $peer = new ilCheckboxInputGUI($lng->txt("exc_peer_review"), "peer"); $peer->setInfo($this->lng->txt("exc_peer_review_ass_setting_info")); $this->form->addItem($peer); if ($a_mode == "create") { $peer->setInfo($lng->txt("exc_peer_review_info")); } $peer_min = new ilNumberInputGUI($lng->txt("exc_peer_review_min_number"), "peer_min"); $peer_min->setInfo($lng->txt("exc_peer_review_min_number_info")); $peer_min->setRequired(true); $peer_min->setValue(5); $peer_min->setSize(3); $peer_min->setValue(2); $peer->addSubItem($peer_min); $peer_dl = new ilDateTimeInputGUI($lng->txt("exc_peer_review_deadline"), "peer_dl"); $peer_dl->setInfo($lng->txt("exc_peer_review_deadline_info")); $peer_dl->enableDateActivation("", "peer_dl_tgl"); $peer_dl->setShowTime(true); $peer->addSubItem($peer_dl); $peer_file = new ilCheckboxInputGUI($lng->txt("exc_peer_review_file"), "peer_file"); $peer_file->setInfo($lng->txt("exc_peer_review_file_info")); $peer->addSubItem($peer_file); $peer_prsl = new ilCheckboxInputGUI($lng->txt("exc_peer_review_personal"), "peer_prsl"); $peer_prsl->setInfo($lng->txt("exc_peer_review_personal_info")); $peer->addSubItem($peer_prsl); if ($a_mode != "create" && $this->ass && $this->ass->getDeadline() && $this->ass->getDeadline() < time()) { $peer_prsl->setDisabled(true); } // global feedback $fb = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file"), "fb"); $this->form->addItem($fb); $fb_file = new ilFileInputGUI($lng->txt("file"), "fb_file"); // $fb_file->setRequired(true); $fb_file->setALlowDeletion(true); $fb->addSubItem($fb_file); $fb_date = new ilRadioGroupInputGUI($lng->txt("exc_global_feedback_file_date"), "fb_date"); $fb_date->setRequired(true); $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_deadline"), ilExAssignment::FEEDBACK_DATE_DEADLINE)); $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_upload"), ilExAssignment::FEEDBACK_DATE_SUBMISSION)); $fb->addSubItem($fb_date); $fb_cron = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file_cron"), "fb_cron"); $fb_cron->setInfo($lng->txt("exc_global_feedback_file_cron_info")); $fb->addSubItem($fb_cron); // save and cancel commands if ($a_mode == "create") { $this->form->addCommandButton("saveAssignment", $lng->txt("save")); $this->form->addCommandButton("listAssignments", $lng->txt("cancel")); } else { $this->form->addCommandButton("updateAssignment", $lng->txt("save")); $this->form->addCommandButton("listAssignments", $lng->txt("cancel")); } }
/** * Init category mapping form * @return */ protected function initCategoryMappingForm($a_mode = 'add') { global $ilDB; if (is_object($this->form)) { return true; } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php'; $this->form = new ilPropertyFormGUI(); if ($a_mode == 'add') { $this->form->setTitle($this->lng->txt('ecs_new_category_mapping')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'categoryMapping')); $this->form->addCommandButton('addCategoryMapping', $this->lng->txt('save')); $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel')); } else { $this->form->setTitle($this->lng->txt('ecs_edit_category_mapping')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'editCategoryMapping')); $this->form->addCommandButton('updateCategoryMapping', $this->lng->txt('save')); $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel')); } $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'), 'import_id'); $imp->setRequired(true); $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS'); $tpl->setVariable('SIZE', 5); $tpl->setVariable('MAXLENGTH', 11); $tpl->setVariable('POST_VAR', 'import_id'); $tpl->setVariable('PROPERTY_VALUE', $this->rule->getContainerId()); if ($this->settings->getImportId()) { $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->rule->getContainerId())); } $imp->setHTML($tpl->get()); $imp->setInfo($this->lng->txt('ecs_import_id_info')); $this->form->addItem($imp); include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php'; $select = new ilSelectInputGUI($this->lng->txt('ecs_attribute_name'), 'field'); $select->setValue($this->rule->getFieldName()); $select->setRequired(true); $select->setOptions(ilECSCategoryMapping::getPossibleFields()); $this->form->addItem($select); // Value $value = new ilRadioGroupInputGUI($this->lng->txt('ecs_cat_mapping_type'), 'type'); $value->setValue($this->rule->getMappingType()); $value->setRequired(true); $fixed = new ilRadioOption($this->lng->txt('ecs_cat_mapping_fixed'), ilECSCategoryMappingRule::TYPE_FIXED); $fixed->setInfo($this->lng->txt('ecs_cat_mapping_fixed_info')); $fixed_val = new ilTextInputGUI($this->lng->txt('ecs_cat_mapping_values'), 'mapping_value'); $fixed_val->setValue($this->rule->getMappingValue()); $fixed_val->setMaxLength(255); $fixed_val->setSize(40); $fixed_val->setRequired(true); $fixed->addSubItem($fixed_val); $value->addOption($fixed); $duration = new ilRadioOption($this->lng->txt('ecs_cat_mapping_duration'), ilECSCategoryMappingRule::TYPE_DURATION); $duration->setInfo($this->lng->txt('ecs_cat_mapping_duration_info')); $dur_start = new ilDateTimeInputGUI($this->lng->txt('from'), 'dur_begin'); $dur_start->setDate($this->rule->getDateRangeStart()); $duration->addSubItem($dur_start); $dur_end = new ilDateTimeInputGUI($this->lng->txt('to'), 'dur_end'); $dur_end->setDate($this->rule->getDateRangeEnd()); $duration->addSubItem($dur_end); $value->addOption($duration); $type = new ilRadioOption($this->lng->txt('ecs_cat_mapping_by_type'), ilECSCategoryMappingRule::TYPE_BY_TYPE); $type->setInfo($this->lng->txt('ecs_cat_mapping_by_type_info')); $options = ilECSUtils::getPossibleRemoteTypes(true); $types = new ilSelectInputGUI($this->lng->txt('type'), 'by_type'); $types->setOptions($options); $types->setValue($this->rule->getByType()); $types->setRequired(true); $type->addSubitem($types); $value->addOption($type); $this->form->addItem($value); }
/** * Init settings form. * This command uses the form class to display an input form. */ protected function initSettingsForm() { $this->settingsForm = new ilPropertyFormGUI(); // Title and description (Standard) $titleField = new ilTextInputGUI($this->lng->txt('title'), 'title'); $titleField->setMaxLength(128); $titleField->setRequired(true); $this->settingsForm->addItem($titleField); $descField = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc'); $descField->setCols(50); $descField->setRows(5); $this->settingsForm->addItem($descField); // Online flag $onlineField = new ilCheckboxInputGUI($this->lng->txt('online'), 'online'); $this->settingsForm->addItem($onlineField); // Max booking time // $maxtimeField = new ilRoomSharingTimeInputGUI($this->lng->txt('rep_robj_xrs_max_book_time'), 'max_book_time'); // $maxtimeField->setShowTime(true); // $maxtimeField->setMinuteStepSize(5); // $maxtimeField->setShowDate(false); // $this->settingsForm->addItem($maxtimeField); require_once './Customizing/global/plugins/Services/Repository/RepositoryObject/RoomSharing/classes/utils/class.xrsTimeInputGUI.php'; $xrsTimeInputGUI = new xrsTimeInputGUI($this->lng->txt('rep_robj_xrs_max_book_time'), 'max_book_time'); $this->settingsForm->addItem($xrsTimeInputGUI); // Rooms agreement $roomsAgrField = new ilFileInputGUI($this->lng->txt('rep_robj_xrs_rooms_user_agreement'), "rooms_agreement"); $roomsAgrField->setSize(50); $roomsAgrField->setRequired(false); $roomsAgrField->setInfo($this->lng->txt("rep_robj_xrs_room_agreement_filetypes") . " .bmp, .jpg, .jpeg, .png, .gif, .txt, .pdf"); $this->settingsForm->addItem($roomsAgrField); $this->settingsForm->addCommandButton('updateSettings', $this->lng->txt('save')); $this->settingsForm->setTitle($this->lng->txt('edit_properties')); $this->settingsForm->setFormAction($this->ctrl->getFormAction($this)); }
/** * Init filter */ public function initFilter() { global $lng; $this->setDisableFilterHiding(true); // object type selection include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; /* $si = new ilSelectInputGUI($lng->txt("obj_type"), "type"); $options = $this->getPossibleTypes(true); $si->setOptions($options); $this->addFilterItem($si); $si->readFromSession(); if(!$si->getValue()) { $si->setValue("crs"); } $this->filter["type"] = $si->getValue(); $this->filter_captions[] = $options[$this->filter["type"]]; */ $this->filter["type"] = "crs"; // title/description include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query"); $ti->setMaxLength(64); $ti->setSize(20); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["query"] = $ti->getValue(); // year/month $si = new ilSelectInputGUI($lng->txt("year") . " / " . $lng->txt("month"), "yearmonth"); $si->setOptions($this->getMonthsFilter()); $this->addFilterItem($si); $si->readFromSession(); if (!$si->getValue()) { $si->setValue(date("Y-m")); } $this->filter["yearmonth"] = $si->getValue(); if (!strpos($this->filter["yearmonth"], "-")) { $si = new ilSelectInputGUI($lng->txt("trac_figure"), "figure"); $options = array("mem_cnt_max" => $lng->txt("members") . " " . $lng->txt("trac_object_stat_lp_max"), "mem_cnt_avg" => $lng->txt("members") . " Ø", "in_progress_max" => ilLearningProgressBaseGUI::_getStatusText(ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) . " " . $lng->txt("trac_object_stat_lp_max"), "in_progress_avg" => ilLearningProgressBaseGUI::_getStatusText(ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) . " Ø"); $si->setOptions($options); $this->addFilterItem($si); $si->readFromSession(); if (!$si->getValue()) { $si->setValue("mem_cnt_max"); } $this->filter["measure"] = $si->getValue(); } if ($this->is_details) { $this->filters = array(); } }