protected function initLicenseForm() { include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "updateLicense")); $form->setTitle($this->lng->txt('edit_license')); $exist = new ilNumberInputGUI($this->lng->txt("existing_licenses"), "licenses"); $exist->setInfo($this->lng->txt("zero_licenses_explanation")); $exist->setMaxLength(10); $exist->setSize(10); $exist->setValue($this->license->getLicenses()); $form->addItem($exist); $info_used = new ilNonEditableValueGUI($this->lng->txt("used_licenses")); $info_used->setInfo($this->lng->txt("used_licenses_explanation")); $info_used->setValue($this->license->getAccesses()); $form->addItem($info_used); $remaining_licenses = $this->license->getLicenses() == "0" ? $this->lng->txt("arbitrary") : $this->license->getRemainingLicenses(); $info_remain = new ilNonEditableValueGUI($this->lng->txt("remaining_licenses")); $info_remain->setInfo($this->lng->txt("remaining_licenses_explanation")); $info_remain->setValue($remaining_licenses); $form->addItem($info_remain); $info_potential = new ilNonEditableValueGUI($this->lng->txt("potential_accesses")); $info_potential->setInfo($this->lng->txt("potential_accesses_explanation")); $info_potential->setValue($this->license->getPotentialAccesses()); $form->addItem($info_potential); $comm = new ilTextAreaInputGUI($this->lng->txt("comment"), "remarks"); $comm->setRows(5); $comm->setValue($this->license->getRemarks()); $form->addItem($comm); $form->addCommandButton('updateLicense', $this->lng->txt('save')); return $form; }
/** * 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)); }
function initAddCodesForm() { global $ilCtrl, $lng; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setFormAction($ilCtrl->getFormAction($this, 'createCodes')); $this->form_gui->setTitle($lng->txt('user_account_codes_edit_header')); $count = new ilNumberInputGUI($lng->txt('user_account_codes_number'), 'acc_codes_number'); $count->setSize(4); $count->setMaxLength(4); $count->setMinValue(1); $count->setMaxValue(1000); $count->setRequired(true); $this->form_gui->addItem($count); $valid = new ilRadioGroupInputGUI($lng->txt('user_account_code_valid_until'), 'valid_type'); $valid->setRequired(true); $unl = new ilRadioOption($lng->txt('user_account_code_valid_until_unlimited'), 'valid_unlimited'); $valid->addOption($unl); $st = new ilRadioOption($lng->txt('user_account_code_valid_until_static'), 'valid_static'); $valid->addOption($st); $dt = new ilDateTimeInputGUI($lng->txt('date'), 'valid_date'); $dt->setRequired(true); $st->addSubItem($dt); $dyn = new ilRadioOption($lng->txt('user_account_code_valid_until_dynamic'), 'valid_dynamic'); $valid->addOption($dyn); $ds = new ilNumberInputGUI($lng->txt('days'), 'valid_days'); $ds->setSize(5); $ds->setRequired(true); $dyn->addSubItem($ds); $this->form_gui->addItem($valid); $this->form_gui->addCommandButton('createCodes', $lng->txt('create')); $this->form_gui->addCommandButton('listCodes', $lng->txt('cancel')); }
/** * Init property form * * @return ilPropertyFormGUI $form */ protected function initFormSettings() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('tracking_settings')); $form->setFormAction($this->ctrl->getFormAction($this)); // Mode $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus'); $mod->setRequired(true); $mod->setValue($this->obj_lp->getCurrentMode()); $form->addItem($mod); foreach ($this->obj_lp->getValidModes() as $mode_key) { $opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key)); $opt->setValue($mode_key); $mod->addOption($opt); // :TODO: Subitem for visits ?! if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) { $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits'); $vis->setSize(3); $vis->setMaxLength(4); $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan())); $vis->setRequired(true); $vis->setValue($this->obj_settings->getVisits()); $opt->addSubItem($vis); } } $form->addCommandButton('saveSettings', $this->lng->txt('save')); return $form; }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng, $ilSetting; $lng->loadLanguageModule('dateplaner'); $consultation_days = new ilNumberInputGUI($lng->txt('cal_ch_cron_reminder_days'), 'ch_reminder_days'); $consultation_days->setMinValue(1); $consultation_days->setMaxLength(2); $consultation_days->setSize(2); $consultation_days->setValue($ilSetting->get('ch_reminder_days', 2)); $consultation_days->setRequired(true); $a_form->addItem($consultation_days); }
/** * Init property form * * @return ilPropertyFormGUI $form */ protected function initFormSettings() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('tracking_settings')); $form->setFormAction($this->ctrl->getFormAction($this)); // Mode $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus'); $mod->setRequired(true); $mod->setValue($this->obj_settings->getMode()); $form->addItem($mod); foreach ($this->obj_settings->getValidModes() as $mode_key => $mode_name) { $opt = new ilRadioOption($mode_name, $mode_key, ilLPObjSettings::_mode2InfoText($mode_key)); $opt->setValue($mode_key); $mod->addOption($opt); // Subitem for vistits if ($mode_key == LP_MODE_VISITS) { $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits'); $vis->setSize(3); $vis->setMaxLength(4); $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan())); $vis->setRequired(true); $vis->setValue($this->obj_settings->getVisits()); $opt->addSubItem($vis); } } /* // Info Active $act = new ilCustomInputGUI($this->lng->txt('trac_activated'), ''); $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking'); $img->setVariable("IMG_SRC", $activated = ilObjUserTracking::_enabledLearningProgress() ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png') ); $act->setHTML($img->get()); $form->addItem($act); // Info Anonymized $ano = new ilCustomInputGUI($this->lng->txt('trac_anonymized'), ''); $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking'); $img->setVariable("IMG_SRC", $anonymized = !ilObjUserTracking::_enabledUserRelatedData() ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png') ); $ano->setHTML($img->get()); $form->addItem($ano); */ $form->addCommandButton('saveSettings', $this->lng->txt('save')); return $form; }
public function initPluginSettings() { if ($this->getAdminConfigObject()->getDefaultAllowPublicLinksConfigAllowPublicLinks() && $this->getAdminConfigObject()->getDefaultAllowPublicLinks()) { $public_links = new ilCheckboxInputGUI($this->txt("activate_public_links"), "activate_public_links"); $public_links->setInfo($this->txt("info_activate_public_links")); $this->form->addItem($public_links); } if ($this->getAdminConfigObject()->getConfigMaxFileSize()) { $max_file_size = new ilNumberInputGUI($this->txt("max_file_size"), "max_file_size"); $max_file_size->setInfo($this->txt("info_max_file_size")); $max_file_size->setMaxLength(10); $max_file_size->setSize(10); $this->form->addItem($max_file_size); } }
public function addToForm() { $def = $this->getADT()->getCopyOfDefinition(); $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId()); $number->setSize(10); $min = $def->getMin(); if ($min !== null) { $number->setMinValue($min); } $max = $def->getMax(); if ($max !== null) { $number->setMaxValue($max); $length = strlen($max); $number->setSize($length); $number->setMaxLength($length); } $this->addToParentElement($number); }
/** * Init java server form. */ public function initJavaServerForm() { global $lng, $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // host $ti = new ilTextInputGUI($this->lng->txt("java_server_host"), "rpc_server_host"); $ti->setMaxLength(64); $ti->setSize(32); $ti->setValue($ilSetting->get("rpc_server_host")); $this->form->addItem($ti); // port $ti = new ilNumberInputGUI($this->lng->txt("java_server_port"), "rpc_server_port"); $ti->setMaxLength(5); $ti->setSize(5); $ti->setValue($ilSetting->get("rpc_server_port")); $this->form->addItem($ti); // pdf fonts $pdf = new ilFormSectionHeaderGUI(); $pdf->setTitle($this->lng->txt('rpc_pdf_generation')); $this->form->addItem($pdf); $pdf_font = new ilTextInputGUI($this->lng->txt('rpc_pdf_font'), 'rpc_pdf_font'); $pdf_font->setInfo($this->lng->txt('rpc_pdf_font_info')); $pdf_font->setSize(64); $pdf_font->setMaxLength(1024); $pdf_font->setRequired(true); $pdf_font->setValue($ilSetting->get('rpc_pdf_font', 'Helvetica, unifont')); $this->form->addItem($pdf_font); // save and cancel commands $this->form->addCommandButton("saveJavaServer", $lng->txt("save")); $this->form->setTitle($lng->txt("java_server")); $this->form->setDescription($lng->txt("java_server_info") . '<br /><a href="Services/WebServices/RPC/lib/README.txt" target="_blank">' . $lng->txt("java_server_readme") . '</a>'); $this->form->setFormAction($this->ctrl->getFormAction($this)); }
/** * Edit personal desktop settings. */ public function editSettings() { global $ilCtrl, $lng, $ilSetting; $pd_set = new ilSetting("pd"); $enable_calendar = ilCalendarSettings::_getInstance()->isEnabled(); #$enable_calendar = $ilSetting->get("enable_calendar"); $enable_block_moving = $pd_set->get("enable_block_moving"); $enable_active_users = $ilSetting->get("block_activated_pdusers"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitle($lng->txt("pd_settings")); // Enable calendar $cb_prop = new ilCheckboxInputGUI($lng->txt("enable_calendar"), "enable_calendar"); $cb_prop->setValue("1"); //$cb_prop->setInfo($lng->txt("pd_enable_block_moving_info")); $cb_prop->setChecked($enable_calendar); $form->addItem($cb_prop); // Enable bookmarks $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_bookmarks"), "enable_bookmarks"); $cb_prop->setValue("1"); $cb_prop->setChecked($ilSetting->get("disable_bookmarks") ? "0" : "1"); $form->addItem($cb_prop); // Enable contacts $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_contacts"), "enable_contacts"); $cb_prop->setValue("1"); $cb_prop->setChecked($ilSetting->get("disable_contacts") ? "0" : "1"); $cb_prop_requires_mail = new ilCheckboxInputGUI($lng->txt('pd_enable_contacts_requires_mail'), 'enable_contacts_require_mail'); $cb_prop_requires_mail->setValue("1"); $cb_prop_requires_mail->setChecked($ilSetting->get("disable_contacts_require_mail") ? "0" : "1"); $cb_prop->addSubItem($cb_prop_requires_mail); $form->addItem($cb_prop); // Enable notes $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_notes"), "enable_notes"); $cb_prop->setValue("1"); $cb_prop->setChecked($ilSetting->get("disable_notes") ? "0" : "1"); $form->addItem($cb_prop); // Enable notes $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_comments"), "enable_comments"); $cb_prop->setValue("1"); $cb_prop->setChecked($ilSetting->get("disable_comments") ? "0" : "1"); $form->addItem($cb_prop); $comm_del_user = new ilCheckboxInputGUI($lng->txt("pd_enable_comments_del_user"), "comm_del_user"); $comm_del_user->setChecked($ilSetting->get("comments_del_user", 0)); $cb_prop->addSubItem($comm_del_user); $comm_del_tutor = new ilCheckboxInputGUI($lng->txt("pd_enable_comments_del_tutor"), "comm_del_tutor"); $comm_del_tutor->setChecked($ilSetting->get("comments_del_tutor", 1)); $cb_prop->addSubItem($comm_del_tutor); // Enable Chatviewer $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_chatviewer"), "block_activated_chatviewer"); $cb_prop->setValue("1"); $cb_prop->setChecked($ilSetting->get("block_activated_chatviewer")); $form->addItem($cb_prop); // Enable block moving $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_block_moving"), "enable_block_moving"); $cb_prop->setValue("1"); $cb_prop->setInfo($lng->txt("pd_enable_block_moving_info")); $cb_prop->setChecked($enable_block_moving); $form->addItem($cb_prop); // Enable active users block $cb_prop = new ilCheckboxInputGUI($lng->txt("pd_enable_active_users"), "block_activated_pdusers"); $cb_prop->setValue("1"); $cb_prop->setChecked($enable_active_users); // maximum inactivity time $ti_prop = new ilNumberInputGUI($lng->txt("pd_time_before_removal"), "time_removal"); $ti_prop->setValue($pd_set->get("user_activity_time")); $ti_prop->setInfo($lng->txt("pd_time_before_removal_info")); $ti_prop->setMaxLength(3); $ti_prop->setSize(3); $cb_prop->addSubItem($ti_prop); // osi host // see http://www.onlinestatus.org $ti_prop = new ilTextInputGUI($lng->txt("pd_osi_host"), "osi_host"); $ti_prop->setValue($pd_set->get("osi_host")); $ti_prop->setInfo($lng->txt("pd_osi_host_info") . ' <a href="http://www.onlinestatus.org" target="_blank">http://www.onlinestatus.org</a>'); $cb_prop->addSubItem($ti_prop); $form->addItem($cb_prop); // Enable 'My Offers' (default personal items) $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_my_offers'), 'enable_my_offers'); $cb_prop->setValue('1'); $cb_prop->setInfo($lng->txt('pd_enable_my_offers_info')); $cb_prop->setChecked($ilSetting->get('disable_my_offers') ? '0' : '1'); $form->addItem($cb_prop); // Enable 'My Memberships' $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_my_memberships'), 'enable_my_memberships'); $cb_prop->setValue('1'); $cb_prop->setInfo($lng->txt('pd_enable_my_memberships_info')); $cb_prop->setChecked($ilSetting->get('disable_my_memberships') ? '0' : '1'); $form->addItem($cb_prop); if ($ilSetting->get('disable_my_offers') == 0 && $ilSetting->get('disable_my_memberships') == 0) { // Default view of personal items $sb_prop = new ilSelectInputGUI($lng->txt('pd_personal_items_default_view'), 'personal_items_default_view'); $sb_prop->setInfo($lng->txt('pd_personal_items_default_view_info')); $option = array(); $option[0] = $lng->txt('pd_my_offers'); $option[1] = $lng->txt('my_courses_groups'); $sb_prop->setOptions($option); $sb_prop->setValue((int) $ilSetting->get('personal_items_default_view')); $form->addItem($sb_prop); } // command buttons $form->addCommandButton("saveSettings", $lng->txt("save")); $form->addCommandButton("view", $lng->txt("cancel")); $this->tpl->setContent($form->getHTML()); }
/** * Init form table for new role assignments * * @param string mode edit | create * @param object object of ilLDAPRoleAsssignmentRule * @access protected * */ protected function initFormRoleAssignments($a_mode) { include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; include_once 'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); switch ($a_mode) { case 'edit': $this->form->setTitle($this->lng->txt('ldap_edit_role_ass_rule')); $this->form->addCommandButton('updateRoleAssignment', $this->lng->txt('save')); $this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel')); break; case 'create': $this->form->setTitle($this->lng->txt('ldap_add_role_ass_rule')); $this->form->addCommandButton('addRoleAssignment', $this->lng->txt('ldap_btn_add_role_ass')); $this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel')); break; } // Role Selection $role = new ilRadioGroupInputGUI($this->lng->txt('ldap_ilias_role'), 'role_name'); $role->setRequired(true); $global = new ilRadioOption($this->lng->txt('ldap_global_role'), 0); $role->addOption($global); $role_select = new ilSelectInputGUI('', 'role_id'); $role_select->setOptions($this->prepareGlobalRoleSelection()); $global->addSubItem($role_select); $local = new ilRadioOption($this->lng->txt('ldap_local_role'), 1); $role->addOption($local); include_once './Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php'; $role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject'); $role_search->setSize(40); $local->addSubItem($role_search); $role->setInfo($this->lng->txt('ldap_role_name_info')); $this->form->addItem($role); // Update options $update = new ilNonEditableValueGUI($this->lng->txt('ldap_update_roles'), 'update_roles'); $update->setValue($this->lng->txt('ldap_check_role_assignment')); $add = new ilCheckboxInputGUI('', 'add_missing'); $add->setOptionTitle($this->lng->txt('ldap_add_missing')); $update->addSubItem($add); $remove = new ilCheckboxInputGUI('', 'remove_deprecated'); $remove->setOptionTitle($this->lng->txt('ldap_remove_deprecated')); $update->addSubItem($remove); $this->form->addItem($update); // Assignment Type $group = new ilRadioGroupInputGUI($this->lng->txt('ldap_assignment_type'), 'type'); #$group->setValue($current_rule->getType()); $group->setRequired(true); // Option by group $radio_group = new ilRadioOption($this->lng->txt('ldap_role_by_group'), ilLDAPRoleAssignmentRule::TYPE_GROUP); $dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'), 'dn'); #$dn->setValue($current_rule->getDN()); $dn->setSize(32); $dn->setMaxLength(512); $dn->setInfo($this->lng->txt('ldap_role_grp_dn_info')); $radio_group->addSubItem($dn); $at = new ilTextInputGUI($this->lng->txt('ldap_role_grp_at'), 'at'); #$at->setValue($current_rule->getMemberAttribute()); $at->setSize(16); $at->setMaxLength(128); $radio_group->addSubItem($at); $isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_role_grp_isdn'), 'isdn'); #$isdn->setChecked($current_rule->isMemberAttributeDN()); $isdn->setInfo($this->lng->txt('ldap_group_member_info')); $radio_group->addSubItem($isdn); $radio_group->setInfo($this->lng->txt('ldap_role_grp_info')); $group->addOption($radio_group); // Option by Attribute $radio_attribute = new ilRadioOption($this->lng->txt('ldap_role_by_attribute'), ilLDAPRoleAssignmentRule::TYPE_ATTRIBUTE); $name = new ilTextInputGUI($this->lng->txt('ldap_role_at_name'), 'name'); #$name->setValue($current_rule->getAttributeName()); $name->setSize(32); $name->setMaxLength(128); #$name->setInfo($this->lng->txt('ldap_role_at_name_info')); $radio_attribute->addSubItem($name); // Radio Attribute $val = new ilTextInputGUI($this->lng->txt('ldap_role_at_value'), 'value'); #$val->setValue($current_rule->getAttributeValue()); $val->setSize(32); $val->setMaxLength(128); #$val->setInfo($this->lng->txt('ldap_role_at_value_info')); $radio_attribute->addSubItem($val); $radio_attribute->setInfo($this->lng->txt('ldap_role_at_info')); $group->addOption($radio_attribute); // Option by Plugin $pl_active = (bool) $this->hasActiveRoleAssignmentPlugins(); $pl = new ilRadioOption($this->lng->txt('ldap_plugin'), 3); $pl->setInfo($this->lng->txt('ldap_plugin_info')); $pl->setDisabled(!$pl_active); $id = new ilNumberInputGUI($this->lng->txt('ldap_plugin_id'), 'plugin_id'); $id->setDisabled(!$pl_active); $id->setSize(3); $id->setMaxLength(3); $id->setMaxValue(999); $id->setMinValue(1); $pl->addSubItem($id); $group->addOption($pl); $this->form->addItem($group); }
/** * Creates an output of the edit form for the question * * @access public */ public function editQuestion($checkonly = FALSE) { $save = $this->isSaveCommand(); $this->getQuestionTemplate(); # if ($_REQUEST['prev_qid']) { # $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']); # } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->outQuestionType()); $form->setMultipart(FALSE); $form->setTableWidth("100%"); $form->setId("assclozetest"); // title, author, description, question, working time (assessment mode) $this->addBasicQuestionFormProperties($form); $q_item = $form->getItemByPostVar("question"); $q_item->setInfo($this->lng->txt("close_text_hint")); $q_item->setTitle($this->lng->txt("cloze_text")); // text rating if (!$this->getSelfAssessmentEditingMode()) { $textrating = new ilSelectInputGUI($this->lng->txt("text_rating"), "textgap_rating"); $text_options = array("ci" => $this->lng->txt("cloze_textgap_case_insensitive"), "cs" => $this->lng->txt("cloze_textgap_case_sensitive"), "l1" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1"), "l2" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2"), "l3" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3"), "l4" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4"), "l5" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5")); $textrating->setOptions($text_options); $textrating->setValue($this->object->getTextgapRating()); $form->addItem($textrating); // text field length $fixedTextLength = new ilNumberInputGUI($this->lng->txt("cloze_fixed_textlength"), "fixedTextLength"); $fixedTextLength->setValue(ilUtil::prepareFormOutput($this->object->getFixedTextLength())); $fixedTextLength->setMinValue(0); $fixedTextLength->setSize(3); $fixedTextLength->setMaxLength(6); $fixedTextLength->setInfo($this->lng->txt('cloze_fixed_textlength_description')); $fixedTextLength->setRequired(false); $form->addItem($fixedTextLength); // identical scoring $identical_scoring = new ilCheckboxInputGUI($this->lng->txt("identical_scoring"), "identical_scoring"); $identical_scoring->setValue(1); $identical_scoring->setChecked($this->object->getIdenticalScoring()); $identical_scoring->setInfo($this->lng->txt('identical_scoring_desc')); $identical_scoring->setRequired(FALSE); $form->addItem($identical_scoring); } for ($i = 0; $i < $this->object->getGapCount(); $i++) { $gap = $this->object->getGap($i); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("gap") . " " . ($i + 1)); $form->addItem($header); $gapcounter = new ilHiddenInputGUI("gap[{$i}]"); $gapcounter->setValue($i); $form->addItem($gapcounter); $gaptype = new ilSelectInputGUI($this->lng->txt('type'), "clozetype_{$i}"); $options = array(0 => $this->lng->txt("text_gap"), 1 => $this->lng->txt("select_gap"), 2 => $this->lng->txt("numeric_gap")); $gaptype->setOptions($options); $gaptype->setValue($gap->getType()); $form->addItem($gaptype); if ($gap->getType() == CLOZE_TEXT) { // Choices include_once "./Modules/TestQuestionPool/classes/class.ilAnswerWizardInputGUI.php"; include_once "./Modules/TestQuestionPool/classes/class.assAnswerCloze.php"; $values = new ilAnswerWizardInputGUI($this->lng->txt("values"), "gap_" . $i . ""); $values->setRequired(true); $values->setQuestionObject($this->object); $values->setSingleline(true); $values->setAllowMove(false); if (count($gap->getItemsRaw()) == 0) { $gap->addItem(new assAnswerCloze("", 0, 0)); } $values->setValues($gap->getItemsRaw()); $form->addItem($values); } else { if ($gap->getType() == CLOZE_SELECT) { include_once "./Modules/TestQuestionPool/classes/class.ilAnswerWizardInputGUI.php"; include_once "./Modules/TestQuestionPool/classes/class.assAnswerCloze.php"; $values = new ilAnswerWizardInputGUI($this->lng->txt("values"), "gap_" . $i . ""); $values->setRequired(true); $values->setQuestionObject($this->object); $values->setSingleline(true); $values->setAllowMove(false); if (count($gap->getItemsRaw()) == 0) { $gap->addItem(new assAnswerCloze("", 0, 0)); } $values->setValues($gap->getItemsRaw()); $form->addItem($values); // shuffle $shuffle = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle_" . $i . ""); $shuffle->setValue(1); $shuffle->setChecked($gap->getShuffle()); $shuffle->setRequired(FALSE); $form->addItem($shuffle); } else { if ($gap->getType() == CLOZE_NUMERIC) { if (count($gap->getItemsRaw()) == 0) { $gap->addItem(new assAnswerCloze("", 0, 0)); } foreach ($gap->getItemsRaw() as $item) { // #8944: the js-based ouput in self-assessment cannot support formulas if (!$this->getSelfAssessmentEditingMode()) { $value = new ilFormulaInputGUI($this->lng->txt('value'), "gap_" . $i . "_numeric"); $value->setInlineStyle('text-align: right;'); $lowerbound = new ilFormulaInputGUI($this->lng->txt('range_lower_limit'), "gap_" . $i . "_numeric_lower"); $lowerbound->setInlineStyle('text-align: right;'); $upperbound = new ilFormulaInputGUI($this->lng->txt('range_upper_limit'), "gap_" . $i . "_numeric_upper"); $upperbound->setInlineStyle('text-align: right;'); } else { $value = new ilNumberInputGUI($this->lng->txt('value'), "gap_" . $i . "_numeric"); $value->allowDecimals(true); $lowerbound = new ilNumberInputGUI($this->lng->txt('range_lower_limit'), "gap_" . $i . "_numeric_lower"); $lowerbound->allowDecimals(true); $upperbound = new ilNumberInputGUI($this->lng->txt('range_upper_limit'), "gap_" . $i . "_numeric_upper"); $upperbound->allowDecimals(true); } $value->setSize(10); $value->setValue(ilUtil::prepareFormOutput($item->getAnswertext())); $value->setRequired(true); $form->addItem($value); $lowerbound->setSize(10); $lowerbound->setRequired(true); $lowerbound->setValue(ilUtil::prepareFormOutput($item->getLowerBound())); $form->addItem($lowerbound); $upperbound->setSize(10); $upperbound->setRequired(true); $upperbound->setValue(ilUtil::prepareFormOutput($item->getUpperBound())); $form->addItem($upperbound); $points = new ilNumberInputGUI($this->lng->txt('points'), "gap_" . $i . "_numeric_points"); $points->setSize(3); $points->setRequired(true); $points->setValue(ilUtil::prepareFormOutput($item->getPoints())); $form->addItem($points); } } } } } $form->addCommandButton('createGaps', $this->lng->txt('create_gaps')); $this->addQuestionFormCommandButtons($form); $errors = false; if ($save) { $form->setValuesByPost(); $errors = !$form->checkInput(); $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes if ($errors) { $checkonly = false; } } if (!$checkonly) { $this->tpl->setVariable("QUESTION_DATA", $form->getHTML()); } return $errors; }
/** * Init form. * * @param int $a_mode Edit Mode */ public function initSettingsForm() { global $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // title $title = new ilTextInputGUI($this->txt("title"), "title"); $title->setRequired(true); $this->form->addItem($title); // description $description = new ilTextAreaInputGUI($this->txt("description"), "description"); $description->setCols(39); $description->setRows(4); $this->form->addItem($description); // show submissions $show_submissions = new ilCheckboxInputGUI($this->txt("show_submissions"), "show_submissions"); $show_submissions->setInfo($this->txt("show_submissions_info")); $this->form->addItem($show_submissions); // pass mode $pass_mode = new ilRadioGroupInputGUI($this->txt("pass_mode"), "pass_mode"); $pass_all = new ilRadioOption($this->txt("pass_all"), "all", $this->txt("pass_all_info")); $pass_mode->addOption($pass_all); $pass_min = new ilRadioOption($this->txt("pass_minimum_nr"), "pass_min", $this->txt("pass_minimum_nr_info")); $pass_mode->addOption($pass_min); // minimum number of assignments to pass $min_number = new ilNumberInputGUI($this->txt("min_nr"), "min_number"); $min_number->setSize(4); $min_number->setMaxLength(4); $min_number->setRequired(true); include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignment.php"; $mand = ilEphAssignment::countMandatory($this->object->getId()); $min = max($mand, 1); $min_number->setMinValue($min); $pass_min->addSubItem($min_number); $this->form->addItem($pass_mode); $notification = new ilCheckboxInputGUI($this->txt("submission_notification"), "notification"); $notification->setInfo($this->txt("submission_notification_info")); $this->form->addItem($notification); $copletion_by_submission = new ilCheckboxInputGUI($this->txt('completion_by_submission'), 'completion_by_submission'); $copletion_by_submission->setInfo($this->txt('completion_by_submission_info')); $copletion_by_submission->setValue(1); $this->form->addItem($copletion_by_submission); $processtype = new ilSelectInputGUI($this->txt("processtype"), "processtype"); $processtype->setOptions(array(1 => $this->txt("default"), 2 => $this->txt("reference"), 3 => $this->txt("private"))); $processtype->setInfo($this->txt("processtype_description")); $this->form->addItem($processtype); $this->form->addCommandButton("updateSettings", $this->txt("save")); $this->form->setTitle($this->txt("edit_ephorus_exercise")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
/** * 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 properties form. */ protected function initEditCustomForm(ilPropertyFormGUI $a_form) { $a_form->setTitle($this->lng->txt("exc_edit_exercise")); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('exc_passing_exc')); $a_form->addItem($section); // pass mode $radg = new ilRadioGroupInputGUI($this->lng->txt("exc_pass_mode"), "pass_mode"); $op1 = new ilRadioOption($this->lng->txt("exc_pass_all"), "all", $this->lng->txt("exc_pass_all_info")); $radg->addOption($op1); $op2 = new ilRadioOption($this->lng->txt("exc_pass_minimum_nr"), "nr", $this->lng->txt("exc_pass_minimum_nr_info")); $radg->addOption($op2); // minimum number of assignments to pass $ni = new ilNumberInputGUI($this->lng->txt("exc_min_nr"), "pass_nr"); $ni->setSize(4); $ni->setMaxLength(4); $ni->setRequired(true); include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; $mand = ilExAssignment::countMandatory($this->object->getId()); $min = max($mand, 1); $ni->setMinValue($min, true); $ni->setInfo($this->lng->txt("exc_min_nr_info")); $op2->addSubItem($ni); $a_form->addItem($radg); // completion by submission $subcompl = new ilRadioGroupInputGUI($this->lng->txt("exc_passed_status_determination"), "completion_by_submission"); $op1 = new ilRadioOption($this->lng->txt("exc_completion_by_tutor"), 0, ""); $subcompl->addOption($op1); $op2 = new ilRadioOption($this->lng->txt("exc_completion_by_submission"), 1, $this->lng->txt("exc_completion_by_submission_info")); $subcompl->addOption($op2); $a_form->addItem($subcompl); /*$subcompl = new ilCheckboxInputGUI($this->lng->txt('exc_completion_by_submission'), 'completion_by_submission'); $subcompl->setInfo($this->lng->txt('exc_completion_by_submission_info')); $subcompl->setValue(1); $a_form->addItem($subcompl);*/ $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('exc_publishing')); $a_form->addItem($section); // show submissions $cb = new ilCheckboxInputGUI($this->lng->txt("exc_show_submissions"), "show_submissions"); $cb->setInfo($this->lng->txt("exc_show_submissions_info")); $a_form->addItem($cb); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('exc_notification')); $a_form->addItem($section); // submission notifications $cbox = new ilCheckboxInputGUI($this->lng->txt("exc_submission_notification"), "notification"); $cbox->setInfo($this->lng->txt("exc_submission_notification_info")); $a_form->addItem($cbox); }
/** * Init settings property form * * @access protected */ protected function initFormSettings() { if (is_object($this->form)) { return true; } include_once 'Services/Calendar/classes/class.ilCalendarUtil.php'; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('cal_global_settings')); $this->form->addCommandButton('save', $this->lng->txt('save')); #$this->form->addCommandButton('cancel',$this->lng->txt('cancel')); $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable'); $check->setValue(1); $check->setChecked($this->settings->isEnabled() ? true : false); $this->form->addItem($check); $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz')); $server_tz->setValue(ilTimeZone::_getDefaultTimeZone()); $this->form->addItem($server_tz); $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone'); $select->setOptions(ilCalendarUtil::_getShortTimeZoneList()); $select->setInfo($this->lng->txt('cal_def_timezone_info')); $select->setValue($this->settings->getDefaultTimeZone()); $this->form->addItem($select); $year = date("Y"); $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format'); $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year)); $select->setInfo($this->lng->txt('cal_def_date_format_info')); $select->setValue($this->settings->getDefaultDateFormat()); $this->form->addItem($select); $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format'); $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm')); $select->setInfo($this->lng->txt('cal_def_time_format_info')); $select->setValue($this->settings->getDefaultTimeFormat()); $this->form->addItem($select); // Weekstart $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start'); $radio->setValue($this->settings->getDefaultWeekStart()); $option = new ilRadioOption($this->lng->txt('l_su'), 0); $radio->addOption($option); $option = new ilRadioOption($this->lng->txt('l_mo'), 1); $radio->addOption($option); $this->form->addItem($radio); // Day start $day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst'); $day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())); $day_start->setValue($this->settings->getDefaultDayStart()); $this->form->addItem($day_start); $day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den'); $day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())); $day_end->setValue($this->settings->getDefaultDayEnd()); $this->form->addItem($day_end); $sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal'); $sync->setValue(1); $sync->setChecked($this->settings->isWebCalSyncEnabled()); $sync->setInfo($this->lng->txt('cal_webcal_sync_info')); $sync_min = new ilNumberInputGUI('', 'webcal_hours'); $sync_min->setSize(2); $sync_min->setMaxLength(3); $sync_min->setValue($this->settings->getWebCalSyncHours()); $sync_min->setSuffix($this->lng->txt('hours')); $sync->addSubItem($sync_min); $this->form->addItem($sync); // enable milestone planning in groups $mil = new ilFormSectionHeaderGUI(); $mil->setTitle($this->lng->txt('cal_milestone_settings')); $this->form->addItem($mil); $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones'); $checkm->setValue(1); $checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false); $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc')); $this->form->addItem($checkm); // Consultation hours $con = new ilFormSectionHeaderGUI(); $con->setTitle($this->lng->txt('cal_ch_form_header')); $this->form->addItem($con); $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch'); $ch->setInfo($this->lng->txt('cal_ch_form_info')); $ch->setValue(1); $ch->setChecked($this->settings->areConsultationHoursEnabled()); $this->form->addItem($ch); // repository visibility default $rep = new ilFormSectionHeaderGUI(); $rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos')); $this->form->addItem($rep); $crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs'); $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info')); $crs->setValue(1); $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info')); $crs->setChecked($this->settings->isCourseCalendarEnabled()); $this->form->addItem($crs); $grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp'); $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info')); $grp->setValue(1); $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info')); $grp->setChecked($this->settings->isGroupCalendarEnabled()); $this->form->addItem($grp); // Notifications $not = new ilFormSectionHeaderGUI(); $not->setTitle($this->lng->txt('notifications')); $this->form->addItem($not); $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn'); $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp')); $cgn->setValue(1); $cgn->setChecked($this->settings->isNotificationEnabled()); $cgn->setInfo($this->lng->txt('cal_adm_notification_info')); $this->form->addItem($cgn); $cnu = new ilCheckboxInputGUI('', 'cnu'); $cnu->setOptionTitle($this->lng->txt('cal_notification_users')); $cnu->setValue(1); $cnu->setChecked($this->settings->isUserNotificationEnabled()); $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info')); $this->form->addItem($cnu); // Registration $book = new ilFormSectionHeaderGUI(); $book->setTitle($this->lng->txt('cal_registrations')); $this->form->addItem($book); $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr'); $cgn->setValue(1); $cgn->setChecked($this->settings->isCGRegistrationEnabled()); $cgn->setInfo($this->lng->txt('cal_cg_registration_info')); $this->form->addItem($cgn); // Synchronisation cache $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('cal_cache_settings')); $this->form->addItem($sec); $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache'); $cache->setValue((int) $this->settings->isSynchronisationCacheEnabled()); $cache->setInfo($this->lng->txt('cal_sync_cache_info')); $cache->setRequired(true); $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), 0); $cache->addOption($sync_cache); $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), 1); $cache->addOption($sync_cache); $cache_t = new ilNumberInputGUI('', 'sync_cache_time'); $cache_t->setValue($this->settings->getSynchronisationCacheMinutes()); $cache_t->setMinValue(0); $cache_t->setSize(3); $cache_t->setMaxLength(3); $cache_t->setSuffix($this->lng->txt('form_minutes')); $sync_cache->addSubItem($cache_t); $this->form->addItem($cache); // Calendar cache $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache'); $cache->setValue((int) $this->settings->isCacheUsed()); $cache->setInfo($this->lng->txt('cal_cache_info')); $cache->setRequired(true); $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), 0); $cache->addOption($sync_cache); $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), 1); $cache->addOption($sync_cache); $cache_t = new ilNumberInputGUI('', 'cache_time'); $cache_t->setValue($this->settings->getCacheMinutes()); $cache_t->setMinValue(0); $cache_t->setSize(3); $cache_t->setMaxLength(3); $cache_t->setSuffix($this->lng->txt('form_minutes')); $sync_cache->addSubItem($cache_t); $this->form->addItem($cache); }
/** * Add basic question form properties: * assessment: title, author, description, question, working time * * @return int Default Nr of Tries */ function addBasicQuestionFormProperties($form) { // title $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setValue($this->object->getTitle()); $title->setRequired(TRUE); $form->addItem($title); if (!$this->object->getSelfAssessmentEditingMode()) { // author $author = new ilTextInputGUI($this->lng->txt("author"), "author"); $author->setValue($this->object->getAuthor()); $author->setRequired(TRUE); $form->addItem($author); // description $description = new ilTextInputGUI($this->lng->txt("description"), "comment"); $description->setValue($this->object->getComment()); $description->setRequired(FALSE); $form->addItem($description); } else { // author as hidden field $hi = new ilHiddenInputGUI("author"); $author = ilUtil::prepareFormOutput($this->object->getAuthor()); if (trim($author) == "") { $author = "-"; } $hi->setValue($author); $form->addItem($hi); } // questiontext $question = new ilTextAreaInputGUI($this->lng->txt("question"), "question"); $question->setValue($this->object->prepareTextareaOutput($this->object->getQuestion())); $question->setRequired(TRUE); $question->setRows(10); $question->setCols(80); if (!$this->object->getSelfAssessmentEditingMode()) { if ($this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT) { $question->setUseRte(TRUE); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment")); $question->addPlugin("latex"); $question->addButton("latex"); $question->addButton("pastelatex"); $question->setRTESupport($this->object->getId(), "qpl", "assessment"); } } else { $question->setRteTags(self::getSelfAssessmentTags()); $question->setUseTagsForRteOnly(false); } $form->addItem($question); if (!$this->object->getSelfAssessmentEditingMode()) { // duration $duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated"); $duration->setShowHours(TRUE); $duration->setShowMinutes(TRUE); $duration->setShowSeconds(TRUE); $ewt = $this->object->getEstimatedWorkingTime(); $duration->setHours($ewt["h"]); $duration->setMinutes($ewt["m"]); $duration->setSeconds($ewt["s"]); $duration->setRequired(FALSE); $form->addItem($duration); } else { // number of tries if (strlen($this->object->getNrOfTries())) { $nr_tries = $this->object->getNrOfTries(); } else { $nr_tries = $this->object->getDefaultNrOfTries(); } if ($nr_tries < 1) { $nr_tries = ""; } $ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries"); $ni->setValue($nr_tries); $ni->setMinValue(0); $ni->setSize(5); $ni->setMaxLength(5); $form->addItem($ni); } }
/** * Init form settings */ protected function dInitFormTreeSettings(ilPropertyFormGUI $form = null) { include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php'; include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php'; if ($form instanceof ilPropertyFormGUI) { return $form; } include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php'; $assignment = new ilECSNodeMappingAssignment($this->getServer()->getServerId(), $this->getMid(), (int) $_REQUEST['tid'], 0); include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'dEditTree')); $form->setTitle($this->lng->txt('general_settings')); $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save')); $form->addCommandButton('dTrees', $this->lng->txt('cancel')); $form->setTableWidth('30%'); // CMS id (readonly) include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php'; $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid'); $cmsid->setValue(ilECSCmsData::lookupCmsId(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid']))); $cmsid->setDisabled(true); $cmsid->setSize(7); $cmsid->setMaxLength(12); $form->addItem($cmsid); $mapping_status = ilECSMappingUtils::lookupMappingStatus($this->getServer()->getServerId(), $this->getMid(), (int) $_REQUEST['tid']); $mapping_advanced = $mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false; // Status (readonly) $status = new ilNonEditableValueGUI($this->lng->txt('status'), ''); $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status)); $form->addItem($status); // title update $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title'); $title->setValue(1); $title->setChecked($assignment->isTitleUpdateEnabled()); #$title->setInfo($this->lng->txt('ecs_title_update_info')); $form->addItem($title); $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position'); $position->setDisabled(!$mapping_advanced); $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled()); $position->setValue(1); #$position->setInfo($this->lng->txt('ecs_position_update_info')); $form->addItem($position); $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree'); $tree->setDisabled(!$mapping_advanced); $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled()); $tree->setValue(1); #$tree->setInfo($this->lng->txt('ecs_tree_update_info')); $form->addItem($tree); return $form; }
/** * Initializes the preview settings form. */ private function initPreviewSettingsForm() { global $ilCtrl, $lng; require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitle($lng->txt("settings")); require_once "Services/Preview/classes/class.ilPreviewSettings.php"; // drag and drop file upload in repository $chk_prop = new ilCheckboxInputGUI($lng->txt("enable_preview"), "enable_preview"); $chk_prop->setValue('1'); $chk_prop->setChecked(ilPreviewSettings::isPreviewEnabled()); $chk_prop->setInfo($lng->txt('enable_preview_info')); $form->addItem($chk_prop); $num_prop = new ilNumberInputGUI($lng->txt("max_previews_per_object"), "max_previews_per_object"); $num_prop->setDecimals(0); $num_prop->setMinValue(1); $num_prop->setMinvalueShouldBeGreater(false); $num_prop->setMaxValue(ilPreviewSettings::MAX_PREVIEWS_MAX); $num_prop->setMaxvalueShouldBeLess(false); $num_prop->setMaxLength(5); $num_prop->setSize(10); $num_prop->setValue(ilPreviewSettings::getMaximumPreviews()); $num_prop->setInfo($lng->txt('max_previews_per_object_info')); $form->addItem($num_prop); // command buttons $form->addCommandButton('savePreviewSettings', $lng->txt('save')); $form->addCommandButton('view', $lng->txt('cancel')); return $form; }
public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form) { $orderingtype = $this->getOrderingTypeFromPost(); // Edit mode $hidden = new ilHiddenInputGUI("ordering_type"); $hidden->setValue($orderingtype); $form->addItem($hidden); if (!$this->object->getSelfAssessmentEditingMode()) { $element_height = new ilNumberInputGUI($this->lng->txt("element_height"), "element_height"); $element_height->setValue($this->object->getElementHeight()); $element_height->setRequired(false); $element_height->setMaxLength(6); $element_height->setMinValue(20); $element_height->setSize(6); $element_height->setInfo($this->lng->txt("element_height_info")); $form->addItem($element_height); } if ($orderingtype == OQ_PICTURES) { $geometry = new ilNumberInputGUI($this->lng->txt("thumb_geometry"), "thumb_geometry"); $geometry->setValue($this->object->getThumbGeometry()); $geometry->setRequired(true); $geometry->setMaxLength(6); $geometry->setMinValue(20); $geometry->setSize(6); $geometry->setInfo($this->lng->txt("thumb_geometry_info")); $form->addItem($geometry); } // points $points = new ilNumberInputGUI($this->lng->txt("points"), "points"); $points->allowDecimals(true); $points->setValue($this->object->getPoints()); $points->setRequired(TRUE); $points->setSize(3); $points->setMinValue(0); $points->setMinvalueShouldBeGreater(true); $form->addItem($points); return $form; }
private function initForm() { include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'save')); $this->form->setTitle($this->lng->txt('general_settings')); // Subject prefix $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix'); $pre->setSize(12); $pre->setMaxLength(32); $pre->setInfo($this->lng->txt('mail_subject_prefix_info')); $this->form->addItem($pre); // incoming type include_once 'Services/Mail/classes/class.ilMailOptions.php'; $options = array(IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'), IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')); $si = new ilSelectInputGUI($this->lng->txt('mail_incoming'), 'mail_incoming_mail'); $si->setOptions($options); $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID); $si->setInfo(sprintf($this->lng->txt('mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings'))); $this->ctrl->clearParametersByClass('ilobjuserfoldergui'); $this->form->addItem($si); // noreply address $ti = new ilTextInputGUI($this->lng->txt('mail_external_sender_noreply'), 'mail_external_sender_noreply'); $ti->setInfo($this->lng->txt('info_mail_external_sender_noreply')); $ti->setMaxLength(255); $this->form->addItem($ti); $system_sender_name = new ilTextInputGUI($this->lng->txt('mail_system_sender_name'), 'mail_system_sender_name'); $system_sender_name->setInfo($this->lng->txt('mail_system_sender_name_info')); $system_sender_name->setMaxLength(255); $this->form->addItem($system_sender_name); $cb = new ilCheckboxInputGUI($this->lng->txt('mail_use_pear_mail'), 'pear_mail_enable'); $cb->setInfo($this->lng->txt('mail_use_pear_mail_info')); $cb->setValue(1); $this->form->addItem($cb); // prevent smtp mails $cb = new ilCheckboxInputGUI($this->lng->txt('mail_prevent_smtp_globally'), 'prevent_smtp_globally'); $cb->setValue(1); $this->form->addItem($cb); $cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification'); $cron_options = array(0 => $this->lng->txt('cron_mail_notification_never'), 1 => $this->lng->txt('cron_mail_notification_cron')); $cron_mail->setOptions($cron_options); $cron_mail->setInfo($this->lng->txt('cron_mail_notification_desc')); $this->form->addItem($cron_mail); // section header $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($this->lng->txt('mail') . ' (' . $this->lng->txt('internal_system') . ')'); $this->form->addItem($sh); // max attachment size $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach'); $ti->setSuffix($this->lng->txt('kb')); $ti->setInfo($this->lng->txt('mail_max_size_attachments_total')); $ti->setMaxLength(10); $ti->setSize(10); $this->form->addItem($ti); // Course/Group member notification $mn = new ilFormSectionHeaderGUI(); $mn->setTitle($this->lng->txt('mail_member_notification')); $this->form->addItem($mn); include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php"; ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_MAIL, $this->form, $this); $this->form->addCommandButton('save', $this->lng->txt('save')); }
/** * Init properties (editable) form. */ public function initPropertiesEditableForm() { global $lng, $ilCtrl, $tree, $rbacsystem, $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // localization $options = array("" => $lng->txt("please_select")); $langs = $lng->getInstalledLanguages(); $lng->loadLanguageModule("meta"); foreach ($langs as $l) { $options[$l] = $lng->txt("meta_l_" . $l); } $loc = new ilSelectInputGUI($this->lng->txt("cont_localization"), "localization"); $loc->setOptions($options); $loc->setInfo($this->lng->txt("cont_localization_info")); $this->form->addItem($loc); // glossary $ne = new ilNonEditableValueGUI($lng->txt("obj_glo"), "glossary"); $this->form->addItem($ne); // style $lng->loadLanguageModule("style"); $fixed_style = $ilSetting->get("fixed_content_style_id"); $style_id = $this->object->getStyleSheetId(); if ($fixed_style > 0) { $st = new ilNonEditableValueGUI($lng->txt("cont_current_style")); $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")"); $this->form->addItem($st); } else { $st_styles = ilObjStyleSheet::_getStandardStyles(true, false, $_GET["ref_id"]); $st_styles[0] = $this->lng->txt("default"); ksort($st_styles); if ($style_id > 0) { // individual style if (!ilObjStyleSheet::_lookupStandard($style_id)) { $st = new ilNonEditableValueGUI($lng->txt("cont_current_style")); $st->setValue(ilObject::_lookupTitle($style_id)); $this->form->addItem($st); } } if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) { $style_sel = ilUtil::formSelect($style_id, "style_id", $st_styles, false, true); $style_sel = new ilSelectInputGUI($lng->txt("cont_current_style"), "style_id"); $style_sel->setOptions($st_styles); $style_sel->setValue($style_id); $this->form->addItem($style_sel); } } // number of tries $ni = new ilNumberInputGUI($lng->txt("cont_qtries"), "q_tries"); $ni->setMaxLength(3); $ni->setSize(3); $this->form->addItem($ni); $this->form->addCommandButton("saveProperties", $lng->txt("save")); $this->form->setTitle($lng->txt("cont_scorm_ed_properties")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
private function initLoginSettingsForm() { $this->setSubTabs('settings'); $this->tabs_gui->setTabActive('settings'); $this->tabs_gui->setSubTabActive('loginname_settings'); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->loginSettingsForm = new ilPropertyFormGUI(); $this->loginSettingsForm->setFormAction($this->ctrl->getFormAction($this, 'saveLoginnameSettings')); $this->loginSettingsForm->setTitle($this->lng->txt('loginname_settings')); $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname'); $chbChangeLogin->setValue(1); $this->loginSettingsForm->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->loginSettingsForm->addCommandButton('saveLoginnameSettings', $this->lng->txt('save')); }
/** * Init Settings Form */ function initSettingsForm() { global $tpl, $lng, $ilCtrl; $lng->loadLanguageModule("mcst"); include "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setTitle($lng->txt("mcst_settings")); // Title $tit = new ilTextInputGUI($lng->txt("title"), "title"); $tit->setValue($this->object->getTitle()); $tit->setRequired(true); $this->form_gui->addItem($tit); // description $des = new ilTextAreaInputGUI($lng->txt("description"), "description"); $des->setValue($this->object->getLongDescription()); $this->form_gui->addItem($des); // Online $online = new ilCheckboxInputGUI($lng->txt("online"), "online"); $online->setChecked($this->object->getOnline()); $this->form_gui->addItem($online); // Sorting $sort = new ilRadioGroupInputGUI($lng->txt("mcst_ordering"), "order"); $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_title"), ilObjMediaCast::ORDER_TITLE)); $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_asc"), ilObjMediaCast::ORDER_CREATION_DATE_ASC)); $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_desc"), ilObjMediaCast::ORDER_CREATION_DATE_DESC)); $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_manual"), ilObjMediaCast::ORDER_MANUAL)); $sort->setValue($this->object->getOrder()); $this->form_gui->addItem($sort); // view mode $options = array(ilObjMediaCast::VIEW_LIST => $lng->txt("mcst_list"), ilObjMediaCast::VIEW_GALLERY => $lng->txt("mcst_gallery")); $si = new ilSelectInputGUI($this->lng->txt("mcst_viewmode"), "viewmode"); $si->setOptions($options); $si->setValue($this->object->getViewMode()); $this->form_gui->addItem($si); // Downloadable $downloadable = new ilCheckboxInputGUI($lng->txt("mcst_downloadable"), "downloadable"); $downloadable->setChecked($this->object->getDownloadable()); $downloadable->setInfo($lng->txt("mcst_downloadable_info")); $this->form_gui->addItem($downloadable); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); //Default Visibility if ($enable_internal_rss) { $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "defaultaccess"); $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "0"); $radio_group->addOption($radio_option); $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "1"); $radio_group->addOption($radio_option); $radio_group->setInfo($lng->txt("news_news_item_visibility_info")); $radio_group->setRequired(false); $radio_group->setValue($this->object->getDefaultAccess()); #$ch->addSubItem($radio_group); $this->form_gui->addItem($radio_group); //Extra Feed include_once "./Services/Block/classes/class.ilBlockSetting.php"; $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId()); $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "extra_feed"); $ch->setInfo($lng->txt("news_public_feed_info")); $ch->setChecked($public_feed); $this->form_gui->addItem($ch); // keep minimal x number of items $ni = new ilNumberInputGUI($this->lng->txt("news_keep_minimal_x_items"), "keep_rss_min"); $ni->setMaxValue(100); $ni->setMinValue(0); $ni->setMaxLength(3); $ni->setSize(3); $ni->setInfo($this->lng->txt("news_keep_minimal_x_items_info") . " (" . ilNewsItem::_lookupRSSPeriod() . " " . (ilNewsItem::_lookupRSSPeriod() == 1 ? $lng->txt("day") : $lng->txt("days")) . ")"); $ni->setValue((int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $this->object->getId())); $ch->addSubItem($ni); // Include Files in Pubic Items $incl_files = new ilCheckboxInputGUI($lng->txt("mcst_incl_files_in_rss"), "public_files"); $incl_files->setChecked($this->object->getPublicFiles()); $incl_files->setInfo($lng->txt("mcst_incl_files_in_rss_info")); #$ch->addSubItem($incl_files); $this->form_gui->addItem($incl_files); } // Form action and save button $this->form_gui->addCommandButton("saveSettings", $lng->txt("save")); $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings")); }
/** * Creates an output of the edit form for the question * * @access public */ function editQuestion($checkonly = FALSE) { $save = $this->isSaveCommand(); $this->getQuestionTemplate(); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $orderingtype = array_key_exists('ordering_type', $_POST) ? $_POST['ordering_type'] : $this->object->getOrderingType(); if (strcmp($this->ctrl->getCmd(), 'changeToText') == 0) { $orderingtype = OQ_TERMS; } if (strcmp($this->ctrl->getCmd(), 'changeToPictures') == 0) { $orderingtype = OQ_PICTURES; } $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->outQuestionType()); $form->setMultipart($orderingtype == OQ_PICTURES ? TRUE : FALSE); $form->setTableWidth("100%"); $form->setId("ordering"); // Edit mode $hidden = new ilHiddenInputGUI("ordering_type"); $hidden->setValue($orderingtype); $form->addItem($hidden); // title, author, description, question, working time (assessment mode) $this->addBasicQuestionFormProperties($form); if (!$this->getSelfAssessmentEditingMode()) { $element_height = new ilNumberInputGUI($this->lng->txt("element_height"), "element_height"); $element_height->setValue($this->object->getElementHeight()); $element_height->setRequired(false); $element_height->setMaxLength(6); $element_height->setMinValue(20); $element_height->setSize(6); $element_height->setInfo($this->lng->txt("element_height_info")); $form->addItem($element_height); } if ($orderingtype == OQ_PICTURES) { $geometry = new ilNumberInputGUI($this->lng->txt("thumb_geometry"), "thumb_geometry"); $geometry->setValue($this->object->getThumbGeometry()); $geometry->setRequired(true); $geometry->setMaxLength(6); $geometry->setMinValue(20); $geometry->setSize(6); $geometry->setInfo($this->lng->txt("thumb_geometry_info")); $form->addItem($geometry); } if (count($this->object->getAnswers()) == 0) { $this->object->addAnswer(); } // Answers if ($orderingtype == OQ_PICTURES) { include_once "./Modules/TestQuestionPool/classes/class.ilImageWizardInputGUI.php"; $answers = new ilImageWizardInputGUI($this->lng->txt("answers"), "answers"); $answers->setRequired(TRUE); $answers->setQuestionObject($this->object); $answers->setInfo($this->lng->txt('ordering_answer_sequence_info')); $answers->setAllowMove(TRUE); $answervalues = array(); foreach ($this->object->getAnswers() as $index => $answervalue) { $answervalues[$index] = $answervalue->getAnswertext(); } $answers->setValues($answervalues); $form->addItem($answers); } else { $answers = new ilTextWizardInputGUI($this->lng->txt("answers"), "answers"); $answers->setRequired(TRUE); $answers->setInfo($this->lng->txt('ordering_answer_sequence_info')); $answers->setAllowMove(TRUE); $answervalues = array(); foreach ($this->object->getAnswers() as $index => $answervalue) { $answervalues[$index] = $answervalue->getAnswertext(); } ksort($answervalues); $answers->setValues($answervalues); $form->addItem($answers); } // points $points = new ilNumberInputGUI($this->lng->txt("points"), "points"); $points->setValue($this->object->getPoints()); $points->setRequired(TRUE); $points->setSize(3); $points->setMinValue(0); $points->setMinvalueShouldBeGreater(true); $form->addItem($points); if (true || !$this->getSelfAssessmentEditingMode()) { if ($orderingtype == OQ_PICTURES) { $form->addCommandButton("changeToText", $this->lng->txt("order_terms")); } else { $form->addCommandButton("changeToPictures", $this->lng->txt("order_pictures")); } } $this->addQuestionFormCommandButtons($form); $errors = false; if ($save) { $form->setValuesByPost(); $errors = !$form->checkInput(); $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes if ($errors) { $checkonly = false; } } if (!$checkonly) { $this->tpl->setVariable("QUESTION_DATA", $form->getHTML()); } return $errors; }
/** * Build property form * @param string $a_mode * @param int $id * @return object */ function initForm($a_mode = "create", $id = NULL) { global $lng, $ilCtrl, $ilObjDataCache; 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); $desc = new ilTextAreaInputGUI($lng->txt("description"), "desc"); $desc->setCols(70); $desc->setRows(15); $form_gui->addItem($desc); $file = new ilFileInputGUI($lng->txt("book_additional_info_file"), "file"); $file->setALlowDeletion(true); $form_gui->addItem($file); $nr = new ilNumberInputGUI($lng->txt("booking_nr_of_items"), "items"); $nr->setRequired(true); $nr->setSize(3); $nr->setMaxLength(3); $form_gui->addItem($nr); if ($this->pool_has_schedule) { $options = array(); include_once 'Modules/BookingManager/classes/class.ilBookingSchedule.php'; foreach (ilBookingSchedule::getList($ilObjDataCache->lookupObjId($this->ref_id)) as $schedule) { $options[$schedule["booking_schedule_id"]] = $schedule["title"]; } $schedule = new ilSelectInputGUI($lng->txt("book_schedule"), "schedule"); $schedule->setRequired(true); $schedule->setOptions($options); $form_gui->addItem($schedule); } $post = new ilFormSectionHeaderGUI(); $post->setTitle($lng->txt("book_post_booking_information")); $form_gui->addItem($post); $pdesc = new ilTextAreaInputGUI($lng->txt("book_post_booking_text"), "post_text"); $pdesc->setCols(70); $pdesc->setRows(15); $form_gui->addItem($pdesc); $pfile = new ilFileInputGUI($lng->txt("book_post_booking_file"), "post_file"); $pfile->setALlowDeletion(true); $form_gui->addItem($pfile); if ($a_mode == "edit") { $form_gui->setTitle($lng->txt("book_edit_object")); $item = new ilHiddenInputGUI('object_id'); $item->setValue($id); $form_gui->addItem($item); include_once 'Modules/BookingManager/classes/class.ilBookingObject.php'; $obj = new ilBookingObject($id); $title->setValue($obj->getTitle()); $desc->setValue($obj->getDescription()); $nr->setValue($obj->getNrOfItems()); $pdesc->setValue($obj->getPostText()); $file->setValue($obj->getFile()); $pfile->setValue($obj->getPostFile()); if (isset($schedule)) { $schedule->setValue($obj->getScheduleId()); } $form_gui->addCommandButton("update", $lng->txt("save")); } else { $form_gui->setTitle($lng->txt("book_add_object")); $form_gui->addCommandButton("save", $lng->txt("save")); $form_gui->addCommandButton("render", $lng->txt("cancel")); } $form_gui->setFormAction($ilCtrl->getFormAction($this)); return $form_gui; }
public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form) { // points $points = new ilNumberInputGUI($this->lng->txt("points"), "points"); $points->setValue($this->object->getPoints()); $points->setRequired(TRUE); $points->setSize(3); $points->setMinValue(0.0); $form->addItem($points); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("applet_attributes")); $form->addItem($header); // java applet $javaapplet = $this->object->getJavaAppletFilename(); $applet = new ilFileInputGUI($this->lng->txt('javaapplet'), 'javaappletName'); $applet->setSuffixes(array('jar', 'class')); $applet->setRequired(false); if (strlen($javaapplet)) { $filename = new ilNonEditableValueGUI($this->lng->txt('filename'), 'uploaded_javaapplet'); $filename->setValue($javaapplet); $applet->addSubItem($filename); $delete = new ilCheckboxInputGUI('', 'delete_applet'); $delete->setOptionTitle($this->lng->txt('delete')); $delete->setValue(1); $applet->addSubItem($delete); } $form->addItem($applet); // Code $code = new ilTextInputGUI($this->lng->txt("code"), "java_code"); $code->setValue($this->object->getJavaCode()); $code->setRequired(TRUE); $form->addItem($code); if (!strlen($javaapplet)) { // Archive $archive = new ilTextInputGUI($this->lng->txt("archive"), "java_archive"); $archive->setValue($this->object->getJavaArchive()); $archive->setRequired(false); $form->addItem($archive); // Codebase $codebase = new ilTextInputGUI($this->lng->txt("codebase"), "java_codebase"); $codebase->setValue($this->object->getJavaCodebase()); $codebase->setRequired(false); $form->addItem($codebase); } // Width $width = new ilNumberInputGUI($this->lng->txt("width"), "java_width"); $width->setDecimals(0); $width->setSize(6); $width->setMinValue(50); $width->setMaxLength(6); $width->setValue($this->object->getJavaWidth()); $width->setRequired(TRUE); $form->addItem($width); // Height $height = new ilNumberInputGUI($this->lng->txt("height"), "java_height"); $height->setDecimals(0); $height->setSize(6); $height->setMinValue(50); $height->setMaxLength(6); $height->setValue($this->object->getJavaHeight()); $height->setRequired(TRUE); $form->addItem($height); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("applet_parameters")); $form->addItem($header); include_once "./Modules/TestQuestionPool/classes/class.ilKVPWizardInputGUI.php"; $kvp = new ilKVPWizardInputGUI($this->lng->txt("applet_parameters"), "kvp"); $values = array(); for ($i = 0; $i < $this->object->getParameterCount(); $i++) { $param = $this->object->getParameter($i); array_push($values, array($param['name'], $param['value'])); } if (count($values) == 0) { array_push($values, array("", "")); } $kvp->setKeyName($this->lng->txt('name')); $kvp->setValueName($this->lng->txt('value')); $kvp->setValues($values); $form->addItem($kvp); }
/** * Show lucene settings form * @param * @return */ protected function initFormLuceneSettings() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Search/classes/class.ilSearchSettings.php'; $this->settings = ilSearchSettings::getInstance(); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel')); $this->form->setTitle($this->lng->txt('lucene_settings_title')); $this->form->addCommandButton('saveLuceneSettings', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); // Offline filter /* $offline = new ilCheckboxInputGUI($this->lng->txt('lucene_offline_filter_setting'),'offline_filter'); $offline->setInfo($this->lng->txt('lucene_offline_filter_setting_info')); $offline->setValue(1); $offline->setChecked($this->settings->isLuceneOfflineFilterEnabled()); $this->form->addItem($offline); */ // user search $us = new ilCheckboxInputGUI($this->lng->txt('search_user_search_form'), 'user_search_enabled'); $us->setInfo($this->lng->txt('search_user_search_info_form')); $us->setValue(1); $us->setChecked($this->settings->isLuceneUserSearchEnabled()); $this->form->addItem($us); // Item filter $if = new ilCheckboxInputGUI($this->lng->txt('search_mime_filter_form'), 'mime_enabled'); $if->setValue(1); $if->setChecked($this->settings->isLuceneMimeFilterEnabled()); $if->setInfo($this->lng->txt('search_item_filter_form_info')); $this->form->addItem($if); $mimes = $this->settings->getLuceneMimeFilter(); foreach (ilSearchSettings::getLuceneMimeFilterDefinitions() as $mime => $def) { $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']), 'mime[' . $mime . ']'); if (isset($mimes[$mime]) and $mimes[$mime]) { $ch->setChecked(true); } $ch->setValue(1); $if->addSubItem($ch); } $prefix = new ilCheckboxInputGUI($this->lng->txt('lucene_prefix_wildcard'), 'prefix'); $prefix->setValue(1); $prefix->setInfo($this->lng->txt('lucene_prefix_wildcard_info')); $prefix->setChecked($this->settings->isPrefixWildcardQueryEnabled()); $this->form->addItem($prefix); $numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'), 'fragmentCount'); $numFrag->setRequired(true); $numFrag->setSize(2); $numFrag->setMaxLength(2); $numFrag->setMinValue(1); $numFrag->setMaxValue(10); $numFrag->setInfo($this->lng->txt('lucene_num_frag_info')); $numFrag->setValue($this->settings->getFragmentCount()); $this->form->addItem($numFrag); $sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'), 'fragmentSize'); $sizeFrag->setRequired(true); $sizeFrag->setSize(2); $sizeFrag->setMaxLength(4); $sizeFrag->setMinValue(10); $sizeFrag->setMaxValue(1000); $sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info')); $sizeFrag->setValue($this->settings->getFragmentSize()); $this->form->addItem($sizeFrag); $maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'), 'maxSubitems'); $maxSub->setRequired(true); $maxSub->setSize(2); $maxSub->setMaxLength(2); $maxSub->setMinValue(1); $maxSub->setMaxValue(10); $maxSub->setInfo($this->lng->txt('lucene_max_sub_info')); $maxSub->setValue($this->settings->getMaxSubitems()); $this->form->addItem($maxSub); $relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'), 'relevance'); $relevance->setOptionTitle($this->lng->txt('lucene_show_relevance')); $relevance->setInfo($this->lng->txt('lucene_show_relevance_info')); $relevance->setValue(1); $relevance->setChecked($this->settings->isRelevanceVisible()); $this->form->addItem($relevance); // begin-patch mime_filter $subrel = new ilCheckboxInputGUI('', 'subrelevance'); $subrel->setOptionTitle($this->lng->txt('lucene_show_sub_relevance')); $subrel->setValue(1); $subrel->setChecked($this->settings->isSubRelevanceVisible()); $relevance->addSubItem($subrel); // end-patch mime_filter $last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'), 'last_index'); $last_index->setShowTime(true); $last_index->setDate($this->settings->getLastIndexTime()); $last_index->setInfo($this->lng->txt('lucene_last_index_time_info')); $this->form->addItem($last_index); return true; }
/** * 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 table template generation form */ function initTemplateGenerationForm() { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setTitle($lng->txt("sty_generate_template")); // name $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name"); $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*\$/"); $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9"); $name_input->setRequired(true); $name_input->setSize(30); $name_input->setMaxLength(30); $this->form_gui->addItem($name_input); // basic layout $bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout"); $options = array("coloredZebra" => $lng->txt("sty_table_template_colored_zebra"), "bwZebra" => $lng->txt("sty_table_template_bw_zebra"), "noZebra" => $lng->txt("sty_table_template_no_zebra")); $bl_input->setOptions($options); $this->form_gui->addItem($bl_input); // top bottom padding include_once "./Services/Style/classes/class.ilNumericStyleValueInputGUI.php"; $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding"); $num_input->setAllowPercentage(false); $num_input->setValue("3px"); $this->form_gui->addItem($num_input); // left right padding $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding"); $num_input->setAllowPercentage(false); $num_input->setValue("10px"); $this->form_gui->addItem($num_input); // base color $bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color"); $cs = $this->object->getColors(); $options = array(); foreach ($cs as $c) { $options[$c["name"]] = $c["name"]; } $bc_input->setOptions($options); $this->form_gui->addItem($bc_input); // Lightness Settings $lss = array("border" => 90, "header_text" => 70, "header_bg" => 0, "cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75); foreach ($lss as $ls => $v) { $l_input = new ilNumberInputGUI($lng->txt("sty_lightness_" . $ls), "lightness_" . $ls); $l_input->setMaxValue(100); $l_input->setMinValue(-100); $l_input->setValue($v); $l_input->setSize(4); $l_input->setMaxLength(4); $this->form_gui->addItem($l_input); } $this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate")); $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel")); $this->form_gui->setFormAction($ilCtrl->getFormAction($this)); }