2 require_once(
"./Services/Style/System/classes/Icons/class.ilSystemStyleIcon.php");
3 require_once(
"./Services/Style/System/classes/Exceptions/class.ilSystemStyleIconException.php");
70 } elseif ($b->
getType() ==
"svg") {
85 protected function xRead($src =
"", $rel_path=
"")
90 foreach (scandir($src) as
$file) {
91 $src_file = rtrim($src,
'/') .
'/' .
$file;
92 if (!is_readable($src_file)) {
95 if (substr($file, 0, 1) !=
".") {
96 if (is_dir($src_file)) {
97 self::xRead($src_file, $rel_path .
"/" . $file);
100 $extension =
$info->getExtension();
101 if ($extension ==
"gif" || $extension ==
"svg" || $extension ==
"png") {
117 foreach ($this->
getIcons() as $icon) {
118 $icon->changeColors($color_changes);
129 $this->icons[] = $icon;
149 foreach ($this->icons as $icon) {
150 if ($icon->getName() ==
$name) {
166 foreach ($this->
getIcons() as $icon) {
167 $folders[dirname($icon->getPath())][] = $icon;
172 foreach ($folders as
$id => $folder) {
173 ksort($folders[
$id]);
207 if (!$this->color_set) {
219 foreach ($this->
getIcons() as $icon) {
220 $this->color_set->mergeColorSet($icon->getColorSet());
233 foreach ($this->
getIcons() as $icon) {
234 if ($icon->usesColor($color_id)) {
251 $usage_string .= rtrim($icon->getName(),
".svg") .
"; ";
253 return $usage_string;
Class for advanced editing exception handling in ILIAS.
sortIcons()
Sorts the Icons by name and type.
getUsagesOfColorAsString($color_id)
Gets the usages of a color as string.
if(!array_key_exists('StateId', $_REQUEST)) $id
xRead($src="", $rel_path="")
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. ...
getUsagesOfColor($color_id)
Gets the usages of a certain color.
const IMAGES_FOLDER_DOES_NOT_EXIST
Class for advanced editing exception handling in ILIAS.
const FILE_OPENING_FAILED
changeIconColors(array $color_changes)
Changes a set of colors in all icons contained in the folder.
Create styles array
The data for the language used.
Abstracts a folder containing a set of icons.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
const ICON_DOES_NOT_EXIST
__construct($path)
ilSystemStyleIconFolder constructor.
read()
Reads the folder recursively and sorts the icons by name and type.