You are here

public function FrxEditor::setMenu in Forena Reports 7.3

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

File

./FrxEditor.inc, line 385
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 setMenu($menu_data) {
  $dom = $this->dom;
  $this
    ->verifyHeaderElements(array(
    'menu',
  ));
  $options = $dom
    ->getElementsByTagNameNS($this->xmlns, 'menu')
    ->item(0);
  foreach ($menu_data as $key => $value) {
    if ($value) {
      $options
        ->setAttribute($key, $value);
    }
    else {
      if ($options
        ->hasAttribute($key)) {
        $options
          ->removeAttribute($key);
      }
    }
  }
}