50 $this->lng = $DIC->language();
51 $this->
user = $DIC->user();
52 parent::__construct($a_title, $a_postvar);
54 $this->dirs = array(
"all",
"top",
"bottom",
"left",
"right");
64 $this->allvalue = $a_allvalue;
74 return $this->allvalue;
84 $this->topvalue = $a_topvalue;
94 return $this->topvalue;
104 $this->bottomvalue = $a_bottomvalue;
114 return $this->bottomvalue;
124 $this->leftvalue = $a_leftvalue;
134 return $this->leftvalue;
144 $this->rightvalue = $a_rightvalue;
154 return $this->rightvalue;
166 foreach ($this->dirs as $dir) {
184 if (!is_numeric($num_value) && $num_value !=
"") {
185 $this->
setAlert(
$lng->txt(
"sty_msg_input_must_be_numeric"));
190 if (
$type ==
"numeric") {
191 if ($num_value !=
"") {
192 $value = $num_value . $num_unit;
219 $layout_tpl =
new ilTemplate(
"tpl.prop_trbl_layout.html",
true,
true,
"Services/Style/Content");
221 foreach ($this->dirs as $dir) {
222 $tpl =
new ilTemplate(
"tpl.prop_trbl_border_width.html",
true,
true,
"Services/Style/Content");
234 if (in_array(
$value, $pre_options)) {
235 $current_type =
"pre";
236 $tpl->setVariable(
"PREDEFINED_SELECTED",
'checked="checked"');
238 $current_type =
"unit";
239 $tpl->setVariable(
"NUMERIC_SELECTED",
'checked="checked"');
242 foreach ($unit_options as $u) {
243 if (substr(
$value, strlen(
$value) - strlen($u)) == $u) {
247 $disp_val = substr(
$value, 0, strlen(
$value) - strlen($current_unit));
248 if ($current_unit ==
"") {
249 $current_unit =
"px";
251 $tpl->setVariable(
"VAL_NUM", $disp_val);
254 foreach ($unit_options as $option) {
255 $tpl->setCurrentBlock(
"unit_option");
256 $tpl->setVariable(
"VAL_UNIT", $option);
257 $tpl->setVariable(
"TXT_UNIT", $option);
258 if ($current_type ==
"unit" && $current_unit == $option) {
259 $tpl->setVariable(
"UNIT_SELECTED",
'selected="selected"');
261 $tpl->parseCurrentBlock();
264 foreach ($pre_options as $option) {
265 $tpl->setCurrentBlock(
"pre_option");
266 $tpl->setVariable(
"VAL_PRE", $option);
267 $tpl->setVariable(
"TXT_PRE", $option);
268 if ($current_type ==
"pre" &&
$value == $option) {
269 $tpl->setVariable(
"PRE_SELECTED",
'selected="selected"');
271 $tpl->parseCurrentBlock();
275 $tpl->setVariable(
"TXT_DIR",
$lng->txt(
"sty_$dir"));
276 $tpl->setVariable(
"DIR", $dir);
278 $layout_tpl->setVariable(strtoupper($dir),
$tpl->get());
280 $layout_tpl->setVariable(
"COLSPAN",
"2");
282 $a_tpl->setCurrentBlock(
"prop_generic");
283 $a_tpl->setVariable(
"PROP_GENERIC", $layout_tpl->get());
284 $a_tpl->parseCurrentBlock();
296 if ($a_values[$this->
getPostVar()][
"all"][
"type"] ==
"predefined") {
300 $a_values[$this->
getPostVar()][
"all"][
"num_unit"]);
302 if ($a_values[$this->
getPostVar()][
"bottom"][
"type"] ==
"predefined") {
306 $a_values[$this->
getPostVar()][
"bottom"][
"num_unit"]);
308 if ($a_values[$this->
getPostVar()][
"top"][
"type"] ==
"predefined") {
312 $a_values[$this->
getPostVar()][
"top"][
"num_unit"]);
314 if ($a_values[$this->
getPostVar()][
"left"][
"type"] ==
"predefined") {
318 $a_values[$this->
getPostVar()][
"left"][
"num_unit"]);
320 if ($a_values[$this->
getPostVar()][
"right"][
"type"] ==
"predefined") {
324 $a_values[$this->
getPostVar()][
"right"][
"num_unit"]);
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)