You are here

class BiblioStyleEndNote in Bibliography Module 7.3

@file EndNote tagged biblio style.

Hierarchy

Expanded class hierarchy of BiblioStyleEndNote

1 string reference to 'BiblioStyleEndNote'
endnote.inc in plugins/biblio_style/endnote/endnote.inc

File

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

View source
class BiblioStyleEndNote extends BiblioStyleBase {
  public function settingsForm() {
    $form['type'] = array(
      '#type' => 'select',
      '#title' => t('Type'),
      '#required' => TRUE,
      '#options' => array(
        'tagged' => t('Tagged'),
        'xml' => t('XML'),
      ),
      '#default_value' => 'tagged',
    );
    return $form;
  }

  /**
   * @inheritdoc
   */
  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);
  }

  /**
   * @inheritdoc
   */
  public function render($options = array(), $langcode = NULL) {
    $options += array(
      'type' => 'tagged',
    );
    switch ($options['type']) {
      case 'xml':
        $class_name = 'BiblioStyleEndNoteXML8';
        break;
      default:
        $class_name = 'BiblioStyleEndNoteTagged';
        break;
    }
    $handler = new $class_name($this->plugin, $this->biblio);
    return $handler
      ->render($options, $langcode);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BiblioStyleBase::$biblio protected property The Biblio entity.
BiblioStyleBase::$plugin protected property The plugin definition.
BiblioStyleBase::generateBiblioMd5 public static function Generates an md5 string based on a biblio object. The md5 is later used to determine whether or not two Biblio objects are the same and prevent duplications.
BiblioStyleBase::getBiblioType public function Returns Biblio Publication Type based on Publication Type.
BiblioStyleBase::getMapping public function @todo: Make abstract function? 4
BiblioStyleBase::import public function Entry point for data import.
BiblioStyleBase::importKeywordsList public function Helper function to import existing or new keywords.
BiblioStyleBase::isDuplicate public function Searches for a biblio object identical to the given one.
BiblioStyleBase::renderEntryFiles public function
BiblioStyleBase::saveOrFindDuplicateFromImportData public function Given a of successful import, find duplicates or save the new Biblios.
BiblioStyleBase::settingsFormValidate public function
BiblioStyleBase::__construct public function Constructor for the notifier. Overrides BiblioStyleInterface::__construct
BiblioStyleEndNote::importData public function @inheritdoc 2
BiblioStyleEndNote::render public function @inheritdoc Overrides BiblioStyleBase::render 2
BiblioStyleEndNote::settingsForm public function Overrides BiblioStyleBase::settingsForm