34 include_once
'./Services/Xml/classes/class.ilSaxParser.php';
35 include_once(
'./webservice/soap/classes/class.ilObjectXMLException.php');
61 return $this->object_data ? $this->object_data : array();
71 public function parse($a_xml_parser, $a_fp = null)
85 xml_set_object($a_xml_parser, $this);
86 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
87 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
104 $this->curr_obj = -1;
134 $this->time_target = array();
135 $this->ref_id = $a_attribs[
"ref_id"];
136 $this->parent_id = $a_attribs[
'parent_id'];
140 $this->time_target[
'timing_type'] = $a_attribs[
'type'];
144 $this->time_target[
'timing_visibility'] = $a_attribs[
'visibility'];
145 if (isset($a_attribs[
'starting_time'])) {
146 $this->time_target[
'starting_time'] = $a_attribs[
'starting_time'];
148 if (isset($a_attribs[
'ending_time'])) {
149 $this->time_target[
'ending_time'] = $a_attribs[
'ending_time'];
152 if ($a_attribs[
'ending_time'] < $a_attribs[
'starting_time']) {
158 $this->time_target[
'changeable'] = $a_attribs[
'changeable'];
161 if (isset($a_attribs[
'starting_time'])) {
162 $this->time_target[
'suggestion_start'] = $a_attribs[
'starting_time'];
164 if (isset($a_attribs[
'ending_time'])) {
165 $this->time_target[
'suggestion_end'] = $a_attribs[
'ending_time'];
212 $this->
__addReference($this->ref_id, $this->parent_id, $this->time_target);
229 if ($a_data !=
"\n") {
231 $a_data = preg_replace(
"/\t+/",
" ", $a_data);
233 $this->cdata .= $a_data;
240 $this->object_data[$this->curr_obj][$a_name] = $a_value;
248 $reference[
'ref_id'] = $a_ref_id;
249 $reference[
'parent_id'] = $a_parent_id;
250 $reference[
'time_target'] = $a_time_target;
252 if (isset($reference[
'time_target'][
'changeable'])
and $reference[
'time_target'][
'changeable']) {
253 if (!isset($reference[
'time_target'][
'suggestion_start'])
or !isset($reference[
'time_target'][
'suggestion_end'])) {
254 throw new ilObjectXMLException(
'Missing attributes: "starting_time" and "ending_time" required for attribute "changeable"');
258 $this->object_data[$this->curr_obj][
'references'][] = $reference;
handlerEndTag($a_xml_parser, $a_name)
handler for end of element
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
Exception class for ObjectXMLWriter and ObjectXMLParser.
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
__construct($a_xml_data='', $throwException=false)
Constructor.
__addReference($a_ref_id, $a_parent_id, $a_time_target)
parse($uri)
Parses a URI and returns its individual components.
setHandlers($a_xml_parser)
set event handlers
parse($a_xml_parser, $a_fp=null)
parse xml file
setXMLContent($a_xml_content)
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
__addProperty($a_name, $a_value)