ILIAS  release_8 Revision v8.24
ilFolderXmlParser Class Reference

XML parser for folder xml. More...

+ Inheritance diagram for ilFolderXmlParser:
+ Collaboration diagram for ilFolderXmlParser:

Public Member Functions

 __construct (ilObject $folder, string $xml)
 
 setFolder (ilObject $folder)
 
 getFolder ()
 
 start ()
 
 setHandlers ($a_xml_parser)
 
 handlerBeginTag ($a_xml_parser, string $a_name, array $a_attribs)
 
 handlerEndTag ($a_xml_parser, string $a_name)
 
 handlerCharacterData ($a_xml_parser, string $a_data)
 
- Public Member Functions inherited from ilSaxParser
 __construct (?string $path_to_file='', ?bool $throw_exception=false)
 
 setXMLContent (string $a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 
 setHandlers ($a_xml_parser)
 
 parse ($a_xml_parser, $a_fp=null)
 

Protected Attributes

ilErrorHandling $error
 
string $cdata = ""
 
- Protected Attributes inherited from ilSaxParser
ilLanguage $lng = null
 

Private Attributes

ilObject $folder
 

Additional Inherited Members

- Data Fields inherited from ilSaxParser
string $xml_file
 
bool $throw_exception = false
 
- Protected Member Functions inherited from ilContainerBaseXmlParser
 trimAndStripAttribs (array $attribs)
 
 trimAndStrip (string $input)
 
- Protected Member Functions inherited from ilSaxParser
 openXMLFile ()
 
 handleError (string $message)
 
 setThrowException (bool $throw_exception)
 

Detailed Description

XML parser for folder xml.

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

Definition at line 23 of file class.ilFolderXmlParser.php.

Constructor & Destructor Documentation

◆ __construct()

ilFolderXmlParser::__construct ( ilObject  $folder,
string  $xml 
)

Definition at line 29 of file class.ilFolderXmlParser.php.

30 {
31 global $DIC;
32
33 $this->error = $DIC["ilErr"];
35 $this->setXMLContent($xml);
36 $this->setFolder($folder);
37 $this->setThrowException(true);
38 }
error(string $a_errmsg)
setFolder(ilObject $folder)
setXMLContent(string $a_xml_content)
setThrowException(bool $throw_exception)
global $DIC
Definition: feed.php:28
$xml
Definition: metadata.php:351
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), error(), setFolder(), ilSaxParser\setThrowException(), and ilSaxParser\setXMLContent().

+ Here is the call graph for this function:

Member Function Documentation

◆ getFolder()

ilFolderXmlParser::getFolder ( )

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

45 : ilObject
46 {
47 return $this->folder;
48 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $folder.

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ handlerBeginTag()

ilFolderXmlParser::handlerBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)
Parameters
XMLParser | resource$a_xml_parser
string$a_name
array$a_attribs
Returns
void

Definition at line 71 of file class.ilFolderXmlParser.php.

71 : void
72 {
73 switch ($a_name) {
74
75 case 'Folder':
76 case 'Title':
77 case 'Description':
78 break;
79
80 case 'Sorting':
81 case 'Sort':
83 break;
84 }
85 }
static _importContainerSortingSettings(array $attibs, int $obj_id)
sorting import for all container objects

References ilContainerSortingSettings\_importContainerSortingSettings(), getFolder(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ handlerCharacterData()

ilFolderXmlParser::handlerCharacterData (   $a_xml_parser,
string  $a_data 
)
Parameters
XMLParser | resource$a_xml_parser
string$a_data
Returns
void

Definition at line 121 of file class.ilFolderXmlParser.php.

121 : void
122 {
123 if ($a_data !== "\n") {
124 // Replace multiple tabs with one space
125 $a_data = preg_replace("/\t+/", " ", $a_data);
126 $this->cdata .= $a_data;
127 }
128 }

◆ handlerEndTag()

ilFolderXmlParser::handlerEndTag (   $a_xml_parser,
string  $a_name 
)
Parameters
XMLParser | resource$a_xml_parser
string$a_name
Returns
void

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

92 : void
93 {
94 $GLOBALS['ilLog']->write(__METHOD__ . ': Called ' . $a_name);
95
96 switch ($a_name) {
97
98 case 'Folder':
99 $this->getFolder()->update();
100 break;
101
102 case 'Title':
103 $this->getFolder()->setTitle($this->trimAndStrip((string) $this->cdata));
104 break;
105
106 case 'Description':
107 $this->getFolder()->setDescription($this->trimAndStrip((string) $this->cdata));
108 break;
109
110 }
111
112 // Reset cdata
113 $this->cdata = '';
114 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

References $GLOBALS, getFolder(), and ilContainerBaseXmlParser\trimAndStrip().

+ Here is the call graph for this function:

◆ setFolder()

ilFolderXmlParser::setFolder ( ilObject  $folder)

Definition at line 40 of file class.ilFolderXmlParser.php.

40 : void
41 {
42 $this->folder = $folder;
43 }

References $folder.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setHandlers()

ilFolderXmlParser::setHandlers (   $a_xml_parser)
Parameters
XMLParser | resource$a_xml_parser
Returns
void

Reimplemented from ilSaxParser.

Definition at line 58 of file class.ilFolderXmlParser.php.

58 : void
59 {
60 xml_set_object($a_xml_parser, $this);
61 xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
62 xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
63 }

◆ start()

ilFolderXmlParser::start ( )
Exceptions
ilSaxParserException

Definition at line 53 of file class.ilFolderXmlParser.php.

53 : void
54 {
55 $this->startParsing();
56 }
startParsing()
stores xml data in array

References ilSaxParser\startParsing().

+ Here is the call graph for this function:

Field Documentation

◆ $cdata

string ilFolderXmlParser::$cdata = ""
protected

Definition at line 27 of file class.ilFolderXmlParser.php.

◆ $error

ilErrorHandling ilFolderXmlParser::$error
protected

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

◆ $folder

ilObject ilFolderXmlParser::$folder
private

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

Referenced by getFolder(), and setFolder().


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