You are here

function csl_date::render in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/CiteProc/CSL.inc \csl_date::render()
  2. 7 modules/CiteProc/CSL.inc \csl_date::render()

Overrides csl_rendering_element::render

File

modules/CiteProc/CSL.inc, line 934

Class

csl_date

Code

function render($data, $mode = NULL) {
  $date_parts = array();
  $date = '';
  $text = '';
  if (($var = $this->variable) && isset($data->{$var})) {
    $date[] = $data->{$var};
    foreach ($this->elements as $element) {
      $date_parts[] = $element
        ->render($date, $mode);
    }
    $text = implode('', $date_parts);
  }

  //    else {
  //      $text = $this->citeproc->get_locale('term', 'no date');
  //    }
  return $this
    ->format($text);
}