ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSystemStyleIconColorSet Class Reference
+ Collaboration diagram for ilSystemStyleIconColorSet:

Public Member Functions

 addColor (ilSystemStyleIconColor $color)
 
 getColors ()
 
 setColors (array $colors)
 
 getColorById ($id="")
 
 doesColorExist ($id)
 
 mergeColorSet (ilSystemStyleIconColorSet $color_set)
 Merges an other colorset into this one. More...
 
 getColorsSortedAsArray ()
 Orders and sorts the colors to be displayed in GUI (form) More...
 
 asArray ()
 Returns the ids of the colors of this color set as array. More...
 
 asString ()
 Returns the ids of the colors of this color set as string. More...
 

Protected Attributes

 $colors = []
 

Detailed Description

Definition at line 12 of file class.ilSystemStyleIconColorSet.php.

Member Function Documentation

◆ addColor()

ilSystemStyleIconColorSet::addColor ( ilSystemStyleIconColor  $color)
Parameters
ilSystemStyleIconColor$color

Definition at line 24 of file class.ilSystemStyleIconColorSet.php.

References ilSystemStyleIconColor\getId().

Referenced by mergeColorSet().

25  {
26  $this->colors[$color->getId()] = $color;
27  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asArray()

ilSystemStyleIconColorSet::asArray ( )

Returns the ids of the colors of this color set as array.

Returns
array [color_id]

Definition at line 104 of file class.ilSystemStyleIconColorSet.php.

References $colors, and getColors().

105  {
106  $colors = [];
107  foreach ($this->getColors() as $color) {
108  $colors[] = $color->getId();
109  }
110  return $colors;
111  }
+ Here is the call graph for this function:

◆ asString()

ilSystemStyleIconColorSet::asString ( )

Returns the ids of the colors of this color set as string.

Returns
array

Definition at line 118 of file class.ilSystemStyleIconColorSet.php.

References $colors, and getColors().

119  {
120  $colors = "";
121  foreach ($this->getColors() as $color) {
122  $colors .= $color->getId() . "; ";
123  }
124  return $colors;
125  }
+ Here is the call graph for this function:

◆ doesColorExist()

ilSystemStyleIconColorSet::doesColorExist (   $id)
Parameters
string$id
Returns
bool

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

References $id.

Referenced by mergeColorSet().

63  {
64  return array_key_exists($id, $this->colors);
65  }
if(!array_key_exists('StateId', $_REQUEST)) $id
+ Here is the caller graph for this function:

◆ getColorById()

ilSystemStyleIconColorSet::getColorById (   $id = "")
Parameters
string$id
Returns
ilSystemStyleIconColor
Exceptions
ilSystemStyleException

Definition at line 50 of file class.ilSystemStyleIconColorSet.php.

References $id, and ilSystemStyleException\INVALID_ID.

51  {
52  if (!array_key_exists($id, $this->colors)) {
54  }
55  return $this->colors[$id];
56  }
if(!array_key_exists('StateId', $_REQUEST)) $id
Class for advanced editing exception handling in ILIAS.

◆ getColors()

ilSystemStyleIconColorSet::getColors ( )
Returns
ilSystemStyleIconColor[]

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

References $colors.

Referenced by asArray(), asString(), getColorsSortedAsArray(), and mergeColorSet().

+ Here is the caller graph for this function:

◆ getColorsSortedAsArray()

ilSystemStyleIconColorSet::getColorsSortedAsArray ( )

Orders and sorts the colors to be displayed in GUI (form)

Returns
array [CategoryOfColor][color]

Definition at line 85 of file class.ilSystemStyleIconColorSet.php.

References $colors, array, and getColors().

86  {
87  $colors_categories = [];
88  foreach ($this->getColors() as $color) {
89  $colors_categories[$color->getDominatAspect()][] = $color;
90  }
91  ksort($colors_categories);
92  foreach ($colors_categories as $category => $colors) {
93  usort($colors_categories[$category], array("ilSystemStyleIconColor","compareColors"));
94  }
95 
96  return $colors_categories;
97  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ mergeColorSet()

ilSystemStyleIconColorSet::mergeColorSet ( ilSystemStyleIconColorSet  $color_set)

Merges an other colorset into this one.

Parameters
ilSystemStyleIconColorSet$color_set

Definition at line 72 of file class.ilSystemStyleIconColorSet.php.

References addColor(), doesColorExist(), and getColors().

73  {
74  foreach ($color_set->getColors() as $color) {
75  if (!$this->doesColorExist($color->getId())) {
76  $this->addColor($color);
77  }
78  }
79  }
addColor(ilSystemStyleIconColor $color)
+ Here is the call graph for this function:

◆ setColors()

ilSystemStyleIconColorSet::setColors ( array  $colors)
Parameters
ilSystemStyleIconColor[]$colors

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

References $colors.

41  {
42  $this->colors = $colors;
43  }

Field Documentation

◆ $colors

ilSystemStyleIconColorSet::$colors = []
protected

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