You are here

public function FrxEditor::setOptions in Forena Reports 7.3

Same name and namespace in other branches
  1. 7.4 FrxEditor.inc \FrxEditor::setOptions()

Set the options list for the report Enter description here ...

Parameters

unknown_type $option_data:

File

./FrxEditor.inc, line 348
FrxEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd

Class

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

Code

public function setOptions($option_data) {
  $dom = $this->dom;
  $this
    ->verifyHeaderElements(array(
    'options',
  ));
  $options = $dom
    ->getElementsByTagNameNS($this->xmlns, 'options')
    ->item(0);
  foreach ($option_data as $key => $value) {
    if ($value) {
      $options
        ->setAttribute($key, $value);
    }
    else {
      if ($options
        ->hasAttribute($key)) {
        $options
          ->removeAttribute($key);
      }
    }
  }
}