'; $xml .= "\n\n"; if (!is_array($results)) { $result_array[] = $results; } else { $result_array = $results; } foreach ($result_array as $pub) { $xml .= "\n"; $xml .= "\t". _endnote7_type_map($pub->biblio_type) ."\n"; $a = $e = $t = $s = ''; foreach ((array)$pub->biblio_contributors[1] as $auth) { $a .= "\t\t". htmlspecialchars(trim($auth['name'])) ."\n"; } foreach ((array)$pub->biblio_contributors[2] as $auth) { $e .= "\t\t". htmlspecialchars(trim($auth['name'])) ."\n"; } foreach ((array)$pub->biblio_contributors[3] as $auth) { $t .= "\t\t". htmlspecialchars(trim($auth['name'])) ."\n"; } foreach ((array)$pub->biblio_contributors[4] as $auth) { $s .= "\t\t". htmlspecialchars(trim($auth['name'])) ."\n"; } if (!empty ($a)) $xml .= "\t\n$a\t\n"; if (!empty ($e)) $xml .= "\t\n$e\t\n"; if (!empty ($t)) $xml .= "\t\n$t\t\n"; if (!empty ($s)) $xml .= "\t\n$s\t\n"; $xml .= (!empty ($pub->biblio_year)) ? "\t$pub->biblio_year\n" : ""; $xml .= (!empty ($pub->title)) ? "\t".htmlspecialchars($pub->title)."\n" : ""; $xml .= (!empty ($pub->biblio_secondary_title)) ? "\t". htmlentities($pub->biblio_secondary_title) ."\n" : ""; $xml .= (!empty ($pub->biblio_place_published)) ? "\t". htmlentities($pub->biblio_place_published) ."\n" : ""; $xml .= (!empty ($pub->biblio_publisher)) ? "\t". htmlentities($pub->biblio_publisher) ."\n" : ""; $xml .= (!empty ($pub->biblio_volume)) ? "\t".htmlspecialchars($pub->biblio_volume)."\n" : ""; $xml .= (!empty ($pub->biblio_number_of_volumes)) ? "\t".htmlspecialchars($pub->biblio_number_of_volumes)."\n":''; $xml .= (!empty ($pub->biblio_issue)) ? "\t".htmlspecialchars($pub->biblio_issue)."\n" : ""; $xml .= (!empty ($pub->biblio_pages)) ? "\t".htmlspecialchars($pub->biblio_pages)."\n" : ""; $xml .= (!empty ($pub->biblio_section)) ? "\t
".htmlspecialchars($pub->biblio_section)."
\n" : ""; $xml .= (!empty ($pub->biblio_tertiary_title)) ? "\t".htmlspecialchars($pub->biblio_tertiary_title)."\n" : ""; $xml .= (!empty ($pub->biblio_edition)) ? "\t".htmlspecialchars($pub->biblio_edition)."\n" : ""; $xml .= (!empty ($pub->biblio_date)) ? "\t".htmlspecialchars($pub->biblio_date)."\n" : ""; $xml .= (!empty ($pub->biblio_type_of_work)) ? "\t".htmlspecialchars($pub->biblio_type_of_work)."\n" : ""; $xml .= (!empty ($pub->biblio_short_title)) ? "\t".htmlspecialchars($pub->biblio_short_title)."\n" : ""; $xml .= (!empty ($pub->biblio_alternate_title)) ? "\t".htmlspecialchars($pub->biblio_alternate_title)."\n" : ""; $xml .= (!empty ($pub->biblio_isbn)) ? "\t".htmlspecialchars($pub->biblio_isbn)."\n" : ""; $xml .= (!empty ($pub->biblio_original_publication)) ? "\t".htmlspecialchars($pub->biblio_original_publication)."\n" : ""; $xml .= (!empty ($pub->biblio_reprint_edition)) ? "\treprint edition\n" : ""; // reviewed item $xml .= (!empty ($pub->biblio_custom1)) ? "\t".htmlspecialchars($pub->biblio_custom1)."\n" : ""; $xml .= (!empty ($pub->biblio_custom2)) ? "\t".htmlspecialchars($pub->biblio_custom2)."\n" : ""; $xml .= (!empty ($pub->biblio_custom3)) ? "\t".htmlspecialchars($pub->biblio_custom3)."\n" : ""; $xml .= (!empty ($pub->biblio_custom4)) ? "\t".htmlspecialchars($pub->biblio_custom4)."\n" : ""; $xml .= (!empty ($pub->biblio_custom5)) ? "\t".htmlspecialchars($pub->biblio_custom5)."\n" : ""; $xml .= (!empty ($pub->biblio_custom6)) ? "\t".htmlspecialchars($pub->biblio_custom6)."\n" : ""; $xml .= (!empty ($pub->biblio_accession_number)) ? "\t".htmlspecialchars($pub->biblio_accession_number)."\n" : ""; $xml .= (!empty ($pub->biblio_call_number)) ? "\t".htmlspecialchars($pub->biblio_call_number)."\n" : ""; $xml .= (!empty ($pub->biblio_label)) ? "\t\n" : ""; $kw_xml = ''; $kw_array = array(); if (!empty($pub->terms)) { foreach($pub->terms as $term) { $kw_array[] = trim($term->name) ; } } if (!empty($pub->biblio_keywords)) { foreach($pub->biblio_keywords as $term) { $kw_array[] = trim($term); } } if (!empty($kw_array)) { $kw_array = array_unique($kw_array); $xml .= "\t\n"; foreach($kw_array as $word) { $xml .= "\t\t". htmlspecialchars(trim($word)) ."\n"; } $xml .= "\t\n"; } $xml .= (!empty ($pub->biblio_abst_e)) ? "\t". htmlspecialchars($pub->biblio_abst_e) ."\n" : ""; $xml .= (!empty ($pub->biblio_notes)) ? "\t".htmlspecialchars($pub->biblio_notes)."\n" : ""; $xml .= (!empty ($pub->biblio_url)) ? "\t". urlencode($pub->biblio_url) ."\n" : ""; // author address // caption $xml .= "
\n"; } //end while $xml .= "
"; return $xml; } function _endnote7_type_map($bibliotype) { static $map = array(); if (empty($map)) { module_load_include('inc', 'biblio', 'biblio.type.mapper'); $map = biblio_get_type_map('endnote7'); } return ($en7_type = array_search($bibliotype, $map)) ? $en7_type : 31; //return the biblio type or 129 (Misc) if type not found }