ILIAS
release_8 Revision v8.23
|
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...
Public Member Functions | |
__construct (ilLanguage $lng, ilSkin $skin, ilSystemStyleMessageStack $message_stack, ilSystemStyleConfig $system_styles_conf=null, ilFileSystemHelper $file_system=null) | |
create (ilSystemStyleMessageStack $message_stack) | |
Creates a new skin. More... | |
updateSkin (ilSkin $old_skin=null) | |
Updates the skin. More... | |
updateStyle (string $style_id, ilSkinStyle $old_style) | |
Updates one single style. More... | |
createMainLessFile (ilSkinStyle $style) | |
Creates the main less file. More... | |
copyVariablesFromDefault (ilSkinStyle $style) | |
Copies (resets) the variables file from delos. More... | |
resetImages (ilSkinStyle $style) | |
Copies (resets) the images from delos. More... | |
copyCSSFromDefault (ilSkinStyle $style) | |
Copies (resets) the images from delos. More... | |
delete () | |
Deletes the container of a skin completely. More... | |
deleteStyle (ilSkinStyle $style) | |
Deletes a style completely. More... | |
export () | |
Exports the complete skin to an zip file. More... | |
createTempZip () | |
Creates a temp zip file. More... | |
compileLess (string $style_id) | |
getSkin () | |
setSkin (ilSkin $skin) | |
getSkinDirectory () | |
getCSSFilePath (string $style_id) | |
getLessFilePath (string $style_id) | |
getLessVariablesFilePath (string $style_id) | |
getLessVariablesName (string $style_id) | |
getImagesSkinPath (string $style_id) | |
getMessageStack () | |
setMessageStack (ilSystemStyleMessageStack $message_stack) | |
addStyle (ilSkinStyle $style) | |
getSystemStylesConf () | |
setSystemStylesConf (ilSystemStyleConfig $system_styles_conf) | |
Protected Member Functions | |
resourcesStyleReferences (string $resource) | |
Checks if a given resource (folder) is still referenced by a style of the containers skin. More... | |
createLessStructure (ilSkinStyle $style) | |
Creates the less/css structure of a style. More... | |
getLessMainFileDefautContent (ilSkinStyle $style) | |
Returns the main less default content if a new style is created. More... | |
changeVariablesImport (string $main_path, string $old_style_import, string $new_style_import) | |
writeSkinToXML () | |
Protected Attributes | |
ilLanguage | $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... | |
ilFileSystemHelper | $file_system |
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 26 of file class.ilSkinStyleContainer.php.
ilSkinStyleContainer::__construct | ( | ilLanguage | $lng, |
ilSkin | $skin, | ||
ilSystemStyleMessageStack | $message_stack, | ||
ilSystemStyleConfig | $system_styles_conf = null , |
||
ilFileSystemHelper | $file_system = null |
||
) |
Definition at line 47 of file class.ilSkinStyleContainer.php.
References $file_system, $lng, $skin, ILIAS\Repository\lng(), setMessageStack(), and setSystemStylesConf().
ilSkinStyleContainer::addStyle | ( | ilSkinStyle | $style | ) |
Definition at line 487 of file class.ilSkinStyleContainer.php.
References ilSkinStyle\getId(), getSkin(), and updateStyle().
Referenced by ilSkinStyleContainerTest\testAddStyle().
|
protected |
Definition at line 400 of file class.ilSkinStyleContainer.php.
Referenced by updateStyle().
ilSkinStyleContainer::compileLess | ( | string | $style_id | ) |
ilSystemStyleException |
Definition at line 417 of file class.ilSkinStyleContainer.php.
References getCSSFilePath(), getLessFilePath(), ilSystemStyleException\LESS_COMPILE_FAILED, and ilSystemStyleException\LESSC_NOT_INSTALLED.
Referenced by createLessStructure(), and updateStyle().
ilSkinStyleContainer::copyCSSFromDefault | ( | ilSkinStyle | $style | ) |
Copies (resets) the images from delos.
Definition at line 296 of file class.ilSkinStyleContainer.php.
References getCSSFilePath(), ilSkinStyle\getId(), and getSystemStylesConf().
Referenced by createLessStructure().
ilSkinStyleContainer::copyVariablesFromDefault | ( | ilSkinStyle | $style | ) |
Copies (resets) the variables file from delos.
Definition at line 273 of file class.ilSkinStyleContainer.php.
References ilSkinStyle\getId(), getLessVariablesFilePath(), and getSystemStylesConf().
Referenced by createLessStructure(), and updateStyle().
ilSkinStyleContainer::create | ( | ilSystemStyleMessageStack | $message_stack | ) |
Creates a new skin.
This includes the generation of the XML and the corresponding folders of all contained styles.
ilSystemStyleException |
Definition at line 75 of file class.ilSkinStyleContainer.php.
References Vendor\Package\$e, ilSystemStyleMessageStack\addMessage(), createLessStructure(), getImagesSkinPath(), getSkin(), getSkinDirectory(), getSystemStylesConf(), ILIAS\Repository\lng(), ilSystemStyleException\SKIN_ALREADY_EXISTS, ilSystemStyleMessage\TYPE_ERROR, and writeSkinToXML().
Referenced by ilSkinStyleContainerTest\testCreateDelete().
|
protected |
Creates the less/css structure of a style.
ilSystemStyleException |
Definition at line 247 of file class.ilSkinStyleContainer.php.
References compileLess(), copyCSSFromDefault(), copyVariablesFromDefault(), createMainLessFile(), and ilSkinStyle\getId().
Referenced by create().
ilSkinStyleContainer::createMainLessFile | ( | ilSkinStyle | $style | ) |
Creates the main less file.
Definition at line 258 of file class.ilSkinStyleContainer.php.
References $path, ilSkinStyle\getId(), getLessFilePath(), getLessMainFileDefautContent(), getMessageStack(), ILIAS\Repository\lng(), and ilSystemStyleMessage\TYPE_SUCCESS.
Referenced by createLessStructure(), and updateStyle().
ilSkinStyleContainer::createTempZip | ( | ) |
Creates a temp zip file.
Definition at line 393 of file class.ilSkinStyleContainer.php.
References getSkin(), getSkinDirectory(), and ilFileUtils\zip().
Referenced by export(), and ilSkinFactoryTest\testImportSkin().
ilSkinStyleContainer::delete | ( | ) |
Deletes the container of a skin completely.
Definition at line 316 of file class.ilSkinStyleContainer.php.
References getMessageStack(), getSkinDirectory(), ILIAS\Repository\lng(), and ilSystemStyleMessage\TYPE_SUCCESS.
Referenced by ilSkinStyleContainerTest\testCreateDelete(), and ilSkinStyleContainerTest\testDeleteSkin().
ilSkinStyleContainer::deleteStyle | ( | ilSkinStyle | $style | ) |
Deletes a style completely.
Definition at line 330 of file class.ilSkinStyleContainer.php.
References ilSystemStyleSettings\deleteSubStyleCategoryAssignments(), getCSSFilePath(), ilSkinStyle\getFontDirectory(), ILIAS\Survey\Mode\getId(), ilSkinStyle\getId(), ilSkinStyle\getImageDirectory(), getLessFilePath(), getLessVariablesFilePath(), getMessageStack(), ilSkinStyle\getName(), getSkin(), getSkinDirectory(), ilSkinStyle\getSoundDirectory(), ilSkinStyle\getSubstyleOf(), ilSkinStyle\isSubstyle(), ILIAS\Repository\lng(), resourcesStyleReferences(), ilSystemStyleMessage\TYPE_SUCCESS, and writeSkinToXML().
Referenced by ilSkinStyleContainerTest\testDeleteStyle().
ilSkinStyleContainer::export | ( | ) |
Exports the complete skin to an zip file.
Definition at line 380 of file class.ilSkinStyleContainer.php.
References createTempZip(), ilFileDelivery\deliverFileAttached(), ILIAS\Survey\Mode\getId(), and getSkin().
ilSkinStyleContainer::getCSSFilePath | ( | string | $style_id | ) |
Definition at line 452 of file class.ilSkinStyleContainer.php.
References getSkin(), and getSkinDirectory().
Referenced by compileLess(), copyCSSFromDefault(), deleteStyle(), and updateStyle().
ilSkinStyleContainer::getImagesSkinPath | ( | string | $style_id | ) |
Definition at line 472 of file class.ilSkinStyleContainer.php.
References getSkin(), and getSkinDirectory().
Referenced by create(), resetImages(), and updateStyle().
ilSkinStyleContainer::getLessFilePath | ( | string | $style_id | ) |
Definition at line 457 of file class.ilSkinStyleContainer.php.
References getSkin(), and getSkinDirectory().
Referenced by compileLess(), createMainLessFile(), deleteStyle(), and updateStyle().
|
protected |
Returns the main less default content if a new style is created.
Definition at line 304 of file class.ilSkinStyleContainer.php.
References ilSkinStyle\getId(), getLessVariablesName(), and getSystemStylesConf().
Referenced by createMainLessFile().
ilSkinStyleContainer::getLessVariablesFilePath | ( | string | $style_id | ) |
Definition at line 462 of file class.ilSkinStyleContainer.php.
References getLessVariablesName(), and getSkinDirectory().
Referenced by copyVariablesFromDefault(), deleteStyle(), and updateStyle().
ilSkinStyleContainer::getLessVariablesName | ( | string | $style_id | ) |
Definition at line 467 of file class.ilSkinStyleContainer.php.
References getSkin().
Referenced by getLessMainFileDefautContent(), getLessVariablesFilePath(), and updateStyle().
ilSkinStyleContainer::getMessageStack | ( | ) |
Definition at line 477 of file class.ilSkinStyleContainer.php.
References $message_stack.
Referenced by createMainLessFile(), delete(), deleteStyle(), and updateStyle().
ilSkinStyleContainer::getSkin | ( | ) |
Definition at line 437 of file class.ilSkinStyleContainer.php.
References $skin.
Referenced by addStyle(), ilSkinFactory\copyFromSkinStyleContainer(), create(), createTempZip(), deleteStyle(), export(), getCSSFilePath(), getImagesSkinPath(), getLessFilePath(), getLessVariablesName(), getSkinDirectory(), resourcesStyleReferences(), ilSkinFactoryTest\testCopySkin(), ilSkinFactoryTest\testCopySkinWithInjectedName(), ilSkinStyleContainerTest\testCreateDelete(), ilSkinStyleContainerTest\testDeleteSkin(), ilSkinFactoryTest\testImportSkin(), ilSkinFactoryTest\testSkinStyleContainerFromId(), ilSkinStyleContainerTest\testUpdateSkinWithChangedID(), ilSkinStyleContainerTest\testUpdateStyle(), updateSkin(), updateStyle(), and writeSkinToXML().
ilSkinStyleContainer::getSkinDirectory | ( | ) |
Definition at line 447 of file class.ilSkinStyleContainer.php.
References getSkin(), and getSystemStylesConf().
Referenced by ilSkinFactory\copyFromSkinStyleContainer(), create(), createTempZip(), delete(), deleteStyle(), getCSSFilePath(), getImagesSkinPath(), getLessFilePath(), getLessVariablesFilePath(), resetImages(), updateSkin(), updateStyle(), and writeSkinToXML().
ilSkinStyleContainer::getSystemStylesConf | ( | ) |
Definition at line 499 of file class.ilSkinStyleContainer.php.
References $system_styles_conf.
Referenced by copyCSSFromDefault(), ilSkinFactory\copyFromSkinStyleContainer(), copyVariablesFromDefault(), create(), getLessMainFileDefautContent(), getSkinDirectory(), resetImages(), updateSkin(), and updateStyle().
ilSkinStyleContainer::resetImages | ( | ilSkinStyle | $style | ) |
Copies (resets) the images from delos.
Definition at line 284 of file class.ilSkinStyleContainer.php.
References ilSkinStyle\getId(), ilSkinStyle\getImageDirectory(), getImagesSkinPath(), getSkinDirectory(), and getSystemStylesConf().
|
protected |
Checks if a given resource (folder) is still referenced by a style of the containers skin.
Definition at line 232 of file class.ilSkinStyleContainer.php.
References getSkin().
Referenced by deleteStyle(), and updateStyle().
ilSkinStyleContainer::setMessageStack | ( | ilSystemStyleMessageStack | $message_stack | ) |
Definition at line 482 of file class.ilSkinStyleContainer.php.
References $message_stack.
Referenced by __construct().
ilSkinStyleContainer::setSkin | ( | ilSkin | $skin | ) |
Definition at line 442 of file class.ilSkinStyleContainer.php.
References $skin.
ilSkinStyleContainer::setSystemStylesConf | ( | ilSystemStyleConfig | $system_styles_conf | ) |
Definition at line 504 of file class.ilSkinStyleContainer.php.
References $system_styles_conf.
Referenced by __construct().
ilSkinStyleContainer::updateSkin | ( | ilSkin | $old_skin = null | ) |
Updates the skin.
Style are not updated, use updateStyle for that.
ilSystemStyleException |
Definition at line 112 of file class.ilSkinStyleContainer.php.
References getSkin(), getSkinDirectory(), getSystemStylesConf(), and writeSkinToXML().
Referenced by ilSkinStyleContainerTest\testUpdateSkinNoIdChange(), and ilSkinStyleContainerTest\testUpdateSkinWithChangedID().
ilSkinStyleContainer::updateStyle | ( | string | $style_id, |
ilSkinStyle | $old_style | ||
) |
Updates one single style.
Definition at line 132 of file class.ilSkinStyleContainer.php.
References Vendor\Package\$e, changeVariablesImport(), compileLess(), copyVariablesFromDefault(), createMainLessFile(), ilSkinStyle\getCssFile(), getCSSFilePath(), ilSkinStyle\getFontDirectory(), ilSkinStyle\getImageDirectory(), getImagesSkinPath(), getLessFilePath(), getLessVariablesFilePath(), getLessVariablesName(), getMessageStack(), getSkin(), getSkinDirectory(), ilSkinStyle\getSoundDirectory(), getSystemStylesConf(), resourcesStyleReferences(), ilSystemStyleMessage\TYPE_ERROR, and writeSkinToXML().
Referenced by addStyle(), and ilSkinStyleContainerTest\testUpdateStyle().
|
protected |
Definition at line 494 of file class.ilSkinStyleContainer.php.
References getSkin(), and getSkinDirectory().
Referenced by create(), deleteStyle(), updateSkin(), and updateStyle().
|
protected |
Definition at line 45 of file class.ilSkinStyleContainer.php.
Referenced by __construct().
|
protected |
Definition at line 28 of file class.ilSkinStyleContainer.php.
Referenced by __construct().
|
protected |
Used to stack messages to be displayed to the user (mostly reports for failed actions)
Definition at line 38 of file class.ilSkinStyleContainer.php.
Referenced by getMessageStack(), and setMessageStack().
|
protected |
Data-scope for the skin this container capsules.
Definition at line 33 of file class.ilSkinStyleContainer.php.
Referenced by __construct(), getSkin(), and setSkin().
|
protected |
Used to wire this component up with the correct pathes into the customizing directory.
Definition at line 43 of file class.ilSkinStyleContainer.php.
Referenced by getSystemStylesConf(), and setSystemStylesConf().