You are here

function csl_text::init in Bibliography Module 7.2

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

Overrides csl_element::init

File

modules/CiteProc/CSL.inc, line 1084

Class

csl_text

Code

function init($dom_node, $citeproc) {
  foreach (array(
    'variable',
    'macro',
    'term',
    'value',
  ) as $attr) {
    if ($dom_node
      ->hasAttribute($attr)) {
      $this->source = $attr;
      if ($this->source == 'macro') {
        $this->var = str_replace(' ', '_', $dom_node
          ->getAttribute($attr));
      }
      else {
        $this->var = $dom_node
          ->getAttribute($attr);
      }
    }
  }
}