|
ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
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 ilSystemStyleSkinContainer:Public Member Functions | |
| __construct (ilSkinXML $skin, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null) | |
| ilSystemStyleSkinContainer constructor. More... | |
| create (ilSystemStyleMessageStack $message_stack) | |
| Creates a new skin. More... | |
| updateSkin (ilSkinXML $old_skin) | |
| Updates the skin. More... | |
| updateStyle ($style_id, ilSkinStyleXML $old_style) | |
| Updates one single style. More... | |
| createMainLessFile (ilSkinStyleXML $style) | |
| Creates the main less file. More... | |
| copyVariablesFromDefault (ilSkinStyleXML $style) | |
| Copies (resets) the variables file from delos. More... | |
| resetImages (ilSkinStyleXML $style) | |
| Copies (resets) the images from delos. More... | |
| copyCSSFromDefault (ilSkinStyleXML $style) | |
| Copies (resets) the images from delos. More... | |
| move ($from, $to) | |
| Used to move a complete directory of a skin. More... | |
| delete () | |
| Deletes the container of a skin completely. More... | |
| deleteStyle (ilSkinStyleXML $style) | |
| Deletes a style completely. More... | |
| copy () | |
| Copies a complete Skin. More... | |
| export () | |
| Exports the complete skin to an zip file. More... | |
| createTempZip () | |
| Creates a temp zip file. More... | |
| compileLess ($style_id) | |
| getSkin () | |
| setSkin ($skin) | |
| getSkinDirectory () | |
| getCSSFilePath ($style_id) | |
| getLessFilePath ($style_id) | |
| getLessVariablesFilePath ($style_id) | |
| getLessVariablesName ($style_id) | |
| getImagesSkinPath ($style_id) | |
| addStyle (ilSkinStyleXML $style) | |
| getSystemStylesConf () | |
| setSystemStylesConf ($system_styles_conf) | |
Static Public Member Functions | |
| static | generateFromId ($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null) |
| Generate the container class by parsing the corresponding XML. More... | |
| static | xCopy ($src, $dest) |
| Recursive copy of a folder. More... | |
| static | recursiveRemoveDir ($dir) |
| Recursive delete of a folder. More... | |
| static | import ($import_zip_path, $name, ilSystemStyleMessageStack $message_stack=null, $system_styles_conf=null, $uploaded=true) |
| Imports a skin from zip. More... | |
| static | getMessageStack () |
| static | setMessageStack ($message_stack) |
Protected Member Functions | |
| resourcesStyleReferences ($resource) | |
| Checks if a given resource (folder) is still referenced by a style of the containers skin. More... | |
| createResourceDirectory ($source, $target) | |
| Creates a resource directory (sound, images or fonts) by copying from the source (mostly delos) More... | |
| changeResourceDirectory ($new_dir, $old_dir) | |
| Alters the name/path of a resource directory. More... | |
| removeResourceDirectory ($dir) | |
| Deletes a resource directory. More... | |
| createLessStructure (ilSkinStyleXML $style) | |
| Creates the less/css structure of a style. More... | |
| getLessMainFileDefautContent (ilSkinStyleXML $style) | |
| Returns the main less default content if a new style is created. More... | |
| deleteFile ($path) | |
| Deletes a given file in the container. More... | |
| changeVariablesImport ($main_path, $old_style_import, $new_style_import) | |
| writeSkinToXML () | |
Protected Attributes | |
| $lng | |
| $skin | |
| $system_styles_conf | |
Static Protected Attributes | |
| static | $message_stack = null |
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 19 of file class.ilSystemStyleSkinContainer.php.
| ilSystemStyleSkinContainer::__construct | ( | ilSkinXML | $skin, |
| ilSystemStyleMessageStack | $message_stack = null, |
||
| ilSystemStyleConfig | $system_styles_conf = null |
||
| ) |
ilSystemStyleSkinContainer constructor.
| ilSkinXML | $skin | |
| ilSystemStyleMessageStack | null | $message_stack | |
| ilSystemStyleConfig | $system_styles_conf |
Definition at line 54 of file class.ilSystemStyleSkinContainer.php.
References $DIC, $message_stack, $skin, $system_styles_conf, setMessageStack(), and setSystemStylesConf().
Here is the call graph for this function:| ilSystemStyleSkinContainer::addStyle | ( | ilSkinStyleXML | $style | ) |
| ilSkinStyleXML | $style |
Definition at line 720 of file class.ilSystemStyleSkinContainer.php.
References ilSkinStyleXML\getId(), getSkin(), and updateStyle().
Here is the call graph for this function:
|
protected |
Alters the name/path of a resource directory.
| $new_dir | |
| $old_dir |
| ilSystemStyleException |
Definition at line 266 of file class.ilSystemStyleSkinContainer.php.
References getMessageStack(), getSkinDirectory(), recursiveRemoveDir(), resourcesStyleReferences(), ilSystemStyleMessage\TYPE_SUCCESS, and xCopy().
Referenced by updateStyle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
| $main_path | |
| $old_style_import | |
| $new_style_import |
Definition at line 608 of file class.ilSystemStyleSkinContainer.php.
Referenced by updateStyle().
Here is the caller graph for this function:| ilSystemStyleSkinContainer::compileLess | ( | $style_id | ) |
| $style_id |
| ilSystemStyleException |
Definition at line 620 of file class.ilSystemStyleSkinContainer.php.
References $output, getCSSFilePath(), ilSystemStyleException\LESS_COMPILE_FAILED, and ilSystemStyleException\LESSC_NOT_INSTALLED.
Referenced by createLessStructure(), and updateStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::copy | ( | ) |
Copies a complete Skin.
| ilSystemStyleException |
Definition at line 532 of file class.ilSystemStyleSkinContainer.php.
References generateFromId(), getMessageStack(), getSkin(), getSkinDirectory(), getSystemStylesConf(), ilStyleDefinition\skinExists(), ilSystemStyleMessage\TYPE_SUCCESS, and xCopy().
Referenced by copyCSSFromDefault(), updateStyle(), and xCopy().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::copyCSSFromDefault | ( | ilSkinStyleXML | $style | ) |
Copies (resets) the images from delos.
| ilSkinStyleXML | $style |
Definition at line 380 of file class.ilSystemStyleSkinContainer.php.
References copy(), getCSSFilePath(), ilSkinStyleXML\getId(), and getSystemStylesConf().
Referenced by createLessStructure().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::copyVariablesFromDefault | ( | ilSkinStyleXML | $style | ) |
Copies (resets) the variables file from delos.
| ilSkinStyleXML | $style |
Definition at line 358 of file class.ilSystemStyleSkinContainer.php.
References ilSkinStyleXML\getId(), getLessVariablesFilePath(), and getSystemStylesConf().
Referenced by createLessStructure(), and updateStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::create | ( | ilSystemStyleMessageStack | $message_stack | ) |
Creates a new skin.
This includes the generation of the XML and the corresponding folders of all contained styles.
| ilSystemStyleMessageStack | $message_stack |
| ilSystemStyleException |
Definition at line 108 of file class.ilSystemStyleSkinContainer.php.
References $message_stack, $style, createLessStructure(), createResourceDirectory(), getSkin(), getSkinDirectory(), getSystemStylesConf(), ilSystemStyleException\SKIN_ALREADY_EXISTS, ilSystemStyleMessage\TYPE_ERROR, and writeSkinToXML().
Here is the call graph for this function:
|
protected |
Creates the less/css structure of a style.
| ilSkinStyleXML | $style |
| ilSystemStyleException |
Definition at line 331 of file class.ilSystemStyleSkinContainer.php.
References compileLess(), copyCSSFromDefault(), copyVariablesFromDefault(), createMainLessFile(), and ilSkinStyleXML\getId().
Referenced by create().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::createMainLessFile | ( | ilSkinStyleXML | $style | ) |
Creates the main less file.
| ilSkinStyleXML | $style |
Definition at line 343 of file class.ilSystemStyleSkinContainer.php.
References $path, ilSkinStyleXML\getId(), getLessFilePath(), getLessMainFileDefautContent(), getMessageStack(), and ilSystemStyleMessage\TYPE_SUCCESS.
Referenced by createLessStructure(), and updateStyle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Creates a resource directory (sound, images or fonts) by copying from the source (mostly delos)
| $source | |
| $target |
| ilSystemStyleException |
Definition at line 245 of file class.ilSystemStyleSkinContainer.php.
References $path, getMessageStack(), getSkinDirectory(), ilSystemStyleMessage\TYPE_SUCCESS, and xCopy().
Referenced by create(), resetImages(), and updateStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::createTempZip | ( | ) |
Creates a temp zip file.
Definition at line 560 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory(), and ilUtil\zip().
Referenced by export().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::delete | ( | ) |
Deletes the container of a skin completely.
Definition at line 472 of file class.ilSystemStyleSkinContainer.php.
References getMessageStack(), recursiveRemoveDir(), and ilSystemStyleMessage\TYPE_SUCCESS.
Here is the call graph for this function:
|
protected |
Deletes a given file in the container.
| $path |
Definition at line 485 of file class.ilSystemStyleSkinContainer.php.
References $path, getMessageStack(), and ilSystemStyleMessage\TYPE_SUCCESS.
Referenced by deleteStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::deleteStyle | ( | ilSkinStyleXML | $style | ) |
Deletes a style completely.
| ilSkinStyleXML | $style |
Definition at line 500 of file class.ilSystemStyleSkinContainer.php.
References $style, deleteFile(), ilSystemStyleSettings\deleteSubStyleCategoryAssignments(), getCSSFilePath(), ilSkinStyleXML\getFontDirectory(), ilSkinStyleXML\getId(), ilSkinStyleXML\getImageDirectory(), getLessFilePath(), getLessVariablesFilePath(), getMessageStack(), getSkin(), ilSkinStyleXML\getSoundDirectory(), removeResourceDirectory(), ilSystemStyleMessage\TYPE_SUCCESS, and writeSkinToXML().
Here is the call graph for this function:| ilSystemStyleSkinContainer::export | ( | ) |
Exports the complete skin to an zip file.
Definition at line 551 of file class.ilSystemStyleSkinContainer.php.
References createTempZip(), ilFileDelivery\deliverFileAttached(), and getSkin().
Here is the call graph for this function:
|
static |
Generate the container class by parsing the corresponding XML.
| $skin_id | ||
| ilSystemStyleMessageStack | null | $message_stack | |
| ilSystemStyleConfig | $system_styles_conf |
| ilSystemStyleException |
Definition at line 84 of file class.ilSystemStyleSkinContainer.php.
References $message_stack, $system_styles_conf, and ilSystemStyleException\NO_SKIN_ID.
Referenced by ilSystemStyleIconsGUI\__construct(), ilSystemStyleLessGUI\__construct(), ilSystemStyleOverviewGUI\checkDeletable(), ilSystemStyleOverviewGUI\confirmDelete(), copy(), ilSystemStyleOverviewGUI\copyStyle(), ilSystemStyleOverviewGUI\deleteStyle(), ilSystemStyleOverviewGUI\deleteStyles(), ilSystemStyleOverviewGUI\export(), import(), ilSystemStyleOverviewGUI\saveNewSubStyle(), ilSystemStyleSettingsGUI\saveStyle(), ilSystemStyleSettingsGUI\saveSubStyle(), ilSystemStyleMainGUI\setUnderworldTitle(), ilSkinStyleLessFileTest\setUp(), ilSystemStyleIconFolderTest\setUp(), ilSystemStyleIconTest\setUp(), ilSystemStyleStyleLessFileTest\setUp(), ilStyleDefinition\styleExistsForSkinId(), ilSystemStyleSkinContainerTest\testAddStyle(), ilSystemStyleSkinContainerTest\testCopySkin(), ilSystemStyleSkinContainerTest\testCreateDelete(), ilSystemStyleSkinContainerTest\testDeleteSkin(), ilSystemStyleSkinContainerTest\testDeleteStyle(), ilSystemStyleSkinContainerTest\testGenerateFromId(), ilSystemStyleSkinContainerTest\testImportSkin(), ilSystemStyleSkinContainerTest\testUpdateSkin(), and ilSystemStyleSkinContainerTest\testUpdateStyle().
Here is the caller graph for this function:| ilSystemStyleSkinContainer::getCSSFilePath | ( | $style_id | ) |
| $style_id |
Definition at line 665 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory().
Referenced by compileLess(), copyCSSFromDefault(), deleteStyle(), and updateStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::getImagesSkinPath | ( | $style_id | ) |
| $style_id |
Definition at line 697 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory().
Here is the call graph for this function:| ilSystemStyleSkinContainer::getLessFilePath | ( | $style_id | ) |
| $style_id |
Definition at line 673 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory().
Referenced by createMainLessFile(), deleteStyle(), and updateStyle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Returns the main less default content if a new style is created.
| ilSkinStyleXML | $style |
Definition at line 447 of file class.ilSystemStyleSkinContainer.php.
References $style, and getSystemStylesConf().
Referenced by createMainLessFile().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::getLessVariablesFilePath | ( | $style_id | ) |
| $style_id |
Definition at line 681 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory().
Referenced by copyVariablesFromDefault(), and deleteStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::getLessVariablesName | ( | $style_id | ) |
| $style_id |
Definition at line 689 of file class.ilSystemStyleSkinContainer.php.
References getSkin().
Here is the call graph for this function:
|
static |
Definition at line 704 of file class.ilSystemStyleSkinContainer.php.
References $message_stack.
Referenced by changeResourceDirectory(), copy(), createMainLessFile(), createResourceDirectory(), delete(), deleteFile(), deleteStyle(), removeResourceDirectory(), and updateStyle().
Here is the caller graph for this function:| ilSystemStyleSkinContainer::getSkin | ( | ) |
Definition at line 639 of file class.ilSystemStyleSkinContainer.php.
References $skin.
Referenced by addStyle(), copy(), create(), deleteStyle(), export(), getLessVariablesName(), resourcesStyleReferences(), updateStyle(), and writeSkinToXML().
Here is the caller graph for this function:| ilSystemStyleSkinContainer::getSkinDirectory | ( | ) |
Definition at line 655 of file class.ilSystemStyleSkinContainer.php.
References getSystemStylesConf().
Referenced by changeResourceDirectory(), copy(), create(), createResourceDirectory(), createTempZip(), getCSSFilePath(), getImagesSkinPath(), getLessFilePath(), getLessVariablesFilePath(), removeResourceDirectory(), resetImages(), updateSkin(), updateStyle(), and writeSkinToXML().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::getSystemStylesConf | ( | ) |
Definition at line 733 of file class.ilSystemStyleSkinContainer.php.
References $system_styles_conf.
Referenced by copy(), copyCSSFromDefault(), copyVariablesFromDefault(), create(), getLessMainFileDefautContent(), getSkinDirectory(), resetImages(), updateSkin(), and updateStyle().
Here is the caller graph for this function:
|
static |
Imports a skin from zip.
| $import_zip_path | ||
| $name | ||
| ilSystemStyleMessageStack | null | $message_stack | |
| null | $system_styles_conf | |
| bool | true | $uploaded |
| ilSystemStyleException |
Definition at line 577 of file class.ilSystemStyleSkinContainer.php.
References $message_stack, $system_styles_conf, generateFromId(), ilStyleDefinition\skinExists(), and ilUtil\unzip().
Referenced by ilSystemStyleOverviewGUI\importStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::move | ( | $from, | |
| $to | |||
| ) |
Used to move a complete directory of a skin.
| $from | |
| $to |
Definition at line 464 of file class.ilSystemStyleSkinContainer.php.
Referenced by updateSkin().
Here is the caller graph for this function:
|
static |
Recursive delete of a folder.
| $dir |
Definition at line 425 of file class.ilSystemStyleSkinContainer.php.
References recursiveRemoveDir().
Referenced by changeResourceDirectory(), delete(), recursiveRemoveDir(), removeResourceDirectory(), resetImages(), ilSkinStyleLessFileTest\tearDown(), ilSkinXMLTest\tearDown(), ilSystemStyleIconFolderTest\tearDown(), ilSystemStyleIconTest\tearDown(), ilSystemStyleSkinContainerTest\tearDown(), ilSystemStyleSkinXMLTest\tearDown(), and ilSystemStyleStyleLessFileTest\tearDown().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Deletes a resource directory.
| $dir |
Definition at line 306 of file class.ilSystemStyleSkinContainer.php.
References getMessageStack(), getSkinDirectory(), recursiveRemoveDir(), resourcesStyleReferences(), and ilSystemStyleMessage\TYPE_SUCCESS.
Referenced by deleteStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSystemStyleSkinContainer::resetImages | ( | ilSkinStyleXML | $style | ) |
Copies (resets) the images from delos.
| ilSkinStyleXML | $style |
Definition at line 370 of file class.ilSystemStyleSkinContainer.php.
References $style, createResourceDirectory(), ilSkinStyleXML\getImageDirectory(), getSkinDirectory(), getSystemStylesConf(), and recursiveRemoveDir().
Here is the call graph for this function:
|
protected |
Checks if a given resource (folder) is still referenced by a style of the containers skin.
| $resource |
Definition at line 227 of file class.ilSystemStyleSkinContainer.php.
References $style, and getSkin().
Referenced by changeResourceDirectory(), and removeResourceDirectory().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
| ilSystemStyleMessageStack | $message_stack |
Definition at line 712 of file class.ilSystemStyleSkinContainer.php.
References $message_stack.
Referenced by __construct().
Here is the caller graph for this function:| ilSystemStyleSkinContainer::setSkin | ( | $skin | ) |
| ilSkinXML | $skin |
Definition at line 647 of file class.ilSystemStyleSkinContainer.php.
References $skin.
| ilSystemStyleSkinContainer::setSystemStylesConf | ( | $system_styles_conf | ) |
| ilSystemStyleConfig | $system_styles_conf |
Definition at line 741 of file class.ilSystemStyleSkinContainer.php.
References $system_styles_conf.
Referenced by __construct().
Here is the caller graph for this function:| ilSystemStyleSkinContainer::updateSkin | ( | ilSkinXML | $old_skin | ) |
Updates the skin.
Style are not updated, use updateStyle for that.
| ilSkinXML | $old_skin |
| ilSystemStyleException |
Definition at line 138 of file class.ilSystemStyleSkinContainer.php.
References ilSkinXML\getId(), getSkinDirectory(), getSystemStylesConf(), move(), and writeSkinToXML().
Here is the call graph for this function:| ilSystemStyleSkinContainer::updateStyle | ( | $style_id, | |
| ilSkinStyleXML | $old_style | ||
| ) |
Updates one single style.
| $style_id | ||
| ilSkinStyleXML | $old_style |
Definition at line 157 of file class.ilSystemStyleSkinContainer.php.
References $style, changeResourceDirectory(), changeVariablesImport(), compileLess(), copy(), copyVariablesFromDefault(), createMainLessFile(), createResourceDirectory(), ilSkinStyleXML\getCssFile(), getCSSFilePath(), ilSkinStyleXML\getFontDirectory(), ilSkinStyleXML\getImageDirectory(), getLessFilePath(), getMessageStack(), getSkin(), getSkinDirectory(), ilSkinStyleXML\getSoundDirectory(), getSystemStylesConf(), ilSystemStyleMessage\TYPE_ERROR, and writeSkinToXML().
Referenced by addStyle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 726 of file class.ilSystemStyleSkinContainer.php.
References getSkin(), and getSkinDirectory().
Referenced by create(), deleteStyle(), updateSkin(), and updateStyle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Recursive copy of a folder.
| $src | |
| $dest |
| ilSystemStyleException |
Definition at line 391 of file class.ilSystemStyleSkinContainer.php.
References $file, copy(), ilSystemStyleException\FILE_CREATION_FAILED, ilSystemStyleException\FILE_OPENING_FAILED, ilSystemStyleException\FOLDER_CREATION_FAILED, and xCopy().
Referenced by changeResourceDirectory(), copy(), createResourceDirectory(), ilSkinStyleLessFileTest\setUp(), ilSkinXMLTest\setUp(), ilSystemStyleIconFolderTest\setUp(), ilSystemStyleIconTest\setUp(), ilSystemStyleSkinContainerTest\setUp(), ilSystemStyleSkinXMLTest\setUp(), ilSystemStyleStyleLessFileTest\setUp(), and xCopy().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 24 of file class.ilSystemStyleSkinContainer.php.
|
staticprotected |
Definition at line 38 of file class.ilSystemStyleSkinContainer.php.
Referenced by __construct(), create(), generateFromId(), getMessageStack(), import(), and setMessageStack().
|
protected |
Definition at line 31 of file class.ilSystemStyleSkinContainer.php.
Referenced by __construct(), getSkin(), and setSkin().
|
protected |
Definition at line 45 of file class.ilSystemStyleSkinContainer.php.
Referenced by __construct(), generateFromId(), getSystemStylesConf(), import(), and setSystemStylesConf().