You are here

function en8_endElement in Bibliography Module 6

Same name and namespace in other branches
  1. 5 endnote8_parser.inc \en8_endElement()

File

./endnote8_parser.inc, line 60

Code

function en8_endElement($parser, $name) {
  global $node, $nids, $element, $terms, $batch_proc, $session_id, $contributors, $contrib_count, $dates, $urls, $keyword_count, $font_attr;
  switch ($name) {
    case 'record':
      $element = $contributors = $contrib_count = $dates = $urls = '';
      if (!empty($terms)) {
        if (!isset($node['taxonomy'])) {
          $node['taxonomy'] = array();
        }
        $node['taxonomy'] = array_merge($terms, $node['taxonomy']);
      }
      $nid = biblio_save_node($node, $batch_proc, $session_id);
      if (isset($nid)) {
        $nids[] = $nid;
      }
      break;
    case 'authors':
    case 'secondary-authors':
    case 'tertiary-authors':
    case 'subsidiary-authors':
    case 'translated-authors':
      $contributors = '';
      break;
    case 'author':
      $contrib_count++;
      break;
    case 'keyword':
      $keyword_count++;
      break;
    case 'year':
    case 'pub-dates':
    case 'copyright-dates':
      $dates = '';
      break;
    case 'web-urls':
    case 'pdf-urls':
    case 'text-urls':
    case 'related-urls':
    case 'image-urls':
      $urls = '';
      break;
    case 'ref-type':
      $node['biblio_type'] = en8_parser_type_map($node['biblio_type']);
      $element = '';
      break;
    case 'style':
      foreach ($font_attr as $fatt) {
        switch ($fatt) {
          case 'normal':
            break;
          case 'bold':
            en8_characterData(NULL, '</b>');
            break;
          case 'italic':
            en8_characterData(NULL, '</i>');
            break;
          case 'underline':
            en8_characterData(NULL, '</u>');
            break;
          case 'superscript':
            en8_characterData(NULL, '</sup>');
            break;
          case 'subscript':
            en8_characterData(NULL, '</sub>');
            break;
        }
      }
      $font_attr = array();
      break;
    default:
      $element = '';
  }
}