예제 #1
0
파일: menu.php 프로젝트: difra-org/difra
 /**
  * @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());
 }
예제 #2
0
파일: CMS.php 프로젝트: difra-org/difra
 /**
  * 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;
 }