2require_once(
"./Services/Style/System/classes/Icons/class.ilSystemStyleIcon.php");
3require_once(
"./Services/Style/System/classes/Exceptions/class.ilSystemStyleIconException.php");
64 return strcmp($a->getName(),$b->getName());
67 if($a->getType() ==
"svg"){
69 }
else if($b->
getType() ==
"svg"){
72 return strcmp($a->getType(),$b->getType());
84 protected function xRead($src =
"",$rel_path=
""){
88 foreach (scandir($src) as
$file) {
89 $src_file = rtrim($src,
'/') .
'/' .
$file;
90 if (!is_readable($src_file)) {
93 if (substr(
$file, 0, 1) !=
".") {
94 if (is_dir($src_file)) {
95 self::xRead($src_file,$rel_path.
"/".
$file);
97 $info =
new SplFileInfo($src_file);
98 $extension =
$info->getExtension();
99 if($extension ==
"gif" || $extension ==
"svg" || $extension ==
"png"){
114 foreach($this->getIcons() as $icon){
115 $icon->changeColors($color_changes);
125 $this->icons[] = $icon;
144 foreach($this->icons as $icon){
145 if($icon->getName() == $name){
160 foreach($this->getIcons() as $icon){
161 $folders[dirname($icon->getPath())][] = $icon;
166 foreach($folders as $id => $folder){
167 ksort($folders[$id]);
177 $this->icons = $icons;
201 if(!$this->color_set){
202 $this->extractColorSet();
204 return $this->color_set;
212 foreach($this->getIcons() as $icon){
213 $this->color_set->mergeColorSet($icon->getColorSet());
225 foreach($this->getIcons() as $icon){
226 if($icon->usesColor($color_id)){
242 foreach($this->getUsagesOfColor($color_id) as $icon){
243 $usage_string .= rtrim($icon->getName(),
".svg").
"; ";
245 return $usage_string;
253 $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(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file