ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilStyleExporter Class Reference

Style export definition. More...

+ Inheritance diagram for ilStyleExporter:
+ Collaboration diagram for ilStyleExporter:

Public Member Functions

 init ()
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 Constructor. More...
 
 setExport (ilExport $a_exp)
 Set export object. More...
 
 getExport ()
 Get export. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 init ()
 
 setExportDirectories ($a_dir_relative, $a_dir_absolute)
 Export directories. More...
 
 getRelativeExportDirectory ()
 Get relative export directory. More...
 
 getAbsoluteExportDirectory ()
 Get absolute export directory. More...
 
 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion ($a_entity, $a_target_release)
 Determine schema version. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 export directory lookup More...
 
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 
 $exp
 

Detailed Description

Style export definition.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 14 of file class.ilStyleExporter.php.

Member Function Documentation

◆ getValidSchemaVersions()

ilStyleExporter::getValidSchemaVersions (   $a_entity)

Returns schema versions that the component can export to.

ILIAS chooses the first one, that has min/max constraints which fit to the target release. Please put the newest on top. Example:

            return array (
    "4.1.0" => array(
            "namespace" => "http://www.ilias.de/Services/MetaData/md/4_1",
            "xsd_file" => "ilias_md_4_1.xsd",
            "min" => "4.1.0",
            "max" => "")
    );
Returns
array

Reimplemented from ilXmlExporter.

Definition at line 55 of file class.ilStyleExporter.php.

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 }

◆ getXmlRepresentation()

ilStyleExporter::getXmlRepresentation (   $a_entity,
  $a_schema_version,
  $a_id 
)

Get xml representation.

Parameters
stringentity
stringschema version
stringid
Returns
string xml string

Reimplemented from ilXmlExporter.

Definition at line 24 of file class.ilStyleExporter.php.

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/classes/class.ilObjStyleSheet.php";
37 $style = new ilObjStyleSheet($a_id, false);
38
39 // images
40 $target = $this->getAbsoluteExportDirectory();
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 }
Class ilObjStyleSheet.
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.
getAbsoluteExportDirectory()
Get absolute export directory.
$style
Definition: example_012.php:70

References $style, ilXmlExporter\getAbsoluteExportDirectory(), ilUtil\makeDirParents(), and ilUtil\rCopy().

+ Here is the call graph for this function:

◆ init()

ilStyleExporter::init ( )

Reimplemented from ilXmlExporter.

Definition at line 16 of file class.ilStyleExporter.php.

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 }
Style Data set class.

The documentation for this class was generated from the following file: