コード例 #1
0
 function handlerEndTag($a_xml_parser, $a_name)
 {
     if ($this->in_meta_data) {
         parent::handlerEndTag($a_xml_parser, $a_name);
         return true;
     }
     switch ($a_name) {
         case 'MetaData':
             $this->in_meta_data = false;
             parent::handlerEndTag($a_xml_parser, $a_name);
             return true;
         default:
             // hier die Tags aller nicht-MetaData Attribute
     }
 }
コード例 #2
0
 /**
  * handler for end of element
  *
  * @param	resource	$a_xml_parser		xml parser
  * @param	string		$a_name				element name
  * @throws	ilSaxParserException	if invalid xml structure is given
  * @throws	ilWebLinkXMLParserException	missing elements
  */
 public function handlerEndTag($a_xml_parser, $a_name)
 {
     if ($this->in_metadata) {
         parent::handlerEndTag($a_xml_parser, $a_name);
     }
     $GLOBALS['ilLog']->write(__METHOD__ . ': Called ' . $a_name);
     switch ($a_name) {
         case 'MetaData':
             $this->in_metadata = false;
             parent::handlerEndTag($a_xml_parser, $a_name);
             break;
         case 'WebLinks':
             $this->getWebLink()->MDUpdateListener('General');
             $this->getWebLink()->update();
             break;
         case 'WebLink':
             if ($this->current_link_delete) {
                 break;
             }
             if (!$this->current_link) {
                 throw new ilSaxParserException('Invalid xml structure given. Missing start tag "WebLink"');
             }
             if (!$this->current_link->validate()) {
                 throw new ilWebLinkXmlParserException('Missing required elements "Title, Target"');
             }
             if ($this->current_link_update) {
                 $this->current_link->update();
             } else {
                 $this->current_link->add();
             }
             // Save dynamic parameters
             foreach ($this->current_parameters as $param) {
                 $param->add($this->current_link->getLinkId());
             }
             unset($this->current_link);
             break;
         case 'Title':
             if ($this->current_link) {
                 $this->current_link->setTitle(trim($this->cdata));
             }
             break;
         case 'Description':
             if ($this->current_link) {
                 $this->current_link->setDescription(trim($this->cdata));
             }
             break;
         case 'Target':
             if ($this->current_link) {
                 $this->current_link->setTarget(trim($this->cdata));
             }
             break;
     }
     // Reset cdata
     $this->cdata = '';
 }
コード例 #3
0
 /**
  * handler for end of element
  *
  * @param	resource	$a_xml_parser		xml parser
  * @param	string		$a_name				element name
  */
 function handlerEndTag($a_xml_parser, $a_name)
 {
     if ($this->in_meta_data) {
         parent::handlerEndTag($a_xml_parser, $a_name);
     }
     switch ($a_name) {
         case 'Course':
             $this->log->write('CourseXMLParser: import_id = ' . $this->course_obj->getImportId());
             $this->course_obj->MDUpdateListener('General');
             $this->course_obj->update();
             $this->adv_md_handler->save();
             break;
         case 'Settings':
             $this->in_settings = false;
             break;
         case 'Availability':
             $this->in_availability = false;
             break;
         case 'Registration':
             $this->in_registration = false;
             break;
         case 'Archive':
             $this->in_archive = false;
             break;
         case 'Start':
             if ($this->in_availability) {
                 $this->course_obj->setActivationStart(trim($this->cdata));
             }
             if ($this->in_registration) {
                 $this->course_obj->setSubscriptionStart(trim($this->cdata));
             }
             if ($this->in_archive) {
                 $this->course_obj->setArchiveStart(trim($this->cdata));
             }
             break;
         case 'End':
             if ($this->in_availability) {
                 $this->course_obj->setActivationEnd(trim($this->cdata));
             }
             if ($this->in_registration) {
                 $this->course_obj->setSubscriptionEnd(trim($this->cdata));
             }
             if ($this->in_archive) {
                 $this->course_obj->setArchiveEnd(trim($this->cdata));
             }
             break;
         case 'Syllabus':
             $this->course_obj->setSyllabus(trim($this->cdata));
             break;
         case 'ImportantInformation':
             $this->course_obj->setImportantInformation(trim($this->cdata));
             break;
         case 'Name':
             $this->course_obj->setContactName(trim($this->cdata));
             break;
         case 'Responsibility':
             $this->course_obj->setContactResponsibility(trim($this->cdata));
             break;
         case 'Phone':
             $this->course_obj->setContactPhone(trim($this->cdata));
             break;
         case 'Email':
             $this->course_obj->setContactEmail(trim($this->cdata));
             break;
         case 'Consultation':
             $this->course_obj->setContactConsultation(trim($this->cdata));
             break;
         case 'Password':
             $this->course_obj->setSubscriptionPassword(trim($this->cdata));
             break;
         case 'MetaData':
             $this->in_meta_data = false;
             parent::handlerEndTag($a_xml_parser, $a_name);
             break;
     }
     $this->cdata = '';
     return;
 }
コード例 #4
0
 function handlerEndTag($a_xml_parser, $a_name)
 {
     if ($this->in_meta_data and !$this->__inFilter($a_name)) {
         parent::handlerEndTag($a_xml_parser, $a_name);
         return true;
     }
     switch ($a_name) {
         case 'Identifier':
             $par =& $this->__getParent();
             $par->update();
             $this->__popParent();
             break;
         case 'MetaData':
             $this->in_meta_data = false;
             parent::handlerEndTag($a_xml_parser, $a_name);
             break;
     }
     return true;
 }
コード例 #5
0
 /**
  * send all cached tags to the meta data parser and
  * clear the cache
  */
 function emptyMediaMetaCache(&$a_xml_parser)
 {
     foreach ($this->media_meta_cache as $cache_entry) {
         switch ($cache_entry["type"]) {
             case "handlerBeginTag":
                 parent::handlerBeginTag($a_xml_parser, $cache_entry["par1"], $cache_entry["par2"]);
                 break;
             case "handlerEndTag":
                 parent::handlerEndTag($a_xml_parser, $cache_entry["par1"]);
                 break;
             case "handlerCharacterData":
                 parent::handlerCharacterData($a_xml_parser, $cache_entry["par1"]);
                 break;
         }
     }
     $this->media_meta_start = false;
     $this->media_meta_cache[] = array();
 }