You are here

private function FrxEditor::cleanup_ids in Forena Reports 7.4

Removes the attributes associated with forena-# that are added by forena. There is no real reason to persist them as they can be added on later and they are only created for wysiwyg compatibility.

1 call to FrxEditor::cleanup_ids()
FrxEditor::save in ./FrxEditor.inc
Save report

File

./FrxEditor.inc, line 668
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

private function cleanup_ids() {
  if ($this->simplexml) {
    $this->simplexml
      ->registerXPathNamespace('frx', FRX_NS);
    $frx_attributes = array();
    $frx_nodes = $this->simplexml
      ->xpath('body//*[@frx:*]');
    if ($frx_nodes) {
      foreach ($frx_nodes as $node) {
        $attr_nodes = $node
          ->attributes(FRX_NS);
        if ($attr_nodes) {
          if ((string) $node['id'] && strpos($node['id'], 'forena-') === 0) {
            unset($node['id']);
          }
        }
      }
    }
  }
}