45 $this->dirs = array(
"horizontal",
"vertical");
55 $this->horizontalvalue = $a_horizontalvalue;
65 return $this->horizontalvalue;
75 $this->verticalvalue = $a_verticalvalue;
85 return $this->verticalvalue;
108 return "left ".$this->getVerticalValue();
119 $a_val = trim($a_val);
120 $a_val_arr = explode(
" ", $a_val);
121 $hor = trim($a_val_arr[0]);
122 $ver = trim($a_val_arr[1]);
123 if ($hor ==
"center" && $ver ==
"")
140 foreach ($this->dirs as
$dir)
159 if (!is_numeric($num_value) && trim($num_value) !=
"")
161 $this->
setAlert($lng->txt(
"sty_msg_input_must_be_numeric"));
166 if (
$type ==
"numeric")
168 if ($num_value !=
"")
170 $value = $num_value.$num_unit;
199 $layout_tpl =
new ilTemplate(
"tpl.prop_hv_layout.html",
true,
true,
"Services/Style");
201 foreach ($this->dirs as
$dir)
203 $tpl =
new ilTemplate(
"tpl.prop_background_position.html",
true,
true,
"Services/Style");
206 $pre_options = $pre_options[
$dir];
213 if (in_array(
$value, $pre_options))
215 $current_type =
"pre";
216 $tpl->setVariable(
"PREDEFINED_SELECTED",
'checked="checked"');
220 $current_type =
"unit";
221 $tpl->setVariable(
"NUMERIC_SELECTED",
'checked="checked"');
224 foreach ($unit_options as $u)
231 $disp_val = substr(
$value, 0, strlen(
$value) - strlen($current_unit));
232 if ($current_unit ==
"")
234 $current_unit =
"px";
236 $tpl->setVariable(
"VAL_NUM", $disp_val);
239 foreach ($unit_options as $option)
241 $tpl->setCurrentBlock(
"unit_option");
242 $tpl->setVariable(
"VAL_UNIT", $option);
243 $tpl->setVariable(
"TXT_UNIT", $option);
244 if ($current_type ==
"unit" && $current_unit == $option)
246 $tpl->setVariable(
"UNIT_SELECTED",
'selected="selected"');
248 $tpl->parseCurrentBlock();
251 foreach ($pre_options as $option)
253 $tpl->setCurrentBlock(
"pre_option");
254 $tpl->setVariable(
"VAL_PRE", $option);
255 $tpl->setVariable(
"TXT_PRE", $option);
256 if ($current_type ==
"pre" &&
$value == $option)
258 $tpl->setVariable(
"PRE_SELECTED",
'selected="selected"');
260 $tpl->parseCurrentBlock();
264 $tpl->setVariable(
"TXT_DIR", $lng->txt(
"sty_$dir"));
265 $tpl->setVariable(
"DIR", $dir);
267 $layout_tpl->setVariable(strtoupper($dir),
$tpl->get());
269 $layout_tpl->setVariable(
"COLSPAN",
"2");
271 $a_tpl->setCurrentBlock(
"prop_generic");
272 $a_tpl->setVariable(
"PROP_GENERIC", $layout_tpl->get());
273 $a_tpl->parseCurrentBlock();
285 if ($a_values[$this->
getPostVar()][
"horizontal"][
"type"] ==
"predefined")
292 $a_values[$this->
getPostVar()][
"horizontal"][
"num_unit"]);
294 if ($a_values[$this->
getPostVar()][
"vertical"][
"type"] ==
"predefined")
301 $a_values[$this->
getPostVar()][
"vertical"][
"num_unit"]);