Huge FML Update
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
namespace FML;
|
||||
|
||||
/**
|
||||
* Class holding several Manialinks at once
|
||||
* Class holding several ManiaLinks at once
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
@ -23,7 +23,7 @@ class ManiaLinks {
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public function setXmlEncoding($encoding) {
|
||||
$this->encoding = $encoding;
|
||||
$this->encoding = (string) $encoding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -64,20 +64,20 @@ class ManiaLinks {
|
||||
/**
|
||||
* Render the XML Document
|
||||
*
|
||||
* @param bool $echo If the XML should be echoed and the Content-Type Header should be set
|
||||
* @param bool (optional) $echo Whether the XML Text should be echoed and the Content-Type Header should be set
|
||||
* @return \DOMDocument
|
||||
*/
|
||||
public function render($echo = false) {
|
||||
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
||||
$manialinks = $domDocument->createElement($this->tagName);
|
||||
$domDocument->appendChild($manialinks);
|
||||
$maniaLinks = $domDocument->createElement($this->tagName);
|
||||
$domDocument->appendChild($maniaLinks);
|
||||
foreach ($this->children as $child) {
|
||||
$childXml = $child->render(false, $domDocument);
|
||||
$manialinks->appendChild($childXml);
|
||||
$maniaLinks->appendChild($childXml);
|
||||
}
|
||||
if ($this->customUI) {
|
||||
$customUIXml = $this->customUI->render($domDocument);
|
||||
$manialinks->appendChild($customUIXml);
|
||||
$maniaLinks->appendChild($customUIXml);
|
||||
}
|
||||
if ($echo) {
|
||||
header('Content-Type: application/xml');
|
||||
|
Reference in New Issue
Block a user