ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 (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 ()
 
 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 ()
 
 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)
 
- 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
 getTableFilterLabelFor ()
 Get label "for" attribute value. 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
 symbol ()
 
 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

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 = "" 
)

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

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

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: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilTRBLColorPickerInputGUI::checkInput ( )

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

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

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);
156  break;
157  case "top": $this->setTopValue($value);
158  break;
159  case "bottom": $this->setBottomValue($value);
160  break;
161  case "left": $this->setLeftValue($value);
162  break;
163  case "right": $this->setRightValue($value);
164  break;
165  }
166  }
167  }
168  return true;
169  }
+ Here is the call graph for this function:

◆ getAcceptNamedColors()

ilTRBLColorPickerInputGUI::getAcceptNamedColors ( )

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

References $acceptnamedcolors.

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

142  : bool
143  {
145  }
+ Here is the caller graph for this function:

◆ getAllValue()

ilTRBLColorPickerInputGUI::getAllValue ( )

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

References $allvalue.

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

◆ getBottomValue()

ilTRBLColorPickerInputGUI::getBottomValue ( )

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

References $bottomvalue.

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

◆ getDefaultColor()

ilTRBLColorPickerInputGUI::getDefaultColor ( )

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

References $defaultcolor.

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

◆ getInput()

ilTRBLColorPickerInputGUI::getInput ( )

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

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

Referenced by checkInput().

171  : array
172  {
173  return $this->arrayArray($this->getPostVar());
174  }
+ 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.

References $leftvalue.

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

◆ getRightValue()

ilTRBLColorPickerInputGUI::getRightValue ( )

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

References $rightvalue.

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

◆ getTopValue()

ilTRBLColorPickerInputGUI::getTopValue ( )

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

References $topvalue.

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

◆ insert()

ilTRBLColorPickerInputGUI::insert ( ilTemplate  $a_tpl)

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

References Vendor\Package\$f, ilFormPropertyGUI\$lng, 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().

176  : void
177  {
178  $lng = $this->lng;
179 
180  $layout_tpl = new ilTemplate("tpl.prop_trbl_layout.html", true, true, "components/ILIAS/Style/Content");
181 
182  $funcs = array(
183  "all" => "getAllValue", "top" => "getTopValue",
184  "bottom" => "getBottomValue", "left" => "getLeftValue",
185  "right" => "getRightValue");
186 
187  foreach ($this->dirs as $dir) {
188  $f = $funcs[$dir];
189  $value = trim($this->$f());
190  if (!$this->getAcceptNamedColors() || substr($value, 0, 1) != "!") {
191  $value = strtoupper($value);
192  }
193 
194  $tpl = new ilTemplate('tpl.prop_color.html', true, true, 'components/ILIAS/Form');
195  $tpl->setVariable('COLOR_ID', $this->getFieldId() . "_" . $dir);
197  if ($ic == "") {
198  $ic = "FFFFFF";
199  }
200  $tpl->setVariable('INIT_COLOR_SHORT', $ic);
201  $tpl->setVariable('POST_VAR', $this->getPostVar());
202 
203  if ($this->getDisabled()) {
204  $a_tpl->setVariable('COLOR_DISABLED', 'disabled="disabled"');
205  }
206 
207  $tpl->setVariable("POST_VAR", $this->getPostVar() . "[" . $dir . "][value]");
208  $tpl->setVariable("PROP_COLOR_ID", $this->getFieldId() . "_" . $dir);
209 
210  if (substr(trim((string) $this->getValue()), 0, 1) == "!" && $this->getAcceptNamedColors()) {
211  $tpl->setVariable(
212  "PROPERTY_VALUE_COLOR",
214  );
215  } else {
216  $tpl->setVariable("PROPERTY_VALUE_COLOR", ilLegacyFormElementsUtil::prepareFormOutput($value));
217  $tpl->setVariable('INIT_COLOR', '#' . $value);
218  }
219 
220  $tpl->setVariable("TXT_PREFIX", $lng->txt("sty_$dir"));
221 
222  $layout_tpl->setVariable(strtoupper($dir), $tpl->get());
223  }
224 
225  $a_tpl->setCurrentBlock("prop_generic");
226  $a_tpl->setVariable("PROP_GENERIC", $layout_tpl->get());
227  $a_tpl->parseCurrentBlock();
228  }
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...
static prepareFormOutput($a_str, bool $a_strip=false)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static determineHexcode(string $a_value)
+ Here is the call graph for this function:

◆ setAcceptNamedColors()

ilTRBLColorPickerInputGUI::setAcceptNamedColors ( bool  $a_acceptnamedcolors)

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

Referenced by ilStyleCharacteristicGUI\initTagStyleForm().

137  : void
138  {
139  $this->acceptnamedcolors = $a_acceptnamedcolors;
140  }
+ Here is the caller graph for this function:

◆ setAllValue()

ilTRBLColorPickerInputGUI::setAllValue ( string  $a_allvalue)

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

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

Referenced by checkInput().

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  }
static determineHexcode(string $a_value)
+ 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.

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

Referenced by checkInput().

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  }
static determineHexcode(string $a_value)
+ 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.

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

Referenced by checkInput().

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  }
static determineHexcode(string $a_value)
+ 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.

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

Referenced by checkInput().

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  }
static determineHexcode(string $a_value)
+ 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.

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

Referenced by checkInput().

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  }
static determineHexcode(string $a_value)
+ 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: