You are here

function csl_number::render in Bibliography Module 6.2

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

Overrides csl_rendering_element::render

File

modules/CiteProc/CSL.inc, line 1052

Class

csl_number

Code

function render($data, $mode = NULL) {
  $var = $this->variable;
  if (!$var || empty($data->{$var})) {
    return;
  }

  //   $form = $this->form;
  switch ($this->form) {
    case 'ordinal':
      $text = $this
        ->ordinal($data->{$var});
      break;
    case 'long-ordinal':
      $text = $this
        ->long_ordinal($data->{$var});
      break;
    case 'roman':
      $text = $this
        ->roman($data->{$var});
      break;
    case 'numeric':
    default:
      $text = $data->{$var};
      break;
  }
  return $this
    ->format($text);
}