You are here

class BiblioStyleExampleCiteProc in Bibliography Module 7.3

@file Extending Citeproc biblio style example.

Hierarchy

Expanded class hierarchy of BiblioStyleExampleCiteProc

1 string reference to 'BiblioStyleExampleCiteProc'
example_citeproc.inc in modules/biblio_example/plugins/biblio_style/example_citeproc/example_citeproc.inc

File

modules/biblio_example/plugins/biblio_style/example_citeproc/BiblioStyleExampleCiteProc.class.php, line 8
Extending Citeproc biblio style example.

View source
class BiblioStyleExampleCiteProc extends BiblioStyleCiteProc {
  public function render($options = array(), $langcode = NULL) {
    $output = parent::render($options, $langcode);

    // Get abstract.
    $wrapper = entity_metadata_wrapper('biblio', $this->biblio);
    $abstract = isset($wrapper->biblio_abstract) ? $wrapper->biblio_abstract
      ->value() : '';
    $items = array();
    $options = array(
      'attributes' => array(
        'class' => 'publication-pdf',
      ),
    );
    foreach ($wrapper->biblio_pdf
      ->value() as $pdf_file) {
      $url = file_create_url($pdf_file['uri']);
      $items[] = l($pdf_file['filename'], $url, $options);
    }
    $image = $wrapper->biblio_image
      ->value();
    $variables = array(
      'bid' => $wrapper
        ->getIdentifier(),
      'image' => theme('image', array(
        'path' => $image['uri'],
        'width' => 50,
        'height' => 50,
      )),
      'title' => $this->biblio->title,
      'abstract' => $abstract,
      'pdf_list' => theme('item_list', array(
        'items' => $items,
      )),
    );
    return theme('biblio_example_citeproc', $variables);
  }

}

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::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::settingsForm public function 1
BiblioStyleBase::settingsFormValidate public function
BiblioStyleBase::__construct public function Constructor for the notifier. Overrides BiblioStyleInterface::__construct
BiblioStyleCiteProc::getMapping public function @todo: Make abstract function? Overrides BiblioStyleBase::getMapping
BiblioStyleCiteProc::map public function Map the fields from the Biblio entity to the ones known by CiteProc.
BiblioStyleExampleCiteProc::render public function Render the Biblio according to the style plugin. Overrides BiblioStyleCiteProc::render