2include_once(
"Services/Style/System/classes/Utilities/class.ilSkinXML.php");
3include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleSkinContainer.php");
4include_once(
"Services/Style/System/classes/class.ilSystemStyleSettings.php");
5include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleConfig.php");
118 if (
$DIC->isDependencyAvailable(
"systemStyle") && is_object(
$DIC->systemStyle()->getSkin())) {
119 return $DIC->systemStyle()->getSkin()->getId();
123 if (
$DIC->isDependencyAvailable(
"user") && is_object(
$DIC->user()) && property_exists(
$DIC->user(),
"skin")) {
124 $skin_id =
$DIC->user()->skin;
125 if (!self::skinExists($skin_id)) {
127 $skin_id = $system_style_conf->getDefaultSkinId();
141 return $this->
getSkin()->getStyles();
150 return $this->
getSkin()->getName();
161 return $this->
getSkin()->getStyle($a_id);
171 return $this->
getSkin()->getStyle($a_id)->getName();
187 return $this->
getSkin()->getStyle($style_id)->getImageDirectory();
197 return $this->
getSkin()->getStyle($style_id)->getSoundDirectory();
221 $cust_skins_directory =
new RecursiveDirectoryIterator(
$system_style_config->getCustomizingSkinPath(), FilesystemIterator::SKIP_DOTS);
222 foreach ($cust_skins_directory as $skin_folder) {
223 if ($skin_folder->isDir()) {
224 $template_path = $skin_folder->getRealPath() .
"/template.xml";
225 if (file_exists($template_path)) {
226 $skin = ilSkinXML::parseFromXML($template_path);
247 return self::getAllSkins();
287 if (self::$current_style) {
291 if (!
$DIC || !
$DIC->isDependencyAvailable(
"user")) {
297 if (
$DIC->isDependencyAvailable(
"systemStyle") && self::styleExistsForCurrentSkin(self::$current_style)) {
298 if (
$DIC->systemStyle()->getSkin()->hasStyleSubstyles(self::$current_style)) {
301 if (count($assignments) > 0) {
303 foreach ($assignments as $a) {
304 if (
$DIC->systemStyle()->getSkin()->hasStyle($a[
"substyle"])) {
305 $ref_ass[$a[
"ref_id"]] = $a[
"substyle"];
310 if (
$_GET[
"ref_id"]) {
311 $ref_id =
$_GET[
"ref_id"];
312 } elseif (
$_GET[
"target"]) {
318 if (
$DIC->isDependencyAvailable(
"repositoryTree") && $ref_id &&
$DIC->repositoryTree()->isInTree($ref_id)) {
319 $path =
$DIC->repositoryTree()->getPathId($ref_id);
321 if (isset($ref_ass[
$path[
$i]])) {
322 self::$current_style = $ref_ass[
$path[
$i]];
331 if (!self::styleExistsForCurrentSkin(self::$current_style)) {
352 if (!self::getCachedAllStylesInformation()) {
362 if (
$style->getSubstyleOf()) {
363 $parent_name =
$skin->getStyle(
$style->getSubstyleOf())->getName();
367 $all_styles[
$skin->getId() .
":" .
$style->getId()] = [
368 "title" =>
$skin->getName() .
" / " .
$style->getName(),
370 "skin_id" =>
$skin->getId(),
371 "skin_name" =>
$skin->getName(),
372 "template_id" =>
$skin->getId(),
373 "template_name" =>
$skin->getName(),
374 "style_id" =>
$style->getId(),
375 "style_name" =>
$style->getName(),
376 "substyle_of" =>
$style->getSubstyleOf(),
377 "substyle_of_name" => $parent_name,
378 "users" => $num_users
397 if (
$DIC->isDependencyAvailable(
"systemStyle") &&
$DIC->systemStyle()->getSkin()->getName() != $a_skin) {
399 if (!self::styleExistsForCurrentSkin(self::$current_style)) {
400 $styleDefinition->setCurrentStyle(
$DIC->systemStyle()->getSkin()->getDefaultStyle()->getId());
413 foreach (self::getSkins() as
$skin) {
414 if (
$skin->hasStyle($style_id)) {
429 if (!self::skinExists($skin_id)) {
433 return $skin->hasStyle($style_id);
444 return $DIC->systemStyle()->getSkin()->hasStyle($style_id);
452 self::$current_style = $a_style;
461 return self::getAllSkins();
An exception for terminatinating execution or to throw for unit testing.
static _getNumberOfUsersForStyle($a_skin, $a_style)
skins and styles
ilStyleDefinition acts as a wrapper of style related actions.
static getCurrentSkin()
get the current skin
static skinExists($skin_id, ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
getImageDirectory($style_id)
static setCachedAllStylesInformation($cached_all_styles_information)
static getCachedAllStylesInformation()
getSoundDirectory($style_id)
static setCurrentStyle($a_style)
static styleExistsForSkinId($skin_id, $style_id)
static $cached_all_styles_information
__construct($skin_id="", ilSystemStyleConfig $system_style_config=null)
ilStyleDefinition constructor.
static styleExists($style_id)
static getAllSkinStyles()
Get all skins/styles as array (convenient for tables) Attention: tempalte_name/template_id in this ar...
static styleExistsForCurrentSkin($style_id)
setSystemStylesConf($system_style_config)
static getCurrentStyle()
get the current style or sub style
static setCurrentSkin($a_skin)
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
Class for advanced editing exception handling in ILIAS.
static getSystemStyleCategoryAssignments($a_skin_id, $a_style_id)
Get all system sub styles category assignments.
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.