45 $this->dirs = array(
"all",
"top",
"bottom",
"left",
"right");
55 $this->allvalue = $a_allvalue;
65 return $this->allvalue;
75 $this->topvalue = $a_topvalue;
85 return $this->topvalue;
95 $this->bottomvalue = $a_bottomvalue;
105 return $this->bottomvalue;
115 $this->leftvalue = $a_leftvalue;
125 return $this->leftvalue;
135 $this->rightvalue = $a_rightvalue;
145 return $this->rightvalue;
157 foreach ($this->dirs as
$dir)
176 if (!is_numeric($num_value) && $num_value !=
"")
178 $this->
setAlert($lng->txt(
"sty_msg_input_must_be_numeric"));
183 if (
$type ==
"numeric")
185 if ($num_value !=
"")
187 $value = $num_value.$num_unit;
219 $layout_tpl =
new ilTemplate(
"tpl.prop_trbl_layout.html",
true,
true,
"Services/Style");
221 foreach ($this->dirs as
$dir)
223 $tpl =
new ilTemplate(
"tpl.prop_trbl_border_width.html",
true,
true,
"Services/Style");
236 if (in_array(
$value, $pre_options))
238 $current_type =
"pre";
239 $tpl->setVariable(
"PREDEFINED_SELECTED",
'checked="checked"');
243 $current_type =
"unit";
244 $tpl->setVariable(
"NUMERIC_SELECTED",
'checked="checked"');
247 foreach ($unit_options as $u)
254 $disp_val = substr(
$value, 0, strlen(
$value) - strlen($current_unit));
255 if ($current_unit ==
"")
257 $current_unit =
"px";
259 $tpl->setVariable(
"VAL_NUM", $disp_val);
262 foreach ($unit_options as $option)
264 $tpl->setCurrentBlock(
"unit_option");
265 $tpl->setVariable(
"VAL_UNIT", $option);
266 $tpl->setVariable(
"TXT_UNIT", $option);
267 if ($current_type ==
"unit" && $current_unit == $option)
269 $tpl->setVariable(
"UNIT_SELECTED",
'selected="selected"');
271 $tpl->parseCurrentBlock();
274 foreach ($pre_options as $option)
276 $tpl->setCurrentBlock(
"pre_option");
277 $tpl->setVariable(
"VAL_PRE", $option);
278 $tpl->setVariable(
"TXT_PRE", $option);
279 if ($current_type ==
"pre" &&
$value == $option)
281 $tpl->setVariable(
"PRE_SELECTED",
'selected="selected"');
283 $tpl->parseCurrentBlock();
287 $tpl->setVariable(
"TXT_DIR", $lng->txt(
"sty_$dir"));
288 $tpl->setVariable(
"DIR", $dir);
290 $layout_tpl->setVariable(strtoupper($dir),
$tpl->get());
292 $layout_tpl->setVariable(
"COLSPAN",
"2");
294 $a_tpl->setCurrentBlock(
"prop_generic");
295 $a_tpl->setVariable(
"PROP_GENERIC", $layout_tpl->get());
296 $a_tpl->parseCurrentBlock();
308 if ($a_values[$this->
getPostVar()][
"all"][
"type"] ==
"predefined")
315 $a_values[$this->
getPostVar()][
"all"][
"num_unit"]);
317 if ($a_values[$this->
getPostVar()][
"bottom"][
"type"] ==
"predefined")
324 $a_values[$this->
getPostVar()][
"bottom"][
"num_unit"]);
326 if ($a_values[$this->
getPostVar()][
"top"][
"type"] ==
"predefined")
333 $a_values[$this->
getPostVar()][
"top"][
"num_unit"]);
335 if ($a_values[$this->
getPostVar()][
"left"][
"type"] ==
"predefined")
342 $a_values[$this->
getPostVar()][
"left"][
"num_unit"]);
344 if ($a_values[$this->
getPostVar()][
"right"][
"type"] ==
"predefined")
351 $a_values[$this->
getPostVar()][
"right"][
"num_unit"]);