45 $this->
setType(
"style_numeric");
46 $this->dirs = array(
"all",
"top",
"bottom",
"left",
"right");
56 $this->allvalue = $a_allvalue;
66 return $this->allvalue;
76 $this->topvalue = $a_topvalue;
86 return $this->topvalue;
96 $this->bottomvalue = $a_bottomvalue;
106 return $this->bottomvalue;
116 $this->leftvalue = $a_leftvalue;
126 return $this->leftvalue;
136 $this->rightvalue = $a_rightvalue;
146 return $this->rightvalue;
156 $this->allowpercentage = $a_allowpercentage;
178 foreach ($this->dirs as
$dir)
193 if (!is_numeric($num_value) && $num_value !=
"")
195 $this->
setAlert($lng->txt(
"sty_msg_input_must_be_numeric"));
199 if (trim($num_value) !=
"")
203 case "all": $this->
setAllValue($num_value.$num_unit);
break;
204 case "top": $this->
setTopValue($num_value.$num_unit);
break;
205 case "bottom": $this->
setBottomValue($num_value.$num_unit);
break;
206 case "left": $this->
setLeftValue($num_value.$num_unit);
break;
207 case "right": $this->
setRightValue($num_value.$num_unit);
break;
222 $layout_tpl =
new ilTemplate(
"tpl.prop_trbl_layout.html",
true,
true,
"Services/Style");
224 foreach ($this->dirs as
$dir)
226 $tpl =
new ilTemplate(
"tpl.prop_trbl_style_numeric.html",
true,
true,
"Services/Style");
239 foreach ($unit_options as $u)
246 $disp_val = substr(
$value, 0, strlen(
$value) - strlen($current_unit));
247 if ($current_unit ==
"")
249 $current_unit =
"px";
252 foreach ($unit_options as $option)
254 $tpl->setCurrentBlock(
"unit_option");
255 $tpl->setVariable(
"VAL_UNIT", $option);
256 $tpl->setVariable(
"TXT_UNIT", $option);
257 if ($current_unit == $option)
259 $tpl->setVariable(
"UNIT_SELECTED",
'selected="selected"');
261 $tpl->parseCurrentBlock();
265 $tpl->setVariable(
"VAL_NUM", $disp_val);
266 $tpl->setVariable(
"TXT_DIR", $lng->txt(
"sty_$dir"));
267 $tpl->setVariable(
"DIR", $dir);
269 $layout_tpl->setVariable(strtoupper($dir),
$tpl->get());
272 $a_tpl->setCurrentBlock(
"prop_generic");
273 $a_tpl->setVariable(
"PROP_GENERIC", $layout_tpl->get());
274 $a_tpl->parseCurrentBlock();
287 $a_values[$this->
getPostVar()][
"all"][
"num_unit"]);
289 $a_values[$this->
getPostVar()][
"bottom"][
"num_unit"]);
291 $a_values[$this->
getPostVar()][
"top"][
"num_unit"]);
293 $a_values[$this->
getPostVar()][
"left"][
"num_unit"]);
295 $a_values[$this->
getPostVar()][
"right"][
"num_unit"]);