ILIAS  release_8 Revision v8.24
ilTRBLBorderWidthInputGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTRBLBorderWidthInputGUI:
+ Collaboration diagram for ilTRBLBorderWidthInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 setAllValue (string $a_allvalue)
 
 getAllValue ()
 
 setTopValue (string $a_topvalue)
 
 getTopValue ()
 
 setBottomValue (string $a_bottomvalue)
 
 getBottomValue ()
 
 setLeftValue (string $a_leftvalue)
 
 getLeftValue ()
 
 setRightValue (string $a_rightvalue)
 
 getRightValue ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
 setValueByArray (array $a_values)
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 

Protected Attributes

string $rightvalue = ""
 
string $leftvalue = ""
 
string $bottomvalue = ""
 
string $topvalue = ""
 
array $dirs = []
 
string $allvalue = ""
 
ilObjUser $user
 
string $value = ""
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning This class represents a border width with all/top/right/bottom/left in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 of file class.ilTRBLBorderWidthInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTRBLBorderWidthInputGUI::__construct ( string  $a_title = "",
string  $a_postvar = "" 
)

Reimplemented from ilFormPropertyGUI.

Definition at line 40 of file class.ilTRBLBorderWidthInputGUI.php.

41 {
42 global $DIC;
43
44 $this->lng = $DIC->language();
45 $this->user = $DIC->user();
46 parent::__construct($a_title, $a_postvar);
47 $this->setType("border_width");
48 $this->dirs = array("all", "top", "bottom", "left", "right");
49 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), ilFormPropertyGUI\setType(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilTRBLBorderWidthInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilFormPropertyGUI.

Definition at line 101 of file class.ilTRBLBorderWidthInputGUI.php.

101 : bool
102 {
104
105 $input = $this->getInput();
106
107 foreach ($this->dirs as $dir) {
108 $type = $input[$dir]["type"];
109 $num_value = $input[$dir]["num_value"];
110 $num_unit = $input[$dir]["num_unit"];
111 $pre_value = $input[$dir]["pre_value"];
112
113 /*
114 if ($this->getRequired() && trim($num_value) == "")
115 {
116 $this->setAlert($lng->txt("msg_input_is_required"));
117
118 return false;
119 }*/
120
121 if (!is_numeric($num_value) && $num_value != "") {
122 $this->setAlert($lng->txt("sty_msg_input_must_be_numeric"));
123 return false;
124 }
125
126 $value = "";
127 if ($type == "numeric") {
128 if ($num_value != "") {
129 $value = $num_value . $num_unit;
130 }
131 } else {
132 $value = $pre_value;
133 }
134
135 if (trim($value) != "") {
136 switch ($dir) {
137 case "all": $this->setAllValue($value); break;
138 case "top": $this->setTopValue($value); break;
139 case "bottom": $this->setBottomValue($value); break;
140 case "left": $this->setLeftValue($value); break;
141 case "right": $this->setRightValue($value); break;
142 }
143 }
144 }
145
146 return true;
147 }
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...

References ilFormPropertyGUI\$lng, ilFormPropertyGUI\$type, $value, getInput(), ilFormPropertyGUI\setAlert(), setAllValue(), setBottomValue(), setLeftValue(), setRightValue(), setTopValue(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getAllValue()

ilTRBLBorderWidthInputGUI::getAllValue ( )

Definition at line 56 of file class.ilTRBLBorderWidthInputGUI.php.

56 : string
57 {
58 return $this->allvalue;
59 }

References $allvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getBottomValue()

ilTRBLBorderWidthInputGUI::getBottomValue ( )

Definition at line 76 of file class.ilTRBLBorderWidthInputGUI.php.

76 : string
77 {
78 return $this->bottomvalue;
79 }

References $bottomvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getInput()

ilTRBLBorderWidthInputGUI::getInput ( )

Definition at line 149 of file class.ilTRBLBorderWidthInputGUI.php.

149 : array
150 {
151 return $this->arrayArray($this->getPostVar());
152 }

References ilFormPropertyGUI\arrayArray(), and ilFormPropertyGUI\getPostVar().

Referenced by checkInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLeftValue()

ilTRBLBorderWidthInputGUI::getLeftValue ( )

Definition at line 86 of file class.ilTRBLBorderWidthInputGUI.php.

86 : string
87 {
88 return $this->leftvalue;
89 }

References $leftvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getRightValue()

ilTRBLBorderWidthInputGUI::getRightValue ( )

Definition at line 96 of file class.ilTRBLBorderWidthInputGUI.php.

96 : string
97 {
98 return $this->rightvalue;
99 }

References $rightvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getTopValue()

ilTRBLBorderWidthInputGUI::getTopValue ( )

Definition at line 66 of file class.ilTRBLBorderWidthInputGUI.php.

66 : string
67 {
68 return $this->topvalue;
69 }

References $topvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilTRBLBorderWidthInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 154 of file class.ilTRBLBorderWidthInputGUI.php.

154 : void
155 {
157 $value = "";
158 $current_unit = "";
159 $layout_tpl = new ilTemplate("tpl.prop_trbl_layout.html", true, true, "Services/Style/Content");
160
161 foreach ($this->dirs as $dir) {
162 $tpl = new ilTemplate("tpl.prop_trbl_border_width.html", true, true, "Services/Style/Content");
164 $pre_options = ilObjStyleSheet::_getStyleParameterValues("border-width");
165
166 switch ($dir) {
167 case "all": $value = strtolower(trim($this->getAllValue())); break;
168 case "top": $value = strtolower(trim($this->getTopValue())); break;
169 case "bottom": $value = strtolower(trim($this->getBottomValue())); break;
170 case "left": $value = strtolower(trim($this->getLeftValue())); break;
171 case "right": $value = strtolower(trim($this->getRightValue())); break;
172 }
173
174 if (in_array($value, $pre_options)) {
175 $current_type = "pre";
176 $tpl->setVariable("PREDEFINED_SELECTED", 'checked="checked"');
177 } else {
178 $current_type = "unit";
179 $tpl->setVariable("NUMERIC_SELECTED", 'checked="checked"');
180
181 $current_unit = "";
182 foreach ($unit_options as $u) {
183 if (substr($value, strlen($value) - strlen($u)) == $u) {
184 $current_unit = $u;
185 }
186 }
187 $disp_val = substr($value, 0, strlen($value) - strlen($current_unit));
188 if ($current_unit == "") {
189 $current_unit = "px";
190 }
191 $tpl->setVariable("VAL_NUM", $disp_val);
192 }
193
194 foreach ($unit_options as $option) {
195 $tpl->setCurrentBlock("unit_option");
196 $tpl->setVariable("VAL_UNIT", $option);
197 $tpl->setVariable("TXT_UNIT", $option);
198 if ($current_type == "unit" && $current_unit == $option) {
199 $tpl->setVariable("UNIT_SELECTED", 'selected="selected"');
200 }
201 $tpl->parseCurrentBlock();
202 }
203
204 foreach ($pre_options as $option) {
205 $tpl->setCurrentBlock("pre_option");
206 $tpl->setVariable("VAL_PRE", $option);
207 $tpl->setVariable("TXT_PRE", $option);
208 if ($current_type == "pre" && $value == $option) {
209 $tpl->setVariable("PRE_SELECTED", 'selected="selected"');
210 }
211 $tpl->parseCurrentBlock();
212 }
213
214 $tpl->setVariable("POSTVAR", $this->getPostVar());
215 $tpl->setVariable("TXT_DIR", $lng->txt("sty_$dir"));
216 $tpl->setVariable("DIR", $dir);
217
218 $layout_tpl->setVariable(strtoupper($dir), $tpl->get());
219 }
220 $layout_tpl->setVariable("COLSPAN", "2");
221
222 $a_tpl->setCurrentBlock("prop_generic");
223 $a_tpl->setVariable("PROP_GENERIC", $layout_tpl->get());
224 $a_tpl->parseCurrentBlock();
225 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
static _getStyleParameterNumericUnits(bool $a_no_percentage=false)
static _getStyleParameterValues(string $par)
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References ilFormPropertyGUI\$lng, $tpl, $value, ilObjStyleSheet\_getStyleParameterNumericUnits(), ilObjStyleSheet\_getStyleParameterValues(), getAllValue(), getBottomValue(), getLeftValue(), ilFormPropertyGUI\getPostVar(), getRightValue(), getTopValue(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ setAllValue()

ilTRBLBorderWidthInputGUI::setAllValue ( string  $a_allvalue)

Definition at line 51 of file class.ilTRBLBorderWidthInputGUI.php.

51 : void
52 {
53 $this->allvalue = $a_allvalue;
54 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setBottomValue()

ilTRBLBorderWidthInputGUI::setBottomValue ( string  $a_bottomvalue)

Definition at line 71 of file class.ilTRBLBorderWidthInputGUI.php.

71 : void
72 {
73 $this->bottomvalue = $a_bottomvalue;
74 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setLeftValue()

ilTRBLBorderWidthInputGUI::setLeftValue ( string  $a_leftvalue)

Definition at line 81 of file class.ilTRBLBorderWidthInputGUI.php.

81 : void
82 {
83 $this->leftvalue = $a_leftvalue;
84 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setRightValue()

ilTRBLBorderWidthInputGUI::setRightValue ( string  $a_rightvalue)

Definition at line 91 of file class.ilTRBLBorderWidthInputGUI.php.

91 : void
92 {
93 $this->rightvalue = $a_rightvalue;
94 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setTopValue()

ilTRBLBorderWidthInputGUI::setTopValue ( string  $a_topvalue)

Definition at line 61 of file class.ilTRBLBorderWidthInputGUI.php.

61 : void
62 {
63 $this->topvalue = $a_topvalue;
64 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilTRBLBorderWidthInputGUI::setValueByArray ( array  $a_values)

Definition at line 227 of file class.ilTRBLBorderWidthInputGUI.php.

227 : void
228 {
229 if ($a_values[$this->getPostVar()]["all"]["type"] == "predefined") {
230 $this->setAllValue($a_values[$this->getPostVar()]["all"]["pre_value"]);
231 } else {
232 $this->setAllValue($a_values[$this->getPostVar()]["all"]["num_value"] .
233 $a_values[$this->getPostVar()]["all"]["num_unit"]);
234 }
235 if ($a_values[$this->getPostVar()]["bottom"]["type"] == "predefined") {
236 $this->setBottomValue($a_values[$this->getPostVar()]["bottom"]["pre_value"]);
237 } else {
238 $this->setBottomValue($a_values[$this->getPostVar()]["bottom"]["num_value"] .
239 $a_values[$this->getPostVar()]["bottom"]["num_unit"]);
240 }
241 if ($a_values[$this->getPostVar()]["top"]["type"] == "predefined") {
242 $this->setTopValue($a_values[$this->getPostVar()]["top"]["pre_value"]);
243 } else {
244 $this->setTopValue($a_values[$this->getPostVar()]["top"]["num_value"] .
245 $a_values[$this->getPostVar()]["top"]["num_unit"]);
246 }
247 if ($a_values[$this->getPostVar()]["left"]["type"] == "predefined") {
248 $this->setLeftValue($a_values[$this->getPostVar()]["left"]["pre_value"]);
249 } else {
250 $this->setLeftValue($a_values[$this->getPostVar()]["left"]["num_value"] .
251 $a_values[$this->getPostVar()]["left"]["num_unit"]);
252 }
253 if ($a_values[$this->getPostVar()]["right"]["type"] == "predefined") {
254 $this->setRightValue($a_values[$this->getPostVar()]["right"]["pre_value"]);
255 } else {
256 $this->setRightValue($a_values[$this->getPostVar()]["right"]["num_value"] .
257 $a_values[$this->getPostVar()]["right"]["num_unit"]);
258 }
259 }

References ilFormPropertyGUI\getPostVar(), setAllValue(), setBottomValue(), setLeftValue(), setRightValue(), and setTopValue().

+ Here is the call graph for this function:

Field Documentation

◆ $allvalue

string ilTRBLBorderWidthInputGUI::$allvalue = ""
protected

Definition at line 36 of file class.ilTRBLBorderWidthInputGUI.php.

Referenced by getAllValue().

◆ $bottomvalue

string ilTRBLBorderWidthInputGUI::$bottomvalue = ""
protected

Definition at line 30 of file class.ilTRBLBorderWidthInputGUI.php.

Referenced by getBottomValue().

◆ $dirs

array ilTRBLBorderWidthInputGUI::$dirs = []
protected

Definition at line 35 of file class.ilTRBLBorderWidthInputGUI.php.

◆ $leftvalue

string ilTRBLBorderWidthInputGUI::$leftvalue = ""
protected

Definition at line 29 of file class.ilTRBLBorderWidthInputGUI.php.

Referenced by getLeftValue().

◆ $rightvalue

string ilTRBLBorderWidthInputGUI::$rightvalue = ""
protected

Definition at line 28 of file class.ilTRBLBorderWidthInputGUI.php.

Referenced by getRightValue().

◆ $topvalue

string ilTRBLBorderWidthInputGUI::$topvalue = ""
protected

Definition at line 31 of file class.ilTRBLBorderWidthInputGUI.php.

Referenced by getTopValue().

◆ $user

ilObjUser ilTRBLBorderWidthInputGUI::$user
protected

Definition at line 37 of file class.ilTRBLBorderWidthInputGUI.php.

◆ $value

string ilTRBLBorderWidthInputGUI::$value = ""
protected

Definition at line 38 of file class.ilTRBLBorderWidthInputGUI.php.

Referenced by checkInput(), and insert().


The documentation for this class was generated from the following file: