ILIAS  release_8 Revision v8.24
ilSystemStyleIconColorSet Class Reference
+ Collaboration diagram for ilSystemStyleIconColorSet:

Public Member Functions

 addColor (ilSystemStyleIconColor $color)
 
 getColors ()
 
 setColors (array $colors)
 
 getColorById (string $id='')
 
 doesColorExist (string $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

array $colors = []
 

Detailed Description

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

Member Function Documentation

◆ addColor()

ilSystemStyleIconColorSet::addColor ( ilSystemStyleIconColor  $color)

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

34 : void
35 {
36 $this->colors[$color->getId()] = $color;
37 }

References ilSystemStyleIconColor\getId().

Referenced by mergeColorSet().

+ 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.

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

104 : array
105 {
106 $colors = [];
107 foreach ($this->getColors() as $color) {
108 $colors[] = $color->getId();
109 }
110 return $colors;
111 }

References $colors, and getColors().

+ Here is the call graph for this function:

◆ asString()

ilSystemStyleIconColorSet::asString ( )

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

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

116 : string
117 {
118 $colors = '';
119 foreach ($this->getColors() as $color) {
120 $colors .= $color->getId() . '; ';
121 }
122 return $colors;
123 }

References $colors, and getColors().

+ Here is the call graph for this function:

◆ doesColorExist()

ilSystemStyleIconColorSet::doesColorExist ( string  $id)

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

66 : bool
67 {
68 return array_key_exists($id, $this->colors);
69 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

Referenced by mergeColorSet().

+ Here is the caller graph for this function:

◆ getColorById()

ilSystemStyleIconColorSet::getColorById ( string  $id = '')
Exceptions
ilSystemStyleException

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

59 {
60 if (!array_key_exists($id, $this->colors)) {
62 }
63 return $this->colors[$id];
64 }
Class for advanced editing exception handling in ILIAS.

References $id, and ilSystemStyleException\INVALID_ID.

◆ getColors()

ilSystemStyleIconColorSet::getColors ( )
Returns
ilSystemStyleIconColor[]

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

42 : array
43 {
44 return $this->colors;
45 }

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 87 of file class.ilSystemStyleIconColorSet.php.

87 : array
88 {
89 $colors_categories = [];
90 foreach ($this->getColors() as $color) {
91 $colors_categories[$color->getDominatAspect()][] = $color;
92 }
93 ksort($colors_categories);
94 foreach ($colors_categories as $category => $colors) {
95 usort($colors_categories[$category], ['ilSystemStyleIconColor','compareColors']);
96 }
97
98 return $colors_categories;
99 }

References $colors, and getColors().

+ Here is the call graph for this function:

◆ mergeColorSet()

ilSystemStyleIconColorSet::mergeColorSet ( ilSystemStyleIconColorSet  $color_set)

Merges an other colorset into this one.

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

74 : void
75 {
76 foreach ($color_set->getColors() as $color) {
77 if (!$this->doesColorExist($color->getId())) {
78 $this->addColor($color);
79 }
80 }
81 }
addColor(ilSystemStyleIconColor $color)

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

+ Here is the call graph for this function:

◆ setColors()

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

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

50 : void
51 {
52 $this->colors = $colors;
53 }

References $colors.

Field Documentation

◆ $colors

array ilSystemStyleIconColorSet::$colors = []
protected

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