Huge FML Update

This commit is contained in:
Steffen Schröder
2014-01-12 00:51:46 +01:00
parent 6a6fa56596
commit 345368df39
69 changed files with 2068 additions and 429 deletions

View File

@ -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');