/** * @param \DOMNode|\DOMElement $node * @param int $menuId */ private function getEditXML($node, $menuId) { $menu = \Difra\Plugins\CMS\Menu::get($menuId); $node->setAttribute('depth', $menu->getDepth()); $parentsNode = $node->appendChild($this->xml->createElement('parents')); \Difra\Plugins\CMS::getInstance()->getMenuItemsXML($parentsNode, $menu->getId()); }
/** * Get menu list * @param \DOMNode $node * @return bool */ public function getMenuListXML($node) { $data = Menu::getList(); if (empty($data)) { return false; } foreach ($data as $menu) { /** @var \DOMElement $menuNode */ $menuNode = $node->appendChild($node->ownerDocument->createElement('menuobj')); $menu->getXML($menuNode); } return true; }