本文整理汇总了PHP中ilTextInputGUI::setMaxLength方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextInputGUI::setMaxLength方法的具体用法?PHP ilTextInputGUI::setMaxLength怎么用?PHP ilTextInputGUI::setMaxLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTextInputGUI
的用法示例。
在下文中一共展示了ilTextInputGUI::setMaxLength方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToForm
public function addToForm()
{
$def = $this->getADT()->getCopyOfDefinition();
if (!$this->isMulti()) {
$text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
if ($def->getMaxLength()) {
$max = $def->getMaxLength();
$size = $text->getSize();
$text->setMaxLength($max);
if ($size && $max < $size) {
$text->setSize($max);
}
}
} else {
$text = new ilTextAreaInputGUI($this->getTitle(), $this->getElementId());
if ($this->multi_rows) {
$text->setRows($this->multi_rows);
}
if ($this->multi_cols) {
$text->setCols($this->multi_cols);
}
}
$this->addBasicFieldProperties($text, $def);
$text->setValue($this->getADT()->getText());
$this->addToParentElement($text);
}
示例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: addToForm
public function addToForm()
{
$text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
$text->setSize(20);
$text->setMaxLength(512);
$text->setSubmitFormOnEnter(true);
$text->setValue($this->getADT()->getText());
$this->addToParentElement($text);
}
示例4: initConfigurationForm
/**
* Init configuration form.
*
* @return object form object
*/
public function initConfigurationForm()
{
global $lng, $ilCtrl, $ilDB;
$pl = $this->getPluginObject();
$this->getPluginObject()->includeClass('class.ilOpenmeetingsConfig.php');
$this->object = ilOpenmeetingsConfig::getInstance();
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$this->form->setTitle($pl->txt("openmeetings_plugin_configuration"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
$this->form->addCommandButton("save", $lng->txt("save"));
// url (text)
$ti = new ilTextInputGUI($pl->txt("url"), "frmurl");
$ti->setRequired(true);
$ti->setMaxLength(256);
$ti->setSize(60);
$this->form->addItem($ti);
// port (text)
$ti = new ilTextInputGUI($pl->txt("port"), "frmport");
$ti->setRequired(true);
$ti->setMaxLength(10);
$ti->setSize(10);
$this->form->addItem($ti);
// appname
$ti = new ilTextInputGUI($pl->txt("appname"), "frmappname");
$ti->setRequired(true);
$ti->setMaxLength(32);
$ti->setSize(20);
$this->form->addItem($ti);
// username (text)
$ti = new ilTextInputGUI($pl->txt("username"), "frmusername");
$ti->setRequired(true);
$ti->setMaxLength(256);
$ti->setSize(20);
$this->form->addItem($ti);
// password (text)
$ti = new ilPasswordInputGUI($pl->txt("password"), "frmpassword");
$ti->setRequired(true);
$ti->setMaxLength(256);
$ti->setSize(20);
$ti->setRetype(false);
$this->form->addItem($ti);
foreach ($this->fields as $key => $item) {
$field = new $item["type"]($this->plugin_object->txt('conf_' . $key), $key);
$field->setInfo($this->plugin_object->txt($item["info"]));
if (is_array($item["subelements"])) {
foreach ($item["subelements"] as $subkey => $subitem) {
$subfield = new $subitem["type"]($this->plugin_object->txt('conf_' . $key . "_" . $subkey), $subkey);
$subfield->setInfo($this->plugin_object->txt($subitem["info"]));
$field->addSubItem($subfield);
}
}
$this->form->addItem($field);
}
return $this->form;
}
示例5: initFilter
/**
* Init filter
*/
function initFilter()
{
global $lng, $rbacreview, $ilUser;
// title
include_once "./Services/Form/classes/class.ilTextInputGUI.php";
$ti = new ilTextInputGUI($lng->txt("title"), "title");
$ti->setMaxLength(64);
$ti->setSize(20);
$ti->setValidationRegexp('/^[^%]+$/is');
$this->addFilterItem($ti);
$ti->readFromSession();
$this->filter["title"] = $ti->getValue();
}
示例6: _initForm
/**
* Init Social Bookmark edit/create Form
*
* @param ilObjectGUI $formhandlerObject taken as form target
* @param int $mode "create" / "edit"
*/
public static function _initForm($formhandlerObject, $mode = "create", $id = 0)
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setMultipart(true);
// File Title
$in_title = new ilTextInputGUI($lng->txt("title"), "title");
$in_title->setMaxLength(128);
$in_title->setSize(40);
$in_title->setRequired(true);
$form->addItem($in_title);
// Link
$in_link = new ilTextInputGUI($lng->txt("link"), "link");
$in_link->setMaxLength(300);
$in_link->setSize(40);
$in_link->setRequired(true);
$in_link->setInfo($lng->txt('socialbm_link_description'));
$form->addItem($in_link);
// File
$in_file = new ilFileInputGUI($lng->txt("file"), "image_file");
$in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png'));
$form->addItem($in_file);
// Activate on submit
$in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate");
$in_activate->setValue('1');
$form->addItem($in_activate);
// save and cancel commands
if ($mode == "create") {
$form->addCommandButton("createSocialBookmark", $lng->txt("create"));
$form->addCommandButton("editSocialBookmarks", $lng->txt("cancel"));
$form->setTitle($lng->txt("adm_social_bm_create"));
$in_file->setRequired(true);
} else {
if ($mode == "update") {
$in_hidden = new ilHiddenInputGUI("sbm_id", $id);
$form->addItem($in_hidden);
$form->addCommandButton("updateSocialBookmark", $lng->txt("update"));
$form->addCommandButton("cancel", $lng->txt("cancel"));
$form->setTitle($lng->txt("adm_social_bm_edit"));
$in_file->setRequired(false);
}
}
$form->setTableWidth("60%");
$form->setFormAction($ilCtrl->getFormAction($formhandlerObject));
return $form;
}
示例7: initConfigurationForm
/**
* Init configuration form.
*
* @return object form object
*/
public function initConfigurationForm()
{
global $lng, $ilCtrl;
$pl = $this->getPluginObject();
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
// setting 1 (a checkbox)
$cb = new ilCheckboxInputGUI($pl->txt("setting_1"), "setting_1");
$form->addItem($cb);
// setting 2 (text)
$ti = new ilTextInputGUI($pl->txt("setting_2"), "setting_2");
$ti->setRequired(true);
$ti->setMaxLength(10);
$ti->setSize(10);
$form->addItem($ti);
$form->addCommandButton("save", $lng->txt("save"));
$form->setTitle($pl->txt("example_plugin_configuration"));
$form->setFormAction($ilCtrl->getFormAction($this));
return $form;
}
示例8: initFilter
/**
* Init filter
*/
public function initFilter()
{
global $lng;
$this->setDisableFilterHiding(true);
// object type selection
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
$si = new ilSelectInputGUI($lng->txt("obj_type"), "type");
$si->setOptions($this->getPossibleTypes(true, false, true));
$this->addFilterItem($si);
$si->readFromSession();
if (!$si->getValue()) {
$si->setValue("crs");
}
$this->filter["type"] = $si->getValue();
// title/description
include_once "./Services/Form/classes/class.ilTextInputGUI.php";
$ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
$ti->setMaxLength(64);
$ti->setSize(20);
$this->addFilterItem($ti);
$ti->readFromSession();
$this->filter["query"] = $ti->getValue();
// read_count/spent_seconds
$si = new ilSelectInputGUI($lng->txt("trac_figure"), "figure");
$si->setOptions(array("read_count" => $lng->txt("trac_read_count"), "spent_seconds" => $lng->txt("trac_spent_seconds")));
$this->addFilterItem($si);
$si->readFromSession();
if (!$si->getValue()) {
$si->setValue("read_count");
}
$this->filter["measure"] = $si->getValue();
// year/month
$si = new ilSelectInputGUI($lng->txt("year") . " / " . $lng->txt("month"), "yearmonth");
$si->setOptions($this->getMonthsFilter());
$this->addFilterItem($si);
$si->readFromSession();
if (!$si->getValue()) {
$si->setValue(date("Y-m"));
}
$this->filter["yearmonth"] = $si->getValue();
}
示例9: initForm
/**
* get html
*
* @access public
* @param
* @return
*/
public function initForm()
{
$rec = new ilSelectInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
$rec->setRequired(true);
$rec->setOptions(array(0 => $this->lng->txt('cal_no_recurrence'), ilCalendarRecurrence::FREQ_DAILY => $this->lng->txt('cal_rec_daily'), ilCalendarRecurrence::FREQ_WEEKLY => $this->lng->txt('cal_rec_weekly'), ilCalendarRecurrence::FREQ_MONTHLY => $this->lng->txt('cal_rec_monthly'), ilCalendarRecurrence::FREQ_YEARLY => $this->lng->txt('cal_rec_yearly')));
$rec->setValue($this->recurrence->getFrequenceType());
$this->form->addItem($rec);
// DAILY part
$interval = new ilTextInputGUI($this->lng->txt('interval'), 'interval');
$interval->setSize(2);
$interval->setMaxLength(3);
$interval->setValue($this->recurrence->getInterval() ? $this->recurrence->getInterval() : 1);
$interval->setInfo($this->lng->txt('interval_info'));
$rec->addSubItem($interval);
// Weekly
$check = new ilCheckboxInputGUI($this->lng->txt('Su_short'), 'w_day[0]');
$check->setChecked(true);
$rec->addSubItem($check);
$check = new ilCheckboxInputGUI($this->lng->txt('Mo_short'), 'w_day[1]');
$check->setChecked(true);
$rec->addSubItem($check);
$check = new ilCheckboxInputGUI($this->lng->txt('Tu_short'), 'w_day[2]');
$check->setChecked(true);
$rec->addSubItem($check);
$check = new ilCheckboxInputGUI($this->lng->txt('We_short'), 'w_day[3]');
$check->setChecked(true);
$rec->addSubItem($check);
$check = new ilCheckboxInputGUI($this->lng->txt('Th_short'), 'w_day[4]');
$check->setChecked(true);
$rec->addSubItem($check);
$check = new ilCheckboxInputGUI($this->lng->txt('Fr_short'), 'w_day[5]');
$check->setChecked(true);
$rec->addSubItem($check);
$check = new ilCheckboxInputGUI($this->lng->txt('Sa_short'), 'w_day[6]');
$check->setChecked(true);
$rec->addSubItem($check);
}
示例10: initFilter
/**
* Init filter
*/
function initFilter()
{
global $lng, $rbacreview, $ilUser, $ilDB;
// term
include_once "./Services/Form/classes/class.ilTextInputGUI.php";
$ti = new ilTextInputGUI($lng->txt("cont_term"), "term");
$ti->setMaxLength(64);
$ti->setSize(20);
$ti->setSubmitFormOnEnter(true);
$this->addFilterItem($ti);
$ti->readFromSession();
$this->filter["term"] = $ti->getValue();
// definition
if ($ilDB->getDBType() != "oracle") {
include_once "./Services/Form/classes/class.ilTextInputGUI.php";
$ti = new ilTextInputGUI($lng->txt("cont_definition"), "defintion");
$ti->setMaxLength(64);
$ti->setSize(20);
$ti->setSubmitFormOnEnter(true);
$this->addFilterItem($ti);
$ti->readFromSession();
$this->filter["definition"] = $ti->getValue();
}
}
示例11: showTopicForm
public function showTopicForm()
{
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
if ($this->objCurrentTopic->getId()) {
$this->ctrl->setParameter($this, 'topic_id', $this->objCurrentTopic->getId());
}
$form->setFormAction($this->ctrl->getFormAction($this, 'saveTopic'));
$form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ? 'edit_topic' : 'new_topic'));
$title = new ilTextInputGUI($this->lng->txt('title'), 'title');
$title->setValue($this->objCurrentTopic->getTitle());
$title->setRequired(true);
$form->addItem($title);
$sorting = new ilTextInputGUI($this->lng->txt('pay_sorting_value'), 'sorting');
$sorting->setValue($this->objCurrentTopic->getSorting());
$sorting->setMaxLength(11);
$sorting->setSize(11);
$form->addItem($sorting);
$form->addCommandButton('saveTopic', $this->lng->txt('save'));
$form->addCommandButton('showTopicsList', $this->lng->txt('cancel'));
$this->tpl->setVariable('FORM', $form->getHTML());
return true;
}
示例12: initVatForm
private function initVatForm($a_type = 'create')
{
$this->form = new ilPropertyFormGUI();
if ($a_type == 'edit') {
$this->ctrl->setParameter($this, 'vat_id', $_GET['vat_id']);
$this->form->setFormAction($this->ctrl->getFormAction($this, 'updateVat'));
$this->form->setTitle($this->lng->txt('payment_edit_vat'));
} else {
$this->form->setFormAction($this->ctrl->getFormAction($this, 'saveVat'));
$this->form->setTitle($this->lng->txt('payment_add_vat'));
}
$oTitle = new ilTextInputGUI($this->lng->txt('title'), 'vat_title');
$oTitle->setMaxLength(255);
$oTitle->setSize(40);
$oTitle->setRequired(true);
$oTitle->setInfo($this->lng->txt('payment_vat_title_info'));
$this->form->addItem($oTitle);
$oRate = new ilTextInputGUI($this->lng->txt('vat_rate'), 'vat_rate');
$oRate->setMaxLength(5);
$oRate->setSize(5);
$oRate->setRequired(true);
$oRate->setInfo($this->lng->txt('payment_vat_rate_info'));
$this->form->addItem($oRate);
if ($a_type == 'edit') {
$this->form->addCommandButton('updateVat', $this->lng->txt('save'));
} else {
$this->form->addCommandButton('saveVat', $this->lng->txt('save'));
}
$this->form->addCommandButton('vats', $this->lng->txt('cancel'));
}
示例13: initFormSearch
public function initFormSearch()
{
global $ilCtrl;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this, 'search'));
$this->form->setTitle($this->getTitle());
$this->form->addCommandButton('performSearch', $this->lng->txt('search'));
$this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
$kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for');
$kind->setValue($this->search_type);
$this->form->addItem($kind);
// Users
$users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr');
// UDF
include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
foreach (ilUserSearchOptions::_getSearchableFieldsInfo(!$this->isSearchableCheckEnabled()) as $info) {
switch ($info['type']) {
case FIELD_TYPE_UDF_SELECT:
case FIELD_TYPE_SELECT:
$sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
$sel->setOptions($info['values']);
$users->addSubItem($sel);
break;
case FIELD_TYPE_UDF_TEXT:
case FIELD_TYPE_TEXT:
if (isset($info['autoComplete']) and $info['autoComplete']) {
$ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']);
$ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
$ul->setDataSource($ilCtrl->getLinkTarget($this, "doUserAutoComplete", "", true));
$ul->setSize(30);
$ul->setMaxLength(120);
$users->addSubItem($ul);
} else {
$txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
$txt->setSize(30);
$txt->setMaxLength(120);
$users->addSubItem($txt);
}
break;
}
}
$kind->addOption($users);
// Role
$roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role');
$role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]');
$role->setSize(30);
$role->setMaxLength(120);
$roles->addSubItem($role);
$kind->addOption($roles);
// Course
$groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs');
$group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]');
$group->setSize(30);
$group->setMaxLength(120);
$groups->addSubItem($group);
$kind->addOption($groups);
// Group
$groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp');
$group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]');
$group->setSize(30);
$group->setMaxLength(120);
$groups->addSubItem($group);
$kind->addOption($groups);
}
示例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: initEditForm
/**
* Init object edit form
*
* @return ilPropertyFormGUI
*/
protected function initEditForm()
{
global $lng, $ilCtrl;
$lng->loadLanguageModule($this->object->getType());
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "update"));
$form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setSize(min(40, ilObject::TITLE_LENGTH));
$ti->setMaxLength(ilObject::TITLE_LENGTH);
$ti->setRequired(true);
$form->addItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
$ta->setCols(40);
$ta->setRows(2);
$form->addItem($ta);
$this->initEditCustomForm($form);
$form->addCommandButton("update", $this->lng->txt("save"));
//$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
return $form;
}