19 declare(strict_types=1);
29 protected string $top =
"";
46 $this->
lng = $DIC->language();
52 public function setValue(array $valueArray): void
54 $this->top = $valueArray[
'top'];
55 $this->left = $valueArray[
'left'];
56 $this->right = $valueArray[
'right'];
57 $this->bottom = $valueArray[
'bottom'];
70 public function setTop(
string $a_value): void
72 $this->top = $a_value;
82 $this->bottom = $a_value;
90 public function setLeft(
string $a_value): void
92 $this->left = $a_value;
102 $this->right = $a_value;
112 $this->size = $a_size;
119 $positions = [
'top',
'left',
'right',
'bottom'];
127 foreach ($positions as $position) {
128 if (isset($a_values[$postVar .
'_' . $position])) {
129 $values[$position] = $a_values[$postVar .
'_' . $position];
130 } elseif (isset($a_values[$postVar][$position])) {
131 $values[$position] = $a_values[$postVar][$position];
152 || ($val[$this->
getPostVar() .
'_bottom'] ==
"")
153 || ($val[$this->
getPostVar() .
'_left'] ==
"")
154 || ($val[$this->
getPostVar() .
'_right'] ==
"")
161 foreach ([
'top',
'right',
'bottom',
'left'] as $side) {
162 $value = $val[$this->
getPostVar() .
'_' . $side];
164 if (($this->
getRequired() || $value !==
"") && !preg_match(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0).*?$/si', $value)) {
171 if ((!preg_match(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0)(cm|mm|in|pt|pc|px|em)$/is', $val[$this->
getPostVar() .
'_top'])) ||
172 (!preg_match(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0)(cm|mm|in|pt|pc|px|em)$/is', $val[$this->
getPostVar() .
'_right'])) ||
173 (!preg_match(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0)(cm|mm|in|pt|pc|px|em)$/is', $val[$this->
getPostVar() .
'_bottom'])) ||
174 (!preg_match(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0)(cm|mm|in|pt|pc|px|em)$/is', $val[$this->
getPostVar() .
'_left']))) {
185 $ret[$this->
getPostVar() .
'_top'] = trim($val[
'top']);
186 $ret[$this->
getPostVar() .
'_right'] = trim($val[
'right']);
187 $ret[$this->
getPostVar() .
'_bottom'] = trim($val[
'bottom']);
188 $ret[$this->
getPostVar() .
'_left'] = trim($val[
'left']);
196 if (strlen($this->
getTop())) {
206 if (strlen($this->
getLeft())) {
227 " disabled=\"disabled\"" 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...
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)