ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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().

24  {
25  $this->colors[$color->getId()] = $color;
26  }
+ 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 99 of file class.ilSystemStyleIconColorSet.php.

References $colors, and getColors().

99  {
100  $colors = [];
101  foreach($this->getColors() as $color){
102  $colors[] = $color->getId();
103  }
104  return $colors;
105  }
+ 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 112 of file class.ilSystemStyleIconColorSet.php.

References $colors, and getColors().

112  {
113  $colors = "";
114  foreach($this->getColors() as $color){
115  $colors .= $color->getId()."; ";
116  }
117  return $colors;
118  }
+ Here is the call graph for this function:

◆ doesColorExist()

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

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

Referenced by mergeColorSet().

60  {
61  return array_key_exists($id,$this->colors);
62  }
+ Here is the caller graph for this function:

◆ getColorById()

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

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

References ilSystemStyleException\INVALID_ID.

49  {
50  if(!array_key_exists($id,$this->colors)){
52  }
53  return $this->colors[$id];
54  }
Class for advanced editing exception handling in ILIAS.

◆ getColors()

ilSystemStyleIconColorSet::getColors ( )
Returns
ilSystemStyleIconColor[]

Definition at line 31 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 81 of file class.ilSystemStyleIconColorSet.php.

References $colors, array, and getColors().

81  {
82  $colors_categories = [];
83  foreach($this->getColors() as $color){
84  $colors_categories[$color->getDominatAspect()][] = $color;
85  }
86  ksort($colors_categories);
87  foreach($colors_categories as $category => $colors){
88  usort($colors_categories[$category],array("ilSystemStyleIconColor","compareColors"));
89  }
90 
91  return $colors_categories;
92  }
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 69 of file class.ilSystemStyleIconColorSet.php.

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

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

◆ setColors()

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

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

References $colors.

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

Field Documentation

◆ $colors

ilSystemStyleIconColorSet::$colors = []
protected

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