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...
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().
ilSystemStyleSkinContainer::addStyle | ( | ilSkinStyleXML | $style | ) |
ilSkinStyleXML | $style |
Definition at line 720 of file class.ilSystemStyleSkinContainer.php.
References ilSkinStyleXML\getId(), getSkin(), and updateStyle().
|
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(), resourcesStyleReferences(), and ilSystemStyleMessage\TYPE_SUCCESS.
Referenced by updateStyle().
|
protected |
$main_path | |
$old_style_import | |
$new_style_import |
Definition at line 608 of file class.ilSystemStyleSkinContainer.php.
Referenced by updateStyle().
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().
ilSystemStyleSkinContainer::copy | ( | ) |
Copies a complete Skin.
ilSystemStyleException |
Definition at line 532 of file class.ilSystemStyleSkinContainer.php.
References getMessageStack(), getSkin(), getSkinDirectory(), getSystemStylesConf(), ilStyleDefinition\skinExists(), ilSystemStyleMessage\TYPE_SUCCESS, and xCopy().
Referenced by copyCSSFromDefault(), updateStyle(), and xCopy().
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().
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().
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 $style, ilSystemStyleMessageStack\addMessage(), createLessStructure(), createResourceDirectory(), getSkin(), getSkinDirectory(), getSystemStylesConf(), ilSystemStyleException\SKIN_ALREADY_EXISTS, ilSystemStyleMessage\TYPE_ERROR, and writeSkinToXML().
|
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().
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().
|
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(), and ilSystemStyleMessage\TYPE_SUCCESS.
Referenced by create(), resetImages(), and updateStyle().
ilSystemStyleSkinContainer::createTempZip | ( | ) |
Creates a temp zip file.
Definition at line 560 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory(), and ilUtil\zip().
Referenced by export().
ilSystemStyleSkinContainer::delete | ( | ) |
Deletes the container of a skin completely.
Definition at line 472 of file class.ilSystemStyleSkinContainer.php.
References getMessageStack(), and ilSystemStyleMessage\TYPE_SUCCESS.
|
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().
ilSystemStyleSkinContainer::deleteStyle | ( | ilSkinStyleXML | $style | ) |
Deletes a style completely.
ilSkinStyleXML | $style |
Definition at line 500 of file class.ilSystemStyleSkinContainer.php.
References deleteFile(), ilSystemStyleSettings\deleteSubStyleCategoryAssignments(), getCSSFilePath(), ilSkinStyleXML\getFontDirectory(), ilSkinStyleXML\getId(), ilSkinStyleXML\getImageDirectory(), getLessFilePath(), getLessVariablesFilePath(), getMessageStack(), ilSkinStyleXML\getName(), getSkin(), ilSkinStyleXML\getSoundDirectory(), ilSkinStyleXML\getSubstyleOf(), ilSkinStyleXML\isSubstyle(), removeResourceDirectory(), ilSystemStyleMessage\TYPE_SUCCESS, and writeSkinToXML().
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().
|
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(), ilSystemStyleOverviewGUI\copyStyle(), ilSystemStyleOverviewGUI\deleteStyle(), ilSystemStyleOverviewGUI\deleteStyles(), ilSystemStyleOverviewGUI\export(), ilSystemStyleOverviewGUI\saveNewSubStyle(), ilSystemStyleSettingsGUI\saveStyle(), ilSystemStyleSettingsGUI\saveSubStyle(), ilSystemStyleMainGUI\setUnderworldTitle(), ilSkinStyleLessFileTest\setUp(), ilSystemStyleStyleLessFileTest\setUp(), ilSystemStyleIconTest\setUp(), ilSystemStyleIconFolderTest\setUp(), ilStyleDefinition\styleExistsForSkinId(), ilSystemStyleSkinContainerTest\testAddStyle(), ilSystemStyleSkinContainerTest\testCopySkin(), ilSystemStyleSkinContainerTest\testCreateDelete(), ilSystemStyleSkinContainerTest\testDeleteSkin(), ilSystemStyleSkinContainerTest\testDeleteStyle(), ilSystemStyleSkinContainerTest\testGenerateFromId(), ilSystemStyleSkinContainerTest\testImportSkin(), ilSystemStyleSkinContainerTest\testUpdateSkin(), and ilSystemStyleSkinContainerTest\testUpdateStyle().
ilSystemStyleSkinContainer::getCSSFilePath | ( | $style_id | ) |
$style_id |
Definition at line 665 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory().
Referenced by compileLess(), copyCSSFromDefault(), deleteStyle(), and updateStyle().
ilSystemStyleSkinContainer::getImagesSkinPath | ( | $style_id | ) |
$style_id |
Definition at line 697 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory().
ilSystemStyleSkinContainer::getLessFilePath | ( | $style_id | ) |
$style_id |
Definition at line 673 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory().
Referenced by createMainLessFile(), deleteStyle(), and updateStyle().
|
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 ilSkinStyleXML\getId(), and getSystemStylesConf().
Referenced by createMainLessFile().
ilSystemStyleSkinContainer::getLessVariablesFilePath | ( | $style_id | ) |
$style_id |
Definition at line 681 of file class.ilSystemStyleSkinContainer.php.
References getSkinDirectory().
Referenced by copyVariablesFromDefault(), deleteStyle(), and updateStyle().
ilSystemStyleSkinContainer::getLessVariablesName | ( | $style_id | ) |
$style_id |
Definition at line 689 of file class.ilSystemStyleSkinContainer.php.
References getSkin().
Referenced by updateStyle().
|
static |
Definition at line 704 of file class.ilSystemStyleSkinContainer.php.
Referenced by changeResourceDirectory(), copy(), createMainLessFile(), createResourceDirectory(), delete(), deleteFile(), deleteStyle(), removeResourceDirectory(), and updateStyle().
ilSystemStyleSkinContainer::getSkin | ( | ) |
Definition at line 639 of file class.ilSystemStyleSkinContainer.php.
References $skin.
Referenced by addStyle(), copy(), create(), deleteStyle(), export(), getLessVariablesName(), resourcesStyleReferences(), updateSkin(), updateStyle(), and writeSkinToXML().
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().
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().
|
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 ilStyleDefinition\skinExists(), and ilUtil\unzip().
Referenced by ilSystemStyleOverviewGUI\importStyle().
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().
|
static |
Recursive delete of a folder.
$dir |
Definition at line 425 of file class.ilSystemStyleSkinContainer.php.
Referenced by ilSkinStyleLessFileTest\tearDown(), ilSystemStyleStyleLessFileTest\tearDown(), ilSkinXMLTest\tearDown(), ilSystemStyleSkinXMLTest\tearDown(), ilSystemStyleIconFolderTest\tearDown(), ilSystemStyleIconTest\tearDown(), and ilSystemStyleSkinContainerTest\tearDown().
|
protected |
Deletes a resource directory.
$dir |
Definition at line 306 of file class.ilSystemStyleSkinContainer.php.
References getMessageStack(), getSkinDirectory(), resourcesStyleReferences(), and ilSystemStyleMessage\TYPE_SUCCESS.
Referenced by deleteStyle().
ilSystemStyleSkinContainer::resetImages | ( | ilSkinStyleXML | $style | ) |
Copies (resets) the images from delos.
ilSkinStyleXML | $style |
Definition at line 370 of file class.ilSystemStyleSkinContainer.php.
References createResourceDirectory(), ilSkinStyleXML\getImageDirectory(), getSkinDirectory(), and getSystemStylesConf().
|
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, array, and getSkin().
Referenced by changeResourceDirectory(), and removeResourceDirectory().
|
static |
ilSystemStyleMessageStack | $message_stack |
Definition at line 712 of file class.ilSystemStyleSkinContainer.php.
References $message_stack.
Referenced by __construct().
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().
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(), getSkin(), getSkinDirectory(), getSystemStylesConf(), move(), and writeSkinToXML().
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(), getLessVariablesFilePath(), getLessVariablesName(), getMessageStack(), getSkin(), getSkinDirectory(), ilSkinStyleXML\getSoundDirectory(), getSystemStylesConf(), ilSystemStyleMessage\TYPE_ERROR, and writeSkinToXML().
Referenced by addStyle().
|
protected |
Definition at line 726 of file class.ilSystemStyleSkinContainer.php.
References getSkin(), and getSkinDirectory().
Referenced by create(), deleteStyle(), updateSkin(), and updateStyle().
|
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, and ilSystemStyleException\FOLDER_CREATION_FAILED.
Referenced by copy(), ilSkinStyleLessFileTest\setUp(), ilSystemStyleStyleLessFileTest\setUp(), ilSkinXMLTest\setUp(), ilSystemStyleSkinXMLTest\setUp(), ilSystemStyleSkinContainerTest\setUp(), ilSystemStyleIconFolderTest\setUp(), and ilSystemStyleIconTest\setUp().
|
protected |
Definition at line 24 of file class.ilSystemStyleSkinContainer.php.
|
staticprotected |
Definition at line 38 of file class.ilSystemStyleSkinContainer.php.
Referenced by __construct(), generateFromId(), 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(), and setSystemStylesConf().