ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilStyleExporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Export/classes/class.ilXmlExporter.php';
5
15{
16 public function init()
17 {
18 include_once("./Services/Style/classes/class.ilStyleDataSet.php");
19 $this->ds = new ilStyleDataSet();
20 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
21 $this->ds->setDSPrefix("ds");
22 }
23
24 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
25 {
26 if ($a_schema_version == "5.1.0") {
28 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
29 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
30 }
31 if ($a_schema_version == "5.0.0") {
32 if ($a_entity == "sty") {
33 include_once "Services/Style/Content/classes/class.ilObjStyleSheet.php";
34 $style = new ilObjStyleSheet($a_id, false);
35
36 // images
38 if ($target && !is_dir($target)) {
40 }
41 ilUtil::rCopy($style->getImagesDirectory(), $target);
42
43 return "<StyleSheetExport>" .
44 "<ImagePath>" . $this->getRelativeExportDirectory() . "</ImagePath>" .
45 $style->getXML() .
46 "</StyleSheetExport>";
47 }
48 }
49 }
50
51 public function getValidSchemaVersions($a_entity)
52 {
53 return array(
54 "5.1.0" => array(
55 "namespace" => "http://www.ilias.de/Services/Style/5_1",
56 "xsd_file" => "ilias_style_5_1.xsd",
57 "uses_dataset" => true,
58 "min" => "5.1.0",
59 "max" => ""),
60 "5.0.0" => array(
61 "namespace" => "http://www.ilias.de/Services/Style/5_0",
62 "xsd_file" => "ilias_style_5_0.xsd",
63 "uses_dataset" => false,
64 "min" => "5.0.0",
65 "max" => "")
66 );
67 }
68}
An exception for terminatinating execution or to throw for unit testing.
Class ilObjStyleSheet.
Style Data set class.
Style export definition.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
Xml Exporter class.
getRelativeExportDirectory()
Get relative export directory.
getAbsoluteExportDirectory()
Get absolute export directory.
$style
Definition: example_012.php:70
$target
Definition: test.php:19