50 $this->lng = $DIC->language();
51 $this->
user = $DIC->user();
52 parent::__construct($a_title, $a_postvar);
63 $this->value = $a_value;
100 if (
$type ==
"numeric") {
101 if (!is_numeric($num_value) && $num_value !=
"") {
102 $this->
setAlert(
$lng->txt(
"sty_msg_input_must_be_numeric"));
107 if (trim($num_value) !=
"") {
108 $this->
setValue($num_value . $num_unit);
122 $tpl =
new ilTemplate(
"tpl.prop_fontsize.html",
true,
true,
"Services/Style/Content");
131 if (in_array(
$value, $pre_options)) {
132 $current_type =
"pre";
133 $tpl->setVariable(
"PREDEFINED_SELECTED",
'checked="checked"');
135 $current_type =
"unit";
136 $tpl->setVariable(
"NUMERIC_SELECTED",
'checked="checked"');
138 foreach ($unit_options as $u) {
139 if (substr(
$value, strlen(
$value) - strlen($u)) == $u) {
145 substr(
$value, 0, strlen(
$value) - strlen($current_unit))
147 if ($current_unit ==
"") {
148 $current_unit =
"px";
152 foreach ($unit_options as $option) {
153 $tpl->setCurrentBlock(
"unit_option");
154 $tpl->setVariable(
"VAL_UNIT", $option);
155 $tpl->setVariable(
"TXT_UNIT", $option);
156 if ($current_type ==
"unit" && $current_unit == $option) {
157 $tpl->setVariable(
"UNIT_SELECTED",
'selected="selected"');
159 $tpl->parseCurrentBlock();
162 foreach ($pre_options as $option) {
163 $tpl->setCurrentBlock(
"pre_option");
164 $tpl->setVariable(
"VAL_PRE", $option);
165 $tpl->setVariable(
"TXT_PRE", $option);
166 if ($current_type ==
"pre" &&
$value == $option) {
167 $tpl->setVariable(
"PRE_SELECTED",
'selected="selected"');
169 $tpl->parseCurrentBlock();
172 $a_tpl->setCurrentBlock(
"prop_generic");
173 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
174 $a_tpl->parseCurrentBlock();
186 if ($a_values[$this->
getPostVar()][
"type"] ==
"predefined") {
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 _getStyleParameterValues($par)
static _getStyleParameterNumericUnits($a_no_percentage=false)