ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
4 include_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")
27  {
29  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
30  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
31  }
32  if ($a_schema_version == "5.0.0")
33  {
34  if ($a_entity == "sty")
35  {
36  include_once "Services/Style/Content/classes/class.ilObjStyleSheet.php";
37  $style = new ilObjStyleSheet($a_id, false);
38 
39  // images
41  if($target && !is_dir($target))
42  {
44  }
45  ilUtil::rCopy($style->getImagesDirectory(), $target);
46 
47  return "<StyleSheetExport>".
48  "<ImagePath>".$this->getRelativeExportDirectory()."</ImagePath>".
49  $style->getXML().
50  "</StyleSheetExport>";
51  }
52  }
53  }
54 
55  public function getValidSchemaVersions($a_entity)
56  {
57  return array (
58  "5.1.0" => array(
59  "namespace" => "http://www.ilias.de/Services/Style/5_1",
60  "xsd_file" => "ilias_style_5_1.xsd",
61  "uses_dataset" => true,
62  "min" => "5.1.0",
63  "max" => ""),
64  "5.0.0" => array(
65  "namespace" => "http://www.ilias.de/Services/Style/5_0",
66  "xsd_file" => "ilias_style_5_0.xsd",
67  "uses_dataset" => false,
68  "min" => "5.0.0",
69  "max" => "")
70  );
71  }
72 }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
$style
Definition: example_012.php:70
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Xml Exporter class.
getValidSchemaVersions($a_entity)
getAbsoluteExportDirectory()
Get absolute export directory.
Create styles array
The data for the language used.
Style Data set class.
Class ilObjStyleSheet.
Style export definition.