ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilCourseReferenceXmlWriter.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once './Services/ContainerReference/classes/class.ilContainerReferenceXmlWriter.php';
6 
14 {
22  public function __construct(ilObjCourseReference $ref = null)
23  {
25  }
26 
27 
31  public function export(bool $a_with_header = true): void
32  {
33  if ($this->getMode() == self::MODE_EXPORT) {
34  if ($a_with_header) {
35  $this->buildHeader();
36  }
37  $this->buildReference();
38  $this->buildTarget();
39  $this->buildTitle();
40  $this->buildCourseSettings();
41  $this->buildFooter();
42  }
43  }
44 
48  protected function buildCourseSettings()
49  {
50  $this->xmlElement('MemberUpdate', [], $this->getReference()->isMemberUpdateEnabled() ? 1 : 0);
51  }
52 
53 
59  protected function buildHeader(): void
60  {
61  global $ilSetting;
62 
63  $this->xmlSetDtdDef("<!DOCTYPE course reference PUBLIC \"-//ILIAS//DTD Group//EN\" \"" . ILIAS_HTTP_PATH . "/xml/ilias_course_reference_4_3.dtd\">");
64  $this->xmlSetGenCmt("Export of ILIAS course reference " . $this->getReference()->getId() . " of installation " . $ilSetting->get('inst_id') . ".");
65  $this->xmlHeader();
66  }
67 }
__construct(ilObjCourseReference $ref=null)
constructor
xmlSetGenCmt(string $genCmt)
Sets generated comment.
buildCourseSettings()
Add member update setting.
export(bool $a_with_header=true)
Start writing xml.
xmlSetDtdDef(string $dtdDef)
Sets dtd definition.
xmlHeader()
Writes xml header.
global $ilSetting
Definition: privfeed.php:17
__construct(Container $dic, ilPlugin $plugin)
Class for container reference export.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...