ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.ilFormulaInputGUI.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once(
"./Services/Form/classes/class.ilTextInputGUI.php"
);
5
include_once(
"./Services/Math/classes/class.EvalMath.php"
);
6
14
class
ilFormulaInputGUI
extends
ilTextInputGUI
15
{
21
function
setValue
($a_value)
22
{
23
$this->value = str_replace(
','
,
'.'
, $a_value);
24
}
25
31
function
checkInput
()
32
{
33
global
$lng
;
34
35
$_POST
[$this->
getPostVar
()] =
ilUtil::stripSlashes
(
$_POST
[$this->
getPostVar
()]);
36
if
($this->
getRequired
() && trim(
$_POST
[$this->
getPostVar
()]) ==
""
)
37
{
38
$this->
setAlert
($lng->txt(
"msg_input_is_required"
));
39
40
return
false
;
41
}
42
else
43
{
44
$eval =
new
EvalMath
();
45
$eval->suppress_errors =
true
;
46
$result
= $eval->e(str_replace(
","
,
"."
,
ilUtil::stripSlashes
(
$_POST
[$this->
getPostVar
()], FALSE)));
47
if
(
$result
===
false
)
48
{
49
$this->
setAlert
($lng->txt(
"form_msg_formula_is_required"
));
50
return
false
;
51
}
52
}
53
54
return
$this->
checkSubItemsInput
();
55
}
56
}
57
?>
ilFormulaInputGUI
This class represents a formula text property in a property form.
Definition:
class.ilFormulaInputGUI.php:14
ilSubEnabledFormPropertyGUI\checkSubItemsInput
checkSubItemsInput()
Check SubItems.
Definition:
class.ilSubEnabledFormPropertyGUI.php:89
$result
$result
Definition:
CleanUpTest.php:407
ilFormulaInputGUI\setValue
setValue($a_value)
Set Value.
Definition:
class.ilFormulaInputGUI.php:21
ilFormPropertyGUI\getPostVar
getPostVar()
Get Post Variable.
Definition:
class.ilFormPropertyGUI.php:108
ilFormPropertyGUI\setAlert
setAlert($a_alert)
Set Alert Text.
Definition:
class.ilFormPropertyGUI.php:151
ilTextInputGUI
This class represents a text property in a property form.
Definition:
class.ilTextInputGUI.php:16
ilFormulaInputGUI\checkInput
checkInput()
Check input, strip slashes etc.
Definition:
class.ilFormulaInputGUI.php:31
EvalMath
Definition:
class.EvalMath.php:89
ilUtil\stripSlashes
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Definition:
class.ilUtil.php:2639
$lng
global $lng
Definition:
privfeed.php:17
php
ilFormPropertyGUI\getRequired
getRequired()
Get Required.
Definition:
class.ilFormPropertyGUI.php:181
$_POST
$_POST["username"]
Definition:
cfg.phpunit.template.php:11
Services
Form
classes
class.ilFormulaInputGUI.php
Generated on Fri Jan 17 2025 19:01:12 for ILIAS by
1.8.13 (using
Doxyfile
)