You are here

public function FrxReportEditor::setFields in Forena Reports 6.2

Same name and namespace in other branches
  1. 6 FrxReportEditor.inc \FrxReportEditor::setFields()
  2. 7 FrxReportEditor.inc \FrxReportEditor::setFields()
  3. 7.2 FrxReportEditor.inc \FrxReportEditor::setFields()

Builds the fields from an array of elements. Enter description here ...

Parameters

$fieldElements:

File

./FrxReportEditor.inc, line 229

Class

FrxReportEditor
Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd

Code

public function setFields($fieldElements) {
  $dom = $this->dom;
  $newFields = $dom
    ->createElementNS($this->xmlns, 'fields');
  $this
    ->verifyHeaderElements(array(
    'fields',
  ));
  $fnode = $dom
    ->getElementsByTagNameNS($this->xmlns, 'fields')
    ->item(0);
  $p = $fnode->parentNode;
  $p
    ->replaceChild($newFields, $fnode);
  $this
    ->setFrxHeader('fields', 'field', $fieldElements, array(
    'id',
    'link',
    'format',
    'format-string',
    'target',
    'rel',
    'class',
  ), 'default');
}