ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTRBLColorPickerInputGUI Class Reference

Color picker form for selecting color hexcodes using yui library (all/top/right/bottom/left) More...

+ Inheritance diagram for ilTRBLColorPickerInputGUI:
+ Collaboration diagram for ilTRBLColorPickerInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setAllValue ($a_allvalue)
 Set All Value. More...
 
 getAllValue ()
 Get All Value. More...
 
 setTopValue ($a_topvalue)
 Set Top Value. More...
 
 getTopValue ()
 Get Top Value. More...
 
 setBottomValue ($a_bottomvalue)
 Set Bottom Value. More...
 
 getBottomValue ()
 Get Bottom Value. More...
 
 setLeftValue ($a_leftvalue)
 Set Left Value. More...
 
 getLeftValue ()
 Get Left Value. More...
 
 setRightValue ($a_rightvalue)
 Set Right Value. More...
 
 getRightValue ()
 Get Right Value. More...
 
 setDefaultColor ($a_defaultcolor)
 Set Default Color. More...
 
 getDefaultColor ()
 Get Default Color. More...
 
 setAcceptNamedColors ($a_acceptnamedcolors)
 Set Accept Named Colors (Leading '!'). More...
 
 getAcceptNamedColors ()
 Get Accept Named Colors (Leading '!'). More...
 
 checkInput ()
 check input More...
 
 insert ($a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilTextInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValidationFailureMessage ($a_msg)
 Set message string for validation failure. More...
 
 getValidationFailureMessage ()
 
 setValidationRegexp ($a_value)
 Set validation regexp. More...
 
 getValidationRegexp ()
 Get validation regexp. More...
 
 setMaxLength ($a_maxlength)
 Set Max Length. More...
 
 getMaxLength ()
 Get Max Length. More...
 
 setSize ($a_size)
 Set Size. More...
 
 setInlineStyle ($a_style)
 Set inline style. More...
 
 getInlineStyle ()
 Get inline style. More...
 
 setCssClass ($a_class)
 
 getCssClass ()
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getSize ()
 Get Size. More...
 
 setSuffix ($a_value)
 Set suffix. More...
 
 getSuffix ()
 Get suffix. More...
 
 setInputType ($a_type)
 set input type More...
 
 getInputType ()
 get input type More...
 
 setSubmitFormOnEnter ($a_val)
 Set submit form on enter. More...
 
 getSubmitFormOnEnter ()
 Get submit form on enter. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getDataSource ()
 get datasource link for js autocomplete More...
 
 setDataSource ($href, $a_delimiter=null)
 set datasource link for js autocomplete More...
 
 setDataSourceSubmitOnSelection ($a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl ($a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
 setDisableHtmlAutoComplete ($autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($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...
 
- 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

 $hex
 
- Protected Attributes inherited from ilTextInputGUI
 $value
 
 $maxlength = 200
 
 $size = 40
 
 $validationRegexp
 
 $validationFailureMessage = ''
 
 $suffix
 
 $style_css
 
 $css_class
 
 $ajax_datasource
 
 $ajax_datasource_delimiter
 
 $ajax_datasource_commit = false
 
 $ajax_datasource_commit_url
 
 $submit_form_on_enter = false
 
 $autocomplete_disabled = false
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

Color picker form for selecting color hexcodes using yui library (all/top/right/bottom/left)

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..com
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilTextInputGUI.

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilTRBLColorPickerInputGUI::checkInput ( )

check input

@access public

Returns

Reimplemented from ilTextInputGUI.

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

226 {
227 foreach ($this->dirs as $dir) {
228 $value = $_POST[$this->getPostVar()][$dir]["value"] =
229 ilUtil::stripSlashes($_POST[$this->getPostVar()][$dir]["value"]);
230
231 if (trim($value) != "") {
232 switch ($dir) {
233 case "all": $this->setAllValue($value); break;
234 case "top": $this->setTopValue($value); break;
235 case "bottom": $this->setBottomValue($value); break;
236 case "left": $this->setLeftValue($value); break;
237 case "right": $this->setRightValue($value); break;
238 }
239 }
240 }
241 return true;
242 }
$_POST["username"]
getPostVar()
Get Post Variable.
setLeftValue($a_leftvalue)
Set Left Value.
setBottomValue($a_bottomvalue)
Set Bottom Value.
setRightValue($a_rightvalue)
Set Right Value.
setTopValue($a_topvalue)
Set Top Value.
setAllValue($a_allvalue)
Set All Value.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, ilTextInputGUI\$value, ilFormPropertyGUI\getPostVar(), setAllValue(), setBottomValue(), setLeftValue(), setRightValue(), setTopValue(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getAcceptNamedColors()

ilTRBLColorPickerInputGUI::getAcceptNamedColors ( )

Get Accept Named Colors (Leading '!').

Returns
boolean Accept Named Colors (Leading '!')

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

215 {
216 return $this->acceptnamedcolors;
217 }

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

+ Here is the caller graph for this function:

◆ getAllValue()

ilTRBLColorPickerInputGUI::getAllValue ( )

Get All Value.

Returns
string All Value

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

75 {
76 return $this->allvalue;
77 }

◆ getBottomValue()

ilTRBLColorPickerInputGUI::getBottomValue ( )

Get Bottom Value.

Returns
string Bottom Value

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

125 {
126 return $this->bottomvalue;
127 }

◆ getDefaultColor()

ilTRBLColorPickerInputGUI::getDefaultColor ( )

Get Default Color.

Returns
mixed Default Color

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

195 {
196 return $this->defaultcolor;
197 }

◆ getLeftValue()

ilTRBLColorPickerInputGUI::getLeftValue ( )

Get Left Value.

Returns
string Left Value

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

150 {
151 return $this->leftvalue;
152 }

◆ getRightValue()

ilTRBLColorPickerInputGUI::getRightValue ( )

Get Right Value.

Returns
string Right Value

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

175 {
176 return $this->rightvalue;
177 }

◆ getTopValue()

ilTRBLColorPickerInputGUI::getTopValue ( )

Get Top Value.

Returns
string Top Value

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

100 {
101 return $this->topvalue;
102 }

◆ insert()

ilTRBLColorPickerInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

Reimplemented from ilTextInputGUI.

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

250 {
252
253 include_once('./Services/YUI/classes/class.ilYuiUtil.php');
255
256 $layout_tpl = new ilTemplate("tpl.prop_trbl_layout.html", true, true, "Services/Style/Content");
257
258 $funcs = array(
259 "all" => "getAllValue", "top" => "getTopValue",
260 "bottom" => "getBottomValue", "left" => "getLeftValue",
261 "right" => "getRightValue");
262
263 foreach ($this->dirs as $dir) {
264 /*switch($dir)
265 {
266 case "all": $value = strtoupper(trim($this->getAllValue())); break;
267 case "top": $value = strtoupper(trim($this->getTopValue())); break;
268 case "bottom": $value = strtoupper(trim($this->getBottomValue())); break;
269 case "left": $value = strtoupper(trim($this->getLeftValue())); break;
270 case "right": $value = strtoupper(trim($this->getRightValue())); break;
271 }*/
272 $f = $funcs[$dir];
273 $value = trim($this->$f());
274 if (!$this->getAcceptNamedColors() || substr($value, 0, 1) != "!") {
275 $value = strtoupper($value);
276 }
277
278 $ctpl = new ilTemplate("tpl.prop_trbl_color.html", true, true, "Services/Style/Content");
279
280 $js_tpl = new ilTemplate('tpl.trbl_color_picker.js', true, true, 'Services/Style/Content');
281 $js_tpl->setVariable('THUMB_PATH', ilUtil::getImagePath('color_picker_thumb.png', 'Services/Form'));
282 $js_tpl->setVariable('HUE_THUMB_PATH', ilUtil::getImagePath('color_picker_hue_thumb.png', 'Services/Form'));
283 $js_tpl->setVariable('COLOR_ID', $this->getFieldId() . "_" . $dir);
285 if ($ic == "") {
286 $ic = "FFFFFF";
287 }
288 $js_tpl->setVariable('INIT_COLOR_SHORT', $ic);
289 $js_tpl->setVariable('INIT_COLOR', '#' . $value);
290 $js_tpl->setVariable('POST_VAR', $this->getPostVar());
291 $js_tpl->setVariable('DIR', $dir);
292
293
294 if ($this->getDisabled()) {
295 $ctpl->setVariable('COLOR_DISABLED', 'disabled="disabled"');
296 } else {
297 $ctpl->setVariable('PROP_COLOR_JS', $js_tpl->get());
298 }
299 $ctpl->setVariable("POST_VAR", $this->getPostVar());
300 $ctpl->setVariable("PROP_COLOR_ID", $this->getFieldId() . "_" . $dir);
301
302 $ctpl->setVariable("PROPERTY_VALUE_COLOR", $value);
303 $ctpl->setVariable("DIR", $dir);
304 $ctpl->setVariable("TXT_DIR", $lng->txt("sty_$dir"));
305
306 $layout_tpl->setVariable(strtoupper($dir), $ctpl->get());
307 }
308
309 $a_tpl->setCurrentBlock("prop_generic");
310 $a_tpl->setVariable("PROP_GENERIC", $layout_tpl->get());
311 $a_tpl->parseCurrentBlock();
312 }
static determineHexcode($a_value)
Determine hex code for a given value.
getFieldId()
Get Post Variable.
getAcceptNamedColors()
Get Accept Named Colors (Leading '!').
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static initColorPicker()
init color picker button

References Vendor\Package\$f, ilFormPropertyGUI\$lng, ilTextInputGUI\$value, ilColorPickerInputGUI\determineHexcode(), getAcceptNamedColors(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilUtil\getImagePath(), ilFormPropertyGUI\getPostVar(), and ilYuiUtil\initColorPicker().

+ Here is the call graph for this function:

◆ setAcceptNamedColors()

ilTRBLColorPickerInputGUI::setAcceptNamedColors (   $a_acceptnamedcolors)

Set Accept Named Colors (Leading '!').

Parameters
boolean$a_acceptnamedcolorsAccept Named Colors (Leading '!')

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

205 {
206 $this->acceptnamedcolors = $a_acceptnamedcolors;
207 }

◆ setAllValue()

ilTRBLColorPickerInputGUI::setAllValue (   $a_allvalue)

Set All Value.

Parameters
string$a_allvalueAll Value

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

60 {
61 $a_allvalue = trim($a_allvalue);
62 if ($this->getAcceptNamedColors() && substr($a_allvalue, 0, 1) == "!") {
63 $this->allvalue = $a_allvalue;
64 } else {
65 $this->allvalue = ilColorPickerInputGUI::determineHexcode($a_allvalue);
66 }
67 }

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

Set Bottom Value.

Parameters
string$a_bottomvalueBottom Value

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

110 {
111 $a_bottomvalue = trim($a_bottomvalue);
112 if ($this->getAcceptNamedColors() && substr($a_bottomvalue, 0, 1) == "!") {
113 $this->bottomvalue = $a_bottomvalue;
114 } else {
115 $this->bottomvalue = ilColorPickerInputGUI::determineHexcode($a_bottomvalue);
116 }
117 }

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

Set Default Color.

Parameters
mixed$a_defaultcolorDefault Color

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

185 {
186 $this->defaultcolor = $a_defaultcolor;
187 }

◆ setLeftValue()

ilTRBLColorPickerInputGUI::setLeftValue (   $a_leftvalue)

Set Left Value.

Parameters
string$a_leftvalueLeft Value

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

135 {
136 $a_leftvalue = trim($a_leftvalue);
137 if ($this->getAcceptNamedColors() && substr($a_leftvalue, 0, 1) == "!") {
138 $this->leftvalue = $a_leftvalue;
139 } else {
140 $this->leftvalue = ilColorPickerInputGUI::determineHexcode($a_leftvalue);
141 }
142 }

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

Set Right Value.

Parameters
string$a_rightvalueRight Value

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

160 {
161 $a_rightvalue = trim($a_rightvalue);
162 if ($this->getAcceptNamedColors() && substr($a_rightvalue, 0, 1) == "!") {
163 $this->rightvalue = $a_rightvalue;
164 } else {
165 $this->rightvalue = ilColorPickerInputGUI::determineHexcode($a_rightvalue);
166 }
167 }

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

Set Top Value.

Parameters
string$a_topvalueTop Value

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

85 {
86 $a_topvalue = trim($a_topvalue);
87 if ($this->getAcceptNamedColors() && substr($a_topvalue, 0, 1) == "!") {
88 $this->topvalue = $a_topvalue;
89 } else {
90 $this->topvalue = ilColorPickerInputGUI::determineHexcode($a_topvalue);
91 }
92 }

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

◆ $hex

ilTRBLColorPickerInputGUI::$hex
protected

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


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