19 declare(strict_types=1);
55 public function read(): void
66 usort($this->icons, [$this,
'compareIconsByName']);
73 } elseif ($a->
getType() ==
'svg') {
75 } elseif ($b->
getType() ==
'svg') {
103 foreach ($rec_it as $file) {
104 if (!$file->isReadable()) {
107 if ($file->isFile()) {
108 $extension = $file->getExtension();
109 if ($extension ==
'gif' || $extension ==
'svg' || $extension ==
'png') {
121 foreach ($this->
getIcons() as $icon) {
122 $icon->changeColors($color_changes);
131 $this->icons[] = $icon;
148 foreach ($this->icons as $icon) {
149 if ($icon->getName() ==
$name) {
161 foreach ($this->icons as $icon) {
162 if ($icon->getPath() ==
$path) {
177 foreach ($this->
getIcons() as $icon) {
178 $folders[dirname($icon->getPath())][] = $icon;
183 foreach ($folders as
$id => $folder) {
184 ksort($folders[
$id]);
210 if (!isset($this->color_set)) {
222 foreach ($this->
getIcons() as $icon) {
223 $this->color_set->mergeColorSet($icon->getColorSet());
234 foreach ($this->
getIcons() as $icon) {
235 if ($icon->usesColor($color_id)) {
249 $usage_string .= rtrim($icon->getName(),
'.svg') .
'; ';
251 return $usage_string;
Class for advanced editing exception handling in ILIAS.
sortIcons()
Sorts the Icons by name and type.
setColorSet(ilSystemStyleIconColorSet $color_set)
getUsagesOfColor(string $color_id)
Gets the usages of a certain color.
addIcon(ilSystemStyleIcon $icon)
Adds an icon to the folders abstraction.
extractColorSet()
Gets the color sets of all icons an merges them into one.
getIconsSortedByFolder()
Sorts all icons by their occurrence in folders.
getIcons()
Gets an Icon from the folders abstraction.
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon. ...
getIconByPath(string $path)
string $path
Path to the root of the folder.
const IMAGES_FOLDER_DOES_NOT_EXIST
const FILE_OPENING_FAILED
changeIconColors(array $color_changes)
Changes a set of colors in all icons contained in the folder.
__construct(string $path)
ilSystemStyleIconFolder constructor.
compareIconsByName(ilSystemStyleIcon $a, ilSystemStyleIcon $b)
ilSystemStyleIconColorSet $color_set
Complete color set of all icons contained in this folder.
readIconsFromFolder(string $src='')
getIconByName(string $name)
Abstracts a folder containing a set of icons.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
const ICON_DOES_NOT_EXIST
read()
Reads the folder recursively and sorts the icons by name and type.
getUsagesOfColorAsString(string $color_id)
Gets the usages of a color as string.