3 declare(strict_types=1);
    42     public function __construct(
string $a_title = 
"", 
string $a_postvar = 
"")
    46         $this->
lng = $DIC->language();
    47         $this->
user = $DIC->user();
    49         $this->
setType(
"style_numeric");
    50         $this->dirs = array(
"all", 
"top", 
"bottom", 
"left", 
"right");
    55         $this->allvalue = $a_allvalue;
    65         $this->topvalue = $a_topvalue;
    75         $this->bottomvalue = $a_bottomvalue;
    85         $this->leftvalue = $a_leftvalue;
    95         $this->rightvalue = $a_rightvalue;
   105         $this->allowpercentage = $a_allowpercentage;
   119         foreach ($this->dirs as $dir) {
   120             $num_value = $input[$dir][
"num_value"];
   121             $num_unit = $input[$dir][
"num_unit"];
   131             if (!is_numeric($num_value) && $num_value != 
"") {
   136             if (trim($num_value) != 
"") {
   138                     case "all": $this->
setAllValue($num_value . $num_unit);
   140                     case "top": $this->
setTopValue($num_value . $num_unit);
   144                     case "left": $this->
setLeftValue($num_value . $num_unit);
   165         $layout_tpl = 
new ilTemplate(
"tpl.prop_trbl_layout.html", 
true, 
true, 
"Services/Style/Content");
   167         foreach ($this->dirs as $dir) {
   168             $tpl = 
new ilTemplate(
"tpl.prop_trbl_style_numeric.html", 
true, 
true, 
"Services/Style/Content");
   172                 case "all": $value = strtolower(trim($this->
getAllValue()));
   174                 case "top": $value = strtolower(trim($this->
getTopValue()));
   176                 case "bottom": $value = strtolower(trim($this->
getBottomValue()));
   178                 case "left": $value = strtolower(trim($this->
getLeftValue()));
   180                 case "right": $value = strtolower(trim($this->
getRightValue()));
   185             foreach ($unit_options as $u) {
   186                 if (substr($value, strlen($value) - strlen($u)) == $u) {
   190             $disp_val = substr($value, 0, strlen($value) - strlen($current_unit));
   191             if ($current_unit == 
"") {
   192                 $current_unit = 
"px";
   195             foreach ($unit_options as $option) {
   196                 $tpl->setCurrentBlock(
"unit_option");
   197                 $tpl->setVariable(
"VAL_UNIT", $option);
   198                 $tpl->setVariable(
"TXT_UNIT", $option);
   199                 if ($current_unit == $option) {
   200                     $tpl->setVariable(
"UNIT_SELECTED", 
'selected="selected"');
   202                 $tpl->parseCurrentBlock();
   205             $tpl->setVariable(
"POSTVAR", $this->
getPostVar());
   206             $tpl->setVariable(
"VAL_NUM", $disp_val);
   207             $tpl->setVariable(
"TXT_DIR", 
$lng->
txt(
"sty_$dir"));
   208             $tpl->setVariable(
"DIR", $dir);
   210             $layout_tpl->setVariable(strtoupper($dir), $tpl->get());
   214         $a_tpl->
setVariable(
"PROP_GENERIC", $layout_tpl->get());
   221             $a_values[$this->
getPostVar()][
"all"][
"num_unit"]);
   223             $a_values[$this->
getPostVar()][
"bottom"][
"num_unit"]);
   225             $a_values[$this->
getPostVar()][
"top"][
"num_unit"]);
   227             $a_values[$this->
getPostVar()][
"left"][
"num_unit"]);
   229             $a_values[$this->
getPostVar()][
"right"][
"num_unit"]);
 
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
static _getStyleParameterNumericUnits(bool $a_no_percentage=false)
 
setVariable($variable, $value='')
Sets a variable value. 
 
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)