FML Update
This commit is contained in:
@ -14,12 +14,12 @@ class ManiaLinks {
|
||||
protected $encoding = 'utf-8';
|
||||
protected $tagName = 'manialinks';
|
||||
protected $children = array();
|
||||
protected $customUI = null;
|
||||
|
||||
/**
|
||||
* Set XML Encoding
|
||||
*
|
||||
* @param string $encoding
|
||||
* XML Encoding
|
||||
* @param string $encoding XML Encoding
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public function setXmlEncoding($encoding) {
|
||||
@ -30,8 +30,7 @@ class ManiaLinks {
|
||||
/**
|
||||
* Add a Child Manialink
|
||||
*
|
||||
* @param ManiaLink $child
|
||||
* Child Manialink
|
||||
* @param ManiaLink $child Child Manialink
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public function add(ManiaLink $child) {
|
||||
@ -51,11 +50,21 @@ class ManiaLinks {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the CustomUI
|
||||
*
|
||||
* @param CustomUI $customUI The CustomUI Object
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public function setCustomUI(CustomUI $customUI) {
|
||||
$this->customUI = $customUI;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the XML Document
|
||||
*
|
||||
* @param bool $echo
|
||||
* If the xml should be echoed and the content-type header should be set
|
||||
* @param bool $echo If the XML should be echoed and the Content-Type Header should be set
|
||||
* @return \DOMDocument
|
||||
*/
|
||||
public function render($echo = false) {
|
||||
@ -66,6 +75,10 @@ class ManiaLinks {
|
||||
$childXml = $child->render(false, $domDocument);
|
||||
$manialinks->appendChild($childXml);
|
||||
}
|
||||
if ($this->customUI) {
|
||||
$customUIXml = $this->customUI->render($domDocument);
|
||||
$manialinks->appendChild($customUIXml);
|
||||
}
|
||||
if ($echo) {
|
||||
header('Content-Type: application/xml');
|
||||
echo $domDocument->saveXML();
|
||||
|
Reference in New Issue
Block a user