You are here

public function BiblioStyleEndNote::importData in Bibliography Module 7.3

@inheritdoc

2 methods override BiblioStyleEndNote::importData()
BiblioStyleEndNoteTagged::importData in plugins/biblio_style/endnote/BiblioStyleEndNoteTagged.php
@inheritdoc
BiblioStyleEndNoteXML8::importData in plugins/biblio_style/endnote/BiblioStyleEndNoteXML8.php
@inheritdoc

File

plugins/biblio_style/endnote/BiblioStyleEndNote.class.php, line 28
EndNote tagged biblio style.

Class

BiblioStyleEndNote
@file EndNote tagged biblio style.

Code

public function importData($data, $options = array()) {
  $options += array(
    'type' => 'tagged',
  );
  $class_name = FALSE;
  if ($options['type'] == 'tagged') {
    $class_name = 'BiblioStyleEndNoteTagged';
  }
  else {

    // This is an XML, and we need to get the format (EndNote 7 or EndNote 8).
    if (strpos($data, 'record') !== FALSE && strpos($data, 'ref-type') !== FALSE) {
      $class_name = 'BiblioStyleEndNoteXML8';
    }
    elseif (strpos($data, 'RECORD') !== FALSE && strpos($data, 'REFERENCE_TYPE') !== FALSE) {
      $class_name = 'BiblioStyleEndNoteXML7';
    }
  }
  if (!$class_name) {
    return;
  }
  $handler = new $class_name($this->plugin, $this->biblio);
  return $handler
    ->importData($data, $options);
}