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

Class ilLOXmlWriter. More...

+ Collaboration diagram for ilLOXmlWriter:

Public Member Functions

 __construct ($a_ref_id)
 Constructor. More...
 
 write ()
 Write xml. More...
 
 getXml ()
 Get xml. More...
 

Data Fields

const TYPE_TST_PO = 1
 
const TYPE_TST_ALL = 2
 
const TYPE_TST_RND = 3
 

Protected Member Functions

 getWriter ()
 Get writer. More...
 

Private Attributes

 $ref_id = 0
 
 $obj_id = 0
 
 $writer = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLOXmlWriter::__construct (   $a_ref_id)

Constructor.

Definition at line 25 of file class.ilLOXmlWriter.php.

References ilObject\_lookupObjectId().

26  {
27  $this->ref_id = $a_ref_id;
28  $this->obj_id = ilObject::_lookupObjectId($a_ref_id);
29 
30  include_once './Services/Xml/classes/class.ilXmlWriter.php';
31  $this->writer = new ilXmlWriter();
32  }
XML writer class.
static _lookupObjectId($a_ref_id)
lookup object id
+ Here is the call graph for this function:

Member Function Documentation

◆ getWriter()

ilLOXmlWriter::getWriter ( )
protected

Get writer.

Returns

Definition at line 38 of file class.ilLOXmlWriter.php.

References $writer.

Referenced by getXml(), and write().

39  {
40  return $this->writer;
41  }
+ Here is the caller graph for this function:

◆ getXml()

ilLOXmlWriter::getXml ( )

Get xml.

Returns
type

Definition at line 79 of file class.ilLOXmlWriter.php.

References getWriter().

80  {
81  return $this->getWriter()->xmlDumpMem(false);
82  }
getWriter()
Get writer.
+ Here is the call graph for this function:

◆ write()

ilLOXmlWriter::write ( )

Write xml.

Definition at line 46 of file class.ilLOXmlWriter.php.

References $GLOBALS, $ilSetting, ilCourseObjective\_getObjectiveIds(), ilLOSettings\getInstanceByObjId(), and getWriter().

47  {
48  global $ilSetting;
49 
50  $this->getWriter()->xmlStartTag('Objectives');
51 
52  // export settings
53  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
54  $settings = ilLOSettings::getInstanceByObjId($this->obj_id);
55  $settings->toXml($this->getWriter());
56 
57  $factory = new ilObjectFactory();
58  $course = $factory->getInstanceByRefId($this->ref_id,false);
59  if(!$course instanceof ilObjCourse)
60  {
61  $GLOBALS['ilLog']->write(__METHOD__.': Cannot create course instance');
62  return;
63  }
64 
65  include_once './Modules/Course/classes/class.ilCourseObjective.php';
66  foreach(ilCourseObjective::_getObjectiveIds($this->obj_id) as $objective_id)
67  {
68  $objective = new ilCourseObjective($course, $objective_id);
69  $objective->toXml($this->getWriter());
70  }
71 
72  $this->getWriter()->xmlEndTag('Objectives');
73  }
static getInstanceByObjId($a_obj_id)
get singleton instance
Class ilObjectFactory.
static _getObjectiveIds($course_id, $a_activated_only=false)
getWriter()
Get writer.
Class ilObjCourse.
class ilcourseobjective
global $ilSetting
Definition: privfeed.php:40
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the call graph for this function:

Field Documentation

◆ $obj_id

ilLOXmlWriter::$obj_id = 0
private

Definition at line 19 of file class.ilLOXmlWriter.php.

◆ $ref_id

ilLOXmlWriter::$ref_id = 0
private

Definition at line 18 of file class.ilLOXmlWriter.php.

◆ $writer

ilLOXmlWriter::$writer = null
private

Definition at line 20 of file class.ilLOXmlWriter.php.

Referenced by getWriter().

◆ TYPE_TST_ALL

const ilLOXmlWriter::TYPE_TST_ALL = 2

Definition at line 15 of file class.ilLOXmlWriter.php.

Referenced by ilCourseObjectiveQuestion\toXml().

◆ TYPE_TST_PO

const ilLOXmlWriter::TYPE_TST_PO = 1

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

Referenced by ilLOTestAssignments\toXml().

◆ TYPE_TST_RND

const ilLOXmlWriter::TYPE_TST_RND = 3

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

Referenced by ilLORandomTestQuestionPools\toXml().


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