public function EndNoteXMLParser::endnote8_endElement in Bibliography Module 7
Same name and namespace in other branches
- 6.2 modules/endnote/endnote_xml_parser.inc \EndNoteXMLParser::endnote8_endElement()
- 7.2 modules/endnote/endnote_xml_parser.inc \EndNoteXMLParser::endnote8_endElement()
File
- modules/
endnote/ endnote_xml_parser.inc, line 176 - endnote_xml_parser.inc
Class
Code
public function endnote8_endElement($parser, $name) {
// Global $this->node, $nids, $this->element, $terms, $batch_proc, $session_id, $this->contributors_type, $this->contrib_count, $this->dates, $this->urls, $this->keyword_count, $this->font_attr;.
switch ($name) {
case 'record':
$this->element = $this->contributors_type = $this->contrib_count = $this->dates = $this->urls = '';
$this->node->biblio_xml_md5 = md5(serialize($this->node));
if (!($dup = $this
->biblio_xml_check_md5($this->node->biblio_xml_md5))) {
biblio_save_node($this->node, $this->terms, $this->batch_proc, $this->session_id);
if (!empty($this->node->nid)) {
$this->nids[] = $this->node->nid;
}
}
else {
$this->dups[] = $dup;
}
break;
case 'authors':
case 'secondary-authors':
case 'tertiary-authors':
case 'subsidiary-authors':
case 'translated-authors':
$this->contributors_type = '';
foreach ($this->contributors as $contributor) {
$this->node->biblio_contributors[] = $contributor;
}
break;
case 'author':
switch ($this->contributors_type) {
case 'authors':
$this->contributors[$this->contrib_count]['auth_category'] = 1;
$this->contributors[$this->contrib_count]['auth_type'] = 1;
break;
case 'secondary-authors':
$this->contributors[$this->contrib_count]['auth_category'] = 2;
$this->contributors[$this->contrib_count]['auth_type'] = 2;
break;
case 'tertiary-authors':
$this->contributors[$this->contrib_count]['auth_category'] = 3;
$this->contributors[$this->contrib_count]['auth_type'] = 3;
break;
case 'subsidiary-authors':
$this->contributors[$this->contrib_count]['auth_category'] = 4;
$this->contributors[$this->contrib_count]['auth_type'] = 4;
break;
case 'translated-authors':
$this->contributors[$this->contrib_count]['auth_category'] = 5;
$this->contributors[$this->contrib_count]['auth_type'] = 5;
break;
}
$this->contrib_count++;
break;
case 'keyword':
$this->keyword_count++;
break;
case 'year':
case 'pub-dates':
case 'copyright-dates':
$this->dates = '';
break;
case 'web-urls':
case 'pdf-urls':
case 'text-urls':
case 'related-urls':
case 'image-urls':
$this->urls = '';
break;
case 'ref-type':
$this->node->biblio_type = $this
->type_map($this->node->biblio_type);
$this->element = '';
break;
case 'style':
foreach ($this->font_attr as $fatt) {
switch ($fatt) {
case 'normal':
break;
case 'bold':
$this
->endnote8_characterData(NULL, '</b>');
break;
case 'italic':
$this
->endnote8_characterData(NULL, '</i>');
break;
case 'underline':
$this
->endnote8_characterData(NULL, '</u>');
break;
case 'superscript':
$this
->endnote8_characterData(NULL, '</sup>');
break;
case 'subscript':
$this
->endnote8_characterData(NULL, '</sub>');
break;
}
}
$this->font_attr = array();
break;
default:
$this->element = '';
}
}