ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 26 of file class.ilFolderXmlParser.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

33  {
34  global $DIC;
35 
36  $this->error = $DIC["ilErr"];
38  $this->setXMLContent($xml);
39  $this->setFolder($folder);
40  $this->setThrowException(true);
41  }
setThrowException(bool $throw_exception)
global $DIC
Definition: shib_login.php:22
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 48 of file class.ilFolderXmlParser.php.

References $folder.

Referenced by handlerBeginTag(), and handlerEndTag().

48  : ilObject
49  {
50  return $this->folder;
51  }
+ 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 73 of file class.ilFolderXmlParser.php.

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

Referenced by setHandlers().

73  : void
74  {
75  switch ($a_name) {
76  case 'Folder':
77  case 'Title':
78  case 'Description':
79  break;
80 
81  case 'Sorting':
82  case 'Sort':
84  break;
85  }
86  }
static _importContainerSortingSettings(array $attibs, int $obj_id)
sorting import for all container objects
+ Here is the call graph for this function:
+ Here is the caller 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 120 of file class.ilFolderXmlParser.php.

Referenced by setHandlers().

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

◆ handlerEndTag()

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

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

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

Referenced by setHandlers().

93  : void
94  {
95  $GLOBALS['ilLog']->write(__METHOD__ . ': Called ' . $a_name);
96 
97  switch ($a_name) {
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  // Reset cdata
112  $this->cdata = '';
113  }
$GLOBALS["DIC"]
Definition: wac.php:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFolder()

ilFolderXmlParser::setFolder ( ilObject  $folder)

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

References $folder.

Referenced by __construct().

43  : void
44  {
45  $this->folder = $folder;
46  }
+ Here is the caller graph for this function:

◆ setHandlers()

ilFolderXmlParser::setHandlers (   $a_xml_parser)

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

References handlerBeginTag(), handlerCharacterData(), and handlerEndTag().

61  : void
62  {
63  xml_set_element_handler($a_xml_parser, $this->handlerBeginTag(...), $this->handlerEndTag(...));
64  xml_set_character_data_handler($a_xml_parser, $this->handlerCharacterData(...));
65  }
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
handlerCharacterData($a_xml_parser, string $a_data)
handlerEndTag($a_xml_parser, string $a_name)
+ Here is the call graph for this function:

◆ start()

ilFolderXmlParser::start ( )
Exceptions
ilSaxParserException

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

References ilSaxParser\startParsing().

56  : void
57  {
58  $this->startParsing();
59  }
startParsing()
stores xml data in array
+ Here is the call graph for this function:

Field Documentation

◆ $cdata

string ilFolderXmlParser::$cdata = ""
protected

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

◆ $error

ilErrorHandling ilFolderXmlParser::$error
protected

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

◆ $folder

ilObject ilFolderXmlParser::$folder
private

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

Referenced by getFolder(), and setFolder().


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