- Moved FML into core folder
- Endurance plugin - map class nbCheckpoints - added script callbacks registration
This commit is contained in:
26
application/core/FML/Elements/Format.php
Normal file
26
application/core/FML/Elements/Format.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
/**
|
||||
* Class representing a format
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Format implements BgColorable, Renderable, Styleable, TextFormatable {
|
||||
/**
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'format';
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xml = $domDocument->createElement($this->tagName);
|
||||
return $xml;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
37
application/core/FML/Elements/Including.php
Normal file
37
application/core/FML/Elements/Including.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
/**
|
||||
* Class representing include
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Including implements Renderable {
|
||||
/**
|
||||
* Protected properties
|
||||
*/
|
||||
protected $url = '';
|
||||
protected $tagName = 'include';
|
||||
|
||||
/**
|
||||
* Set url
|
||||
*
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xml = $domDocument->createElement($this->tagName);
|
||||
$xml->setAttribute('url', $this->url);
|
||||
return $xml;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
41
application/core/FML/Elements/Music.php
Normal file
41
application/core/FML/Elements/Music.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
/**
|
||||
* Class representing music
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Music implements Renderable {
|
||||
/**
|
||||
* Protected properties
|
||||
*/
|
||||
protected $data = '';
|
||||
protected $tagName = 'music';
|
||||
|
||||
/**
|
||||
* Set data
|
||||
*
|
||||
* @param string $data
|
||||
* @return \FML\Elements\Music
|
||||
*/
|
||||
public function setData($data) {
|
||||
$this->data = $data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xml = $domDocument->createElement($this->tagName);
|
||||
if ($this->data) {
|
||||
$xml->setAttribute('data', $this->data);
|
||||
}
|
||||
return $xml;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
42
application/core/FML/Elements/SimpleScript.php
Normal file
42
application/core/FML/Elements/SimpleScript.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Class representing a manialink script tag with a simple script text
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class SimpleScript implements Renderable {
|
||||
/**
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'script';
|
||||
protected $text = '';
|
||||
|
||||
/**
|
||||
* Set script text
|
||||
*
|
||||
* @param string $text
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function setText($text) {
|
||||
$this->text = $text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xml = $domDocument->createElement($this->tagName);
|
||||
$scriptComment = $domDocument->createComment($this->text);
|
||||
$xml->appendChild($scriptComment);
|
||||
return $xml;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user