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';
 
   39                parent::__construct();
 
   73                $this->mode = $a_mode;
 
  105                xml_set_object($a_xml_parser,$this);
 
  106                xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
 
  107                xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
 
  121                if($this->in_metadata)
 
  123                        parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
 
  130                                $this->in_metadata = 
true;
 
  136                                parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
 
  141                                $this->current_sorting_position = ($a_attribs[
'position'] ? $a_attribs[
'position'] : 0);
 
  142                                $this->current_link_update = 
false;
 
  143                                $this->current_link_delete = 
false;
 
  144                                $this->current_parameters = array();
 
  146                                if($this->
getMode() == self::MODE_CREATE or (isset($a_attribs[
'action']) and $a_attribs[
'action'] == 
'Create'))
 
  151                                elseif($this->
getMode() == self::MODE_UPDATE and $a_attribs[
'action'] == 
'Delete')
 
  153                                        $this->current_link_delete = 
true;
 
  155                                        $this->current_link->delete($a_attribs[
'id']);
 
  158                                elseif($this->
getMode() == self::MODE_UPDATE and ($a_attribs[
'action'] == 
'Update' or !isset($a_attribs[
'action'])))
 
  161                                        $this->current_link->readItem($a_attribs[
'id']);
 
  162                                        $this->current_link_update = 
true;
 
  165                                        include_once 
'./Modules/WebResource/classes/class.ilParameterAppender.php';
 
  169                                                $param->delete($param_id);
 
  178                                $this->current_link->setActiveStatus($a_attribs[
'active'] ? 1 : 0);
 
  181                                if(!isset($a_attribs[
'valid']))
 
  187                                        $valid = $a_attribs[
'valid'] ? 1 : 0;
 
  189                                $this->current_link->setValidStatus(
$valid);
 
  192                                $this->current_link->setDisableCheckStatus($a_attribs[
'disableValidation'] ? 1 : 0);
 
  198                                include_once 
'./Services/Container/classes/class.ilContainerSortingSettings.php';
 
  202                                switch($a_attribs[
'type'])
 
  216                                $this->sorting_positions = array();
 
  223                        case 'DynamicParameter':
 
  226                                $param->setName($a_attribs[
'name']);
 
  228                                switch($a_attribs[
'type'])
 
  231#                                               $GLOBALS['ilLog']->write("VALUE: ".LINKS_LOGIN);
 
  236#                                               $GLOBALS['ilLog']->write("VALUE: ".LINKS_USER_ID);
 
  240                                        case 'matriculation':
 
  241#                                               $GLOBALS['ilLog']->write("VALUE: ".LINKS_MATRICULATION);
 
  250                                $this->current_parameters[] = $param;
 
  265                if($this->in_metadata)
 
  267                        parent::handlerEndTag($a_xml_parser,$a_name);
 
  270                $GLOBALS[
'ilLog']->write(__METHOD__.
': Called '.$a_name);
 
  275                                $this->in_metadata = 
false;
 
  276                                parent::handlerEndTag($a_xml_parser,$a_name);
 
  280                                $this->
getWebLink()->MDUpdateListener(
'General');
 
  284                                include_once 
'./Services/Container/classes/class.ilContainerSorting.php';
 
  286                                $sorting->savePost($this->sorting_positions);
 
  292                                if($this->current_link_delete)
 
  296                                if(!$this->current_link)
 
  300                                if(!$this->current_link->validate())
 
  305                                if($this->current_link_update)
 
  307                                        $this->current_link->update();
 
  311                                        $this->current_link->add();
 
  315                                foreach($this->current_parameters as $param)
 
  317                                        $param->add($this->current_link->getLinkId());
 
  322                                $this->sorting_positions[$this->current_link->getLinkId()] = (int) $this->current_sorting_position;
 
  324                                unset($this->current_link);
 
  328                                if($this->current_link)
 
  330                                        $this->current_link->setTitle(trim($this->cdata));
 
  335                                if($this->current_link)
 
  337                                        $this->current_link->setDescription(trim($this->cdata));
 
  342                                if($this->current_link)
 
  344                                        $this->current_link->setTarget(trim($this->cdata));
 
  363                if($this->in_metadata)
 
  365                        parent::handlerCharacterData($a_xml_parser,$a_data);
 
  371                        $a_data = preg_replace(
"/\t+/",
" ",$a_data);
 
  372                        $this->cdata .= $a_data;
 
const LINKS_MATRICULATION
static _getInstance($a_obj_id)
get instance by obj_id
Class ilObjLinkResourceGUI.
static getLogger($a_component_id)
Get component logger.
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.
$current_sorting_position
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
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.