/** * Get the xml element for this item * @param DOMDocument $xml * @return DOMElement * @deprecated since version 2.0 */ public function getNode($xml, $root = true) { $node = parent::getNode($xml); $mapNode = new AppBuilderAPIElement('map'); $mapNode->setAttribute('title', $this->title); $this->applyStyle($mapNode); $mapNode = $mapNode->getNode($xml); $mapNode->appendChild($node); $itemsNode = new AppBuilderAPIElement('items'); $this->applyStyle($itemsNode); $itemsNode = $itemsNode->getNode($xml); $itemsNode->appendChild($mapNode); $node = $itemsNode; if ($root) { $rootNode = $this->getRootNode($xml); $rootNode->setAttribute('type', 'map'); $rootNode->appendChild($node); $node = $rootNode; } return $node; }
protected function getRootNode($xml) { $rootNode = new AppBuilderAPIElement('screen'); $rootNode->setAttribute('updatedate', gmdate('j/n/Y H:i:s')); $rootNode->setAttribute('tabid', static::tabId()); $rootNode->setAttribute('title', $this->title); $this->applyStyle($rootNode); $rootNode = $rootNode->getNode($xml); return $rootNode; }
public function getNode($xml) { $node = parent::getNode($xml); $items = new AppBuilderAPIElement('items'); $items = $items->getNode($xml); foreach ($this->options as $option) { $optionNode = new AppBuilderAPIElement('option'); foreach ($option as $k => $v) { $optionNode->setAttribute($k, $v); } $optionNode = $optionNode->getNode($xml); $items->appendChild($optionNode); } $node->appendChild($items); return $node; }