2require_once(
"./Services/Style/System/classes/Icons/class.ilSystemStyleIcon.php");
3require_once(
"./Services/Style/System/classes/Exceptions/class.ilSystemStyleIconException.php");
66 return strcmp($a->getName(), $b->getName());
68 if ($a->getType() ==
"svg") {
70 } elseif ($b->
getType() ==
"svg") {
73 return strcmp($a->getType(), $b->getType());
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);
99 $info =
new SplFileInfo($src_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]);
183 $this->icons = $icons;
207 if (!$this->color_set) {
208 $this->extractColorSet();
210 return $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)) {
250 foreach ($this->getUsagesOfColor($color_id) as $icon) {
251 $usage_string .= rtrim($icon->getName(),
".svg") .
"; ";
253 return $usage_string;
261 $this->color_set = $color_set;
An exception for terminatinating execution or to throw for unit testing.
Class for advanced editing exception handling in ILIAS.
const FILE_OPENING_FAILED
Class for advanced editing exception handling in ILIAS.
const IMAGES_FOLDER_DOES_NOT_EXIST
const ICON_DOES_NOT_EXIST
Abstracts a folder containing a set of icons.
sortIcons()
Sorts the Icons by name and type.
changeIconColors(array $color_changes)
Changes a set of colors in all icons contained in the folder.
xRead($src="", $rel_path="")
addIcon(ilSystemStyleIcon $icon)
Adds an icon to the folders abstraction.
getUsagesOfColor($color_id)
Gets the usages of a certain color.
getUsagesOfColorAsString($color_id)
Gets the usages of a color as string.
__construct($path)
ilSystemStyleIconFolder constructor.
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.
read()
Reads the folder recursively and sorts the icons by name and type.
Abstracts an Icon and the necessary actions to get all colors out of an svg Icon.
if(!array_key_exists('StateId', $_REQUEST)) $id
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file