folderstructure change
This commit is contained in:
committed by
Steffen Schröder
parent
043c85fa97
commit
570b32fff8
60
application/core/Libs/FML/ManiaCode/AddBuddy.php
Normal file
60
application/core/Libs/FML/ManiaCode/AddBuddy.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element adding a Buddy
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class AddBuddy implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'add_buddy';
|
||||
protected $login = '';
|
||||
|
||||
/**
|
||||
* Construct a new AddBuddy Element
|
||||
*
|
||||
* @param string $login (optional) Buddy Login
|
||||
* @return \FML\ManiaCode\AddBuddy
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
$addBuddy = new AddBuddy($login);
|
||||
return $addBuddy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new AddBuddy Element
|
||||
*
|
||||
* @param string $login (optional) Buddy Login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if ($login !== null) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Buddy Login
|
||||
*
|
||||
* @param string $login Buddy Login
|
||||
* @return \FML\ManiaCode\AddBuddy
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string) $login;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
84
application/core/Libs/FML/ManiaCode/AddFavorite.php
Normal file
84
application/core/Libs/FML/ManiaCode/AddFavorite.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element adding a Server as Favorite
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class AddFavorite implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'add_favourite';
|
||||
protected $login = '';
|
||||
protected $ip = null;
|
||||
protected $port = null;
|
||||
|
||||
/**
|
||||
* Construct a new AddFavorite Element
|
||||
*
|
||||
* @param string $login (optional) Server Login
|
||||
* @return \FML\ManiaCode\AddFavorite
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
$addFavorite = new AddFavorite($login);
|
||||
return $addFavorite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new AddFavorite Element
|
||||
*
|
||||
* @param string $login (optional) Server Login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if ($login !== null) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Server Login
|
||||
*
|
||||
* @param string $login Server Login
|
||||
* @return \FML\ManiaCode\AddFavorite
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string) $login;
|
||||
$this->ip = null;
|
||||
$this->port = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Server Ip and Port
|
||||
*
|
||||
* @param string $ip Server Ip
|
||||
* @param int $port Server Port
|
||||
* @return \FML\ManiaCode\AddFavorite
|
||||
*/
|
||||
public function setIp($ip, $port) {
|
||||
$this->ip = (string) $ip;
|
||||
$this->port = (int) $port;
|
||||
$this->login = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->ip === null) {
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
}
|
||||
else {
|
||||
$ipElement = $domDocument->createElement('ip', $this->ip . ':' . $this->port);
|
||||
$xmlElement->appendChild($ipElement);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
14
application/core/Libs/FML/ManiaCode/Element.php
Normal file
14
application/core/Libs/FML/ManiaCode/Element.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
interface Element {
|
||||
|
||||
/**
|
||||
* Render the ManiaCode Element
|
||||
*
|
||||
* @param \DOMDocument $domDocument The DomDocument for which the Element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument);
|
||||
}
|
98
application/core/Libs/FML/ManiaCode/GetSkin.php
Normal file
98
application/core/Libs/FML/ManiaCode/GetSkin.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element downloading a Skin
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class GetSkin implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'get_skin';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new GetSkin Element
|
||||
*
|
||||
* @param string $name (optional) Skin Name
|
||||
* @param string $file (optional) Skin File
|
||||
* @param string $url (optional) Skin Url
|
||||
* @return \FML\ManiaCode\GetSkin
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
$getSkin = new GetSkin($name, $file, $url);
|
||||
return $getSkin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new GetSkin Element
|
||||
*
|
||||
* @param string $name (optional) Skin Name
|
||||
* @param string $file (optional) Skin File
|
||||
* @param string $url (optional) Skin Url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Skin
|
||||
*
|
||||
* @param string $name Skin Name
|
||||
* @return \FML\ManiaCode\GetSkin
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Skin
|
||||
*
|
||||
* @param string $file Skin File
|
||||
* @return \FML\ManiaCode\GetSkin
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string) $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Skin
|
||||
*
|
||||
* @param string $url Skin Url
|
||||
* @return \FML\ManiaCode\GetSkin
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
$xmlElement->appendChild($fileElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
60
application/core/Libs/FML/ManiaCode/Go_To.php
Normal file
60
application/core/Libs/FML/ManiaCode/Go_To.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element going to a Link
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Go_To implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'goto';
|
||||
protected $link = '';
|
||||
|
||||
/**
|
||||
* Create a new Go_To Element
|
||||
*
|
||||
* @param string $link (optional) Goto Link
|
||||
* @return \FML\ManiaCode\Go_To
|
||||
*/
|
||||
public static function create($link = null) {
|
||||
$goTo = new Go_To($link);
|
||||
return $goTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Go_To Element
|
||||
*
|
||||
* @param string $link (optional) Goto Link
|
||||
*/
|
||||
public function __construct($link = null) {
|
||||
if ($link !== null) {
|
||||
$this->setLink($link);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Goto Link
|
||||
*
|
||||
* @param string $link Goto Link
|
||||
* @return \FML\ManiaCode\Go_To
|
||||
*/
|
||||
public function setLink($link) {
|
||||
$this->link = (string) $link;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$linkElement = $domDocument->createElement('link', $this->link);
|
||||
$xmlElement->appendChild($linkElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
79
application/core/Libs/FML/ManiaCode/InstallMap.php
Normal file
79
application/core/Libs/FML/ManiaCode/InstallMap.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Map
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallMap implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_map';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new InstallMap Element
|
||||
*
|
||||
* @param string $name (optional) Map Name
|
||||
* @param string $url (optional) Map Url
|
||||
* @return \FML\ManiaCode\InstallMap
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$installMap = new InstallMap($name, $url);
|
||||
return $installMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallMap Element
|
||||
*
|
||||
* @param string $name (optional) Map Name
|
||||
* @param string $url (optional) Map Url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Map
|
||||
*
|
||||
* @param string $name Map Name
|
||||
* @return \FML\ManiaCode\InstallMap
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Map
|
||||
*
|
||||
* @param string $url Map Url
|
||||
* @return \FML\ManiaCode\InstallMap
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
98
application/core/Libs/FML/ManiaCode/InstallPack.php
Normal file
98
application/core/Libs/FML/ManiaCode/InstallPack.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Title Pack
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallPack implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_pack';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new InstallPack Element
|
||||
*
|
||||
* @param string $name (optional) Pack Name
|
||||
* @param string $file (optional) Pack File
|
||||
* @param string $url (optional) Pack Url
|
||||
* @return \FML\ManiaCode\InstallPack
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
$installPack = new InstallPack($name, $file, $url);
|
||||
return $installPack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallPack Element
|
||||
*
|
||||
* @param string $name (optional) Pack Name
|
||||
* @param string $file (optional) Pack File
|
||||
* @param string $url (optional) Pack Url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Script
|
||||
*
|
||||
* @param string $name Pack Name
|
||||
* @return \FML\ManiaCode\InstallPack
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Script
|
||||
*
|
||||
* @param string $file Pack File
|
||||
* @return \FML\ManiaCode\InstallPack
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string) $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Script
|
||||
*
|
||||
* @param string $url Pack Url
|
||||
* @return \FML\ManiaCode\InstallPack
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
$xmlElement->appendChild($fileElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
79
application/core/Libs/FML/ManiaCode/InstallReplay.php
Normal file
79
application/core/Libs/FML/ManiaCode/InstallReplay.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Replay
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallReplay implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_replay';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new InstallReplay Element
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @return \FML\ManiaCode\InstallReplay
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$installReplay = new InstallReplay($name, $url);
|
||||
return $installReplay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallReplay Element
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @return \FML\ManiaCode\InstallReplay
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Replay
|
||||
*
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode\InstallReplay
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
98
application/core/Libs/FML/ManiaCode/InstallScript.php
Normal file
98
application/core/Libs/FML/ManiaCode/InstallScript.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Script
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallScript implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_script';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new InstallScript Element
|
||||
*
|
||||
* @param string $name (optional) Script Name
|
||||
* @param string $file (optional) Script File
|
||||
* @param string $url (optional) Script Url
|
||||
* @return \FML\ManiaCode\InstallScript
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
$installScript = new InstallScript($name, $file, $url);
|
||||
return $installScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallScript Element
|
||||
*
|
||||
* @param string $name (optional) Script Name
|
||||
* @param string $file (optional) Script File
|
||||
* @param string $url (optional) Script Url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Script
|
||||
*
|
||||
* @param string $name Script Name
|
||||
* @return \FML\ManiaCode\InstallScript
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Script
|
||||
*
|
||||
* @param string $file Script File
|
||||
* @return \FML\ManiaCode\InstallScript
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string) $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Script
|
||||
*
|
||||
* @param string $url Script Url
|
||||
* @return \FML\ManiaCode\InstallScript
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
$xmlElement->appendChild($fileElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
98
application/core/Libs/FML/ManiaCode/InstallSkin.php
Normal file
98
application/core/Libs/FML/ManiaCode/InstallSkin.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Skin
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class InstallSkin implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'install_skin';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new InstallSkin Element
|
||||
*
|
||||
* @param string $name (optional) Skin Name
|
||||
* @param string $file (optional) Skin File
|
||||
* @param string $url (optional) Skin Url
|
||||
* @return \FML\ManiaCode\InstallSkin
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
$installSkin = new InstallSkin($name, $file, $url);
|
||||
return $installSkin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallSkin Element
|
||||
*
|
||||
* @param string $name (optional) Skin Name
|
||||
* @param string $file (optional) Skin File
|
||||
* @param string $url (optional) Skin Url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Skin
|
||||
*
|
||||
* @param string $name Skin Name
|
||||
* @return \FML\ManiaCode\InstallSkin
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Skin
|
||||
*
|
||||
* @param string $file Skin File
|
||||
* @return \FML\ManiaCode\InstallSkin
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string) $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Skin
|
||||
*
|
||||
* @param string $url Skin Url
|
||||
* @return \FML\ManiaCode\InstallSkin
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
$xmlElement->appendChild($fileElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
84
application/core/Libs/FML/ManiaCode/JoinServer.php
Normal file
84
application/core/Libs/FML/ManiaCode/JoinServer.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element joining a Server
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class JoinServer implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'join_server';
|
||||
protected $login = '';
|
||||
protected $ip = null;
|
||||
protected $port = null;
|
||||
|
||||
/**
|
||||
* Create a new JoinServer Element
|
||||
*
|
||||
* @param string $login (optional) Server Login
|
||||
* @return \FML\ManiaCode\JoinServer
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
$joinServer = new JoinServer($login);
|
||||
return $joinServer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new JoinServer Element
|
||||
*
|
||||
* @param string $login (optional) Server Login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if ($login !== null) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Server Login
|
||||
*
|
||||
* @param string $login Server Login
|
||||
* @return \FML\ManiaCode\JoinServer
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string) $login;
|
||||
$this->ip = null;
|
||||
$this->port = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Server Ip and Port
|
||||
*
|
||||
* @param string $ip Server Ip
|
||||
* @param int $port Server Port
|
||||
* @return \FML\ManiaCode\JoinServer
|
||||
*/
|
||||
public function setIp($ip, $port) {
|
||||
$this->ip = (string) $ip;
|
||||
$this->port = (int) $port;
|
||||
$this->login = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->ip === null) {
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
}
|
||||
else {
|
||||
$ipElement = $domDocument->createElement('ip', $this->ip . ':' . $this->port);
|
||||
$xmlElement->appendChild($ipElement);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
79
application/core/Libs/FML/ManiaCode/PlayMap.php
Normal file
79
application/core/Libs/FML/ManiaCode/PlayMap.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element playing a Map
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class PlayMap implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'play_map';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new PlayMap Element
|
||||
*
|
||||
* @param string $name (optional) Map Name
|
||||
* @param string $url (optional) Map Url
|
||||
* @return \FML\ManiaCode\PlayMap
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$playMap = new PlayMap($name, $url);
|
||||
return $playMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new PlayMap Element
|
||||
*
|
||||
* @param string $name (optional) Map Name
|
||||
* @param string $url (optional) Map Url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Map
|
||||
*
|
||||
* @param string $name Map Name
|
||||
* @return \FML\ManiaCode\PlayMap
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Map
|
||||
*
|
||||
* @param string $url Map Url
|
||||
* @return \FML\ManiaCode\PlayMap
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
79
application/core/Libs/FML/ManiaCode/PlayReplay.php
Normal file
79
application/core/Libs/FML/ManiaCode/PlayReplay.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element playing a Replay
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class PlayReplay implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'play_replay';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new PlayReplay Element
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @return \FML\ManiaCode\PlayReplay
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$playReplay = new PlayReplay($name, $url);
|
||||
return $playReplay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new PlayReplay Element
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @return \FML\ManiaCode\PlayReplay
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Replay
|
||||
*
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode\PlayReplay
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
60
application/core/Libs/FML/ManiaCode/ShowMessage.php
Normal file
60
application/core/Libs/FML/ManiaCode/ShowMessage.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element showing a Message
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ShowMessage implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'show_message';
|
||||
protected $message = '';
|
||||
|
||||
/**
|
||||
* Create a new ShowMessage Element
|
||||
*
|
||||
* @param string $message (optional) Message Text
|
||||
* @return \FML\ManiaCode\ShowMessage
|
||||
*/
|
||||
public static function create($message = null) {
|
||||
$showMessage = new ShowMessage($message);
|
||||
return $showMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new ShowMessage Element
|
||||
*
|
||||
* @param string $message (optional) Message Text
|
||||
*/
|
||||
public function __construct($message = null) {
|
||||
if ($message !== null) {
|
||||
$this->setMessage($message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the displayed Message Text
|
||||
*
|
||||
* @param string $message Message Text
|
||||
* @return \FML\ManiaCode\ShowMessage
|
||||
*/
|
||||
public function setMessage($message) {
|
||||
$this->message = (string) $message;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$messageElement = $domDocument->createElement('message', $this->message);
|
||||
$xmlElement->appendChild($messageElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
79
application/core/Libs/FML/ManiaCode/ViewReplay.php
Normal file
79
application/core/Libs/FML/ManiaCode/ViewReplay.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element viewing a Replay
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ViewReplay implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'view_replay';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Create a new ViewReplay Element
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @return \FML\ManiaCode\ViewReplay
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$viewReplay = new ViewReplay($name, $url);
|
||||
return $viewReplay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new ViewReplay Element
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @return \FML\ManiaCode\ViewReplay
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Replay
|
||||
*
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode\ViewReplay
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
$xmlElement->appendChild($urlElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user