ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

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

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

Member Function Documentation

◆ getFolder()

ilFolderXmlParser::getFolder ( )

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

References $folder.

Referenced by handlerBeginTag(), and handlerEndTag().

45  : ilObject
46  {
47  return $this->folder;
48  }
+ 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.

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

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
+ 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.

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

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
+ Here is the call graph for this function:

◆ setFolder()

ilFolderXmlParser::setFolder ( ilObject  $folder)

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

References $folder.

Referenced by __construct().

40  : void
41  {
42  $this->folder = $folder;
43  }
+ Here is the caller graph for this function:

◆ setHandlers()

ilFolderXmlParser::setHandlers (   $a_xml_parser)

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.

References ilSaxParser\startParsing().

53  : void
54  {
55  $this->startParsing();
56  }
startParsing()
stores xml data in array
+ 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: