5 include_once(
"./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
47 $this->suffix = $a_value;
67 $this->value = str_replace(
',',
'.', $a_value);
70 if($this->value !=
"")
75 $this->value = round($this->value);
81 $this->value = round($this->value, $this->
getDecimals());
84 $this->value = number_format($this->value, $this->
getDecimals(),
".",
"");
106 $this->maxlength = $a_maxlength;
166 $this->size = $a_size;
197 $this->minvalue = $a_minvalue;
198 $this->minvalue_visible = (bool)$a_display_always;
219 $this->maxvalue = $a_maxvalue;
220 $this->maxvalue_visible = (bool)$a_display_always;
240 $this->decimals = (int)$a_decimals;
264 $this->allow_decimals = (bool)$a_value;
289 $this->
setAlert($lng->txt(
"msg_input_is_required"));
296 $this->minvalue_visible =
true;
297 $this->maxvalue_visible =
true;
298 $this->
setAlert($lng->txt(
"form_msg_numeric_value_required"));
308 $this->minvalue_visible =
true;
309 $this->
setAlert($lng->txt(
"form_msg_value_too_low"));
319 $this->minvalue_visible =
true;
320 $this->
setAlert($lng->txt(
"form_msg_value_too_low"));
331 $this->maxvalue_visible =
true;
332 $this->
setAlert($lng->txt(
"form_msg_value_too_high"));
342 $this->maxvalue_visible =
true;
343 $this->
setAlert($lng->txt(
"form_msg_value_too_high"));
360 $a_tpl->setCurrentBlock(
"prop_generic");
361 $a_tpl->setVariable(
"PROP_GENERIC", $html);
362 $a_tpl->parseCurrentBlock();
372 $tpl =
new ilTemplate(
"tpl.prop_number.html",
true,
true,
"Services/Form");
376 $tpl->setCurrentBlock(
"prop_number_propval");
378 $tpl->parseCurrentBlock();
380 $tpl->setCurrentBlock(
"prop_number");
389 $tpl->setVariable(
"DISABLED",
390 " disabled=\"disabled\"");
400 $constraints = $lng->txt(
"form_format").
": ###.".str_repeat(
"#", $this->
getDecimals());
403 if ($this->
getMinValue() !==
false && $this->minvalue_visible)
405 $constraints.= $delim.$lng->txt(
"form_min_value").
": ".(($this->
minvalueShouldBeGreater()) ?
"> " :
"").$this->getMinValue();
408 if ($this->
getMaxValue() !==
false && $this->maxvalue_visible)
410 $constraints.= $delim.$lng->txt(
"form_max_value").
": ".(($this->
maxvalueShouldBeLess()) ?
"< " :
"").$this->getMaxValue();
413 if ($constraints !=
"")
415 $tpl->setVariable(
"TXT_NUMBER_CONSTRAINTS", $constraints);
418 $tpl->parseCurrentBlock();