You are here

function csl_name::init_format in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 modules/CiteProc/CSL.inc \csl_name::init_format()
  2. 7.2 modules/CiteProc/CSL.inc \csl_name::init_format()
1 call to csl_name::init_format()
csl_name::init_formatting in modules/CiteProc/CSL.inc

File

modules/CiteProc/CSL.inc, line 479

Class

csl_name

Code

function init_format($attribs, $part = 'base') {
  if (!isset($this->{$part})) {
    $this->{$part} = array();
  }
  if (isset($attribs['quotes']) && strtolower($attribs['quotes']) == 'true') {
    $this->{$part}['open-quote'] = $this->citeproc
      ->get_locale('term', 'open-quote');
    $this->{$part}['close-quote'] = $this->citeproc
      ->get_locale('term', 'close-quote');
    $this->{$part}['open-inner-quote'] = $this->citeproc
      ->get_locale('term', 'open-inner-quote');
    $this->{$part}['close-inner-quote'] = $this->citeproc
      ->get_locale('term', 'close-inner-quote');
    $this->no_op[$part] = FALSE;
  }
  if (isset($attribs['prefix'])) {
    $this->{$part}['prefix'] = $attribs['prefix'];
  }
  if (isset($attribs['suffix'])) {
    $this->{$part}['suffix'] = $attribs['suffix'];
  }
  $this->format[$part] .= isset($attribs['font-style']) ? 'font-style: ' . $attribs['font-style'] . ';' : '';
  $this->format[$part] .= isset($attribs['font-family']) ? 'font-family: ' . $attribs['font-family'] . ';' : '';
  $this->format[$part] .= isset($attribs['font-weight']) ? 'font-weight: ' . $attribs['font-weight'] . ';' : '';
  $this->format[$part] .= isset($attribs['font-variant']) ? 'font-variant: ' . $attribs['font-variant'] . ';' : '';
  $this->format[$part] .= isset($attribs['text-decoration']) ? 'text-decoration: ' . $attribs['text-decoration'] . ';' : '';
  $this->format[$part] .= isset($attribs['vertical-align']) ? 'vertical-align: ' . $attribs['vertical-align'] . ';' : '';
  if (isset($attribs['text-case'])) {
    $this->no_op[$part] = FALSE;
    $this->{$part}['text-case'] = $attribs['text-case'];
  }
  if (!empty($this->format[$part])) {
    $this->no_op[$part] = FALSE;
  }
}