4 include_once(
"Services/MetaData/classes/class.ilMDSaxParser.php");
5 include_once(
"Services/MetaData/classes/class.ilMD.php");
6 include_once(
'Services/Utilities/interfaces/interface.ilSaxSubsetParser.php');
8 include_once
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
9 include_once
'./Modules/WebResource/classes/class.ilWebLinkXmlParserException.php';
10 include_once
'./Modules/WebResource/classes/class.ilParameterAppender.php';
70 $this->mode = $a_mode;
102 xml_set_object($a_xml_parser,$this);
103 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
104 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
118 if($this->in_metadata)
127 $this->in_metadata =
true;
138 $this->current_link_update =
false;
139 $this->current_link_delete =
false;
140 $this->current_parameters = array();
142 if($this->
getMode() == self::MODE_CREATE or (isset($a_attribs[
'action']) and $a_attribs[
'action'] ==
'Create'))
147 elseif($this->
getMode() == self::MODE_UPDATE and $a_attribs[
'action'] ==
'Delete')
149 $this->current_link_delete =
true;
151 $this->current_link->delete($a_attribs[
'id']);
154 elseif($this->
getMode() == self::MODE_UPDATE and ($a_attribs[
'action'] ==
'Update' or !isset($a_attribs[
'action'])))
157 $this->current_link->readItem($a_attribs[
'id']);
158 $this->current_link_update =
true;
161 include_once
'./Modules/WebResource/classes/class.ilParameterAppender.php';
165 $param->delete($param_id);
174 $this->current_link->setActiveStatus($a_attribs[
'active'] ? 1 : 0);
177 if(!isset($a_attribs[
'valid']))
183 $valid = $a_attribs[
'valid'] ? 1 : 0;
185 $this->current_link->setValidStatus(
$valid);
188 $this->current_link->setDisableCheckStatus($a_attribs[
'disableValidation'] ? 1 : 0);
194 include_once
'./Services/Container/classes/class.ilContainerSortingSettings.php';
198 switch($a_attribs[
'type'])
218 case 'DynamicParameter':
221 $param->setName($a_attribs[
'name']);
223 switch($a_attribs[
'type'])
226 # $GLOBALS['ilLog']->write("VALUE: ".LINKS_LOGIN);
231 # $GLOBALS['ilLog']->write("VALUE: ".LINKS_USER_ID);
235 case 'matriculation':
236 # $GLOBALS['ilLog']->write("VALUE: ".LINKS_MATRICULATION);
245 $this->current_parameters[] = $param;
260 if($this->in_metadata)
265 $GLOBALS[
'ilLog']->write(__METHOD__.
': Called '.$a_name);
270 $this->in_metadata =
false;
275 $this->
getWebLink()->MDUpdateListener(
'General');
281 if($this->current_link_delete)
285 if(!$this->current_link)
289 if(!$this->current_link->validate())
294 if($this->current_link_update)
296 $this->current_link->update();
300 $this->current_link->add();
304 foreach($this->current_parameters as $param)
306 $param->add($this->current_link->getLinkId());
309 unset($this->current_link);
313 if($this->current_link)
315 $this->current_link->setTitle(trim($this->cdata));
320 if($this->current_link)
322 $this->current_link->setDescription(trim($this->cdata));
327 if($this->current_link)
329 $this->current_link->setTarget(trim($this->cdata));
348 if($this->in_metadata)
356 $a_data = preg_replace(
"/\t+/",
" ",$a_data);
357 $this->cdata .= $a_data;