19 declare(strict_types=1);
51 string $a_postvar =
"" 54 $this->
lng = $DIC->language();
58 $this->validationRegexp =
"";
66 if ($this->
getMulti() && is_array($a_value)) {
68 $a_value = array_shift($a_value);
70 $this->value = $a_value;
83 $this->validationFailureMessage = $a_msg;
93 $this->validationRegexp = $a_value;
103 $this->maxlength = $a_maxlength;
113 $this->size = $a_size;
118 $this->style_css = $a_style;
128 $this->css_class = $a_class;
148 $this->suffix = $a_value;
162 $this->input_type = $a_type;
172 $this->submit_form_on_enter = $a_val;
241 ?
string $a_delimiter =
null 243 $this->ajax_datasource = $href;
244 $this->ajax_datasource_delimiter = $a_delimiter;
249 $this->ajax_datasource_commit = $a_stat;
259 $this->ajax_datasource_commit_url = $a_url;
269 foreach ($a_values as $idx =>
$value) {
270 $a_values[$idx] = trim(
$value);
271 if ($a_values[$idx] ==
"") {
272 unset($a_values[$idx]);
275 parent::setMultiValues($a_values);
278 public function render(
string $a_mode =
""): string
282 $tpl =
new ilTemplate(
"tpl.prop_textinput.html",
true,
true,
"components/ILIAS/Form");
283 if (strlen((
string) $this->
getValue())) {
284 $tpl->setCurrentBlock(
"prop_text_propval");
289 $tpl->parseCurrentBlock();
292 $tpl->setCurrentBlock(
"stylecss");
297 $tpl->parseCurrentBlock();
300 $tpl->setCurrentBlock(
"classcss");
302 $tpl->parseCurrentBlock();
305 $tpl->touchBlock(
"submit_form_on_enter");
310 $tpl->setVariable(
'PROP_INPUT_TYPE',
'password');
313 $tpl->setVariable(
'PROP_INPUT_TYPE',
'hidden');
317 $tpl->setVariable(
'PROP_INPUT_TYPE',
'text');
320 $tpl->setVariable(
"SIZE", $this->
getSize());
325 $tpl->setVariable(
"INPUT_SUFFIX", $this->
getSuffix());
333 $tpl->setVariable(
"POST_VAR",
$postvar);
339 foreach (
$value as $item) {
347 $tpl->setVariable(
"HIDDEN_INPUT", $hidden);
349 $tpl->setVariable(
"DISABLED",
" disabled=\"disabled\"");
354 $tpl->setVariable(
'AUTOCOMPLETE',
'autocomplete="off"');
355 $this->global_tpl->addJavaScript(
'assets/js/legacyAutocomplete.js',
true, 3);
356 $config = json_encode([
357 'delimiter' => $this->ajax_datasource_delimiter,
358 'dataSource' => $this->ajax_datasource,
359 'submitOnSelection' => $this->ajax_datasource_commit,
360 'submitUrl' => $this->ajax_datasource_commit_url,
361 'autocompleteLength' => 3,
362 'moreText' => $this->
lng->txt(
'autocomplete_more')
366 $sel_auto =
'[id^="' . $this->
getFieldId() .
'"]';
372 $this->global_tpl->addOnLoadCode(
373 "il.LegacyForm.autocomplete.init(document.querySelector(`{$sel_auto}`), {$config});" 377 if ($a_mode ==
"toolbar") {
383 'display: -moz-inline-stack; display:inline-block; zoom: 1; *display:inline;' 386 $tpl->setVariable(
"STYLE_PAR",
'');
390 $tpl->setVariable(
"AUTOCOMPLETE",
"autocomplete=\"off\"");
394 $tpl->setVariable(
"REQUIRED",
"required=\"required\"");
399 $tpl->touchBlock(
"inline_in_bl");
405 $tpl->setVariable(
'DESCRIBED_BY_FIELD_ID', $this->
getFieldId());
428 $html = $this->
render(
"toolbar");
434 $this->autocomplete_disabled = $autocomplete;
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
string $validationFailureMessage
setSuffix(string $a_value)
getDataSourceSubmitOnSelection()
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
bool $ajax_datasource_commit
setValueByArray(array $a_values)
setDataSourceSubmitOnSelection(bool $a_stat)
getToolbarHTML()
Get input item HTML to be inserted into ilToolbarGUI.
getValidationFailureMessage()
getTableFilterHTML()
Get input item HTML to be inserted into table filters.
isHtmlAutoCompleteDisabled()
setCssClass(string $a_class)
bool $autocomplete_disabled
setDataSource(string $href, ?string $a_delimiter=null)
setInputType(string $a_type)
set input type
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
string $ajax_datasource_commit_url
setVariable($variable, $value='')
Sets a variable value.
string $ajax_datasource_delimiter
insert(ilTemplate $a_tpl)
setMultiValues(array $a_values)
setDataSourceSubmitUrl(string $a_url)
setDisableHtmlAutoComplete(bool $autocomplete)
bool $submit_form_on_enter
render(string $a_mode="")
Interface for multi values support.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setMaxLength(?int $a_maxlength)
setSubmitFormOnEnter(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
setValidationFailureMessage(string $a_msg)
setInlineStyle(string $a_style)
getPostValueForComparison()
__construct(string $a_title="", string $a_postvar="")
setValidationRegexp(string $a_value)