本文整理汇总了PHP中ilNumberInputGUI::setMaxLength方法的典型用法代码示例。如果您正苦于以下问题:PHP ilNumberInputGUI::setMaxLength方法的具体用法?PHP ilNumberInputGUI::setMaxLength怎么用?PHP ilNumberInputGUI::setMaxLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilNumberInputGUI
的用法示例。
在下文中一共展示了ilNumberInputGUI::setMaxLength方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initLicenseForm
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;
}
示例2: initForm
/**
* 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));
}
示例3: initAddCodesForm
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'));
}
示例4: initFormSettings
/**
* 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;
}
示例5: addCustomSettingsToForm
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);
}
示例6: initFormSettings
/**
* 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;
}
示例7: initPluginSettings
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);
}
}
示例8: addToForm
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);
}
示例9: initJavaServerForm
/**
* 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));
}
示例10: editSettings
/**
* 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);
//.........这里部分代码省略.........
示例11: initFormRoleAssignments
/**
* 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);
//.........这里部分代码省略.........
示例12: editQuestion
/**
* 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));
}
//.........这里部分代码省略.........
示例13: initSettingsForm
/**
* 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));
}
示例14: initForm
/**
* 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"));
}
//.........这里部分代码省略.........
示例15: initEditCustomForm
/**
* 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);
}