ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilCourseExporter.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 
5 include_once './Modules/Course/classes/class.ilCourseXMLWriter.php';
6 include_once './Services/Export/classes/class.ilXmlExporter.php';
7 
18 {
19  private $writer = null;
20 
24  public function __construct()
25  {
26  }
27 
32  public function init()
33  {
34 
35  }
36 
45  public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
46  {
47  include_once './Services/Export/classes/class.ilExportOptions.php';
49 
50  if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
51  {
52  return array(
53  array(
54  'component' => 'Services/Container',
55  'entity' => 'struct',
56  'ids' => $a_ids
57  )
58  );
59  }
60  return array();
61  }
62 
63 
71  public function getXmlRepresentation($a_entity, $a_target_release, $a_id)
72  {
73  $course_ref_id = end(ilObject::_getAllReferences($a_id));
74  $course = ilObjectFactory::getInstanceByRefId($course_ref_id,false);
75 
76  if(!$course instanceof ilObjCourse)
77  {
78  $GLOBALS['ilLog']->write(__METHOD__. $a_id . ' is not instance of type course');
79  return '';
80  }
81 
82  $this->writer = new ilCourseXMLWriter($course);
83  $this->writer->setMode(ilCourseXMLWriter::MODE_EXPORT);
84  $this->writer->start();
85  return $this->writer->xmlDumpMem(false);
86  }
87 
95  public function getValidSchemaVersions($a_entity)
96  {
97  return array (
98  "4.1.0" => array(
99  "namespace" => "http://www.ilias.de/Modules/Course/crs/4_1",
100  "xsd_file" => "ilias_course_4_1.xsd",
101  "uses_dataset" => false,
102  "min" => "4.1.0",
103  "max" => "")
104  );
105  }
106 }
107 ?>