ILIAS  release_8 Revision v8.24
ilTRBLNumericStyleValueInputGUI 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 ilTRBLNumericStyleValueInputGUI:
+ Collaboration diagram for ilTRBLNumericStyleValueInputGUI:

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 ()
 
 setAllowPercentage (bool $a_allowpercentage)
 
 getAllowPercentage ()
 
 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 = ""
 
string $allvalue = ""
 
array $dirs
 
ilObjUser $user
 
string $value
 
bool $allowpercentage = true
 
- 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 numeric style property 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.ilTRBLNumericStyleValueInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilFormPropertyGUI.

Definition at line 42 of file class.ilTRBLNumericStyleValueInputGUI.php.

43 {
44 global $DIC;
45
46 $this->lng = $DIC->language();
47 $this->user = $DIC->user();
48 parent::__construct($a_title, $a_postvar);
49 $this->setType("style_numeric");
50 $this->dirs = array("all", "top", "bottom", "left", "right");
51 }
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()

ilTRBLNumericStyleValueInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilFormPropertyGUI.

Definition at line 113 of file class.ilTRBLNumericStyleValueInputGUI.php.

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

+ Here is the call graph for this function:

◆ getAllowPercentage()

ilTRBLNumericStyleValueInputGUI::getAllowPercentage ( )

Definition at line 108 of file class.ilTRBLNumericStyleValueInputGUI.php.

References $allowpercentage.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getAllValue()

ilTRBLNumericStyleValueInputGUI::getAllValue ( )

Definition at line 58 of file class.ilTRBLNumericStyleValueInputGUI.php.

References $allvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getBottomValue()

ilTRBLNumericStyleValueInputGUI::getBottomValue ( )

Definition at line 78 of file class.ilTRBLNumericStyleValueInputGUI.php.

References $bottomvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getInput()

ilTRBLNumericStyleValueInputGUI::getInput ( )

Definition at line 150 of file class.ilTRBLNumericStyleValueInputGUI.php.

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

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()

ilTRBLNumericStyleValueInputGUI::getLeftValue ( )

Definition at line 88 of file class.ilTRBLNumericStyleValueInputGUI.php.

References $leftvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getRightValue()

ilTRBLNumericStyleValueInputGUI::getRightValue ( )

Definition at line 98 of file class.ilTRBLNumericStyleValueInputGUI.php.

References $rightvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getTopValue()

ilTRBLNumericStyleValueInputGUI::getTopValue ( )

Definition at line 68 of file class.ilTRBLNumericStyleValueInputGUI.php.

References $topvalue.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilTRBLNumericStyleValueInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 155 of file class.ilTRBLNumericStyleValueInputGUI.php.

155 : void
156 {
158
159 $value = "";
160 $layout_tpl = new ilTemplate("tpl.prop_trbl_layout.html", true, true, "Services/Style/Content");
161
162 foreach ($this->dirs as $dir) {
163 $tpl = new ilTemplate("tpl.prop_trbl_style_numeric.html", true, true, "Services/Style/Content");
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 $current_unit = "";
175 foreach ($unit_options as $u) {
176 if (substr($value, strlen($value) - strlen($u)) == $u) {
177 $current_unit = $u;
178 }
179 }
180 $disp_val = substr($value, 0, strlen($value) - strlen($current_unit));
181 if ($current_unit == "") {
182 $current_unit = "px";
183 }
184
185 foreach ($unit_options as $option) {
186 $tpl->setCurrentBlock("unit_option");
187 $tpl->setVariable("VAL_UNIT", $option);
188 $tpl->setVariable("TXT_UNIT", $option);
189 if ($current_unit == $option) {
190 $tpl->setVariable("UNIT_SELECTED", 'selected="selected"');
191 }
192 $tpl->parseCurrentBlock();
193 }
194
195 $tpl->setVariable("POSTVAR", $this->getPostVar());
196 $tpl->setVariable("VAL_NUM", $disp_val);
197 $tpl->setVariable("TXT_DIR", $lng->txt("sty_$dir"));
198 $tpl->setVariable("DIR", $dir);
199
200 $layout_tpl->setVariable(strtoupper($dir), $tpl->get());
201 }
202
203 $a_tpl->setCurrentBlock("prop_generic");
204 $a_tpl->setVariable("PROP_GENERIC", $layout_tpl->get());
205 $a_tpl->parseCurrentBlock();
206 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
static _getStyleParameterNumericUnits(bool $a_no_percentage=false)
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(), getAllowPercentage(), 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:

◆ setAllowPercentage()

ilTRBLNumericStyleValueInputGUI::setAllowPercentage ( bool  $a_allowpercentage)

Definition at line 103 of file class.ilTRBLNumericStyleValueInputGUI.php.

103 : void
104 {
105 $this->allowpercentage = $a_allowpercentage;
106 }

◆ setAllValue()

ilTRBLNumericStyleValueInputGUI::setAllValue ( string  $a_allvalue)

Definition at line 53 of file class.ilTRBLNumericStyleValueInputGUI.php.

53 : void
54 {
55 $this->allvalue = $a_allvalue;
56 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setBottomValue()

ilTRBLNumericStyleValueInputGUI::setBottomValue ( string  $a_bottomvalue)

Definition at line 73 of file class.ilTRBLNumericStyleValueInputGUI.php.

73 : void
74 {
75 $this->bottomvalue = $a_bottomvalue;
76 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setLeftValue()

ilTRBLNumericStyleValueInputGUI::setLeftValue ( string  $a_leftvalue)

Definition at line 83 of file class.ilTRBLNumericStyleValueInputGUI.php.

83 : void
84 {
85 $this->leftvalue = $a_leftvalue;
86 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setRightValue()

ilTRBLNumericStyleValueInputGUI::setRightValue ( string  $a_rightvalue)

Definition at line 93 of file class.ilTRBLNumericStyleValueInputGUI.php.

93 : void
94 {
95 $this->rightvalue = $a_rightvalue;
96 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setTopValue()

ilTRBLNumericStyleValueInputGUI::setTopValue ( string  $a_topvalue)

Definition at line 63 of file class.ilTRBLNumericStyleValueInputGUI.php.

63 : void
64 {
65 $this->topvalue = $a_topvalue;
66 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilTRBLNumericStyleValueInputGUI::setValueByArray ( array  $a_values)

Definition at line 208 of file class.ilTRBLNumericStyleValueInputGUI.php.

208 : void
209 {
210 $this->setAllValue($a_values[$this->getPostVar()]["all"]["num_value"] .
211 $a_values[$this->getPostVar()]["all"]["num_unit"]);
212 $this->setBottomValue($a_values[$this->getPostVar()]["bottom"]["num_value"] .
213 $a_values[$this->getPostVar()]["bottom"]["num_unit"]);
214 $this->setTopValue($a_values[$this->getPostVar()]["top"]["num_value"] .
215 $a_values[$this->getPostVar()]["top"]["num_unit"]);
216 $this->setLeftValue($a_values[$this->getPostVar()]["left"]["num_value"] .
217 $a_values[$this->getPostVar()]["left"]["num_unit"]);
218 $this->setRightValue($a_values[$this->getPostVar()]["right"]["num_value"] .
219 $a_values[$this->getPostVar()]["right"]["num_unit"]);
220 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $allowpercentage

bool ilTRBLNumericStyleValueInputGUI::$allowpercentage = true
protected

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

Referenced by getAllowPercentage().

◆ $allvalue

string ilTRBLNumericStyleValueInputGUI::$allvalue = ""
protected

Definition at line 32 of file class.ilTRBLNumericStyleValueInputGUI.php.

Referenced by getAllValue().

◆ $bottomvalue

string ilTRBLNumericStyleValueInputGUI::$bottomvalue = ""
protected

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

Referenced by getBottomValue().

◆ $dirs

array ilTRBLNumericStyleValueInputGUI::$dirs
protected

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

◆ $leftvalue

string ilTRBLNumericStyleValueInputGUI::$leftvalue = ""
protected

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

Referenced by getLeftValue().

◆ $rightvalue

string ilTRBLNumericStyleValueInputGUI::$rightvalue = ""
protected

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

Referenced by getRightValue().

◆ $topvalue

string ilTRBLNumericStyleValueInputGUI::$topvalue = ""
protected

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

Referenced by getTopValue().

◆ $user

ilObjUser ilTRBLNumericStyleValueInputGUI::$user
protected

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

◆ $value

string ilTRBLNumericStyleValueInputGUI::$value
protected

Definition at line 39 of file class.ilTRBLNumericStyleValueInputGUI.php.

Referenced by insert().


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