2 include_once(
"Services/Style/System/classes/Exceptions/class.ilSystemStyleException.php");
3 include_once(
"Services/Style/System/classes/Utilities/class.ilSkinStyleXML.php");
59 public static function parseFromXML(
$path =
""){
67 $skin =
new self(
$id,(
string)$xml->attributes()[
"name"]);
68 $skin->setVersion((
string)$xml->attributes()[
"version"]);
76 foreach($xml->children() as $style_xml){
83 if($style_xml->getName() ==
"substyle") {
87 $style->setSubstyleOf($last_style->getId());
103 $xml =
new SimpleXMLElement(
'<?xml version="1.0" encoding="UTF-8"?><template/>');
104 $xml->addAttribute(
"xmlns",
"http://www.w3.org");
105 $xml->addAttribute(
"version",$this->
getVersion());
106 $xml->addAttribute(
"name",$this->
getName());
111 if(!$style->isSubstyle()){
121 $dom->formatOutput =
true;
122 $dom->loadXML($xml->asXML());
123 return $dom->saveXML();
135 $xml_style = $xml->addChild(
"substyle");
138 $xml_style = $xml->addChild(
"style");
140 $xml_style->addAttribute(
"id", $style->
getId());
141 $xml_style->addAttribute(
"name", $style->
getName());
143 $xml_style->addAttribute(
"css_file", $style->
getCssFile());
168 unset($this->styles[$index]);
182 if($style->getId() ==
$id){
195 if($style->getId() ==
$id){
206 return array_values($this->styles)[0];
215 return current($this->styles) !==
false;
222 return key($this->styles);
236 reset($this->styles);
243 return count($this->styles);
260 if (strpos(
$id,
' ') !==
false) {
263 $this->
id = str_replace(
" ",
"_",
$id);
325 $this->version = implode(
'.', $v);
332 return ($this->version !=
'$Id$');
340 $substyles =
array();
344 if($style->getId() != $style_id && $style->isSubstyle()){
345 if($style->getSubstyleOf() == $style_id){
346 $substyles[$style->getId()] =
$style;
362 if($style->getId() != $style_id && $style->isSubstyle()){
363 if($style->getSubstyleOf() == $style_id){
addStyle(ilSkinStyleXML $style)
__construct($id, $name)
ilSkinXML constructor.
static parseFromXMLElement(SimpleXMLElement $xml_element)
hasStyleSubstyles($style_id)
Returns wheter a given style has substyles.
getSubstylesOfStyle($style_id)
Add rich text string
The name of the decorator.
ilSkinXml holds an manages the basic data of a skin as provide by the template of the skin...
isSubstyle()
Return wheter this style is a substyle of another.
const INVALID_CHARACTERS_IN_ID
addChildToXML(SimpleXMLElement $xml, ilSkinStyleXML $style)
Used to generate the xml for styles contained by the skin.
Class for advanced editing exception handling in ILIAS.
const FILE_OPENING_FAILED
Create styles array
The data for the language used.
count()
Countable implementations.
valid()
Iterator implementations.
asXML()
Stores the skin and all it's styles as xml.