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

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 ()
 
 setDefaultColor (string $a_defaultcolor)
 
 getDefaultColor ()
 
 setAcceptNamedColors (bool $a_acceptnamedcolors)
 
 getAcceptNamedColors ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
- Public Member Functions inherited from ilTextInputGUI
 __construct (string $a_title="", string $a_postvar="")
 
 setValue ($a_value)
 
 getValue ()
 
 setValidationFailureMessage (string $a_msg)
 
 getValidationFailureMessage ()
 
 setValidationRegexp (string $a_value)
 
 getValidationRegexp ()
 
 setMaxLength (?int $a_maxlength)
 
 getMaxLength ()
 
 setSize (int $a_size)
 
 setInlineStyle (string $a_style)
 
 getInlineStyle ()
 
 setCssClass (string $a_class)
 
 getCssClass ()
 
 setValueByArray (array $a_values)
 
 getSize ()
 
 setSuffix (string $a_value)
 
 getSuffix ()
 
 setInputType (string $a_type)
 set input type More...
 
 getInputType ()
 
 setSubmitFormOnEnter (bool $a_val)
 
 getSubmitFormOnEnter ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 getDataSource ()
 
 setDataSource (string $href, string $a_delimiter=null)
 
 setDataSourceSubmitOnSelection (bool $a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl (string $a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 
 render (string $a_mode="")
 
 insert (ilTemplate $a_tpl)
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
 setDisableHtmlAutoComplete (bool $autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
 getPostValueForComparison ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
- 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...
 
- Public Member Functions inherited from ilTableFilterItem
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Attributes

bool $acceptnamedcolors = false
 
string $defaultcolor = ""
 
string $allvalue = ""
 
string $leftvalue = ""
 
string $rightvalue = ""
 
string $bottomvalue = ""
 
string $topvalue = ""
 
array $dirs = []
 
string $hex = ""
 
- Protected Attributes inherited from ilTextInputGUI
 $value = null
 
int $maxlength = 200
 
int $size = 40
 
string $validationRegexp = ""
 
string $validationFailureMessage = ''
 
string $suffix = ""
 
string $style_css = ""
 
string $css_class = ""
 
string $ajax_datasource = ""
 
string $ajax_datasource_delimiter = null
 
bool $ajax_datasource_commit = false
 
string $ajax_datasource_commit_url = ""
 
bool $submit_form_on_enter = false
 
bool $autocomplete_disabled = false
 
string $input_type = ""
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- 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 Color picker form for selecting color hexcodes using yui library (all/top/right/bottom/left)

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilTextInputGUI.

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilTRBLColorPickerInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilTextInputGUI.

Definition at line 147 of file class.ilTRBLColorPickerInputGUI.php.

147 : bool
148 {
149 $input = $this->getInput();
150 foreach ($this->dirs as $dir) {
151 $value = $input[$dir]["value"];
152
153 if (trim($value) != "") {
154 switch ($dir) {
155 case "all": $this->setAllValue($value); break;
156 case "top": $this->setTopValue($value); break;
157 case "bottom": $this->setBottomValue($value); break;
158 case "left": $this->setLeftValue($value); break;
159 case "right": $this->setRightValue($value); break;
160 }
161 }
162 }
163 return true;
164 }

References ilTextInputGUI\$value, getInput(), setAllValue(), setBottomValue(), setLeftValue(), setRightValue(), and setTopValue().

+ Here is the call graph for this function:

◆ getAcceptNamedColors()

ilTRBLColorPickerInputGUI::getAcceptNamedColors ( )

Definition at line 142 of file class.ilTRBLColorPickerInputGUI.php.

142 : bool
143 {
145 }

References $acceptnamedcolors.

Referenced by insert(), setAllValue(), setBottomValue(), setLeftValue(), setRightValue(), and setTopValue().

+ Here is the caller graph for this function:

◆ getAllValue()

ilTRBLColorPickerInputGUI::getAllValue ( )

Definition at line 62 of file class.ilTRBLColorPickerInputGUI.php.

62 : string
63 {
64 return $this->allvalue;
65 }

References $allvalue.

◆ getBottomValue()

ilTRBLColorPickerInputGUI::getBottomValue ( )

Definition at line 92 of file class.ilTRBLColorPickerInputGUI.php.

92 : string
93 {
94 return $this->bottomvalue;
95 }

References $bottomvalue.

◆ getDefaultColor()

ilTRBLColorPickerInputGUI::getDefaultColor ( )

Definition at line 132 of file class.ilTRBLColorPickerInputGUI.php.

132 : string
133 {
134 return $this->defaultcolor;
135 }

References $defaultcolor.

◆ getInput()

ilTRBLColorPickerInputGUI::getInput ( )
Returns
string|string[]

Reimplemented from ilTextInputGUI.

Definition at line 166 of file class.ilTRBLColorPickerInputGUI.php.

166 : array
167 {
168 return $this->arrayArray($this->getPostVar());
169 }

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

ilTRBLColorPickerInputGUI::getLeftValue ( )

Definition at line 107 of file class.ilTRBLColorPickerInputGUI.php.

107 : string
108 {
109 return $this->leftvalue;
110 }

References $leftvalue.

◆ getRightValue()

ilTRBLColorPickerInputGUI::getRightValue ( )

Definition at line 122 of file class.ilTRBLColorPickerInputGUI.php.

122 : string
123 {
124 return $this->rightvalue;
125 }

References $rightvalue.

◆ getTopValue()

ilTRBLColorPickerInputGUI::getTopValue ( )

Definition at line 77 of file class.ilTRBLColorPickerInputGUI.php.

77 : string
78 {
79 return $this->topvalue;
80 }

References $topvalue.

◆ insert()

ilTRBLColorPickerInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented from ilTextInputGUI.

Definition at line 171 of file class.ilTRBLColorPickerInputGUI.php.

171 : void
172 {
174
175 $layout_tpl = new ilTemplate("tpl.prop_trbl_layout.html", true, true, "Services/Style/Content");
176
177 $funcs = array(
178 "all" => "getAllValue", "top" => "getTopValue",
179 "bottom" => "getBottomValue", "left" => "getLeftValue",
180 "right" => "getRightValue");
181
182 foreach ($this->dirs as $dir) {
183 $f = $funcs[$dir];
184 $value = trim($this->$f());
185 if (!$this->getAcceptNamedColors() || substr($value, 0, 1) != "!") {
186 $value = strtoupper($value);
187 }
188
189 $tpl = new ilTemplate('tpl.prop_color.html', true, true, 'Services/Form');
190 $tpl->setVariable('COLOR_ID', $this->getFieldId() . "_" . $dir);
192 if ($ic == "") {
193 $ic = "FFFFFF";
194 }
195 $tpl->setVariable('INIT_COLOR_SHORT', $ic);
196 $tpl->setVariable('POST_VAR', $this->getPostVar());
197
198 if ($this->getDisabled()) {
199 $a_tpl->setVariable('COLOR_DISABLED', 'disabled="disabled"');
200 }
201
202 $tpl->setVariable("POST_VAR", $this->getPostVar() . "[" . $dir . "][value]");
203 $tpl->setVariable("PROP_COLOR_ID", $this->getFieldId() . "_" . $dir);
204
205 if (substr(trim((string) $this->getValue()), 0, 1) == "!" && $this->getAcceptNamedColors()) {
206 $tpl->setVariable(
207 "PROPERTY_VALUE_COLOR",
209 );
210 } else {
211 $tpl->setVariable("PROPERTY_VALUE_COLOR", ilLegacyFormElementsUtil::prepareFormOutput($value));
212 $tpl->setVariable('INIT_COLOR', '#' . $value);
213 }
214
215 $tpl->setVariable("TXT_PREFIX", $lng->txt("sty_$dir"));
216
217 $layout_tpl->setVariable(strtoupper($dir), $tpl->get());
218 }
219
220 $a_tpl->setCurrentBlock("prop_generic");
221 $a_tpl->setVariable("PROP_GENERIC", $layout_tpl->get());
222 $a_tpl->parseCurrentBlock();
223 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
static determineHexcode(string $a_value)
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 prepareFormOutput($a_str, bool $a_strip=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 Vendor\Package\$f, ilFormPropertyGUI\$lng, $tpl, ilTextInputGUI\$value, ilColorPickerInputGUI\determineHexcode(), getAcceptNamedColors(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getValue(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ setAcceptNamedColors()

ilTRBLColorPickerInputGUI::setAcceptNamedColors ( bool  $a_acceptnamedcolors)

Definition at line 137 of file class.ilTRBLColorPickerInputGUI.php.

137 : void
138 {
139 $this->acceptnamedcolors = $a_acceptnamedcolors;
140 }

◆ setAllValue()

ilTRBLColorPickerInputGUI::setAllValue ( string  $a_allvalue)

Definition at line 52 of file class.ilTRBLColorPickerInputGUI.php.

52 : void
53 {
54 $a_allvalue = trim($a_allvalue);
55 if ($this->getAcceptNamedColors() && substr($a_allvalue, 0, 1) == "!") {
56 $this->allvalue = $a_allvalue;
57 } else {
58 $this->allvalue = ilColorPickerInputGUI::determineHexcode($a_allvalue);
59 }
60 }

References ilColorPickerInputGUI\determineHexcode(), and getAcceptNamedColors().

Referenced by checkInput().

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

◆ setBottomValue()

ilTRBLColorPickerInputGUI::setBottomValue ( string  $a_bottomvalue)

Definition at line 82 of file class.ilTRBLColorPickerInputGUI.php.

82 : void
83 {
84 $a_bottomvalue = trim($a_bottomvalue);
85 if ($this->getAcceptNamedColors() && substr($a_bottomvalue, 0, 1) == "!") {
86 $this->bottomvalue = $a_bottomvalue;
87 } else {
88 $this->bottomvalue = ilColorPickerInputGUI::determineHexcode($a_bottomvalue);
89 }
90 }

References ilColorPickerInputGUI\determineHexcode(), and getAcceptNamedColors().

Referenced by checkInput().

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

◆ setDefaultColor()

ilTRBLColorPickerInputGUI::setDefaultColor ( string  $a_defaultcolor)

Definition at line 127 of file class.ilTRBLColorPickerInputGUI.php.

127 : void
128 {
129 $this->defaultcolor = $a_defaultcolor;
130 }

◆ setLeftValue()

ilTRBLColorPickerInputGUI::setLeftValue ( string  $a_leftvalue)

Definition at line 97 of file class.ilTRBLColorPickerInputGUI.php.

97 : void
98 {
99 $a_leftvalue = trim($a_leftvalue);
100 if ($this->getAcceptNamedColors() && substr($a_leftvalue, 0, 1) == "!") {
101 $this->leftvalue = $a_leftvalue;
102 } else {
103 $this->leftvalue = ilColorPickerInputGUI::determineHexcode($a_leftvalue);
104 }
105 }

References ilColorPickerInputGUI\determineHexcode(), and getAcceptNamedColors().

Referenced by checkInput().

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

◆ setRightValue()

ilTRBLColorPickerInputGUI::setRightValue ( string  $a_rightvalue)

Definition at line 112 of file class.ilTRBLColorPickerInputGUI.php.

112 : void
113 {
114 $a_rightvalue = trim($a_rightvalue);
115 if ($this->getAcceptNamedColors() && substr($a_rightvalue, 0, 1) == "!") {
116 $this->rightvalue = $a_rightvalue;
117 } else {
118 $this->rightvalue = ilColorPickerInputGUI::determineHexcode($a_rightvalue);
119 }
120 }

References ilColorPickerInputGUI\determineHexcode(), and getAcceptNamedColors().

Referenced by checkInput().

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

◆ setTopValue()

ilTRBLColorPickerInputGUI::setTopValue ( string  $a_topvalue)

Definition at line 67 of file class.ilTRBLColorPickerInputGUI.php.

67 : void
68 {
69 $a_topvalue = trim($a_topvalue);
70 if ($this->getAcceptNamedColors() && substr($a_topvalue, 0, 1) == "!") {
71 $this->topvalue = $a_topvalue;
72 } else {
73 $this->topvalue = ilColorPickerInputGUI::determineHexcode($a_topvalue);
74 }
75 }

References ilColorPickerInputGUI\determineHexcode(), and getAcceptNamedColors().

Referenced by checkInput().

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

Field Documentation

◆ $acceptnamedcolors

bool ilTRBLColorPickerInputGUI::$acceptnamedcolors = false
protected

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

Referenced by getAcceptNamedColors().

◆ $allvalue

string ilTRBLColorPickerInputGUI::$allvalue = ""
protected

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

Referenced by getAllValue().

◆ $bottomvalue

string ilTRBLColorPickerInputGUI::$bottomvalue = ""
protected

Definition at line 33 of file class.ilTRBLColorPickerInputGUI.php.

Referenced by getBottomValue().

◆ $defaultcolor

string ilTRBLColorPickerInputGUI::$defaultcolor = ""
protected

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

Referenced by getDefaultColor().

◆ $dirs

array ilTRBLColorPickerInputGUI::$dirs = []
protected

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

◆ $hex

string ilTRBLColorPickerInputGUI::$hex = ""
protected

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

◆ $leftvalue

string ilTRBLColorPickerInputGUI::$leftvalue = ""
protected

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

Referenced by getLeftValue().

◆ $rightvalue

string ilTRBLColorPickerInputGUI::$rightvalue = ""
protected

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

Referenced by getRightValue().

◆ $topvalue

string ilTRBLColorPickerInputGUI::$topvalue = ""
protected

Definition at line 34 of file class.ilTRBLColorPickerInputGUI.php.

Referenced by getTopValue().


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