ILIAS  release_8 Revision v8.23
ilContainerReferenceXmlWriter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilContainerReferenceXmlWriter:
+ Collaboration diagram for ilContainerReferenceXmlWriter:

Public Member Functions

 __construct (ilContainerReference $ref=null)
 
 setMode (int $a_mode)
 
 getMode ()
 
 getReference ()
 
 export (bool $a_with_header=true)
 
 getXml ()
 
- Public Member Functions inherited from ilXmlWriter
 __construct (string $version="1.0", string $outEnc="utf-8", string $inEnc="utf-8")
 
 xmlSetDtdDef (string $dtdDef)
 Sets dtd definition. More...
 
 xmlSetGenCmt (string $genCmt)
 Sets generated comment. More...
 
 xmlFormatData (string $data)
 Indents text for better reading. More...
 
 xmlHeader ()
 Writes xml header. More...
 
 xmlStartTag (string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
 Writes a starttag. More...
 
 xmlEndTag (string $tag)
 Writes an endtag. More...
 
 xmlData (string $data, bool $encode=true, bool $escape=true)
 Writes data. More...
 
 xmlElement (string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
 Writes a basic element (no children, just textual content) More...
 
 xmlDumpFile (string $file, bool $format=true)
 Dumps xml document from memory into a file. More...
 
 xmlDumpMem (bool $format=true)
 Returns xml document from memory. More...
 
 appendXML (string $a_str)
 append xml string to document More...
 
 xmlClear ()
 clears xmlStr More...
 

Data Fields

const MODE_SOAP = 1
 
const MODE_EXPORT = 2
 

Protected Member Functions

 buildHeader ()
 
 buildTarget ()
 
 buildTitle ()
 
 buildReference ()
 
 buildFooter ()
 

Protected Attributes

ilSetting $settings
 

Private Attributes

int $mode = self::MODE_SOAP
 
ilContainerReference $ref
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class for container reference export

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 26 of file class.ilContainerReferenceXmlWriter.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerReferenceXmlWriter::__construct ( ilContainerReference  $ref = null)

Definition at line 36 of file class.ilContainerReferenceXmlWriter.php.

References $DIC, $ref, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\settings().

37  {
38  global $DIC;
39 
40  $this->settings = $DIC->settings();
42  $this->ref = $ref;
43  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildFooter()

ilContainerReferenceXmlWriter::buildFooter ( )
protected

Definition at line 113 of file class.ilContainerReferenceXmlWriter.php.

References ilXmlWriter\xmlEndTag().

Referenced by ilCourseReferenceXmlWriter\export(), and export().

113  : void
114  {
115  $this->xmlEndTag('ContainerReference');
116  }
xmlEndTag(string $tag)
Writes an endtag.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeader()

ilContainerReferenceXmlWriter::buildHeader ( )
protected

Definition at line 78 of file class.ilContainerReferenceXmlWriter.php.

References $ilSetting, $settings, ILIAS\Survey\Mode\getId(), getReference(), ilXmlWriter\xmlHeader(), ilXmlWriter\xmlSetDtdDef(), and ilXmlWriter\xmlSetGenCmt().

Referenced by export().

78  : void
79  {
81 
82  $this->xmlSetDtdDef("<!DOCTYPE container reference PUBLIC \"-//ILIAS//DTD Group//EN\" \"" . ILIAS_HTTP_PATH . "/xml/ilias_container_reference_4_3.dtd\">");
83  $this->xmlSetGenCmt("Export of ILIAS container reference " . $this->getReference()->getId() . " of installation " . $ilSetting->get('inst_id') . ".");
84  $this->xmlHeader();
85  }
xmlSetGenCmt(string $genCmt)
Sets generated comment.
xmlSetDtdDef(string $dtdDef)
Sets dtd definition.
xmlHeader()
Writes xml header.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildReference()

ilContainerReferenceXmlWriter::buildReference ( )
protected

Definition at line 108 of file class.ilContainerReferenceXmlWriter.php.

References ilXmlWriter\xmlStartTag().

Referenced by ilCourseReferenceXmlWriter\export(), and export().

108  : void
109  {
110  $this->xmlStartTag('ContainerReference');
111  }
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTarget()

ilContainerReferenceXmlWriter::buildTarget ( )
protected

Definition at line 87 of file class.ilContainerReferenceXmlWriter.php.

References getReference(), and ilXmlWriter\xmlElement().

Referenced by ilCourseReferenceXmlWriter\export(), and export().

87  : void
88  {
89  $this->xmlElement('Target', ['id' => $this->getReference()->getTargetId()]);
90  }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTitle()

ilContainerReferenceXmlWriter::buildTitle ( )
protected

Definition at line 92 of file class.ilContainerReferenceXmlWriter.php.

References getReference(), ilContainerReference\TITLE_TYPE_CUSTOM, and ilXmlWriter\xmlElement().

Referenced by ilCourseReferenceXmlWriter\export(), and export().

92  : void
93  {
94  $title = '';
95  if ($this->getReference()->getTitleType() === ilContainerReference::TITLE_TYPE_CUSTOM) {
96  $title = $this->getReference()->getTitle();
97  }
98 
99  $this->xmlElement(
100  'Title',
101  [
102  'type' => $this->getReference()->getTitleType()
103  ],
104  $title
105  );
106  }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ export()

ilContainerReferenceXmlWriter::export ( bool  $a_with_header = true)

◆ getMode()

ilContainerReferenceXmlWriter::getMode ( )

Definition at line 50 of file class.ilContainerReferenceXmlWriter.php.

References $mode.

Referenced by ilCourseReferenceXmlWriter\export(), and export().

50  : int
51  {
52  return $this->mode;
53  }
+ Here is the caller graph for this function:

◆ getReference()

ilContainerReferenceXmlWriter::getReference ( )

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

References $ref.

Referenced by ilCourseReferenceXmlWriter\buildCourseSettings(), ilGroupReferenceXmlWriter\buildHeader(), ilCategoryReferenceXmlWriter\buildHeader(), ilCourseReferenceXmlWriter\buildHeader(), buildHeader(), buildTarget(), and buildTitle().

56  {
57  return $this->ref;
58  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getXml()

ilContainerReferenceXmlWriter::getXml ( )

Definition at line 73 of file class.ilContainerReferenceXmlWriter.php.

References ilXmlWriter\xmlDumpMem().

73  : string
74  {
75  return $this->xmlDumpMem(false);
76  }
xmlDumpMem(bool $format=true)
Returns xml document from memory.
+ Here is the call graph for this function:

◆ setMode()

ilContainerReferenceXmlWriter::setMode ( int  $a_mode)

Definition at line 45 of file class.ilContainerReferenceXmlWriter.php.

45  : void
46  {
47  $this->mode = $a_mode;
48  }

Field Documentation

◆ $mode

int ilContainerReferenceXmlWriter::$mode = self::MODE_SOAP
private

Definition at line 33 of file class.ilContainerReferenceXmlWriter.php.

Referenced by getMode().

◆ $ref

◆ $settings

ilSetting ilContainerReferenceXmlWriter::$settings
protected

◆ MODE_EXPORT

const ilContainerReferenceXmlWriter::MODE_EXPORT = 2

◆ MODE_SOAP

const ilContainerReferenceXmlWriter::MODE_SOAP = 1

Definition at line 28 of file class.ilContainerReferenceXmlWriter.php.


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