50 $this->lng = $DIC->language();
51 $this->
user = $DIC->user();
52 parent::__construct($a_title, $a_postvar);
54 $this->dirs =
array(
"horizontal",
"vertical");
64 $this->horizontalvalue = $a_horizontalvalue;
74 return $this->horizontalvalue;
84 $this->verticalvalue = $a_verticalvalue;
94 return $this->verticalvalue;
121 $a_val = trim($a_val);
122 $a_val_arr = explode(
" ", $a_val);
123 $hor = trim($a_val_arr[0]);
124 $ver = trim($a_val_arr[1]);
125 if ($hor ==
"center" && $ver ==
"") {
141 foreach ($this->dirs as $dir) {
159 if (!is_numeric($num_value) && trim($num_value) !=
"") {
160 $this->
setAlert(
$lng->txt(
"sty_msg_input_must_be_numeric"));
165 if (
$type ==
"numeric") {
166 if ($num_value !=
"") {
167 $value = $num_value . $num_unit;
191 $layout_tpl =
new ilTemplate(
"tpl.prop_hv_layout.html",
true,
true,
"Services/Style/Content");
193 foreach ($this->dirs as $dir) {
194 $tpl =
new ilTemplate(
"tpl.prop_background_position.html",
true,
true,
"Services/Style/Content");
197 $pre_options = $pre_options[$dir];
203 if (in_array(
$value, $pre_options)) {
204 $current_type =
"pre";
205 $tpl->setVariable(
"PREDEFINED_SELECTED",
'checked="checked"');
207 $current_type =
"unit";
208 $tpl->setVariable(
"NUMERIC_SELECTED",
'checked="checked"');
211 foreach ($unit_options as $u) {
212 if (substr(
$value, strlen(
$value) - strlen($u)) == $u) {
216 $disp_val = substr(
$value, 0, strlen(
$value) - strlen($current_unit));
217 if ($current_unit ==
"") {
218 $current_unit =
"px";
220 $tpl->setVariable(
"VAL_NUM", $disp_val);
223 foreach ($unit_options as $option) {
224 $tpl->setCurrentBlock(
"unit_option");
225 $tpl->setVariable(
"VAL_UNIT", $option);
226 $tpl->setVariable(
"TXT_UNIT", $option);
227 if ($current_type ==
"unit" && $current_unit == $option) {
228 $tpl->setVariable(
"UNIT_SELECTED",
'selected="selected"');
230 $tpl->parseCurrentBlock();
233 foreach ($pre_options as $option) {
234 $tpl->setCurrentBlock(
"pre_option");
235 $tpl->setVariable(
"VAL_PRE", $option);
236 $tpl->setVariable(
"TXT_PRE", $option);
237 if ($current_type ==
"pre" &&
$value == $option) {
238 $tpl->setVariable(
"PRE_SELECTED",
'selected="selected"');
240 $tpl->parseCurrentBlock();
244 $tpl->setVariable(
"TXT_DIR",
$lng->txt(
"sty_$dir"));
245 $tpl->setVariable(
"DIR", $dir);
247 $layout_tpl->setVariable(strtoupper($dir),
$tpl->get());
249 $layout_tpl->setVariable(
"COLSPAN",
"2");
251 $a_tpl->setCurrentBlock(
"prop_generic");
252 $a_tpl->setVariable(
"PROP_GENERIC", $layout_tpl->get());
253 $a_tpl->parseCurrentBlock();
265 if ($a_values[$this->
getPostVar()][
"horizontal"][
"type"] ==
"predefined") {
269 $a_values[$this->
getPostVar()][
"horizontal"][
"num_unit"]);
271 if ($a_values[$this->
getPostVar()][
"vertical"][
"type"] ==
"predefined") {
275 $a_values[$this->
getPostVar()][
"vertical"][
"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
Create styles array
The data for the language used.
static _getStyleParameterValues($par)
static _getStyleParameterNumericUnits($a_no_percentage=false)