You are here

class csl_bibliography in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/CiteProc/CSL.inc \csl_bibliography
  2. 7.2 modules/CiteProc/CSL.inc \csl_bibliography

Hierarchy

Expanded class hierarchy of csl_bibliography

File

modules/CiteProc/CSL.inc, line 1815
CiteProc-PHP.

View source
class csl_bibliography extends csl_format {
  private $layout = NULL;

  /**
   *
   */
  public function init($dom_node, $citeproc) {
    $hier_name_attr = $this
      ->get_hier_attributes();
    $options = $dom_node
      ->getElementsByTagName('option');
    foreach ($options as $option) {
      $value = $option
        ->getAttribute('value');
      $name = $option
        ->getAttribute('name');
      $this->attributes[$name] = $value;
    }
    $layouts = $dom_node
      ->getElementsByTagName('layout');
    foreach ($layouts as $layout) {
      $this->layout = new csl_layout($layout, $citeproc);
    }
  }

  /**
   *
   */
  public function init_formatting() {

    // $this->div_class = 'csl-bib-body';.
    parent::init_formatting();
  }

  /**
   *
   */
  public function render($data, $mode = NULL) {
    $this->citeproc->quash = array();
    $text = $this->layout
      ->render($data, 'bibliography');
    if ($this->{'hanging-indent'} == 'true') {
      $text = '<div style="  text-indent: -25px; padding-left: 25px;">' . $text . '</div>';
    }
    $text = str_replace('?.', '?', str_replace('..', '.', $text));
    return $this
      ->format($text);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
csl_bibliography::$layout private property
csl_bibliography::init public function Overrides csl_element::init
csl_bibliography::init_formatting public function Overrides csl_format::init_formatting
csl_bibliography::render public function Overrides csl_rendering_element::render
csl_collection::$elements protected property
csl_collection::add_element public function
csl_element::$attributes protected property
csl_element::$citeproc protected property
csl_element::get_attributes public function
csl_element::get_hier_attributes public function
csl_element::name public function
csl_element::set_attributes public function
csl_element::__get public function
csl_element::__isset public function
csl_element::__set public function
csl_element::__unset public function
csl_format::$format protected property 1
csl_format::$no_op protected property
csl_format::format public function Overrides csl_collection::format 1
csl_format::__construct public function Overrides csl_element::__construct 2