2 include_once(
"Services/Style/System/classes/Exceptions/class.ilSystemStyleException.php");
3 include_once(
"Services/Style/System/classes/Utilities/class.ilSkinStyleXML.php");
60 public static function parseFromXML(
$path =
"")
69 $skin =
new self(
$id, (string)
$xml->attributes()[
"name"]);
70 $skin->setVersion((
string)
$xml->attributes()[
"version"]);
78 foreach (
$xml->children() as $style_xml) {
84 if ($style_xml->getName() ==
"substyle") {
88 $style->setSubstyleOf($last_style->getId());
105 $xml->addAttribute(
"xmlns",
"http://www.w3.org");
112 if (!$style->isSubstyle()) {
122 $dom->formatOutput =
true;
123 $dom->loadXML(
$xml->asXML());
124 return $dom->saveXML();
137 $xml_style = $xml->addChild(
"substyle");
139 $xml_style = $xml->addChild(
"style");
141 $xml_style->addAttribute(
"id", $style->
getId());
142 $xml_style->addAttribute(
"name", $style->
getName());
144 $xml_style->addAttribute(
"css_file", $style->
getCssFile());
172 unset($this->styles[
$index]);
187 if ($style->getId() ==
$id) {
201 if ($style->getId() ==
$id) {
213 return array_values($this->styles)[0];
223 return current($this->styles) !==
false;
231 return key($this->styles);
248 reset($this->styles);
256 return count($this->styles);
273 if (strpos(
$id,
' ') !==
false) {
276 $this->
id = str_replace(
" ",
"_",
$id);
338 $this->version = implode(
'.', $v);
345 return ($this->version !=
'$Id$');
354 $substyles = array();
358 if ($style->getId() != $style_id && $style->isSubstyle()) {
359 if ($style->getSubstyleOf() == $style_id) {
360 $substyles[$style->getId()] =
$style;
377 if ($style->getId() != $style_id && $style->isSubstyle()) {
378 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)
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
count()
Countable implementations.
valid()
Iterator implementations.
asXML()
Stores the skin and all it's styles as xml.