51 $this->lng = $DIC->language();
52 $this->
user = $DIC->user();
53 parent::__construct($a_title, $a_postvar);
54 $this->
setType(
"style_numeric");
64 $this->value = $a_value;
84 $this->allowpercentage = $a_allowpercentage;
111 if ($this->
getRequired() && trim($num_value) ==
"") {
117 if (!is_numeric($num_value) && $num_value !=
"") {
118 $this->
setAlert(
$lng->txt(
"sty_msg_input_must_be_numeric"));
123 if (trim($num_value) !=
"") {
124 $this->
setValue($num_value . $num_unit);
135 $tpl =
new ilTemplate(
"tpl.prop_style_numeric.html",
true,
true,
"Services/Style/Content");
144 foreach ($unit_options as $u) {
145 if (substr(
$value, strlen(
$value) - strlen($u)) == $u) {
151 substr(
$value, 0, strlen(
$value) - strlen($current_unit))
153 if ($current_unit ==
"") {
154 $current_unit =
"px";
157 foreach ($unit_options as $option) {
158 $tpl->setCurrentBlock(
"unit_option");
159 $tpl->setVariable(
"VAL_UNIT", $option);
160 $tpl->setVariable(
"TXT_UNIT", $option);
161 if ($current_unit == $option) {
162 $tpl->setVariable(
"UNIT_SELECTED",
'selected="selected"');
164 $tpl->parseCurrentBlock();
167 $a_tpl->setCurrentBlock(
"prop_generic");
168 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
169 $a_tpl->parseCurrentBlock();
special template class to simplify handling of ITX/PEAR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _getStyleParameterNumericUnits($a_no_percentage=false)