You are here

public function csl_name::init_attrs in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/CiteProc/CSL.inc \csl_name::init_attrs()
  2. 7.2 modules/CiteProc/CSL.inc \csl_name::init_attrs()
1 call to csl_name::init_attrs()
csl_name::render in modules/CiteProc/CSL.inc

File

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

Class

csl_name

Code

public function init_attrs($mode) {

  // $and = $this->get_attributes('and');.
  if (isset($this->citeproc)) {
    $style_attrs = $this->citeproc->style
      ->get_hier_attributes();
    $mode_attrs = $this->citeproc->{$mode}
      ->get_hier_attributes();
    $this->attributes = array_merge($style_attrs, $mode_attrs, $this->attributes);
  }
  if (isset($this->and)) {
    if ($this->and == 'text') {
      $this->and = $this->citeproc
        ->get_locale('term', 'and');
    }
    elseif ($this->and == 'symbol') {
      $this->and = '&';
    }
  }
  if (!isset($this->delimiter)) {
    $this->delimiter = $this->{'name-delimiter'};
  }
  if (!isset($this->alnum)) {
    list($this->alnum, $this->alpha, $this->cntrl, $this->dash, $this->digit, $this->graph, $this->lower, $this->print, $this->punct, $this->space, $this->upper, $this->word, $this->patternModifiers) = $this
      ->get_regex_patterns();
  }
  $this->dpl = $this->{'delimiter-precedes-last'};
  $this->sort_separator = isset($this->{'sort-separator'}) ? $this->{'sort-separator'} : ', ';
  $this->delimiter = isset($this->{'name-delimiter'}) ? $this->{'name-delimiter'} : (isset($this->delimiter) ? $this->delimiter : ', ');
  $this->form = isset($this->{'name-form'}) ? $this->{'name-form'} : (isset($this->form) ? $this->form : 'long');
  $this->attr_init = $mode;
}