ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSkinStyleContainer Class Reference

This class is responsible for all file system related actions related actions of a skin such as copying files and folders, generating a new skin, deleting a skin etc. More...

+ Collaboration diagram for ilSkinStyleContainer:

Public Member Functions

 __construct (Language $lng, ilSkin $skin, ilSystemStyleMessageStack $message_stack, ?ilSystemStyleConfig $system_styles_conf=null,)
 
 export ()
 Exports the complete skin to an zip file. More...
 
 createTempZip ()
 Creates a temp zip file. More...
 
 getSkin ()
 
 setSkin (ilSkin $skin)
 
 getSkinDirectory ()
 
 getCSSFilePath (string $style_id)
 
 getScssFilePath (string $style_id)
 
 getScssSettingsPath (string $style_id)
 
 getScssSettingsFolderName ()
 
 getImagesStylePath (string $style_id)
 
 getSoundsStylePath (string $style_id)
 
 getFontsStylePath (string $style_id)
 
 getMessageStack ()
 
 setMessageStack (ilSystemStyleMessageStack $message_stack)
 
 getSystemStylesConf ()
 
 setSystemStylesConf (ilSystemStyleConfig $system_styles_conf)
 

Protected Member Functions

 writeSkinToXML ()
 

Protected Attributes

Language $lng
 
ilSkin $skin
 Data-scope for the skin this container capsules. More...
 
ilSystemStyleMessageStack $message_stack
 Used to stack messages to be displayed to the user (mostly reports for failed actions) More...
 
ilSystemStyleConfig $system_styles_conf
 Used to wire this component up with the correct pathes into the customizing directory. More...
 

Detailed Description

This class is responsible for all file system related actions related actions of a skin such as copying files and folders, generating a new skin, deleting a skin etc.

It contains exactly one skin containing several styles. Use this class to parse a skin from xml.

Definition at line 28 of file class.ilSkinStyleContainer.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkinStyleContainer::__construct ( Language  $lng,
ilSkin  $skin,
ilSystemStyleMessageStack  $message_stack,
?ilSystemStyleConfig  $system_styles_conf = null 
)

Definition at line 47 of file class.ilSkinStyleContainer.php.

References $lng, $skin, ILIAS\Repository\lng(), setMessageStack(), and setSystemStylesConf().

52  {
53  $this->lng = $lng;
54  $this->skin = $skin;
55  $this->setMessageStack($message_stack);
56 
57  if (!$system_styles_conf) {
59  } else {
61  }
62  }
setSystemStylesConf(ilSystemStyleConfig $system_styles_conf)
setMessageStack(ilSystemStyleMessageStack $message_stack)
ilSystemStyleConfig $system_styles_conf
Used to wire this component up with the correct pathes into the customizing directory.
ilSkin $skin
Data-scope for the skin this container capsules.
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
+ Here is the call graph for this function:

Member Function Documentation

◆ createTempZip()

ilSkinStyleContainer::createTempZip ( )

Creates a temp zip file.

Definition at line 80 of file class.ilSkinStyleContainer.php.

References getSkin(), getSkinDirectory(), and ilFileUtils\zip().

Referenced by export().

80  : string
81  {
82  $skin_directory = $this->getSkinDirectory(); // parent of skin directory
83 
84  if (strpos($skin_directory, '../') === 0) { // we must resolve relative paths here
85  $skin_directory = realpath(__DIR__ . '/../../../../../../templates/' . $skin_directory);
86  }
87  $output_file = dirname($skin_directory) . '/' . $this->getSkin()->getId() . '.zip';
88 
89  ilFileUtils::zip($skin_directory, $output_file, true);
90 
91  return $output_file;
92  }
static zip(string $a_dir, string $a_file, bool $compress_content=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ export()

ilSkinStyleContainer::export ( )

Exports the complete skin to an zip file.

Definition at line 67 of file class.ilSkinStyleContainer.php.

References createTempZip(), ilFileDelivery\deliverFileAttached(), ILIAS\Survey\Mode\getId(), and getSkin().

67  : void
68  {
70  $this->createTempZip(),
71  $this->getSkin()->getId() . '.zip',
72  '',
73  true
74  );
75  }
static deliverFileAttached(string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
createTempZip()
Creates a temp zip file.
+ Here is the call graph for this function:

◆ getCSSFilePath()

ilSkinStyleContainer::getCSSFilePath ( string  $style_id)

Definition at line 109 of file class.ilSkinStyleContainer.php.

References getSkinDirectory().

109  : string
110  {
111  return $this->getSkinDirectory() . $style_id . "/".$this->getSkin()->getStyle($style_id)->getCssFile() . '.css';
112  }
+ Here is the call graph for this function:

◆ getFontsStylePath()

ilSkinStyleContainer::getFontsStylePath ( string  $style_id)

Definition at line 139 of file class.ilSkinStyleContainer.php.

References getSkin(), and getSkinDirectory().

139  : string
140  {
141  return $this->getSkinDirectory().$style_id."/".$this->getSkin()->getStyle($style_id)->getFontDirectory();
142  }
+ Here is the call graph for this function:

◆ getImagesStylePath()

ilSkinStyleContainer::getImagesStylePath ( string  $style_id)

Definition at line 129 of file class.ilSkinStyleContainer.php.

References getSkin(), and getSkinDirectory().

129  : string
130  {
131  return $this->getSkinDirectory().$style_id."/".$this->getSkin()->getStyle($style_id)->getImageDirectory();
132  }
+ Here is the call graph for this function:

◆ getMessageStack()

ilSkinStyleContainer::getMessageStack ( )

Definition at line 144 of file class.ilSkinStyleContainer.php.

References $message_stack.

145  {
146  return $this->message_stack;
147  }
ilSystemStyleMessageStack $message_stack
Used to stack messages to be displayed to the user (mostly reports for failed actions) ...
Used to stack messages to be shown to the user.

◆ getScssFilePath()

ilSkinStyleContainer::getScssFilePath ( string  $style_id)

Definition at line 114 of file class.ilSkinStyleContainer.php.

References getSkinDirectory().

114  : string
115  {
116  return $this->getSkinDirectory() . $style_id . "/".$this->getSkin()->getStyle($style_id)->getCssFile() . '.scss';
117  }
+ Here is the call graph for this function:

◆ getScssSettingsFolderName()

ilSkinStyleContainer::getScssSettingsFolderName ( )

Definition at line 124 of file class.ilSkinStyleContainer.php.

124  : string
125  {
126  return $this->system_styles_conf->getScssSettingsFolderName();
127  }

◆ getScssSettingsPath()

ilSkinStyleContainer::getScssSettingsPath ( string  $style_id)

Definition at line 119 of file class.ilSkinStyleContainer.php.

References getSkinDirectory().

119  : string
120  {
121  return $this->getSkinDirectory() . $style_id . "/".$this->getScssSettingsFolderName();
122  }
+ Here is the call graph for this function:

◆ getSkin()

ilSkinStyleContainer::getSkin ( )

Definition at line 94 of file class.ilSkinStyleContainer.php.

References $skin.

Referenced by createTempZip(), export(), getFontsStylePath(), getImagesStylePath(), getSkinDirectory(), getSoundsStylePath(), ilSkinFactoryTest\testSkinStyleContainerFromId(), and writeSkinToXML().

94  : ilSkin
95  {
96  return $this->skin;
97  }
ilSkin $skin
Data-scope for the skin this container capsules.
ilSkin holds an manages the basic data of a skin as provide by the template of the skin...
+ Here is the caller graph for this function:

◆ getSkinDirectory()

ilSkinStyleContainer::getSkinDirectory ( )

Definition at line 104 of file class.ilSkinStyleContainer.php.

References getSkin(), and getSystemStylesConf().

Referenced by createTempZip(), getCSSFilePath(), getFontsStylePath(), getImagesStylePath(), getScssFilePath(), getScssSettingsPath(), getSoundsStylePath(), and writeSkinToXML().

104  : string
105  {
106  return $this->getSystemStylesConf()->getCustomizingSkinPath() . $this->getSkin()->getId() . '/';
107  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSoundsStylePath()

ilSkinStyleContainer::getSoundsStylePath ( string  $style_id)

Definition at line 134 of file class.ilSkinStyleContainer.php.

References getSkin(), and getSkinDirectory().

134  : string
135  {
136  return $this->getSkinDirectory().$style_id."/".$this->getSkin()->getStyle($style_id)->getSoundDirectory();
137  }
+ Here is the call graph for this function:

◆ getSystemStylesConf()

ilSkinStyleContainer::getSystemStylesConf ( )

Definition at line 159 of file class.ilSkinStyleContainer.php.

References $system_styles_conf.

Referenced by getSkinDirectory().

160  {
162  }
ilSystemStyleConfig $system_styles_conf
Used to wire this component up with the correct pathes into the customizing directory.
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
+ Here is the caller graph for this function:

◆ setMessageStack()

ilSkinStyleContainer::setMessageStack ( ilSystemStyleMessageStack  $message_stack)

Definition at line 149 of file class.ilSkinStyleContainer.php.

References $message_stack.

Referenced by __construct().

149  : void
150  {
151  $this->message_stack = $message_stack;
152  }
ilSystemStyleMessageStack $message_stack
Used to stack messages to be displayed to the user (mostly reports for failed actions) ...
+ Here is the caller graph for this function:

◆ setSkin()

ilSkinStyleContainer::setSkin ( ilSkin  $skin)

Definition at line 99 of file class.ilSkinStyleContainer.php.

References $skin.

99  : void
100  {
101  $this->skin = $skin;
102  }
ilSkin $skin
Data-scope for the skin this container capsules.

◆ setSystemStylesConf()

ilSkinStyleContainer::setSystemStylesConf ( ilSystemStyleConfig  $system_styles_conf)

Definition at line 164 of file class.ilSkinStyleContainer.php.

References $system_styles_conf.

Referenced by __construct().

164  : void
165  {
166  $this->system_styles_conf = $system_styles_conf;
167  }
ilSystemStyleConfig $system_styles_conf
Used to wire this component up with the correct pathes into the customizing directory.
+ Here is the caller graph for this function:

◆ writeSkinToXML()

ilSkinStyleContainer::writeSkinToXML ( )
protected

Definition at line 154 of file class.ilSkinStyleContainer.php.

References getSkin(), and getSkinDirectory().

154  : void
155  {
156  $this->getSkin()->writeToXMLFile($this->getSkinDirectory() . 'template.xml');
157  }
+ Here is the call graph for this function:

Field Documentation

◆ $lng

Language ilSkinStyleContainer::$lng
protected

Definition at line 30 of file class.ilSkinStyleContainer.php.

Referenced by __construct().

◆ $message_stack

ilSystemStyleMessageStack ilSkinStyleContainer::$message_stack
protected

Used to stack messages to be displayed to the user (mostly reports for failed actions)

Definition at line 40 of file class.ilSkinStyleContainer.php.

Referenced by getMessageStack(), and setMessageStack().

◆ $skin

ilSkin ilSkinStyleContainer::$skin
protected

Data-scope for the skin this container capsules.

Definition at line 35 of file class.ilSkinStyleContainer.php.

Referenced by __construct(), getSkin(), and setSkin().

◆ $system_styles_conf

ilSystemStyleConfig ilSkinStyleContainer::$system_styles_conf
protected

Used to wire this component up with the correct pathes into the customizing directory.

Definition at line 45 of file class.ilSkinStyleContainer.php.

Referenced by getSystemStylesConf(), and setSystemStylesConf().


The documentation for this class was generated from the following file: