4include_once(
"Services/MetaData/classes/class.ilMDSaxParser.php");
 
    5include_once(
"Services/MetaData/classes/class.ilMD.php");
 
    6include_once(
'Services/Utilities/interfaces/interface.ilSaxSubsetParser.php');
 
    8include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
    9include_once 
'./Modules/WebResource/classes/class.ilWebLinkXmlParserException.php';
 
   10include_once 
'./Modules/WebResource/classes/class.ilParameterAppender.php';
 
   36                parent::__construct();
 
   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)
 
  120                        parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
 
  127                                $this->in_metadata = 
true;
 
  133                                parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
 
  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)
 
  262                        parent::handlerEndTag($a_xml_parser,$a_name);
 
  265                $GLOBALS[
'ilLog']->write(__METHOD__.
': Called '.$a_name);
 
  270                                $this->in_metadata = 
false;
 
  271                                parent::handlerEndTag($a_xml_parser,$a_name);
 
  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)
 
  350                        parent::handlerCharacterData($a_xml_parser,$a_data);
 
  356                        $a_data = preg_replace(
"/\t+/",
" ",$a_data);
 
  357                        $this->cdata .= $a_data;
 
const LINKS_MATRICULATION
Class ilObjLinkResourceGUI.
Class ilObject Basic functions for all objects.
Class ilParameterAppender.
static getParameterIds($a_webr_id, $a_link_id)
Get Parameter ids of link.
SaxParserException thrown by ilSaxParser if property throwException is set.
setThrowException($throwException)
set error handling
setXMLContent($a_xml_content)
startParsing()
stores xml data in array
XML parser for weblink xml.
setMode($a_mode)
Set parsing mode.
getWebLink()
Get weblink object.
getMode()
Return parsing mode.
handlerEndTag($a_xml_parser, $a_name)
handler for end of element
setHandlers($a_xml_parser)
set event handlers
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
__construct($webr, $xml)
Constructor.
setWebLink(ilObject $webl)
set weblink
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element