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

Protected Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from ilTextInputGUI
 render ($a_mode="")
 Render item.

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

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.

References ilFormPropertyGUI\setType().

{
parent::__construct($a_title, $a_postvar);
$this->setType("trbl_color");
$this->dirs = array("all", "top", "bottom", "left", "right");
}

+ Here is the call graph for this function:

Member Function Documentation

ilTRBLColorPickerInputGUI::checkInput ( )

check input

public

Returns

Reimplemented from ilTextInputGUI.

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

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

{
foreach ($this->dirs as $dir)
{
$value = $_POST[$this->getPostVar()][$dir]["value"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()][$dir]["value"]);
if (trim($value) != "")
{
switch ($dir)
{
case "all": $this->setAllValue($value); break;
case "top": $this->setTopValue($value); break;
case "bottom": $this->setBottomValue($value); break;
case "left": $this->setLeftValue($value); break;
case "right": $this->setRightValue($value); break;
}
}
}
return true;
}

+ Here is the call graph for this function:

ilTRBLColorPickerInputGUI::getAcceptNamedColors ( )

Get Accept Named Colors (Leading '!').

Returns
boolean Accept Named Colors (Leading '!')

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

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

{
return $this->acceptnamedcolors;
}

+ Here is the caller graph for this function:

ilTRBLColorPickerInputGUI::getAllValue ( )

Get All Value.

Returns
string All Value

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

{
return $this->allvalue;
}
ilTRBLColorPickerInputGUI::getBottomValue ( )

Get Bottom Value.

Returns
string Bottom Value

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

{
return $this->bottomvalue;
}
ilTRBLColorPickerInputGUI::getDefaultColor ( )

Get Default Color.

Returns
mixed Default Color

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

{
return $this->defaultcolor;
}
ilTRBLColorPickerInputGUI::getLeftValue ( )

Get Left Value.

Returns
string Left Value

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

{
return $this->leftvalue;
}
ilTRBLColorPickerInputGUI::getRightValue ( )

Get Right Value.

Returns
string Right Value

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

{
return $this->rightvalue;
}
ilTRBLColorPickerInputGUI::getTopValue ( )

Get Top Value.

Returns
string Top Value

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

{
return $this->topvalue;
}
ilTRBLColorPickerInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

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

{
global $lng;
include_once('./Services/YUI/classes/class.ilYuiUtil.php');
$layout_tpl = new ilTemplate("tpl.prop_trbl_layout.html", true, true, "Services/Style");
$funcs = array(
"all" => "getAllValue", "top" => "getTopValue",
"bottom" => "getBottomValue", "left" => "getLeftValue",
"right" => "getRightValue");
foreach ($this->dirs as $dir)
{
/*switch($dir)
{
case "all": $value = strtoupper(trim($this->getAllValue())); break;
case "top": $value = strtoupper(trim($this->getTopValue())); break;
case "bottom": $value = strtoupper(trim($this->getBottomValue())); break;
case "left": $value = strtoupper(trim($this->getLeftValue())); break;
case "right": $value = strtoupper(trim($this->getRightValue())); break;
}*/
$value = trim($this->$funcs[$dir]());
if (!$this->getAcceptNamedColors() || substr($value, 0, 1) != "!")
{
$value = strtoupper($value);
}
$ctpl = new ilTemplate("tpl.prop_trbl_color.html", true, true, "Services/Style");
$js_tpl = new ilTemplate('tpl.trbl_color_picker.js',true,true,'Services/Style');
$js_tpl->setVariable('THUMB_PATH',ilUtil::getImagePath('color_picker_thumb.png','Services/Form'));
$js_tpl->setVariable('HUE_THUMB_PATH',ilUtil::getImagePath('color_picker_hue_thumb.png','Services/Form'));
$js_tpl->setVariable('COLOR_ID',$this->getFieldId()."_".$dir);
if ($ic == "")
{
$ic = "FFFFFF";
}
$js_tpl->setVariable('INIT_COLOR_SHORT',$ic);
$js_tpl->setVariable('INIT_COLOR','#'.$value);
$js_tpl->setVariable('POST_VAR', $this->getPostVar());
$js_tpl->setVariable('DIR', $dir);
if($this->getDisabled())
{
$ctpl->setVariable('COLOR_DISABLED','disabled="disabled"');
}
else
{
$ctpl->setVariable('PROP_COLOR_JS',$js_tpl->get());
}
$ctpl->setVariable("POST_VAR", $this->getPostVar());
$ctpl->setVariable("PROP_COLOR_ID", $this->getFieldId()."_".$dir);
$ctpl->setVariable("PROPERTY_VALUE_COLOR", $value);
$ctpl->setVariable("DIR", $dir);
$ctpl->setVariable("TXT_DIR", $lng->txt("sty_$dir"));
$layout_tpl->setVariable(strtoupper($dir), $ctpl->get());
}
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $layout_tpl->get());
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilTRBLColorPickerInputGUI::setAcceptNamedColors (   $a_acceptnamedcolors)

Set Accept Named Colors (Leading '!').

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

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

Referenced by ilObjStyleSheetGUI\initTagStyleForm().

{
$this->acceptnamedcolors = $a_acceptnamedcolors;
}

+ Here is the caller graph for this function:

ilTRBLColorPickerInputGUI::setAllValue (   $a_allvalue)

Set All Value.

Parameters
string$a_allvalueAll Value

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

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

Referenced by checkInput().

{
$a_allvalue = trim($a_allvalue);
if ($this->getAcceptNamedColors() && substr($a_allvalue, 0, 1) == "!")
{
$this->allvalue = $a_allvalue;
}
else
{
$this->allvalue = ilColorPickerInputGUI::determineHexcode($a_allvalue);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTRBLColorPickerInputGUI::setBottomValue (   $a_bottomvalue)

Set Bottom Value.

Parameters
string$a_bottomvalueBottom Value

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

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

Referenced by checkInput().

{
$a_bottomvalue = trim($a_bottomvalue);
if ($this->getAcceptNamedColors() && substr($a_bottomvalue, 0, 1) == "!")
{
$this->bottomvalue = $a_bottomvalue;
}
else
{
$this->bottomvalue = ilColorPickerInputGUI::determineHexcode($a_bottomvalue);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTRBLColorPickerInputGUI::setDefaultColor (   $a_defaultcolor)

Set Default Color.

Parameters
mixed$a_defaultcolorDefault Color

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

{
$this->defaultcolor = $a_defaultcolor;
}
ilTRBLColorPickerInputGUI::setLeftValue (   $a_leftvalue)

Set Left Value.

Parameters
string$a_leftvalueLeft Value

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

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

Referenced by checkInput().

{
$a_leftvalue = trim($a_leftvalue);
if ($this->getAcceptNamedColors() && substr($a_leftvalue, 0, 1) == "!")
{
$this->leftvalue = $a_leftvalue;
}
else
{
$this->leftvalue = ilColorPickerInputGUI::determineHexcode($a_leftvalue);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTRBLColorPickerInputGUI::setRightValue (   $a_rightvalue)

Set Right Value.

Parameters
string$a_rightvalueRight Value

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

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

Referenced by checkInput().

{
$a_rightvalue = trim($a_rightvalue);
if ($this->getAcceptNamedColors() && substr($a_rightvalue, 0, 1) == "!")
{
$this->rightvalue = $a_rightvalue;
}
else
{
$this->rightvalue = ilColorPickerInputGUI::determineHexcode($a_rightvalue);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTRBLColorPickerInputGUI::setTopValue (   $a_topvalue)

Set Top Value.

Parameters
string$a_topvalueTop Value

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

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

Referenced by checkInput().

{
$a_topvalue = trim($a_topvalue);
if ($this->getAcceptNamedColors() && substr($a_topvalue, 0, 1) == "!")
{
$this->topvalue = $a_topvalue;
}
else
{
$this->topvalue = ilColorPickerInputGUI::determineHexcode($a_topvalue);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilTRBLColorPickerInputGUI::$hex
protected

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


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