folderstructure change
This commit is contained in:
committed by
Steffen Schröder
parent
043c85fa97
commit
570b32fff8
143
application/core/Libs/FML/Controls/Audio.php
Normal file
143
application/core/Libs/FML/Controls/Audio.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Playable;
|
||||
use FML\Types\Scriptable;
|
||||
|
||||
/**
|
||||
* Audio Control
|
||||
* (CMlMediaPlayer)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Audio extends Control implements Playable, Scriptable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $data = '';
|
||||
protected $dataId = '';
|
||||
protected $play = 0;
|
||||
protected $looping = 0;
|
||||
protected $music = 0;
|
||||
protected $volume = 1.;
|
||||
protected $scriptEvents = 0;
|
||||
|
||||
/**
|
||||
* Create a new Audio Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Audio
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$audio = new Audio($id);
|
||||
return $audio;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Audio Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'audio';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setData()
|
||||
* @return \FML\Controls\Audio
|
||||
*/
|
||||
public function setData($data) {
|
||||
$this->data = (string) $data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setDataId()
|
||||
* @return \FML\Controls\Audio
|
||||
*/
|
||||
public function setDataId($dataId) {
|
||||
$this->dataId = (string) $dataId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setPlay()
|
||||
* @return \FML\Controls\Audio
|
||||
*/
|
||||
public function setPlay($play) {
|
||||
$this->play = ($play ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setLooping()
|
||||
* @return \FML\Controls\Audio
|
||||
*/
|
||||
public function setLooping($looping) {
|
||||
$this->looping = ($looping ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setMusic()
|
||||
* @return \FML\Controls\Audio
|
||||
*/
|
||||
public function setMusic($music) {
|
||||
$this->music = ($music ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setVolume()
|
||||
* @return \FML\Controls\Audio
|
||||
*/
|
||||
public function setVolume($volume) {
|
||||
$this->volume = (float) $volume;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
* @return \FML\Controls\Audio
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
$this->scriptEvents = ($scriptEvents ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->data) {
|
||||
$xmlElement->setAttribute('data', $this->data);
|
||||
}
|
||||
if ($this->play) {
|
||||
$xmlElement->setAttribute('play', $this->play);
|
||||
}
|
||||
if (!$this->looping) {
|
||||
$xmlElement->setAttribute('looping', $this->looping);
|
||||
}
|
||||
if ($this->music) {
|
||||
$xmlElement->setAttribute('music', $this->music);
|
||||
}
|
||||
if ($this->volume != 1.) {
|
||||
$xmlElement->setAttribute('volume', $this->volume);
|
||||
}
|
||||
if ($this->scriptEvents) {
|
||||
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
289
application/core/Libs/FML/Controls/Control.php
Normal file
289
application/core/Libs/FML/Controls/Control.php
Normal file
@ -0,0 +1,289 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Base Control
|
||||
* (CMlControl)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
abstract class Control implements Renderable {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const CENTER = 'center';
|
||||
const CENTER2 = 'center2';
|
||||
const TOP = 'top';
|
||||
const RIGHT = 'right';
|
||||
const BOTTOM = 'bottom';
|
||||
const LEFT = 'left';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'control';
|
||||
protected $id = '';
|
||||
protected $x = 0.;
|
||||
protected $y = 0.;
|
||||
protected $z = 0.;
|
||||
protected $width = -1.;
|
||||
protected $height = -1.;
|
||||
protected $hAlign = self::CENTER;
|
||||
protected $vAlign = self::CENTER2;
|
||||
protected $scale = 1.;
|
||||
protected $hidden = 0;
|
||||
protected $classes = array();
|
||||
|
||||
/**
|
||||
* Construct a new Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
if ($id !== null) {
|
||||
$this->setId($id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Control Id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Id
|
||||
*
|
||||
* @param string $id Control Id
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = (string) $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Id for dangerous Characters and assign an unique Id if necessary
|
||||
*
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function checkId() {
|
||||
if (!$this->getId()) {
|
||||
$this->setId(uniqid());
|
||||
return $this;
|
||||
}
|
||||
$dangerousCharacters = array(' ', ' ', '.', '|', '-', PHP_EOL);
|
||||
$idCharacters = str_split($this->getId());
|
||||
$danger = false;
|
||||
foreach ($idCharacters as $character) {
|
||||
if (!in_array($character, $dangerousCharacters)) continue;
|
||||
$danger = true;
|
||||
break;
|
||||
}
|
||||
if ($danger) {
|
||||
trigger_error("Please don't use special Characters in Ids, they might cause Problems! (I stripped them for You.)");
|
||||
$id = str_ireplace($dangerousCharacters, '', $this->getId());
|
||||
$this->setId($id);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set X Position
|
||||
*
|
||||
* @param float $x Horizontal Position
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setX($x) {
|
||||
$this->x = (float) $x;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Y Position
|
||||
*
|
||||
* @param float $y Vertical Position
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setY($y) {
|
||||
$this->y = (float) $y;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Z Position
|
||||
*
|
||||
* @param float $z Depth
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setZ($z) {
|
||||
$this->z = (float) $z;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Position
|
||||
*
|
||||
* @param float $x Horizontal Position
|
||||
* @param float $y Vertical Position
|
||||
* @param float $z (optional) Depth
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setPosition($x, $y, $z = null) {
|
||||
$this->setX($x);
|
||||
$this->setY($y);
|
||||
if ($z !== null) {
|
||||
$this->setZ($z);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Width
|
||||
*
|
||||
* @param float $width Control Width
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setWidth($width) {
|
||||
$this->width = (float) $width;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Height
|
||||
*
|
||||
* @param float $height Control Height
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setHeight($height) {
|
||||
$this->height = (float) $height;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Size
|
||||
*
|
||||
* @param float $width Control Width
|
||||
* @param float $height Control Height
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setSize($width, $height) {
|
||||
$this->setWidth($width);
|
||||
$this->setHeight($height);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Horizontal Alignment
|
||||
*
|
||||
* @param string $hAlign Horizontal Alignment
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setHAlign($hAlign) {
|
||||
$this->hAlign = (string) $hAlign;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Vertical Alignment
|
||||
*
|
||||
* @param string $vAlign Vertical Alignment
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setVAlign($vAlign) {
|
||||
$this->vAlign = (string) $vAlign;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Horizontal and Vertical Alignment
|
||||
*
|
||||
* @param string $hAlign Horizontal Alignment
|
||||
* @param string $vAlign Vertical Alignment
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setAlign($hAlign, $vAlign) {
|
||||
$this->setHAlign($hAlign);
|
||||
$this->setVAlign($vAlign);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Scale
|
||||
*
|
||||
* @param float $scale Control Scale
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setScale($scale) {
|
||||
$this->scale = (float) $scale;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Visibility
|
||||
*
|
||||
* @param bool $visible Whether Control should be visible
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setVisible($visible) {
|
||||
$this->hidden = ($visible ? 0 : 1);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new Class Name
|
||||
*
|
||||
* @param string $class Class Name
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function addClass($class) {
|
||||
$class = (string) $class;
|
||||
if (!in_array($class, $this->classes)) {
|
||||
array_push($this->classes, $class);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->id) {
|
||||
$xmlElement->setAttribute('id', $this->id);
|
||||
}
|
||||
if ($this->x != 0. || $this->y != 0. || $this->z != 0.) {
|
||||
$xmlElement->setAttribute('posn', "{$this->x} {$this->y} {$this->z}");
|
||||
}
|
||||
if ($this->width >= 0. || $this->height >= 0.) {
|
||||
$xmlElement->setAttribute('sizen', "{$this->width} {$this->height}");
|
||||
}
|
||||
if ($this->hAlign) {
|
||||
$xmlElement->setAttribute('halign', $this->hAlign);
|
||||
}
|
||||
if ($this->vAlign) {
|
||||
$xmlElement->setAttribute('valign', $this->vAlign);
|
||||
}
|
||||
if ($this->scale != 1.) {
|
||||
$xmlElement->setAttribute('scale', $this->scale);
|
||||
}
|
||||
if ($this->hidden) {
|
||||
$xmlElement->setAttribute('hidden', $this->hidden);
|
||||
}
|
||||
if (!empty($this->classes)) {
|
||||
$classes = '';
|
||||
foreach ($this->classes as $class) {
|
||||
$classes .= $class . ' ';
|
||||
}
|
||||
$xmlElement->setAttribute('class', $classes);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
178
application/core/Libs/FML/Controls/Entry.php
Normal file
178
application/core/Libs/FML/Controls/Entry.php
Normal file
@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\NewLineable;
|
||||
use FML\Types\Scriptable;
|
||||
use FML\Types\Styleable;
|
||||
use FML\Types\TextFormatable;
|
||||
|
||||
/**
|
||||
* Entry Control
|
||||
* (CMlEntry)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Entry extends Control implements NewLineable, Scriptable, Styleable, TextFormatable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $name = '';
|
||||
protected $default = null;
|
||||
protected $autoNewLine = 0;
|
||||
protected $scriptEvents = 0;
|
||||
protected $style = '';
|
||||
protected $textColor = '';
|
||||
protected $textSize = -1;
|
||||
protected $focusAreaColor1 = '';
|
||||
protected $focusAreaColor2 = '';
|
||||
|
||||
/**
|
||||
* Create a new Entry Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$entry = new Entry($id);
|
||||
return $entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Entry Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'entry';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Entry Name
|
||||
*
|
||||
* @param string $name Entry Name
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Default Value
|
||||
*
|
||||
* @param string $default Default Value
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setDefault($default) {
|
||||
$this->default = $default;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\NewLineable::setAutoNewLine()
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setAutoNewLine($autoNewLine) {
|
||||
$this->autoNewLine = ($autoNewLine ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
$this->scriptEvents = ($scriptEvents ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Styleable::setStyle()
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setStyle($style) {
|
||||
$this->style = (string) $style;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setTextColor()
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setTextColor($textColor) {
|
||||
$this->textColor = (string) $textColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setTextSize()
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setTextSize($textSize) {
|
||||
$this->textSize = (int) $textSize;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setAreaColor()
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setAreaColor($areaColor) {
|
||||
$this->focusAreaColor1 = (string) $areaColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setAreaFocusColor()
|
||||
* @return \FML\Controls\Entry
|
||||
*/
|
||||
public function setAreaFocusColor($areaFocusColor) {
|
||||
$this->focusAreaColor2 = (string) $areaFocusColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->name) {
|
||||
$xmlElement->setAttribute('name', $this->name);
|
||||
}
|
||||
if ($this->default !== null) {
|
||||
$xmlElement->setAttribute('default', $this->default);
|
||||
}
|
||||
if ($this->autoNewLine) {
|
||||
$xmlElement->setAttribute('autonewline', $this->autoNewLine);
|
||||
}
|
||||
if ($this->scriptEvents) {
|
||||
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
||||
}
|
||||
if ($this->style) {
|
||||
$xmlElement->setAttribute('style', $this->style);
|
||||
}
|
||||
if ($this->textColor) {
|
||||
$xmlElement->setAttribute('textcolor', $this->textColor);
|
||||
}
|
||||
if ($this->textSize >= 0.) {
|
||||
$xmlElement->setAttribute('textsize', $this->textSize);
|
||||
}
|
||||
if ($this->focusAreaColor1) {
|
||||
$xmlElement->setAttribute('focusareacolor1', $this->focusAreaColor1);
|
||||
}
|
||||
if ($this->focusAreaColor2) {
|
||||
$xmlElement->setAttribute('focusareacolor2', $this->focusAreaColor2);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
60
application/core/Libs/FML/Controls/FileEntry.php
Normal file
60
application/core/Libs/FML/Controls/FileEntry.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
/**
|
||||
* FileEntry Control
|
||||
* (CMlFileEntry)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class FileEntry extends Entry {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $folder = '';
|
||||
|
||||
/**
|
||||
* Create a new FileEntry Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\FileEntry
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$fileEntry = new FileEntry($id);
|
||||
return $fileEntry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new FileEntry Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'fileentry';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Folder
|
||||
*
|
||||
* @param string $folder Base Folder
|
||||
* @return \FML\Controls\FileEntry
|
||||
*/
|
||||
public function setFolder($folder) {
|
||||
$this->folder = (string) $folder;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Entry::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->folder) {
|
||||
$xmlElement->setAttribute('folder', $this->folder);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
103
application/core/Libs/FML/Controls/Frame.php
Normal file
103
application/core/Libs/FML/Controls/Frame.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Container;
|
||||
use FML\Types\Renderable;
|
||||
use FML\Elements\Format;
|
||||
use FML\Elements\FrameModel;
|
||||
|
||||
/**
|
||||
* Frame Control
|
||||
* (CMlFrame)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Frame extends Control implements Container {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $children = array();
|
||||
protected $format = null;
|
||||
|
||||
/**
|
||||
* Create a new Frame Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$frame = new Frame($id);
|
||||
return $frame;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Frame Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'frame';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::add()
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function add(Control $child) {
|
||||
if (!in_array($child, $this->children, true)) {
|
||||
array_push($this->children, $child);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::removeChildren()
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function removeChildren() {
|
||||
$this->children = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::setFormat()
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function setFormat(Format $format) {
|
||||
$this->format = $format;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::getFormat()
|
||||
*/
|
||||
public function getFormat($createIfEmpty = true) {
|
||||
if (!$this->format && $createIfEmpty) {
|
||||
$this->format = new Format();
|
||||
}
|
||||
return $this->format;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->format) {
|
||||
$formatXml = $this->format->render($domDocument);
|
||||
$xmlElement->appendChild($formatXml);
|
||||
}
|
||||
foreach ($this->children as $child) {
|
||||
$childXmlElement = $child->render($domDocument);
|
||||
$xmlElement->appendChild($childXmlElement);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
95
application/core/Libs/FML/Controls/Frame3d.php
Normal file
95
application/core/Libs/FML/Controls/Frame3d.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Scriptable;
|
||||
use FML\Stylesheet\Style3d;
|
||||
|
||||
/**
|
||||
* Frame3d Control
|
||||
* (CMlFrame)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Frame3d extends Frame implements Scriptable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $style3dId = '';
|
||||
protected $style3d = null;
|
||||
protected $scriptEvents = 0;
|
||||
|
||||
/**
|
||||
* Create a new Frame3d Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Frame3d
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$frame3d = new Frame3d($id);
|
||||
return $frame3d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Frame3d Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'frame3d';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Style3d Id
|
||||
*
|
||||
* @param string $style3dId Style3d Id
|
||||
* @return \FML\Controls\Frame3d
|
||||
*/
|
||||
public function setStyle3dId($style3dId) {
|
||||
$this->style3dId = (string) $style3dId;
|
||||
$this->style3d = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Style3d
|
||||
*
|
||||
* @param Style3d $style3d Style3d Object
|
||||
* @return \FML\Controls\Frame3d
|
||||
*/
|
||||
public function setStyle3d(Style3d $style3d) {
|
||||
$this->style3d = $style3d;
|
||||
$this->style = '';
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
* @return \FML\Controls\Frame3d
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
$this->scriptEvents = ($scriptEvents ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Controls\Frame::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->style3d) {
|
||||
$this->style3d->checkId();
|
||||
$xmlElement->setAttribute('style3d', $this->style3d->getId());
|
||||
}
|
||||
else if ($this->style3dId) {
|
||||
$xmlElement->setAttribute('style3d', $this->style3dId);
|
||||
}
|
||||
if ($this->scriptEvents) {
|
||||
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
86
application/core/Libs/FML/Controls/FrameInstance.php
Normal file
86
application/core/Libs/FML/Controls/FrameInstance.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Elements\FrameModel;
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Class representing an Instance of a Frame Model
|
||||
* (CMlFrame)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class FrameInstance extends Control {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $modelId = '';
|
||||
protected $model = null;
|
||||
|
||||
/**
|
||||
* Create a new Frame Instance
|
||||
*
|
||||
* @param string $modelId (optional) Frame Model Id
|
||||
* @param string $controlId (optional) Control Id
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public static function create($modelId = null, $controlId = null) {
|
||||
$frameInstance = new FrameInstance($modelId, $controlId);
|
||||
return $frameInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Frame Instance
|
||||
*
|
||||
* @param string $modelId (optional) Frame Model Id
|
||||
* @param string $controlId (optional) Control Id
|
||||
*/
|
||||
public function __construct($modelId = null, $controlId = null) {
|
||||
parent::__construct($controlId);
|
||||
$this->tagName = 'frameinstance';
|
||||
if ($modelId !== null) {
|
||||
$this->setModelId($modelId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Model Id
|
||||
*
|
||||
* @param string $modelId Model Id
|
||||
* @return \FML\Controls\FrameInstance
|
||||
*/
|
||||
public function setModelId($modelId) {
|
||||
$this->modelId = (string) $modelId;
|
||||
$this->model = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Frame Model to use
|
||||
*
|
||||
* @param FrameModel $frameModel Frame Model
|
||||
* @return \FML\Controls\FrameInstance
|
||||
*/
|
||||
public function setModel(FrameModel $frameModel) {
|
||||
$this->model = $frameModel;
|
||||
$this->modelId = '';
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->model) {
|
||||
$this->model->checkId();
|
||||
$xmlElement->setAttribute('modelid', $this->model->getId());
|
||||
}
|
||||
else if ($this->modelId) {
|
||||
$xmlElement->setAttribute('modelid', $this->modelId);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
189
application/core/Libs/FML/Controls/Gauge.php
Normal file
189
application/core/Libs/FML/Controls/Gauge.php
Normal file
@ -0,0 +1,189 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Styleable;
|
||||
|
||||
/**
|
||||
* Gauge Control
|
||||
* (CMlGauge)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Gauge extends Control implements Styleable {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE_BgCard = 'BgCard';
|
||||
const STYLE_EnergyBar = 'EnergyBar';
|
||||
const STYLE_ProgressBar = 'ProgressBar';
|
||||
const STYLE_ProgressBarSmall = 'ProgressBarSmall';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $ratio = 0.;
|
||||
protected $grading = 1.;
|
||||
protected $color = '';
|
||||
protected $rotation = 0.;
|
||||
protected $centered = 0;
|
||||
protected $clan = 0;
|
||||
protected $drawBg = 1;
|
||||
protected $drawBlockBg = 1;
|
||||
protected $style = '';
|
||||
|
||||
/**
|
||||
* Create a new Gauge Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$gauge = new Gauge($id);
|
||||
return $gauge;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Gauge Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'gauge';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Ratio
|
||||
*
|
||||
* @param float $ratio Ratio Value
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setRatio($ratio) {
|
||||
$this->ratio = (float) $ratio;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Grading
|
||||
*
|
||||
* @param float $grading Grading Value
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setGrading($grading) {
|
||||
$this->grading = (float) $grading;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Color
|
||||
*
|
||||
* @param string $color Gauge Color
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setColor($color) {
|
||||
$this->color = (string) $color;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Rotation
|
||||
*
|
||||
* @param float $rotation Gauge Rotation
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setRotation($rotation) {
|
||||
$this->rotation = (float) $rotation;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Centered
|
||||
*
|
||||
* @param bool $centered Whether Gauge is centered
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setCentered($centered) {
|
||||
$this->centered = ($centered ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Clan
|
||||
*
|
||||
* @param int $clan Clan number
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setClan($clan) {
|
||||
$this->clan = (int) $clan;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Draw Background
|
||||
*
|
||||
* @param bool $drawBg Whether Gauge Background should be drawn
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setDrawBg($drawBg) {
|
||||
$this->drawBg = ($drawBg ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Draw Block Background
|
||||
*
|
||||
* @param bool $drawBlockBg Whether Gauge Block Background should be drawn
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setDrawBlockBg($drawBlockBg) {
|
||||
$this->drawBlockBg = ($drawBlockBg ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Styleable::setStyle()
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setStyle($style) {
|
||||
$this->style = (string) $style;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->ratio) {
|
||||
$xmlElement->setAttribute('ratio', $this->ratio);
|
||||
}
|
||||
if ($this->grading != 1.) {
|
||||
$xmlElement->setAttribute('grading', $this->grading);
|
||||
}
|
||||
if ($this->color) {
|
||||
$xmlElement->setAttribute('color', $this->color);
|
||||
}
|
||||
if ($this->rotation) {
|
||||
$xmlElement->setAttribute('rotation', $this->rotation);
|
||||
}
|
||||
if ($this->centered) {
|
||||
$xmlElement->setAttribute('centered', $this->centered);
|
||||
}
|
||||
if ($this->clan) {
|
||||
$xmlElement->setAttribute('clan', $this->clan);
|
||||
}
|
||||
if (!$this->drawBg) {
|
||||
$xmlElement->setAttribute('drawbg', $this->drawBg);
|
||||
}
|
||||
if (!$this->drawBlockBg) {
|
||||
$xmlElement->setAttribute('drawblockbg', $this->drawBlockBg);
|
||||
}
|
||||
if ($this->style) {
|
||||
$xmlElement->setAttribute('style', $this->style);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
327
application/core/Libs/FML/Controls/Label.php
Normal file
327
application/core/Libs/FML/Controls/Label.php
Normal file
@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Actionable;
|
||||
use FML\Types\Linkable;
|
||||
use FML\Types\NewLineable;
|
||||
use FML\Types\Scriptable;
|
||||
use FML\Types\Styleable;
|
||||
use FML\Types\TextFormatable;
|
||||
|
||||
/**
|
||||
* Label Control
|
||||
* (CMlLabel)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Label extends Control implements Actionable, Linkable, NewLineable, Scriptable, Styleable, TextFormatable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $text = '';
|
||||
protected $textId = '';
|
||||
protected $textPrefix = '';
|
||||
protected $textEmboss = 0;
|
||||
protected $translate = 0;
|
||||
protected $maxLines = -1;
|
||||
protected $action = '';
|
||||
protected $actionKey = -1;
|
||||
protected $url = '';
|
||||
protected $urlId = '';
|
||||
protected $manialink = '';
|
||||
protected $manialinkId = '';
|
||||
protected $autoNewLine = 0;
|
||||
protected $scriptEvents = 0;
|
||||
protected $style = '';
|
||||
protected $textSize = -1;
|
||||
protected $textColor = '';
|
||||
protected $focusAreaColor1 = '';
|
||||
protected $focusAreaColor2 = '';
|
||||
|
||||
/**
|
||||
* Create a new Label Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$label = new Label($id);
|
||||
return $label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Label Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'label';
|
||||
$this->setZ(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Text
|
||||
*
|
||||
* @param string $text Text Value
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setText($text) {
|
||||
$this->text = (string) $text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Text Id to use from the Dico
|
||||
*
|
||||
* @param string $textId Text Id
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setTextId($textId) {
|
||||
$this->textId = (string) $textId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Text Prefix
|
||||
*
|
||||
* @param string $textPrefix Text Prefix
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setTextPrefix($textPrefix) {
|
||||
$this->textPrefix = (string) $textPrefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Text Emboss
|
||||
*
|
||||
* @param bool $textEmboss Whether Text should be embossed
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setTextEmboss($textEmboss) {
|
||||
$this->textEmboss = ($textEmboss ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Translate
|
||||
*
|
||||
* @param bool $translate Whether Text should be translated
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setTranslate($translate) {
|
||||
$this->translate = ($translate ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Max Lines Count
|
||||
*
|
||||
* @param int $maxLines Max Lines Count
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setMaxLines($maxLines) {
|
||||
$this->maxLines = (int) $maxLines;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::setAction()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setAction($action) {
|
||||
$this->action = (string) $action;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::getAction()
|
||||
*/
|
||||
public function getAction() {
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::setActionKey()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setActionKey($actionKey) {
|
||||
$this->actionKey = (int) $actionKey;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setUrl()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setUrlId()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setUrlId($urlId) {
|
||||
$this->urlId = (string) $urlId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setManialink()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setManialink($manialink) {
|
||||
$this->manialink = (string) $manialink;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setManialinkId()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setManialinkId($manialinkId) {
|
||||
$this->manialinkId = (string) $manialinkId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\NewLineable::setAutoNewLine()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setAutoNewLine($autoNewLine) {
|
||||
$this->autoNewLine = ($autoNewLine ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
$this->scriptEvents = ($scriptEvents ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Styleable::setStyle()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setStyle($style) {
|
||||
$this->style = (string) $style;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setTextSize()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setTextSize($textSize) {
|
||||
$this->textSize = (int) $textSize;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setTextColor()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setTextColor($textColor) {
|
||||
$this->textColor = (string) $textColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setAreaColor()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setAreaColor($areaColor) {
|
||||
$this->focusAreaColor1 = (string) $areaColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setAreaFocusColor()
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setAreaFocusColor($areaFocusColor) {
|
||||
$this->focusAreaColor2 = (string) $areaFocusColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if (strlen($this->text) > 0) {
|
||||
$xmlElement->setAttribute('text', $this->text);
|
||||
}
|
||||
if ($this->textId) {
|
||||
$xmlElement->setAttribute('textid', $this->textId);
|
||||
}
|
||||
if ($this->textPrefix) {
|
||||
$xmlElement->setAttribute('textprefix', $this->textPrefix);
|
||||
}
|
||||
if ($this->textEmboss) {
|
||||
$xmlElement->setAttribute('textemboss', $this->textEmboss);
|
||||
}
|
||||
if ($this->translate) {
|
||||
$xmlElement->setAttribute('translate', $this->translate);
|
||||
}
|
||||
if ($this->maxLines >= 0) {
|
||||
$xmlElement->setAttribute('maxlines', $this->maxLines);
|
||||
}
|
||||
if (strlen($this->action) > 0) {
|
||||
$xmlElement->setAttribute('action', $this->action);
|
||||
}
|
||||
if ($this->actionKey >= 0) {
|
||||
$xmlElement->setAttribute('actionkey', $this->actionKey);
|
||||
}
|
||||
if ($this->url) {
|
||||
$xmlElement->setAttribute('url', $this->url);
|
||||
}
|
||||
if ($this->manialink) {
|
||||
$xmlElement->setAttribute('manialink', $this->manialink);
|
||||
}
|
||||
if ($this->autoNewLine) {
|
||||
$xmlElement->setAttribute('autonewline', $this->autoNewLine);
|
||||
}
|
||||
if ($this->scriptEvents) {
|
||||
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
||||
}
|
||||
if ($this->style) {
|
||||
$xmlElement->setAttribute('style', $this->style);
|
||||
}
|
||||
if ($this->textSize >= 0) {
|
||||
$xmlElement->setAttribute('textsize', $this->textSize);
|
||||
}
|
||||
if ($this->textColor) {
|
||||
$xmlElement->setAttribute('textcolor', $this->textColor);
|
||||
}
|
||||
if ($this->focusAreaColor1) {
|
||||
$xmlElement->setAttribute('focusareacolor1', $this->focusAreaColor1);
|
||||
}
|
||||
if ($this->focusAreaColor2) {
|
||||
$xmlElement->setAttribute('focusareacolor2', $this->focusAreaColor2);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
54
application/core/Libs/FML/Controls/Labels/Label_Button.php
Normal file
54
application/core/Libs/FML/Controls/Labels/Label_Button.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Labels;
|
||||
|
||||
use FML\Controls\Label;
|
||||
|
||||
/**
|
||||
* Label Class for Button Styles
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Label_Button extends Label {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE_CardButtonMedium = 'CardButtonMedium';
|
||||
const STYLE_CardButtonMediumL = 'CardButtonMediumL';
|
||||
const STYLE_CardButtonMediumS = 'CardButtonMediumS';
|
||||
const STYLE_CardButtonMediumWide = 'CardButtonMediumWide';
|
||||
const STYLE_CardButtonMediumXL = 'CardButtonMediumXL';
|
||||
const STYLE_CardButtonMediumXS = 'CardButtonMediumXS';
|
||||
const STYLE_CardButtonMediumXXL = 'CardButtonMediumXXL';
|
||||
const STYLE_CardButtonMediumXXXL = 'CardButtonMediumXXXL';
|
||||
const STYLE_CardButtonSmall = 'CardButtonSmall';
|
||||
const STYLE_CardButtonSmallL = 'CardButtonSmallL';
|
||||
const STYLE_CardButtonSmallS = 'CardButtonSmallS';
|
||||
const STYLE_CardButtonSmallWide = 'CardButtonSmallWide';
|
||||
const STYLE_CardButtonSmallXL = 'CardButtonSmallXL';
|
||||
const STYLE_CardButtonSmallXS = 'CardButtonSmallXS';
|
||||
const STYLE_CardButtonSmallXXL = 'CardButtonSmallXXL';
|
||||
const STYLE_CardButtonSmallXXXL = 'CardButtonSmallXXXL';
|
||||
const STYLE_CardMain_Quit = 'CardMain_Quit';
|
||||
const STYLE_CardMain_Tool = 'CardMain_Tool';
|
||||
|
||||
/**
|
||||
* Create a new Label_Button Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Labels\Label_Button
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$labelButton = new Label_Button($id);
|
||||
return $labelButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Label_Button Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
}
|
||||
}
|
111
application/core/Libs/FML/Controls/Labels/Label_Text.php
Normal file
111
application/core/Libs/FML/Controls/Labels/Label_Text.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Labels;
|
||||
|
||||
use FML\Controls\Label;
|
||||
|
||||
/**
|
||||
* Label Class for Text Styles
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Label_Text extends Label {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE_AvatarButtonNormal = 'AvatarButtonNormal';
|
||||
const STYLE_BgMainMenuTitleHeader = 'BgMainMenuTitleHeader';
|
||||
const STYLE_Default = 'Default';
|
||||
const STYLE_FrameTransitionFromLeft = 'FrameTransitionFromLeft';
|
||||
const STYLE_FrameTransitionsFromRight = 'FrameTransitionsFromRight';
|
||||
const STYLE_ListItemMedal = 'ListItemMedal';
|
||||
const STYLE_Manialink_Body = 'Manialink_Body';
|
||||
const STYLE_ProgressBar = 'ProgressBar';
|
||||
const STYLE_ProgressBarSmall = 'ProgressBarSmall';
|
||||
const STYLE_SliderSmall = 'SliderSmall';
|
||||
const STYLE_SliderVolume = 'SliderVolume';
|
||||
const STYLE_StyleTextScriptEditor = 'StyleTextScriptEditor';
|
||||
const STYLE_StyleValueYellowSmall = 'StyleValueYellowSmall';
|
||||
const STYLE_TextActionMaker = 'TextActionMaker';
|
||||
const STYLE_TextButtonBig = 'TextButtonBig';
|
||||
const STYLE_TextButtonMedium = 'TextButtonMedium';
|
||||
const STYLE_TextButtonNav = 'TextButtonNav';
|
||||
const STYLE_TextButtonNavBack = 'TextButtonNavBack';
|
||||
const STYLE_TextButtonSmall = 'TextButtonSmall';
|
||||
const STYLE_TextCardInfoSmall = 'TextCardInfoSmall';
|
||||
const STYLE_TextCardInfoVerySmall = 'TextCardInfoVerySmall';
|
||||
const STYLE_TextCardMedium = 'TextCardMedium';
|
||||
const STYLE_TextCardRaceRank = 'TextCardRaceRank';
|
||||
const STYLE_TextCardScores2 = 'TextCardScores2';
|
||||
const STYLE_TextCardSmall = 'TextCardSmall';
|
||||
const STYLE_TextCardSmallScores2 = 'TextCardSmallScores2';
|
||||
const STYLE_TextCardSmallScores2Rank = 'TextCardSmallScores2Rank';
|
||||
const STYLE_TextChallengeNameMedal = 'TextChallengeNameMedal';
|
||||
const STYLE_TextChallengeNameMedalNone = 'TextChallengeNameMedalNone';
|
||||
const STYLE_TextChallengeNameMedium = 'TextChallengeNameMedium';
|
||||
const STYLE_TextChallengeNameSmall = 'TextChallengeNameSmall';
|
||||
const STYLE_TextCongratsBig = 'TextCongratsBig';
|
||||
const STYLE_TextCredits = 'TextCredits';
|
||||
const STYLE_TextCreditsTitle = 'TextCreditsTitle';
|
||||
const STYLE_TextEditorArticle = 'TextEditorArticle';
|
||||
const STYLE_TextInfoMedium = 'TextInfoMedium';
|
||||
const STYLE_TextInfoSmall = 'TextInfoSmall';
|
||||
const STYLE_TextPlayerCardName = 'TextPlayerCardName';
|
||||
const STYLE_TextPlayerCardScore = 'TextPlayerCardScore';
|
||||
const STYLE_TextRaceChat = 'TextRaceChat';
|
||||
const STYLE_TextRaceChrono = 'TextRaceChrono';
|
||||
const STYLE_TextRaceChronoError = 'TextRaceChronoError';
|
||||
const STYLE_TextRaceChronoOfficial = 'TextRaceChronoOfficial';
|
||||
const STYLE_TextRaceChronoWarning = 'TextRaceChronoWarning';
|
||||
const STYLE_TextRaceMessage = 'TextRaceMessage';
|
||||
const STYLE_TextRaceMessageBig = 'TextRaceMessageBig';
|
||||
const STYLE_TextRaceStaticSmall = 'TextRaceStaticSmall';
|
||||
const STYLE_TextRaceValueSmall = 'TextRaceValueSmall';
|
||||
const STYLE_TextRankingsBig = 'TextRankingsBig';
|
||||
const STYLE_TextSPScoreBig = 'TextSPScoreBig';
|
||||
const STYLE_TextSPScoreMedium = 'TextSPScoreMedium';
|
||||
const STYLE_TextSPScoreSmall = 'TextSPScoreSmall';
|
||||
const STYLE_TextStaticMedium = 'TextStaticMedium';
|
||||
const STYLE_TextStaticSmall = 'TextStaticSmall';
|
||||
const STYLE_TextStaticVerySmall = 'TextStaticVerySmall';
|
||||
const STYLE_TextSubTitle1 = 'TextSubTitle1';
|
||||
const STYLE_TextSubTitle2 = 'TextSubTitle2';
|
||||
const STYLE_TextTips = 'TextTips';
|
||||
const STYLE_TextTitle1 = 'TextTitle1';
|
||||
const STYLE_TextTitle2 = 'TextTitle2';
|
||||
const STYLE_TextTitle2Blink = 'TextTitle2Blink';
|
||||
const STYLE_TextTitle3 = 'TextTitle3';
|
||||
const STYLE_TextTitle3Header = 'TextTitle3Header';
|
||||
const STYLE_TextTitleError = 'TextTitleError';
|
||||
const STYLE_TextValueBig = 'TextValueBig';
|
||||
const STYLE_TextValueMedium = 'TextValueMedium';
|
||||
const STYLE_TextValueSmall = 'TextValueSmall';
|
||||
const STYLE_TextValueSmallSm = 'TextValueSmallSm';
|
||||
const STYLE_TrackerText = 'TrackerText';
|
||||
const STYLE_TrackerTextBig = 'TrackerTextBig';
|
||||
const STYLE_TrackListItem = 'TrackListItem';
|
||||
const STYLE_TrackListLine = 'TrackListLine';
|
||||
const STYLE_UiDriving_BgBottom = 'UiDriving_BgBottom';
|
||||
const STYLE_UiDriving_BgCard = 'UiDriving_BgCard';
|
||||
const STYLE_UiDriving_BgCenter = 'UiDriving_BgCenter';
|
||||
|
||||
/**
|
||||
* Create a new Label_Text Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Labels\Label_Text
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$labelText = new Label_Text($id);
|
||||
return $labelText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Label_Text Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
}
|
||||
}
|
311
application/core/Libs/FML/Controls/Quad.php
Normal file
311
application/core/Libs/FML/Controls/Quad.php
Normal file
@ -0,0 +1,311 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Actionable;
|
||||
use FML\Types\BgColorable;
|
||||
use FML\Types\Linkable;
|
||||
use FML\Types\Scriptable;
|
||||
use FML\Types\Styleable;
|
||||
use FML\Types\SubStyleable;
|
||||
|
||||
/**
|
||||
* Quad Control
|
||||
* (CMlQuad)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad extends Control implements Actionable, BgColorable, Linkable, Scriptable, Styleable, SubStyleable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $image = '';
|
||||
protected $imageId = '';
|
||||
protected $imageFocus = '';
|
||||
protected $imageFocusId = '';
|
||||
protected $colorize = '';
|
||||
protected $modulizeColor = '';
|
||||
protected $autoScale = 1;
|
||||
protected $action = '';
|
||||
protected $actionKey = -1;
|
||||
protected $bgColor = '';
|
||||
protected $url = '';
|
||||
protected $urlId = '';
|
||||
protected $manialink = '';
|
||||
protected $manialinkId = '';
|
||||
protected $scriptEvents = 0;
|
||||
protected $style = '';
|
||||
protected $subStyle = '';
|
||||
|
||||
/**
|
||||
* Create a new Quad Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quad = new Quad($id);
|
||||
return $quad;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'quad';
|
||||
$this->setZ(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Image Url
|
||||
*
|
||||
* @param string $image Image Url
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setImage($image) {
|
||||
$this->image = (string) $image;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Image Id to use from the Dico
|
||||
*
|
||||
* @param string $imageId Image Id
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setImageId($imageId) {
|
||||
$this->imageId = (string) $imageId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Image Url
|
||||
*
|
||||
* @param string $imageFocus Focus Image Url
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setImageFocus($imageFocus) {
|
||||
$this->imageFocus = (string) $imageFocus;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Image Id to use from the Dico
|
||||
*
|
||||
* @param string $imageFocusId Focus Image Id
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setImageFocusId($imageFocusId) {
|
||||
$this->imageFocusId = (string) $imageFocusId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Colorization
|
||||
*
|
||||
* @param string $colorize Colorize Value
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setColorize($colorize) {
|
||||
$this->colorize = (string) $colorize;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Modulization
|
||||
*
|
||||
* @param string $modulizeColor Modulize Value
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setModulizeColor($modulizeColor) {
|
||||
$this->modulizeColor = (string) $modulizeColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the automatic Image Scaling
|
||||
*
|
||||
* @param bool $autoScale Whether the Image should scale automatically
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setAutoScale($autoScale) {
|
||||
$this->autoScale = ($autoScale ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::setAction()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setAction($action) {
|
||||
$this->action = (string) $action;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::getAction()
|
||||
*/
|
||||
public function getAction() {
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::setActionKey()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setActionKey($actionKey) {
|
||||
$this->actionKey = (int) $actionKey;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\BgColorable::setBgColor()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setBgColor($bgColor) {
|
||||
$this->bgColor = (string) $bgColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setUrl()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setUrlId()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setUrlId($urlId) {
|
||||
$this->urlId = (string) $urlId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setManialink()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setManialink($manialink) {
|
||||
$this->manialink = (string) $manialink;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setManialinkId()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setManialinkId($manialinkId) {
|
||||
$this->manialinkId = (string) $manialinkId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
$this->scriptEvents = ($scriptEvents ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Styleable::setStyle()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setStyle($style) {
|
||||
$this->style = (string) $style;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\SubStyleable::setSubStyle()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setSubStyle($subStyle) {
|
||||
$this->subStyle = (string) $subStyle;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\SubStyleable::setStyles()
|
||||
* @return \FML\Controls\Quad
|
||||
*/
|
||||
public function setStyles($style, $subStyle) {
|
||||
$this->setStyle($style);
|
||||
$this->setSubStyle($subStyle);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->image) {
|
||||
$xmlElement->setAttribute('image', $this->image);
|
||||
}
|
||||
if ($this->imageId) {
|
||||
$xmlElement->setAttribute('imageid', $this->imageId);
|
||||
}
|
||||
if ($this->imageFocus) {
|
||||
$xmlElement->setAttribute('imagefocus', $this->imageFocus);
|
||||
}
|
||||
if ($this->imageFocusId) {
|
||||
$xmlElement->setAttribute('imagefocusid', $this->imageFocusId);
|
||||
}
|
||||
if ($this->colorize) {
|
||||
$xmlElement->setAttribute('colorize', $this->colorize);
|
||||
}
|
||||
if ($this->modulizeColor) {
|
||||
$xmlElement->setAttribute('modulizecolor', $this->modulizeColor);
|
||||
}
|
||||
if (!$this->autoScale) {
|
||||
$xmlElement->setAttribute('autoscale', $this->autoScale);
|
||||
}
|
||||
if (strlen($this->action) > 0) {
|
||||
$xmlElement->setAttribute('action', $this->action);
|
||||
}
|
||||
if ($this->actionKey >= 0) {
|
||||
$xmlElement->setAttribute('actionkey', $this->actionKey);
|
||||
}
|
||||
if ($this->bgColor) {
|
||||
$xmlElement->setAttribute('bgcolor', $this->bgColor);
|
||||
}
|
||||
if ($this->url) {
|
||||
$xmlElement->setAttribute('url', $this->url);
|
||||
}
|
||||
if ($this->manialink) {
|
||||
$xmlElement->setAttribute('manialink', $this->manialink);
|
||||
}
|
||||
if ($this->scriptEvents) {
|
||||
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
||||
}
|
||||
if ($this->style) {
|
||||
$xmlElement->setAttribute('style', $this->style);
|
||||
}
|
||||
if ($this->subStyle) {
|
||||
$xmlElement->setAttribute('substyle', $this->subStyle);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
42
application/core/Libs/FML/Controls/Quads/Quad_321Go.php
Normal file
42
application/core/Libs/FML/Controls/Quads/Quad_321Go.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for '321Go' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_321Go extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = '321Go';
|
||||
const SUBSTYLE_3 = '3';
|
||||
const SUBSTYLE_2 = '2';
|
||||
const SUBSTYLE_1 = '1';
|
||||
const SUBSTYLE_Go = 'Go!';
|
||||
|
||||
/**
|
||||
* Create a new Quad_321Go Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_321Go
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quad321Go = new Quad_321Go($id);
|
||||
return $quad321Go;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_321Go Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'BgRaceScore2' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_BgRaceScore2 extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'BgRaceScore2';
|
||||
const SUBSTYLE_BgCardPlayer = 'BgCardPlayer';
|
||||
const SUBSTYLE_BgCardServer = 'BgCardServer';
|
||||
const SUBSTYLE_BgScores = 'BgScores';
|
||||
const SUBSTYLE_Cartouche = 'Cartouche';
|
||||
const SUBSTYLE_CartoucheLine = 'CartoucheLine';
|
||||
const SUBSTYLE_CupFinisher = 'CupFinisher';
|
||||
const SUBSTYLE_CupPotentialFinisher = 'CupPotentialFinisher';
|
||||
const SUBSTYLE_Fame = 'Fame';
|
||||
const SUBSTYLE_Handle = 'Handle';
|
||||
const SUBSTYLE_HandleBlue = 'HandleBlue';
|
||||
const SUBSTYLE_HandleRed = 'HandleRed';
|
||||
const SUBSTYLE_HandleSelectable = 'HandleSelectable';
|
||||
const SUBSTYLE_IsLadderDisabled = 'IsLadderDisabled';
|
||||
const SUBSTYLE_IsLocalPlayer = 'IsLocalPlayer';
|
||||
const SUBSTYLE_LadderPoints = 'LadderPoints';
|
||||
const SUBSTYLE_LadderRank = 'LadderRank';
|
||||
const SUBSTYLE_Laps = 'Laps';
|
||||
const SUBSTYLE_Podium = 'Podium';
|
||||
const SUBSTYLE_Points = 'Points';
|
||||
const SUBSTYLE_SandTimer = 'SandTimer';
|
||||
const SUBSTYLE_ScoreLink = 'ScoreLink';
|
||||
const SUBSTYLE_ScoreReplay = 'ScoreReplay';
|
||||
const SUBSTYLE_SendScore = 'SendScore';
|
||||
const SUBSTYLE_Speaking = 'Speaking';
|
||||
const SUBSTYLE_Spectator = 'Spectator';
|
||||
const SUBSTYLE_Tv = 'Tv';
|
||||
const SUBSTYLE_Warmup = 'Warmup';
|
||||
|
||||
/**
|
||||
* Create a new Quad_BgRaceScore2 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_BgRaceScore2
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadBgRaceScore2 = new Quad_BgRaceScore2($id);
|
||||
return $quadBgRaceScore2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_BgRaceScore2 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
102
application/core/Libs/FML/Controls/Quads/Quad_Bgs1.php
Normal file
102
application/core/Libs/FML/Controls/Quads/Quad_Bgs1.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Bgs1' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Bgs1 extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Bgs1';
|
||||
const SUBSTYLE_ArrowDown = 'ArrowDown';
|
||||
const SUBSTYLE_ArrowLeft = 'ArrowLeft';
|
||||
const SUBSTYLE_ArrowRight = 'ArrowRight';
|
||||
const SUBSTYLE_ArrowUp = 'ArrowUp';
|
||||
const SUBSTYLE_BgButton = 'BgButton';
|
||||
const SUBSTYLE_BgButtonBig = 'BgButtonBig';
|
||||
const SUBSTYLE_BgButtonGlow = 'BgButtonGlow';
|
||||
const SUBSTYLE_BgButtonGrayed = 'BgButtonGrayed';
|
||||
const SUBSTYLE_BgButtonOff = 'BgButtonOff';
|
||||
const SUBSTYLE_BgButtonShadow = 'BgButtonShadow';
|
||||
const SUBSTYLE_BgButtonSmall = 'BgButtonSmall';
|
||||
const SUBSTYLE_BgCard = 'BgCard';
|
||||
const SUBSTYLE_BgCard1 = 'BgCard1';
|
||||
const SUBSTYLE_BgCard2 = 'BgCard2';
|
||||
const SUBSTYLE_BgCard3 = 'BgCard3';
|
||||
const SUBSTYLE_BgCardBuddy = 'BgCardBuddy';
|
||||
const SUBSTYLE_BgCardChallenge = 'BgCardChallenge';
|
||||
const SUBSTYLE_BgCardFolder = 'BgCardFolder';
|
||||
const SUBSTYLE_BgCardInventoryItem = 'BgCardInventoryItem';
|
||||
const SUBSTYLE_BgCardList = 'BgCardList';
|
||||
const SUBSTYLE_BgCardOnline = 'BgCardOnline';
|
||||
const SUBSTYLE_BgCardPlayer = 'BgCardPlayer';
|
||||
const SUBSTYLE_BgCardSystem = 'BgCardSystem';
|
||||
const SUBSTYLE_BgCardZone = 'BgCardZone';
|
||||
const SUBSTYLE_BgColorContour = 'BgColorContour';
|
||||
const SUBSTYLE_BgDialogBlur = 'BgDialogBlur';
|
||||
const SUBSTYLE_BgEmpty = 'BgEmpty';
|
||||
const SUBSTYLE_BgGradBottom = 'BgGradBottom';
|
||||
const SUBSTYLE_BgGradLeft = 'BgGradLeft';
|
||||
const SUBSTYLE_BgGradRight = 'BgGradRight';
|
||||
const SUBSTYLE_BgGradTop = 'BgGradTop';
|
||||
const SUBSTYLE_BgGradV = 'BgGradV';
|
||||
const SUBSTYLE_BgHealthBar = 'BgHealthBar';
|
||||
const SUBSTYLE_BgIconBorder = 'BgIconBorder';
|
||||
const SUBSTYLE_BgList = 'BgList';
|
||||
const SUBSTYLE_BgListLine = 'BgListLine';
|
||||
const SUBSTYLE_BgPager = 'BgPager';
|
||||
const SUBSTYLE_BgProgressBar = 'BgProgressBar';
|
||||
const SUBSTYLE_BgShadow = 'BgShadow';
|
||||
const SUBSTYLE_BgSlider = 'BgSlider';
|
||||
const SUBSTYLE_BgSystemBar = 'BgSystemBar';
|
||||
const SUBSTYLE_BgTitle2 = 'BgTitle2';
|
||||
const SUBSTYLE_BgTitle3 = 'BgTitle3';
|
||||
const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1';
|
||||
const SUBSTYLE_BgTitle3_2 = 'BgTitle3_2';
|
||||
const SUBSTYLE_BgTitle3_3 = 'BgTitle3_3';
|
||||
const SUBSTYLE_BgTitle3_4 = 'BgTitle3_4';
|
||||
const SUBSTYLE_BgTitle3_5 = 'BgTitle3_5';
|
||||
const SUBSTYLE_BgTitleGlow = 'BgTitleGlow';
|
||||
const SUBSTYLE_BgTitlePage = 'BgTitlePage';
|
||||
const SUBSTYLE_BgTitleShadow = 'BgTitleShadow';
|
||||
const SUBSTYLE_BgWindow1 = 'BgWindow1';
|
||||
const SUBSTYLE_BgWindow2 = 'BgWindow2';
|
||||
const SUBSTYLE_BgWindow3 = 'BgWindow3';
|
||||
const SUBSTYLE_EnergyBar = 'EnergyBar';
|
||||
const SUBSTYLE_EnergyTeam2 = 'EnergyTeam2';
|
||||
const SUBSTYLE_Glow = 'Glow';
|
||||
const SUBSTYLE_HealthBar = 'HealthBar';
|
||||
const SUBSTYLE_NavButton = 'NavButton';
|
||||
const SUBSTYLE_NavButtonBlink = 'NavButtonBlink';
|
||||
const SUBSTYLE_NavButtonQuit = 'NavButtonQuit';
|
||||
const SUBSTYLE_ProgressBar = 'ProgressBar';
|
||||
const SUBSTYLE_ProgressBarSmall = 'ProgressBarSmall';
|
||||
const SUBSTYLE_Shadow = 'Shadow';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Bgs1 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Bgs1
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadBgs1 = new Quad_Bgs1($id);
|
||||
return $quadBgs1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Bgs1 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
102
application/core/Libs/FML/Controls/Quads/Quad_Bgs1InRace.php
Normal file
102
application/core/Libs/FML/Controls/Quads/Quad_Bgs1InRace.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Bgs1InRace' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Bgs1InRace extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Bgs1InRace';
|
||||
const SUBSTYLE_ArrowDown = 'ArrowDown';
|
||||
const SUBSTYLE_ArrowLeft = 'ArrowLeft';
|
||||
const SUBSTYLE_ArrowRight = 'ArrowRight';
|
||||
const SUBSTYLE_ArrowUp = 'ArrowUp';
|
||||
const SUBSTYLE_BgButton = 'BgButton';
|
||||
const SUBSTYLE_BgButtonBig = 'BgButtonBig';
|
||||
const SUBSTYLE_BgButtonGlow = 'BgButtonGlow';
|
||||
const SUBSTYLE_BgButtonGrayed = 'BgButtonGrayed';
|
||||
const SUBSTYLE_BgButtonOff = 'BgButtonOff';
|
||||
const SUBSTYLE_BgButtonShadow = 'BgButtonShadow';
|
||||
const SUBSTYLE_BgButtonSmall = 'BgButtonSmall';
|
||||
const SUBSTYLE_BgCard = 'BgCard';
|
||||
const SUBSTYLE_BgCard1 = 'BgCard1';
|
||||
const SUBSTYLE_BgCard2 = 'BgCard2';
|
||||
const SUBSTYLE_BgCard3 = 'BgCard3';
|
||||
const SUBSTYLE_BgCardBuddy = 'BgCardBuddy';
|
||||
const SUBSTYLE_BgCardChallenge = 'BgCardChallenge';
|
||||
const SUBSTYLE_BgCardFolder = 'BgCardFolder';
|
||||
const SUBSTYLE_BgCardInventoryItem = 'BgCardInventoryItem';
|
||||
const SUBSTYLE_BgCardList = 'BgCardList';
|
||||
const SUBSTYLE_BgCardOnline = 'BgCardOnline';
|
||||
const SUBSTYLE_BgCardPlayer = 'BgCardPlayer';
|
||||
const SUBSTYLE_BgCardSystem = 'BgCardSystem';
|
||||
const SUBSTYLE_BgCardZone = 'BgCardZone';
|
||||
const SUBSTYLE_BgColorContour = 'BgColorContour';
|
||||
const SUBSTYLE_BgDialogBlur = 'BgDialogBlur';
|
||||
const SUBSTYLE_BgEmpty = 'BgEmpty';
|
||||
const SUBSTYLE_BgGradBottom = 'BgGradBottom';
|
||||
const SUBSTYLE_BgGradLeft = 'BgGradLeft';
|
||||
const SUBSTYLE_BgGradRight = 'BgGradRight';
|
||||
const SUBSTYLE_BgGradTop = 'BgGradTop';
|
||||
const SUBSTYLE_BgGradV = 'BgGradV';
|
||||
const SUBSTYLE_BgHealthBar = 'BgHealthBar';
|
||||
const SUBSTYLE_BgIconBorder = 'BgIconBorder';
|
||||
const SUBSTYLE_BgList = 'BgList';
|
||||
const SUBSTYLE_BgListLine = 'BgListLine';
|
||||
const SUBSTYLE_BgPager = 'BgPager';
|
||||
const SUBSTYLE_BgProgressBar = 'BgProgressBar';
|
||||
const SUBSTYLE_BgShadow = 'BgShadow';
|
||||
const SUBSTYLE_BgSlider = 'BgSlider';
|
||||
const SUBSTYLE_BgSystemBar = 'BgSystemBar';
|
||||
const SUBSTYLE_BgTitle2 = 'BgTitle2';
|
||||
const SUBSTYLE_BgTitle3 = 'BgTitle3';
|
||||
const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1';
|
||||
const SUBSTYLE_BgTitle3_2 = 'BgTitle3_2';
|
||||
const SUBSTYLE_BgTitle3_3 = 'BgTitle3_3';
|
||||
const SUBSTYLE_BgTitle3_4 = 'BgTitle3_4';
|
||||
const SUBSTYLE_BgTitle3_5 = 'BgTitle3_5';
|
||||
const SUBSTYLE_BgTitleGlow = 'BgTitleGlow';
|
||||
const SUBSTYLE_BgTitlePage = 'BgTitlePage';
|
||||
const SUBSTYLE_BgTitleShadow = 'BgTitleShadow';
|
||||
const SUBSTYLE_BgWindow1 = 'BgWindow1';
|
||||
const SUBSTYLE_BgWindow2 = 'BgWindow2';
|
||||
const SUBSTYLE_BgWindow3 = 'BgWindow3';
|
||||
const SUBSTYLE_EnergyBar = 'EnergyBar';
|
||||
const SUBSTYLE_EnergyTeam2 = 'EnergyTeam2';
|
||||
const SUBSTYLE_Glow = 'Glow';
|
||||
const SUBSTYLE_HealthBar = 'HealthBar';
|
||||
const SUBSTYLE_NavButton = 'NavButton';
|
||||
const SUBSTYLE_NavButtonBlink = 'NavButtonBlink';
|
||||
const SUBSTYLE_NavButtonQuit = 'NavButtonQuit';
|
||||
const SUBSTYLE_ProgressBar = 'ProgressBar';
|
||||
const SUBSTYLE_ProgressBarSmall = 'ProgressBarSmall';
|
||||
const SUBSTYLE_Shadow = 'Shadow';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Bgs1InRace Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Bgs1InRace
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadBgs1InRace = new Quad_Bgs1InRace($id);
|
||||
return $quadBgs1InRace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Bgs1InRace Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'BgsChallengeMedals' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_BgsChallengeMedals extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'BgsChallengeMedals';
|
||||
const SUBSTYLE_BgBronze = 'BgBronze';
|
||||
const SUBSTYLE_BgGold = 'BgGold';
|
||||
const SUBSTYLE_BgNadeo = 'BgNadeo';
|
||||
const SUBSTYLE_BgNotPlayed = 'BgNotPlayed';
|
||||
const SUBSTYLE_BgPlayed = 'BgPlayed';
|
||||
const SUBSTYLE_BgSilver = 'BgSilver';
|
||||
|
||||
/**
|
||||
* Create a new Quad_BgsChallengeMedals Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_BgsChallengeMedals
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadBgsChallengeMedals = new Quad_BgsChallengeMedals($id);
|
||||
return $quadBgsChallengeMedals;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_BgsChallengeMedals Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'BgsPlayerCard' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_BgsPlayerCard extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'BgsPlayerCard';
|
||||
const SUBSTYLE_BgActivePlayerCard = 'BgActivePlayerCard';
|
||||
const SUBSTYLE_BgActivePlayerName = 'BgActivePlayerName';
|
||||
const SUBSTYLE_BgActivePlayerScore = 'BgActivePlayerScore';
|
||||
const SUBSTYLE_BgCard = 'BgCard';
|
||||
const SUBSTYLE_BgCardSystem = 'BgCardSystem';
|
||||
const SUBSTYLE_BgMediaTracker = 'BgMediaTracker';
|
||||
const SUBSTYLE_BgPlayerCard = 'BgPlayerCard';
|
||||
const SUBSTYLE_BgPlayerCardBig = 'BgPlayerCardBig';
|
||||
const SUBSTYLE_BgPlayerCardSmall = 'BgPlayerCardSmall';
|
||||
const SUBSTYLE_BgPlayerName = 'BgPlayerName';
|
||||
const SUBSTYLE_BgPlayerScore = 'BgPlayerScore';
|
||||
const SUBSTYLE_BgRacePlayerLine = 'BgRacePlayerLine';
|
||||
const SUBSTYLE_BgRacePlayerName = 'BgRacePlayerName';
|
||||
const SUBSTYLE_ProgressBar = 'ProgressBar';
|
||||
|
||||
/**
|
||||
* Create a new Quad_BgsPlayerCard Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_BgsPlayerCard
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadBgsPlayerCard = new Quad_BgsPlayerCard($id);
|
||||
return $quadBgsPlayerCard;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_BgsPlayerCard Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
50
application/core/Libs/FML/Controls/Quads/Quad_Copilot.php
Normal file
50
application/core/Libs/FML/Controls/Quads/Quad_Copilot.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Copilot' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Copilot extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Copilot';
|
||||
const SUBSTYLE_Down = 'Down';
|
||||
const SUBSTYLE_DownGood = 'DownGood';
|
||||
const SUBSTYLE_DownWrong = 'DownWrong';
|
||||
const SUBSTYLE_Left = 'Left';
|
||||
const SUBSTYLE_LeftGood = 'LeftGood';
|
||||
const SUBSTYLE_LeftWrong = 'LeftWrong';
|
||||
const SUBSTYLE_Right = 'Right';
|
||||
const SUBSTYLE_RightGood = 'RightGood';
|
||||
const SUBSTYLE_RightWrong = 'RightWrong';
|
||||
const SUBSTYLE_Up = 'Up';
|
||||
const SUBSTYLE_UpGood = 'UpGood';
|
||||
const SUBSTYLE_UpWrong = 'UpWrong';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Copilot Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Copilot
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadCopilot = new Quad_Copilot($id);
|
||||
return $quadCopilot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Copilot Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
41
application/core/Libs/FML/Controls/Quads/Quad_Emblems.php
Normal file
41
application/core/Libs/FML/Controls/Quads/Quad_Emblems.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Emblems' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Emblems extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Emblems';
|
||||
const SUBSTYLE_0 = '#0';
|
||||
const SUBSTYLE_1 = '#1';
|
||||
const SUBSTYLE_2 = '#2';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Emblems Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Emblems
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadEmblems = new Quad_Emblems($id);
|
||||
return $quadEmblems;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Emblems Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
44
application/core/Libs/FML/Controls/Quads/Quad_EnergyBar.php
Normal file
44
application/core/Libs/FML/Controls/Quads/Quad_EnergyBar.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'EnergyBar' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_EnergyBar extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'EnergyBar';
|
||||
const SUBSTYLE_BgText = 'BgText';
|
||||
const SUBSTYLE_EnergyBar = 'EnergyBar';
|
||||
const SUBSTYLE_EnergyBar_0_25 = 'EnergyBar_0.25';
|
||||
const SUBSTYLE_EnergyBar_Thin = 'EnergyBar_Thin';
|
||||
const SUBSTYLE_HeaderGaugeLeft = 'HeaderGaugeLeft';
|
||||
const SUBSTYLE_HeaderGaugeRight = 'HeaderGaugeRight';
|
||||
|
||||
/**
|
||||
* Create a new Quad_EnergyBar Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_EnergyBar
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadEnergybar = new Quad_EnergyBar($id);
|
||||
return $quadEnergybar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_EnergyBar Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Hud3dEchelons' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Hud3dEchelons extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Hud3dEchelons';
|
||||
const SUBSTYLE_EchelonBronze1 = 'EchelonBronze1';
|
||||
const SUBSTYLE_EchelonBronze2 = 'EchelonBronze2';
|
||||
const SUBSTYLE_EchelonBronze3 = 'EchelonBronze3';
|
||||
const SUBSTYLE_EchelonGold1 = 'EchelonGold1';
|
||||
const SUBSTYLE_EchelonGold2 = 'EchelonGold2';
|
||||
const SUBSTYLE_EchelonGold3 = 'EchelonGold3';
|
||||
const SUBSTYLE_EchelonSilver1 = 'EchelonSilver1';
|
||||
const SUBSTYLE_EchelonSilver2 = 'EchelonSilver2';
|
||||
const SUBSTYLE_EchelonSilver3 = 'EchelonSilver3';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Hud3dEchelons Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Hud3dEchelons
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadHud3dEchelons = new Quad_Hud3dEchelons($id);
|
||||
return $quadHud3dEchelons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Hud3dEchelons Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
102
application/core/Libs/FML/Controls/Quads/Quad_Icons128x128_1.php
Normal file
102
application/core/Libs/FML/Controls/Quads/Quad_Icons128x128_1.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Icons128x128_1' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons128x128_1 extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons128x128_1';
|
||||
const SUBSTYLE_Advanced = 'Advanced';
|
||||
const SUBSTYLE_Back = 'Back';
|
||||
const SUBSTYLE_BackFocusable = 'BackFocusable';
|
||||
const SUBSTYLE_Beginner = 'Beginner';
|
||||
const SUBSTYLE_Browse = 'Browse';
|
||||
const SUBSTYLE_Buddies = 'Buddies';
|
||||
const SUBSTYLE_Challenge = 'Challenge';
|
||||
const SUBSTYLE_ChallengeAuthor = 'ChallengeAuthor';
|
||||
const SUBSTYLE_Coppers = 'Coppers';
|
||||
const SUBSTYLE_Create = 'Create';
|
||||
const SUBSTYLE_Credits = 'Credits';
|
||||
const SUBSTYLE_Custom = 'Custom';
|
||||
const SUBSTYLE_CustomStars = 'CustomStars';
|
||||
const SUBSTYLE_Default = 'Default';
|
||||
const SUBSTYLE_Download = 'Download';
|
||||
const SUBSTYLE_Easy = 'Easy';
|
||||
const SUBSTYLE_Editor = 'Editor';
|
||||
const SUBSTYLE_Event = 'Event';
|
||||
const SUBSTYLE_Extreme = 'Extreme';
|
||||
const SUBSTYLE_Forever = 'Forever';
|
||||
const SUBSTYLE_GhostEditor = 'GhostEditor';
|
||||
const SUBSTYLE_Hard = 'Hard';
|
||||
const SUBSTYLE_Hotseat = 'Hotseat';
|
||||
const SUBSTYLE_Inputs = 'Inputs';
|
||||
const SUBSTYLE_Invite = 'Invite';
|
||||
const SUBSTYLE_LadderPoints = 'LadderPoints';
|
||||
const SUBSTYLE_Lan = 'Lan';
|
||||
const SUBSTYLE_Launch = 'Launch';
|
||||
const SUBSTYLE_Load = 'Load';
|
||||
const SUBSTYLE_LoadTrack = 'LoadTrack';
|
||||
const SUBSTYLE_Manialink = 'Manialink';
|
||||
const SUBSTYLE_ManiaZones = 'ManiaZones';
|
||||
const SUBSTYLE_MedalCount = 'MedalCount';
|
||||
const SUBSTYLE_MediaTracker = 'MediaTracker';
|
||||
const SUBSTYLE_Medium = 'Medium';
|
||||
const SUBSTYLE_Multiplayer = 'Multiplayer';
|
||||
const SUBSTYLE_Nations = 'Nations';
|
||||
const SUBSTYLE_NewTrack = 'NewTrack';
|
||||
const SUBSTYLE_Options = 'Options';
|
||||
const SUBSTYLE_Padlock = 'Padlock';
|
||||
const SUBSTYLE_Paint = 'Paint';
|
||||
const SUBSTYLE_Platform = 'Platform';
|
||||
const SUBSTYLE_PlayerPage = 'PlayerPage';
|
||||
const SUBSTYLE_Profile = 'Profile';
|
||||
const SUBSTYLE_ProfileAdvanced = 'ProfileAdvanced';
|
||||
const SUBSTYLE_ProfileVehicle = 'ProfileVehicle';
|
||||
const SUBSTYLE_Puzzle = 'Puzzle';
|
||||
const SUBSTYLE_Quit = 'Quit';
|
||||
const SUBSTYLE_Race = 'Race';
|
||||
const SUBSTYLE_Rankings = 'Rankings';
|
||||
const SUBSTYLE_Replay = 'Replay';
|
||||
const SUBSTYLE_Save = 'Save';
|
||||
const SUBSTYLE_ServersAll = 'ServersAll';
|
||||
const SUBSTYLE_ServersFavorites = 'ServersFavorites';
|
||||
const SUBSTYLE_ServersSuggested = 'ServersSuggested';
|
||||
const SUBSTYLE_Share = 'Share';
|
||||
const SUBSTYLE_ShareBlink = 'ShareBlink';
|
||||
const SUBSTYLE_SkillPoints = 'SkillPoints';
|
||||
const SUBSTYLE_Solo = 'Solo';
|
||||
const SUBSTYLE_Statistics = 'Statistics';
|
||||
const SUBSTYLE_Stunts = 'Stunts';
|
||||
const SUBSTYLE_United = 'United';
|
||||
const SUBSTYLE_Upload = 'Upload';
|
||||
const SUBSTYLE_Vehicles = 'Vehicles';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Icons128x128_1 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Icons128x128_1
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadIcons128x128_1 = new Quad_Icons128x128_1($id);
|
||||
return $quadIcons128x128_1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Icons128x128_1 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Icons128x128_Blink' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons128x128_Blink extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons128x128_Blink';
|
||||
const SUBSTYLE_Advanced = 'Advanced';
|
||||
const SUBSTYLE_Back = 'Back';
|
||||
const SUBSTYLE_BackFocusable = 'BackFocusable';
|
||||
const SUBSTYLE_Beginner = 'Beginner';
|
||||
const SUBSTYLE_Browse = 'Browse';
|
||||
const SUBSTYLE_Buddies = 'Buddies';
|
||||
const SUBSTYLE_Challenge = 'Challenge';
|
||||
const SUBSTYLE_ChallengeAuthor = 'ChallengeAuthor';
|
||||
const SUBSTYLE_Coppers = 'Coppers';
|
||||
const SUBSTYLE_Create = 'Create';
|
||||
const SUBSTYLE_Credits = 'Credits';
|
||||
const SUBSTYLE_Custom = 'Custom';
|
||||
const SUBSTYLE_CustomStars = 'CustomStars';
|
||||
const SUBSTYLE_Default = 'Default';
|
||||
const SUBSTYLE_Download = 'Download';
|
||||
const SUBSTYLE_Easy = 'Easy';
|
||||
const SUBSTYLE_Editor = 'Editor';
|
||||
const SUBSTYLE_Event = 'Event';
|
||||
const SUBSTYLE_Extreme = 'Extreme';
|
||||
const SUBSTYLE_Forever = 'Forever';
|
||||
const SUBSTYLE_GhostEditor = 'GhostEditor';
|
||||
const SUBSTYLE_Hard = 'Hard';
|
||||
const SUBSTYLE_Hotseat = 'Hotseat';
|
||||
const SUBSTYLE_Inputs = 'Inputs';
|
||||
const SUBSTYLE_Invite = 'Invite';
|
||||
const SUBSTYLE_LadderPoints = 'LadderPoints';
|
||||
const SUBSTYLE_Lan = 'Lan';
|
||||
const SUBSTYLE_Launch = 'Launch';
|
||||
const SUBSTYLE_Load = 'Load';
|
||||
const SUBSTYLE_LoadTrack = 'LoadTrack';
|
||||
const SUBSTYLE_Manialink = 'Manialink';
|
||||
const SUBSTYLE_ManiaZones = 'ManiaZones';
|
||||
const SUBSTYLE_MedalCount = 'MedalCount';
|
||||
const SUBSTYLE_MediaTracker = 'MediaTracker';
|
||||
const SUBSTYLE_Medium = 'Medium';
|
||||
const SUBSTYLE_Multiplayer = 'Multiplayer';
|
||||
const SUBSTYLE_Nations = 'Nations';
|
||||
const SUBSTYLE_NewTrack = 'NewTrack';
|
||||
const SUBSTYLE_Options = 'Options';
|
||||
const SUBSTYLE_Padlock = 'Padlock';
|
||||
const SUBSTYLE_Paint = 'Paint';
|
||||
const SUBSTYLE_Platform = 'Platform';
|
||||
const SUBSTYLE_PlayerPage = 'PlayerPage';
|
||||
const SUBSTYLE_Profile = 'Profile';
|
||||
const SUBSTYLE_ProfileAdvanced = 'ProfileAdvanced';
|
||||
const SUBSTYLE_ProfileVehicle = 'ProfileVehicle';
|
||||
const SUBSTYLE_Puzzle = 'Puzzle';
|
||||
const SUBSTYLE_Quit = 'Quit';
|
||||
const SUBSTYLE_Race = 'Race';
|
||||
const SUBSTYLE_Rankings = 'Rankings';
|
||||
const SUBSTYLE_Replay = 'Replay';
|
||||
const SUBSTYLE_Save = 'Save';
|
||||
const SUBSTYLE_ServersAll = 'ServersAll';
|
||||
const SUBSTYLE_ServersFavorites = 'ServersFavorites';
|
||||
const SUBSTYLE_ServersSuggested = 'ServersSuggested';
|
||||
const SUBSTYLE_Share = 'Share';
|
||||
const SUBSTYLE_ShareBlink = 'ShareBlink';
|
||||
const SUBSTYLE_SkillPoints = 'SkillPoints';
|
||||
const SUBSTYLE_Solo = 'Solo';
|
||||
const SUBSTYLE_Statistics = 'Statistics';
|
||||
const SUBSTYLE_Stunts = 'Stunts';
|
||||
const SUBSTYLE_United = 'United';
|
||||
const SUBSTYLE_Upload = 'Upload';
|
||||
const SUBSTYLE_Vehicles = 'Vehicles';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Icons128x128_Blink Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Icons128x128_Blink
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadIcons128x128_Blink = new Quad_Icons128x128_Blink($id);
|
||||
return $quadIcons128x128_Blink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Icons128x128_Blink Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Icons128x32_1' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons128x32_1 extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons128x32_1';
|
||||
const SUBSTYLE_Empty = 'Empty';
|
||||
const SUBSTYLE_ManiaLinkHome = 'ManiaLinkHome';
|
||||
const SUBSTYLE_ManiaLinkSwitch = 'ManiaLinkSwitch';
|
||||
const SUBSTYLE_ManiaPlanet = 'ManiaPlanet';
|
||||
const SUBSTYLE_Music = 'Music';
|
||||
const SUBSTYLE_PainterBrush = 'PainterBrush';
|
||||
const SUBSTYLE_PainterFill = 'PainterFill';
|
||||
const SUBSTYLE_PainterLayer = 'PainterLayer';
|
||||
const SUBSTYLE_PainterMirror = 'PainterMirror';
|
||||
const SUBSTYLE_PainterSticker = 'PainterSticker';
|
||||
const SUBSTYLE_PainterTeam = 'PainterTeam';
|
||||
const SUBSTYLE_RT_Cup = 'RT_Cup';
|
||||
const SUBSTYLE_RT_Laps = 'RT_Laps';
|
||||
const SUBSTYLE_RT_Rounds = 'RT_Rounds';
|
||||
const SUBSTYLE_RT_Script = 'RT_Script';
|
||||
const SUBSTYLE_RT_Team = 'RT_Team';
|
||||
const SUBSTYLE_RT_TimeAttack = 'RT_TimeAttack';
|
||||
const SUBSTYLE_RT_Stunts = 'RT_Stunts';
|
||||
const SUBSTYLE_Settings = 'Settings';
|
||||
const SUBSTYLE_SliderBar = 'SliderBar';
|
||||
const SUBSTYLE_SliderBar2 = 'SliderBar2';
|
||||
const SUBSTYLE_SliderCursor = 'SliderCursor';
|
||||
const SUBSTYLE_Sound = 'Sound';
|
||||
const SUBSTYLE_UrlBg = 'UrlBg';
|
||||
const SUBSTYLE_Windowed = 'Windowed';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Icons128x32_1 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Icons128x32_1
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadIcons128x32_1 = new Quad_Icons128x32_1($id);
|
||||
return $quadIcons128x32_1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Icons128x32_1 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
123
application/core/Libs/FML/Controls/Quads/Quad_Icons64x64_1.php
Normal file
123
application/core/Libs/FML/Controls/Quads/Quad_Icons64x64_1.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Icons64x64_1' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons64x64_1 extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons64x64_1';
|
||||
const SUBSTYLE_3DStereo = '3DStereo';
|
||||
const SUBSTYLE_Add = 'Add';
|
||||
const SUBSTYLE_ArrowBlue = 'ArrowBlue';
|
||||
const SUBSTYLE_ArrowDisabled = 'ArrowDisabled';
|
||||
const SUBSTYLE_ArrowDown = 'ArrowDown';
|
||||
const SUBSTYLE_ArrowFastNext = 'ArrowFastNext';
|
||||
const SUBSTYLE_ArrowFastPrev = 'ArrowFastPrev';
|
||||
const SUBSTYLE_ArrowFirst = 'ArrowFirst';
|
||||
const SUBSTYLE_ArrowGreen = 'ArrowGreen';
|
||||
const SUBSTYLE_ArrowLast = 'ArrowLast';
|
||||
const SUBSTYLE_ArrowNext = 'ArrowNext';
|
||||
const SUBSTYLE_ArrowPrev = 'ArrowPrev';
|
||||
const SUBSTYLE_ArrowRed = 'ArrowRed';
|
||||
const SUBSTYLE_ArrowUp = 'ArrowUp';
|
||||
const SUBSTYLE_Browser = 'Browser';
|
||||
const SUBSTYLE_Buddy = 'Buddy';
|
||||
const SUBSTYLE_ButtonLeagues = 'ButtonLeagues';
|
||||
const SUBSTYLE_Camera = 'Camera';
|
||||
const SUBSTYLE_CameraLocal = 'CameraLocal';
|
||||
const SUBSTYLE_Check = 'Check';
|
||||
const SUBSTYLE_ClipPause = 'ClipPause';
|
||||
const SUBSTYLE_ClipPlay = 'ClipPlay';
|
||||
const SUBSTYLE_ClipRewind = 'ClipRewind';
|
||||
const SUBSTYLE_Close = 'Close';
|
||||
const SUBSTYLE_Empty = 'Empty';
|
||||
const SUBSTYLE_Finish = 'Finish';
|
||||
const SUBSTYLE_FinishGrey = 'FinishGrey';
|
||||
const SUBSTYLE_First = 'First';
|
||||
const SUBSTYLE_GenericButton = 'GenericButton';
|
||||
const SUBSTYLE_Green = 'Green';
|
||||
const SUBSTYLE_IconLeaguesLadder = 'IconLeaguesLadder';
|
||||
const SUBSTYLE_IconPlayers = 'IconPlayers';
|
||||
const SUBSTYLE_IconPlayersLadder = 'IconPlayersLadder';
|
||||
const SUBSTYLE_IconServers = 'IconServers';
|
||||
const SUBSTYLE_Inbox = 'Inbox';
|
||||
const SUBSTYLE_LvlGreen = 'LvlGreen';
|
||||
const SUBSTYLE_LvlRed = 'LvlRed';
|
||||
const SUBSTYLE_LvlYellow = 'LvlYellow';
|
||||
const SUBSTYLE_ManiaLinkNext = 'ManiaLinkNext';
|
||||
const SUBSTYLE_ManiaLinkPrev = 'ManiaLinkPrev';
|
||||
const SUBSTYLE_Maximize = 'Maximize';
|
||||
const SUBSTYLE_MediaAudioDownloading = 'MediaAudioDownloading';
|
||||
const SUBSTYLE_MediaPlay = 'MediaPlay';
|
||||
const SUBSTYLE_MediaStop = 'MediaStop';
|
||||
const SUBSTYLE_MediaVideoDownloading = 'MediaVideoDownloading';
|
||||
const SUBSTYLE_NewMessage = 'NewMessage';
|
||||
const SUBSTYLE_NotBuddy = 'NotBuddy';
|
||||
const SUBSTYLE_OfficialRace = 'OfficialRace';
|
||||
const SUBSTYLE_Opponents = 'Opponents';
|
||||
const SUBSTYLE_Outbox = 'Outbox';
|
||||
const SUBSTYLE_QuitRace = 'QuitRace';
|
||||
const SUBSTYLE_RedHigh = 'RedHigh';
|
||||
const SUBSTYLE_RedLow = 'RedLow';
|
||||
const SUBSTYLE_Refresh = 'Refresh';
|
||||
const SUBSTYLE_RestartRace = 'RestartRace';
|
||||
const SUBSTYLE_Save = 'Save';
|
||||
const SUBSTYLE_Second = 'Second';
|
||||
const SUBSTYLE_ShowDown = 'ShowDown';
|
||||
const SUBSTYLE_ShowDown2 = 'ShowDown2';
|
||||
const SUBSTYLE_ShowLeft = 'ShowLeft';
|
||||
const SUBSTYLE_ShowLeft2 = 'ShowLeft2';
|
||||
const SUBSTYLE_ShowRight = 'ShowRight';
|
||||
const SUBSTYLE_ShowRight2 = 'ShowRight2';
|
||||
const SUBSTYLE_ShowUp = 'ShowUp';
|
||||
const SUBSTYLE_ShowUp2 = 'ShowUp2';
|
||||
const SUBSTYLE_SliderCursor = 'SliderCursor';
|
||||
const SUBSTYLE_SliderCursor2 = 'SliderCursor2';
|
||||
const SUBSTYLE_StateFavourite = 'StateFavourite';
|
||||
const SUBSTYLE_StatePrivate = 'StatePrivate';
|
||||
const SUBSTYLE_StateSuggested = 'StateSuggested';
|
||||
const SUBSTYLE_Sub = 'Sub';
|
||||
const SUBSTYLE_TagTypeBronze = 'TagTypeBronze';
|
||||
const SUBSTYLE_TagTypeGold = 'TagTypeGold';
|
||||
const SUBSTYLE_TagTypeNadeo = 'TagTypeNadeo';
|
||||
const SUBSTYLE_TagTypeNone = 'TagTypeNone';
|
||||
const SUBSTYLE_TagTypeSilver = 'TagTypeSilver';
|
||||
const SUBSTYLE_Third = 'Third';
|
||||
const SUBSTYLE_ToolLeague1 = 'ToolLeague1';
|
||||
const SUBSTYLE_ToolRoot = 'ToolRoot';
|
||||
const SUBSTYLE_ToolTree = 'ToolTree';
|
||||
const SUBSTYLE_ToolUp = 'ToolUp';
|
||||
const SUBSTYLE_TrackInfo = 'TrackInfo';
|
||||
const SUBSTYLE_TV = 'TV';
|
||||
const SUBSTYLE_YellowHigh = 'YellowHigh';
|
||||
const SUBSTYLE_YellowLow = 'YellowLow';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Icons64x64_1 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Icons64x64_1
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadIcons64x64_1 = new Quad_Icons64x64_1($id);
|
||||
return $quadIcons64x64_1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Icons64x64_1 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'Icons64x64_2' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_Icons64x64_2 extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons64x64_2';
|
||||
const SUBSTYLE_ArrowElimination = 'ArrowElimination';
|
||||
const SUBSTYLE_ArrowHit = 'ArrowHit';
|
||||
const SUBSTYLE_Disconnected = 'Disconnected';
|
||||
const SUBSTYLE_DisconnectedLight = 'DisconnectedLight';
|
||||
const SUBSTYLE_LaserElimination = 'LaserElimination';
|
||||
const SUBSTYLE_LaserHit = 'LaserHit';
|
||||
const SUBSTYLE_NucleusElimination = 'NucleusElimination';
|
||||
const SUBSTYLE_NucleusHit = 'NucleusHit';
|
||||
const SUBSTYLE_RocketElimination = 'RocketElimination';
|
||||
const SUBSTYLE_RocketHit = 'RocketHit';
|
||||
const SUBSTYLE_ServerNotice = 'ServerNotice';
|
||||
const SUBSTYLE_UnknownElimination = 'UnknownElimination';
|
||||
const SUBSTYLE_UnknownHit = 'UnknownHit';
|
||||
|
||||
/**
|
||||
* Create a new Quad_Icons64x64_2 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_Icons64x64_2
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadIcons64x64_2 = new Quad_Icons64x64_2($id);
|
||||
return $quadIcons64x64_2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_Icons64x64_2 Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'ManiaPlanetLogos' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_ManiaPlanetLogos extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'ManiaPlanetLogos';
|
||||
const SUBSTYLE_IconPlanets = 'IconPlanets';
|
||||
const SUBSTYLE_IconPlanetsPerspective = 'IconPlanetsPerspective';
|
||||
const SUBSTYLE_IconPlanetsSmall = 'IconPlanetsSmall';
|
||||
const SUBSTYLE_ManiaPlanetLogoBlack = 'ManiaPlanetLogoBlack';
|
||||
const SUBSTYLE_ManiaPlanetLogoBlackSmall = 'ManiaPlanetLogoBlackSmall';
|
||||
const SUBSTYLE_ManiaPlanetLogoWhite = 'ManiaPlanetLogoWhite';
|
||||
const SUBSTYLE_ManiaPlanetLogoWhiteSmall = 'ManiaPlanetLogoWhiteSmall';
|
||||
|
||||
/**
|
||||
* Create a new Quad_ManiaPlanetLogos Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_ManiaPlanetLogos
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadManiaPlanetLogos = new Quad_ManiaPlanetLogos($id);
|
||||
return $quadManiaPlanetLogos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_ManiaPlanetLogos Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'ManiaplanetSystem' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_ManiaplanetSystem extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'ManiaplanetSystem';
|
||||
const SUBSTYLE_BgDialog = 'BgDialog';
|
||||
const SUBSTYLE_BgDialogAnchor = 'BgDialogAnchor';
|
||||
const SUBSTYLE_BgFloat = 'BgFloat';
|
||||
const SUBSTYLE_Events = 'Events';
|
||||
const SUBSTYLE_Medals = 'Medals';
|
||||
const SUBSTYLE_Statistics = 'Statistics';
|
||||
|
||||
/**
|
||||
* Create a new Quad_ManiaplanetSystem Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_ManiaplanetSystem
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadManiaplanetSystem = new Quad_ManiaplanetSystem($id);
|
||||
return $quadManiaplanetSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_ManiaplanetSystem Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
45
application/core/Libs/FML/Controls/Quads/Quad_MedalsBig.php
Normal file
45
application/core/Libs/FML/Controls/Quads/Quad_MedalsBig.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'MedalsBig' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_MedalsBig extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'MedalsBig';
|
||||
const SUBSTYLE_MedalBronze = 'MedalBronze';
|
||||
const SUBSTYLE_MedalGold = 'MedalGold';
|
||||
const SUBSTYLE_MedalGoldPerspective = 'MedalGoldPerspective';
|
||||
const SUBSTYLE_MedalNadeo = 'MedalNadeo';
|
||||
const SUBSTYLE_MedalNadeoPerspective = 'MedalNadeoPerspective';
|
||||
const SUBSTYLE_MedalSilver = 'MedalSilver';
|
||||
const SUBSTYLE_MedalSlot = 'MedalSlot';
|
||||
|
||||
/**
|
||||
* Create a new Quad_MedalsBig Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_MedalsBig
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadMedalsBig = new Quad_MedalsBig($id);
|
||||
return $quadMedalsBig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_MedalsBig Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
42
application/core/Libs/FML/Controls/Quads/Quad_TitleLogos.php
Normal file
42
application/core/Libs/FML/Controls/Quads/Quad_TitleLogos.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'TitleLogos' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_TitleLogos extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'TitleLogos';
|
||||
const SUBSTYLE_Author = 'Author';
|
||||
const SUBSTYLE_Collection = 'Collection';
|
||||
const SUBSTYLE_Icon = 'Icon';
|
||||
const SUBSTYLE_Title = 'Title';
|
||||
|
||||
/**
|
||||
* Create a new Quad_TitleLogos Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_TitleLogos
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadTitleLogos = new Quad_TitleLogos($id);
|
||||
return $quadTitleLogos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_TitleLogos Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'UIConstruction_Buttons' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_UIConstruction_Buttons extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'UIConstruction_Buttons';
|
||||
const SUBSTYLE_ActionMaker = 'ActionMaker';
|
||||
const SUBSTYLE_Add = 'Add';
|
||||
const SUBSTYLE_Author = 'Author';
|
||||
const SUBSTYLE_AuthorTime = 'AuthorTime';
|
||||
const SUBSTYLE_BgEditors = 'BgEditors';
|
||||
const SUBSTYLE_BgIcons = 'BgIcons';
|
||||
const SUBSTYLE_BgMain = 'BgMain';
|
||||
const SUBSTYLE_BgTools = 'BgTools';
|
||||
const SUBSTYLE_BlockEditor = 'BlockEditor';
|
||||
const SUBSTYLE_Camera = 'Camera';
|
||||
const SUBSTYLE_Challenge = 'Challenge';
|
||||
const SUBSTYLE_CopyPaste = 'CopyPaste';
|
||||
const SUBSTYLE_DecalEditor = 'DecalEditor';
|
||||
const SUBSTYLE_Delete = 'Delete';
|
||||
const SUBSTYLE_Directory = 'Directory';
|
||||
const SUBSTYLE_Down = 'Down';
|
||||
const SUBSTYLE_Drive = 'Drive';
|
||||
const SUBSTYLE_Erase = 'Erase';
|
||||
const SUBSTYLE_Help = 'Help';
|
||||
const SUBSTYLE_Item = 'Item';
|
||||
const SUBSTYLE_Left = 'Left';
|
||||
const SUBSTYLE_MacroBlockEditor = 'MacroBlockEditor';
|
||||
const SUBSTYLE_MediaTracker = 'MediaTracker';
|
||||
const SUBSTYLE_ObjectEditor = 'ObjectEditor';
|
||||
const SUBSTYLE_OffZone = 'OffZone';
|
||||
const SUBSTYLE_Options = 'Options';
|
||||
const SUBSTYLE_Paint = 'Paint';
|
||||
const SUBSTYLE_Pick = 'Pick';
|
||||
const SUBSTYLE_Plugins = 'Plugins';
|
||||
const SUBSTYLE_Quit = 'Quit';
|
||||
const SUBSTYLE_Redo = 'Redo';
|
||||
const SUBSTYLE_Reload = 'Reload';
|
||||
const SUBSTYLE_Right = 'Right';
|
||||
const SUBSTYLE_Save = 'Save';
|
||||
const SUBSTYLE_SaveAs = 'SaveAs';
|
||||
const SUBSTYLE_ScriptEditor = 'ScriptEditor';
|
||||
const SUBSTYLE_SpotModelClearUnused = 'SpotModelClearUnused';
|
||||
const SUBSTYLE_SpotModelDuplicate = 'SpotModelDuplicate';
|
||||
const SUBSTYLE_SpotModelNew = 'SpotModelNew';
|
||||
const SUBSTYLE_SpotModelRename = 'SpotModelRename';
|
||||
const SUBSTYLE_Square = 'Square';
|
||||
const SUBSTYLE_Stats = 'Stats';
|
||||
const SUBSTYLE_Sub = 'Sub';
|
||||
const SUBSTYLE_TerrainEditor = 'TerrainEditor';
|
||||
const SUBSTYLE_TestSm = 'TestSm';
|
||||
const SUBSTYLE_Text = 'Text';
|
||||
const SUBSTYLE_Tools = 'Tools';
|
||||
const SUBSTYLE_Underground = 'Underground';
|
||||
const SUBSTYLE_Undo = 'Undo';
|
||||
const SUBSTYLE_Up = 'Up';
|
||||
const SUBSTYLE_Validate = 'Validate';
|
||||
const SUBSTYLE_Validate_Step1 = 'Validate_Step1';
|
||||
const SUBSTYLE_Validate_Step2 = 'Validate_Step2';
|
||||
const SUBSTYLE_Validate_Step3 = 'Validate_Step3';
|
||||
|
||||
/**
|
||||
* Create a new Quad_UIConstruction_Buttons Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_UIConstruction_Buttons
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadUIConstructionButtons = new Quad_UIConstruction_Buttons($id);
|
||||
return $quadUIConstructionButtons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_UIConstruction_Buttons Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls\Quads;
|
||||
|
||||
use FML\Controls\Quad;
|
||||
|
||||
/**
|
||||
* Quad Class for 'UiSMSpectatorScoreBig' Style
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Quad_UiSMSpectatorScoreBig extends Quad {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'UiSMSpectatorScoreBig';
|
||||
CONST SUBSTYLE_BotLeft = 'BotLeft';
|
||||
CONST SUBSTYLE_BotLeftGlass = 'BotLeftGlass';
|
||||
CONST SUBSTYLE_BotRight = 'BotRight';
|
||||
CONST SUBSTYLE_BotRightGlass = 'BotRightGlass';
|
||||
CONST SUBSTYLE_CenterShield = 'CenterShield';
|
||||
CONST SUBSTYLE_CenterShieldSmall = 'CenterShieldSmall';
|
||||
CONST SUBSTYLE_HandleLeft = 'HandleLeft';
|
||||
CONST SUBSTYLE_HandleRight = 'HandleRight';
|
||||
CONST SUBSTYLE_PlayerGlass = 'PlayerGlass';
|
||||
CONST SUBSTYLE_PlayerIconBg = 'PlayerIconBg';
|
||||
CONST SUBSTYLE_PlayerJunction = 'PlayerJunction';
|
||||
CONST SUBSTYLE_PlayerSlot = 'PlayerSlot';
|
||||
CONST SUBSTYLE_PlayerSlotCenter = 'PlayerSlotCenter';
|
||||
CONST SUBSTYLE_PlayerSlotRev = 'PlayerSlotRev';
|
||||
CONST SUBSTYLE_PlayerSlotSmall = 'PlayerSlotSmall';
|
||||
CONST SUBSTYLE_PlayerSlotSmallRev = 'PlayerSlotSmallRev';
|
||||
CONST SUBSTYLE_TableBgHoriz = 'TableBgHoriz';
|
||||
CONST SUBSTYLE_TableBgVert = 'TableBgVert';
|
||||
CONST SUBSTYLE_Top = 'Top';
|
||||
CONST SUBSTYLE_UIRange1Bg = 'UIRange1Bg';
|
||||
CONST SUBSTYLE_UIRange2Bg = 'UIRange2Bg';
|
||||
|
||||
/**
|
||||
* Create a new Quad_UiSMSpectatorScoreBig Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Quads\Quad_UiSMSpectatorScoreBig
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$quadUiSMSpectatorScoreBig = new Quad_UiSMSpectatorScoreBig($id);
|
||||
return $quadUiSMSpectatorScoreBig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad_UiSMSpectatorScoreBig Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->setStyle(self::STYLE);
|
||||
}
|
||||
}
|
143
application/core/Libs/FML/Controls/Video.php
Normal file
143
application/core/Libs/FML/Controls/Video.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Playable;
|
||||
use FML\Types\Scriptable;
|
||||
|
||||
/**
|
||||
* Video Control
|
||||
* (CMlMediaPlayer)
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Video extends Control implements Playable, Scriptable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $data = '';
|
||||
protected $dataId = '';
|
||||
protected $play = 0;
|
||||
protected $looping = 0;
|
||||
protected $music = 0;
|
||||
protected $volume = 1.;
|
||||
protected $scriptEvents = 0;
|
||||
|
||||
/**
|
||||
* Create a new Video Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Video
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$video = new Video($id);
|
||||
return $video;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Video Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'video';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setData()
|
||||
* @return \FML\Controls\Video
|
||||
*/
|
||||
public function setData($data) {
|
||||
$this->data = (string) $data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setDataId()
|
||||
* @return \FML\Controls\Video
|
||||
*/
|
||||
public function setDataId($dataId) {
|
||||
$this->dataId = (string) $dataId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setPlay()
|
||||
* @return \FML\Controls\Video
|
||||
*/
|
||||
public function setPlay($play) {
|
||||
$this->play = ($play ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setLooping()
|
||||
* @return \FML\Controls\Video
|
||||
*/
|
||||
public function setLooping($looping) {
|
||||
$this->looping = ($looping ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setMusic()
|
||||
* @return \FML\Controls\Video
|
||||
*/
|
||||
public function setMusic($music) {
|
||||
$this->music = ($music ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setVolume()
|
||||
* @return \FML\Controls\Video
|
||||
*/
|
||||
public function setVolume($volume) {
|
||||
$this->volume = (float) $volume;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
* @return \FML\Controls\Video
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
$this->scriptEvents = ($scriptEvents ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if ($this->data) {
|
||||
$xmlElement->setAttribute('data', $this->data);
|
||||
}
|
||||
if ($this->play) {
|
||||
$xmlElement->setAttribute('play', $this->play);
|
||||
}
|
||||
if (!$this->looping) {
|
||||
$xmlElement->setAttribute('looping', $this->looping);
|
||||
}
|
||||
if ($this->music) {
|
||||
$xmlElement->setAttribute('music', $this->music);
|
||||
}
|
||||
if ($this->volume != 1.) {
|
||||
$xmlElement->setAttribute('volume', $this->volume);
|
||||
}
|
||||
if ($this->scriptEvents) {
|
||||
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
197
application/core/Libs/FML/CustomUI.php
Normal file
197
application/core/Libs/FML/CustomUI.php
Normal file
@ -0,0 +1,197 @@
|
||||
<?php
|
||||
|
||||
namespace FML;
|
||||
|
||||
/**
|
||||
* Class representing a Custom_UI
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class CustomUI {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $encoding = 'utf-8';
|
||||
protected $tagName = 'custom_ui';
|
||||
protected $noticeVisible = null;
|
||||
protected $challengeInfoVisible = null;
|
||||
protected $netInfosVisible = null;
|
||||
protected $chatVisible = null;
|
||||
protected $checkpointListVisible = null;
|
||||
protected $roundScoresVisible = null;
|
||||
protected $scoretableVisible = null;
|
||||
protected $globalVisible = null;
|
||||
|
||||
/**
|
||||
* Create a new CustomUI Object
|
||||
*
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public static function create() {
|
||||
$customUI = new CustomUI();
|
||||
return $customUI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new CustomUI Object
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set XML Encoding
|
||||
*
|
||||
* @param string $encoding XML Encoding
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setXMLEncoding($encoding) {
|
||||
$this->encoding = (string) $encoding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Showing of Notices
|
||||
*
|
||||
* @param bool $visible Whether Notices should be shown
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setNoticeVisible($visible) {
|
||||
$this->noticeVisible = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Showing of the Challenge Info
|
||||
*
|
||||
* @param bool $visible Whether the Challenge Info should be shown
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setChallengeInfoVisible($visible) {
|
||||
$this->challengeInfoVisible = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Showing of the Net Infos
|
||||
*
|
||||
* @param bool $visible Whether the Net Infos should be shown
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setNetInfosVisible($visible) {
|
||||
$this->netInfosVisible = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Showing of the Chat
|
||||
*
|
||||
* @param bool $visible Whether the Chat should be shown
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setChatVisible($visible) {
|
||||
$this->chatVisible = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Showing of the Checkpoint List
|
||||
*
|
||||
* @param bool $visible Whether the Checkpoint should be shown
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setCheckpointListVisible($visible) {
|
||||
$this->checkpointListVisible = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Showing of Round Scores
|
||||
*
|
||||
* @param bool $visible Whether the Round Scores should be shown
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setRoundScoresVisible($visible) {
|
||||
$this->roundScoresVisible = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Showing of the Scoretable
|
||||
*
|
||||
* @param bool $visible Whether the Scoretable should be shown
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setScoretableVisible($visible) {
|
||||
$this->scoretableVisible = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Global Showing
|
||||
*
|
||||
* @param bool $visible Wether the UI should be disabled completely
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function setGlobalVisible($visible) {
|
||||
$this->globalVisible = $visible;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the XML Document
|
||||
*
|
||||
* @param \DOMDocument $domDocument (optional) DomDocument for which the XML Element should be rendered
|
||||
* @return \DOMDocument
|
||||
*/
|
||||
public function render($domDocument = null) {
|
||||
$isChild = (bool) $domDocument;
|
||||
if (!$isChild) {
|
||||
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
||||
$domDocument->xmlStandalone = true;
|
||||
}
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if (!$isChild) {
|
||||
$domDocument->appendChild($xmlElement);
|
||||
}
|
||||
$settings = $this->getSettings();
|
||||
foreach ($settings as $setting => $value) {
|
||||
if ($value === null) continue;
|
||||
$xmlSubElement = $domDocument->createElement($setting);
|
||||
$xmlSubElement->setAttribute('visible', ($value ? 1 : 0));
|
||||
$xmlElement->appendChild($xmlSubElement);
|
||||
}
|
||||
if ($isChild) {
|
||||
return $xmlElement;
|
||||
}
|
||||
return $domDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get String Representation
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
$domDocument = $this->render();
|
||||
$xmlText = $domDocument->saveXML();
|
||||
return $xmlText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get associative Array of all CustomUI Settings
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getSettings() {
|
||||
$settings = array();
|
||||
$settings['challenge_info'] = $this->challengeInfoVisible;
|
||||
$settings['chat'] = $this->chatVisible;
|
||||
$settings['checkpoint_list'] = $this->checkpointListVisible;
|
||||
$settings['global'] = $this->globalVisible;
|
||||
$settings['net_infos'] = $this->netInfosVisible;
|
||||
$settings['notice'] = $this->noticeVisible;
|
||||
$settings['round_scores'] = $this->roundScoresVisible;
|
||||
$settings['scoretable'] = $this->scoretableVisible;
|
||||
return $settings;
|
||||
}
|
||||
}
|
274
application/core/Libs/FML/Elements/Dico.php
Normal file
274
application/core/Libs/FML/Elements/Dico.php
Normal file
@ -0,0 +1,274 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
/**
|
||||
* Dictionary Element
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Dico {
|
||||
/**
|
||||
* Czech Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_CZECH = 'cz';
|
||||
|
||||
/**
|
||||
* Danish Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_DANISH = 'da';
|
||||
|
||||
/**
|
||||
* German Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_GERMAN = 'de';
|
||||
|
||||
/**
|
||||
* English Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_ENGLISH = 'en';
|
||||
|
||||
/**
|
||||
* Spanish Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_SPANISH = 'es';
|
||||
|
||||
/**
|
||||
* French Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_FRENCH = 'fr';
|
||||
|
||||
/**
|
||||
* Hungarian Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_HUNGARIAN = 'hu';
|
||||
|
||||
/**
|
||||
* Italian Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_ITALIAN = 'it';
|
||||
|
||||
/**
|
||||
* Japanese Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_JAPANESE = 'jp';
|
||||
|
||||
/**
|
||||
* Korean Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_KOREAN = 'kr';
|
||||
|
||||
/**
|
||||
* Norwegian Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_NORWEGIAN = 'nb';
|
||||
|
||||
/**
|
||||
* Dutch Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_DUTCH = 'nl';
|
||||
|
||||
/**
|
||||
* Polish Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_POLISH = 'pl';
|
||||
|
||||
/**
|
||||
* Portuguese Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_PORTUGUESE = 'pt';
|
||||
|
||||
/**
|
||||
* Brazilian Portuguese Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_BRAZILIAN_PORTUGUESE = 'pt_BR';
|
||||
|
||||
/**
|
||||
* Romanian Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_ROMANIAN = 'ro';
|
||||
|
||||
/**
|
||||
* Russian Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_RUSSIAN = 'ru';
|
||||
|
||||
/**
|
||||
* Slovak Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_SLOVAK = 'sk';
|
||||
|
||||
/**
|
||||
* Turkish Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_TURKISH = 'tr';
|
||||
|
||||
/**
|
||||
* Chinese Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const LANG_CHINESE = 'zh';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'dico';
|
||||
protected $entries = array();
|
||||
|
||||
/**
|
||||
* Create a new Dictionary Object
|
||||
*
|
||||
* @return \FML\Elements\Dico
|
||||
*/
|
||||
public static function create() {
|
||||
$dico = new Dico();
|
||||
return $dico;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Dictionary Object
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the translatable Entry for the specific Language
|
||||
*
|
||||
* @param string $language Language Id
|
||||
* @param string $entryId Entry Id
|
||||
* @param string $entryValue Translated Entry Value
|
||||
* @return \FML\Elements\Dico
|
||||
*/
|
||||
public function setEntry($language, $entryId, $entryValue) {
|
||||
$language = (string) $language;
|
||||
$entryId = (string) $entryId;
|
||||
$entryValue = (string) $entryValue;
|
||||
if (!isset($this->entries[$language]) && $entryValue) {
|
||||
$this->entries[$language] = array();
|
||||
}
|
||||
if ($entryValue) {
|
||||
$this->entries[$language][$entryId] = $entryValue;
|
||||
}
|
||||
else {
|
||||
if (isset($this->entries[$language][$entryId])) {
|
||||
unset($this->entries[$language][$entryId]);
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Entries of the given Id
|
||||
*
|
||||
* @param string $entryId Entry Id that should be removed
|
||||
* @param string $language (optional) Only remove Entries of the given Language
|
||||
* @return \FML\Elements\Dico
|
||||
*/
|
||||
public function removeEntry($entryId, $language = null) {
|
||||
$entryId = (string) $entryId;
|
||||
if ($language) {
|
||||
$language = (string) $language;
|
||||
if (isset($this->entries[$language])) {
|
||||
unset($this->entries[$language][$entryId]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($this->entries as $language => $entries) {
|
||||
if (isset($entries[$entryId])) {
|
||||
unset($entries[$language][$entryId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Entries of the given Language
|
||||
*
|
||||
* @param string $language Language of which all Entries should be removed
|
||||
* @param string $entryId (optional) Only remove the given Entry Id
|
||||
* @return \FML\Elements\Dico
|
||||
*/
|
||||
public function removeLanguage($language, $entryId = null) {
|
||||
$language = (string) $language;
|
||||
if (isset($this->entries[$language])) {
|
||||
if ($entryId) {
|
||||
$entryId = (string) $entryId;
|
||||
unset($this->entries[$language][$entryId]);
|
||||
}
|
||||
else {
|
||||
unset($this->entries[$language]);
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all Entries from the Dictionary
|
||||
*
|
||||
* @return \FML\Elements\Dico
|
||||
*/
|
||||
public function removeEntries() {
|
||||
$this->entries = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Dico XML Element
|
||||
*
|
||||
* @param \DOMDocument $domDocument DomDocument for which the Dico XML Element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
foreach ($this->entries as $language => $entries) {
|
||||
$languageElement = $domDocument->createElement('language');
|
||||
$languageElement->setAttribute('id', $language);
|
||||
foreach ($entries as $entryId => $entryValue) {
|
||||
$entryElement = $domDocument->createElement($entryId, $entryValue);
|
||||
$languageElement->appendChild($entryElement);
|
||||
}
|
||||
$xmlElement->appendChild($languageElement);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
129
application/core/Libs/FML/Elements/Format.php
Normal file
129
application/core/Libs/FML/Elements/Format.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
use FML\Types\BgColorable;
|
||||
use FML\Types\Renderable;
|
||||
use FML\Types\Styleable;
|
||||
use FML\Types\TextFormatable;
|
||||
|
||||
/**
|
||||
* Format Element
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Format implements BgColorable, Renderable, Styleable, TextFormatable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'format';
|
||||
protected $bgColor = '';
|
||||
protected $style = '';
|
||||
protected $textSize = -1;
|
||||
protected $textColor = '';
|
||||
protected $focusAreaColor1 = '';
|
||||
protected $focusAreaColor2 = '';
|
||||
|
||||
/**
|
||||
* Create a new Format Element
|
||||
*
|
||||
* @return \FML\Elements\Format
|
||||
*/
|
||||
public static function create() {
|
||||
$format = new Format();
|
||||
return $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Format Element
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\BgColorable::setBgColor()
|
||||
* @return \FML\Elements\Format
|
||||
*/
|
||||
public function setBgColor($bgColor) {
|
||||
$this->bgColor = (string) $bgColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Styleable::setStyle()
|
||||
* @return \FML\Elements\Format
|
||||
*/
|
||||
public function setStyle($style) {
|
||||
$this->style = (string) $style;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setTextSize()
|
||||
* @return \FML\Elements\Format
|
||||
*/
|
||||
public function setTextSize($textSize) {
|
||||
$this->textSize = (int) $textSize;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setTextColor()
|
||||
* @return \FML\Elements\Format
|
||||
*/
|
||||
public function setTextColor($textColor) {
|
||||
$this->textColor = (string) $textColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setAreaColor()
|
||||
* @return \FML\Elements\Format
|
||||
*/
|
||||
public function setAreaColor($areaColor) {
|
||||
$this->focusAreaColor1 = (string) $areaColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setAreaFocusColor()
|
||||
* @return \FML\Elements\Format
|
||||
*/
|
||||
public function setAreaFocusColor($areaFocusColor) {
|
||||
$this->focusAreaColor2 = (string) $areaFocusColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$formatXmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->bgColor) {
|
||||
$formatXmlElement->setAttribute('bgcolor', $this->bgColor);
|
||||
}
|
||||
if ($this->style) {
|
||||
$formatXmlElement->setAttribute('style', $this->style);
|
||||
}
|
||||
if ($this->textSize >= 0) {
|
||||
$formatXmlElement->setAttribute('textsize', $this->textSize);
|
||||
}
|
||||
if ($this->textColor) {
|
||||
$formatXmlElement->setAttribute('textcolor', $this->textColor);
|
||||
}
|
||||
if ($this->focusAreaColor1) {
|
||||
$formatXmlElement->setAttribute('focusareacolor1', $this->focusAreaColor1);
|
||||
}
|
||||
if ($this->focusAreaColor2) {
|
||||
$formatXmlElement->setAttribute('focusareacolor2', $this->focusAreaColor2);
|
||||
}
|
||||
return $formatXmlElement;
|
||||
}
|
||||
}
|
116
application/core/Libs/FML/Elements/FrameModel.php
Normal file
116
application/core/Libs/FML/Elements/FrameModel.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
use FML\Controls\Control;
|
||||
use FML\Types\Container;
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Class representing a Frame Model
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class FrameModel implements Container, Renderable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'framemodel';
|
||||
protected $id = '';
|
||||
protected $children = array();
|
||||
protected $format = null;
|
||||
|
||||
/**
|
||||
* Set Model Id
|
||||
*
|
||||
* @param string $id Model Id
|
||||
* @return \FML\Elements\FrameModel
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = (string) $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Model Id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign an Id if necessary
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function checkId() {
|
||||
if (!$this->id) {
|
||||
$this->id = uniqid();
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::add()
|
||||
* @return \FML\Elements\FrameModel
|
||||
*/
|
||||
public function add(Control $childControl) {
|
||||
if (!in_array($childControl, $this->children, true)) {
|
||||
array_push($this->children, $childControl);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::removeChildren()
|
||||
* @return \FML\Elements\FrameModel
|
||||
*/
|
||||
public function removeChildren() {
|
||||
$this->children = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::setFormat()
|
||||
* @return \FML\Elements\FrameModel
|
||||
*/
|
||||
public function setFormat(Format $format) {
|
||||
$this->format = $format;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::getFormat()
|
||||
*/
|
||||
public function getFormat($createIfEmpty = true) {
|
||||
if (!$this->format && $createIfEmpty) {
|
||||
$this->format = new Format();
|
||||
}
|
||||
return $this->format;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$this->checkId();
|
||||
$xmlElement->setAttribute('id', $this->getId());
|
||||
if ($this->format) {
|
||||
$formatXml = $this->format->render($domDocument);
|
||||
$xmlElement->appendChild($formatXml);
|
||||
}
|
||||
foreach ($this->children as $child) {
|
||||
$childElement = $child->render($domDocument);
|
||||
$xmlElement->appendChild($childElement);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
61
application/core/Libs/FML/Elements/Including.php
Normal file
61
application/core/Libs/FML/Elements/Including.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Include Element
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Including implements Renderable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'include';
|
||||
protected $url = '';
|
||||
|
||||
/**
|
||||
* Construct a new Include Element
|
||||
*
|
||||
* @param string $url (optional) Include Url
|
||||
* @return \FML\Elements\Including
|
||||
*/
|
||||
public static function create($url = null) {
|
||||
$including = new Including($url);
|
||||
return $including;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Include Element
|
||||
*
|
||||
* @param string $url (optional) Include Url
|
||||
*/
|
||||
public function __construct($url = null) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Url
|
||||
*
|
||||
* @param string $url Include Url
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->url) {
|
||||
$xmlElement->setAttribute('url', $this->url);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
63
application/core/Libs/FML/Elements/Music.php
Normal file
63
application/core/Libs/FML/Elements/Music.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Elements;
|
||||
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Music Element
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Music implements Renderable {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'music';
|
||||
protected $data = '';
|
||||
|
||||
/**
|
||||
* Create a new Music Element
|
||||
*
|
||||
* @param string $data (optional) Media Url
|
||||
* @return \FML\Elements\Music
|
||||
*/
|
||||
public static function create($data = null) {
|
||||
$music = new Music($data);
|
||||
return $music;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Music Element
|
||||
*
|
||||
* @param string $data (optional) Media Url
|
||||
*/
|
||||
public function __construct($data = null) {
|
||||
if ($data !== null) {
|
||||
$this->setData($data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Data Url
|
||||
*
|
||||
* @param string $data Media Url
|
||||
* @return \FML\Elements\Music
|
||||
*/
|
||||
public function setData($data) {
|
||||
$this->data = (string) $data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->data) {
|
||||
$xmlElement->setAttribute('data', $this->data);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
64
application/core/Libs/FML/Elements/SimpleScript.php
Normal file
64
application/core/Libs/FML/Elements/SimpleScript.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?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 = '';
|
||||
|
||||
/**
|
||||
* Create a new SimpleScript Element
|
||||
*
|
||||
* @param string $text (optional) Script Text
|
||||
* @return \FML\Elements\SimpleScript
|
||||
*/
|
||||
public static function create($text = null) {
|
||||
$simpleScript = new SimpleScript($text);
|
||||
return $simpleScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new SimpleScript Element
|
||||
*
|
||||
* @param string $text (optional) Script Text
|
||||
*/
|
||||
public function __construct($text = null) {
|
||||
if ($text !== null) {
|
||||
$this->setText($text);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Script Text
|
||||
*
|
||||
* @param string $text The Complete Script Text
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function setText($text) {
|
||||
$this->text = (string) $text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->text) {
|
||||
$scriptComment = $domDocument->createComment($this->text);
|
||||
$xmlElement->appendChild($scriptComment);
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
311
application/core/Libs/FML/ManiaCode.php
Normal file
311
application/core/Libs/FML/ManiaCode.php
Normal file
@ -0,0 +1,311 @@
|
||||
<?php
|
||||
|
||||
namespace FML;
|
||||
|
||||
use FML\ManiaCode\AddBuddy;
|
||||
use FML\ManiaCode\AddFavorite;
|
||||
use FML\ManiaCode\Element;
|
||||
use FML\ManiaCode\GetSkin;
|
||||
use FML\ManiaCode\Go_To;
|
||||
use FML\ManiaCode\InstallMap;
|
||||
use FML\ManiaCode\InstallPack;
|
||||
use FML\ManiaCode\InstallReplay;
|
||||
use FML\ManiaCode\InstallScript;
|
||||
use FML\ManiaCode\InstallSkin;
|
||||
use FML\ManiaCode\JoinServer;
|
||||
use FML\ManiaCode\Message;
|
||||
use FML\ManiaCode\PlayMap;
|
||||
use FML\ManiaCode\PlayReplay;
|
||||
use FML\ManiaCode\ShowMessage;
|
||||
use FML\ManiaCode\ViewReplay;
|
||||
|
||||
/**
|
||||
* Class representing a ManiaCode
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ManiaCode {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $encoding = 'utf-8';
|
||||
protected $tagName = 'maniacode';
|
||||
protected $noConfirmation = null;
|
||||
protected $elements = array();
|
||||
|
||||
/**
|
||||
* Create a new ManiaCode Object
|
||||
*
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public static function create() {
|
||||
$maniaCode = new ManiaCode();
|
||||
return $maniaCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new ManiaCode Object
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set XML Encoding
|
||||
*
|
||||
* @param string $encoding XML Encoding
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function setXmlEncoding($encoding) {
|
||||
$this->encoding = (string) $encoding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the Showing of the Confirmation at the End of the ManiaCode
|
||||
*
|
||||
* @param bool $disable Whether the Confirmation should be shown
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function disableConfirmation($disable) {
|
||||
$this->noConfirmation = ($disable ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a Message
|
||||
*
|
||||
* @param string $message Message Text
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addShowMessage($message) {
|
||||
$messageElement = new ShowMessage($message);
|
||||
$this->addElement($messageElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a Map
|
||||
*
|
||||
* @param string $name Map Name
|
||||
* @param string $url Map Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addInstallMap($name, $url) {
|
||||
$mapElement = new InstallMap($name, $url);
|
||||
$this->addElement($mapElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Play a Map
|
||||
*
|
||||
* @param string $name Map Name
|
||||
* @param string $url Map Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addPlayMap($name, $url) {
|
||||
$mapElement = new PlayMap($name, $url);
|
||||
$this->addElement($mapElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a Replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addInstallReplay($name, $url) {
|
||||
$replayElement = new InstallReplay($name, $url);
|
||||
$this->addElement($replayElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* View a Replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addViewReplay($name, $url) {
|
||||
$replayElement = new ViewReplay($name, $url);
|
||||
$this->addElement($replayElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Play a Replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addPlayReplay($name, $url) {
|
||||
$replayElement = new PlayReplay($name, $url);
|
||||
$this->addElement($replayElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a Skin
|
||||
*
|
||||
* @param string $name Skin Name
|
||||
* @param string $file Skin File
|
||||
* @param string $url Skin Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addInstallSkin($name, $file, $url) {
|
||||
$skinElement = new InstallSkin($name, $file, $url);
|
||||
$this->addElement($skinElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Skin
|
||||
*
|
||||
* @param string $name Skin Name
|
||||
* @param string $file Skin File
|
||||
* @param string $url Skin Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addGetSkin($name, $file, $url) {
|
||||
$skinElement = new GetSkin($name, $file, $url);
|
||||
$this->addElement($skinElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Buddy
|
||||
*
|
||||
* @param string $login Buddy Login
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addAddBuddy($login) {
|
||||
$buddyElement = new AddBuddy($login);
|
||||
$this->addElement($buddyElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Go to a Link
|
||||
*
|
||||
* @param string $link Goto Link
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addGoto($link) {
|
||||
$gotoElement = new Go_To($link);
|
||||
$this->addElement($gotoElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Join a Server
|
||||
*
|
||||
* @param string $login Server Login
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addJoinServer($login) {
|
||||
$serverElement = new JoinServer($login);
|
||||
$this->addElement($serverElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Server as Favorite
|
||||
*
|
||||
* @param string $login Server Login
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addAddFavorite($login) {
|
||||
$favoriteElement = new AddFavorite($login);
|
||||
$this->addElement($favoriteElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a Script
|
||||
*
|
||||
* @param string $name Script Name
|
||||
* @param string $file Script File
|
||||
* @param string $url Script Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addInstallScript($name, $file, $url) {
|
||||
$scriptElement = new InstallScript($name, $file, $url);
|
||||
$this->addElement($scriptElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a Title Pack
|
||||
*
|
||||
* @param string $name Pack Name
|
||||
* @param string $file Pack File
|
||||
* @param string $url Pack Url
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addInstallPack($name, $file, $url) {
|
||||
$packElement = new InstallPack($name, $file, $url);
|
||||
$this->addElement($packElement);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a ManiaCode Element
|
||||
*
|
||||
* @param Element $element The Element to add
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function addElement(Element $element) {
|
||||
array_push($this->elements, $element);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all Elements from the ManiaCode
|
||||
*
|
||||
* @return \FML\ManiaCode
|
||||
*/
|
||||
public function removeElements() {
|
||||
$this->elements = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the XML Document
|
||||
*
|
||||
* @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);
|
||||
$domDocument->xmlStandalone = true;
|
||||
$maniaCode = $domDocument->createElement($this->tagName);
|
||||
$domDocument->appendChild($maniaCode);
|
||||
if ($this->noConfirmation) {
|
||||
$maniaCode->setAttribute('noconfirmation', $this->noConfirmation);
|
||||
}
|
||||
foreach ($this->elements as $element) {
|
||||
$xmlElement = $element->render($domDocument);
|
||||
$maniaCode->appendChild($xmlElement);
|
||||
}
|
||||
if ($echo) {
|
||||
header('Content-Type: application/xml; charset=utf-8;');
|
||||
echo $domDocument->saveXML();
|
||||
}
|
||||
return $domDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get String Representation
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
$domDocument = $this->render();
|
||||
$xmlText = $domDocument->saveXML();
|
||||
return $xmlText;
|
||||
}
|
||||
}
|
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;
|
||||
}
|
||||
}
|
289
application/core/Libs/FML/ManiaLink.php
Normal file
289
application/core/Libs/FML/ManiaLink.php
Normal file
@ -0,0 +1,289 @@
|
||||
<?php
|
||||
|
||||
namespace FML;
|
||||
|
||||
use FML\Elements\Dico;
|
||||
use FML\Script\Script;
|
||||
use FML\Stylesheet\Stylesheet;
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Class representing a ManiaLink
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ManiaLink {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const BACKGROUND_0 = '0';
|
||||
const BACKGROUND_STARS = 'stars';
|
||||
const BACKGROUND_STATIONS = 'stations';
|
||||
const BACKGROUND_TITLE = 'title';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $encoding = 'utf-8';
|
||||
protected $tagName = 'manialink';
|
||||
protected $id = '';
|
||||
protected $version = 1;
|
||||
protected $background = '';
|
||||
protected $navigable3d = 0;
|
||||
protected $timeout = 0;
|
||||
protected $children = array();
|
||||
protected $dico = null;
|
||||
protected $stylesheet = null;
|
||||
protected $script = null;
|
||||
|
||||
/**
|
||||
* Create a new ManiaLink Object
|
||||
*
|
||||
* @param string $id (optional) ManiaLink Id
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$maniaLink = new ManiaLink($id);
|
||||
return $maniaLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new ManiaLink Object
|
||||
*
|
||||
* @param string $id (optional) ManiaLink Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
if ($id !== null) {
|
||||
$this->setId($id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set XML Encoding
|
||||
*
|
||||
* @param string $encoding XML Encoding
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function setXmlEncoding($encoding) {
|
||||
$this->encoding = (string) $encoding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ManiaLink Id
|
||||
*
|
||||
* @param string $id ManiaLink Id
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = (string) $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ManiaLink Id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Background
|
||||
*
|
||||
* @param string $background Background Value
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function setBackground($background) {
|
||||
$this->background = (string) $background;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Navigable3d
|
||||
*
|
||||
* @param bool $navigable3d Whether the manialink should be 3d navigable
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function setNavigable3d($navigable3d) {
|
||||
$this->navigable3d = ($navigable3d ? 1 : 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Timeout
|
||||
*
|
||||
* @param int $timeout Timeout Duration
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function setTimeout($timeout) {
|
||||
$this->timeout = (int) $timeout;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an Element to the ManiaLink
|
||||
*
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function add(Renderable $child) {
|
||||
if (!in_array($child, $this->children, true)) {
|
||||
array_push($this->children, $child);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all Elements from the ManiaLinks
|
||||
*
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function removeChildren() {
|
||||
$this->children = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Dictionary of the ManiaLink
|
||||
*
|
||||
* @param Dico $dico The Dictionary to use
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function setDico(Dico $dico) {
|
||||
$this->dico = $dico;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current Dictionary of the ManiaLink
|
||||
*
|
||||
* @param bool $createIfEmpty (optional) Whether the Dico Object should be created if it's not set yet
|
||||
* @return \FML\Elements\Dico
|
||||
*/
|
||||
public function getDico($createIfEmpty = true) {
|
||||
if (!$this->dico && $createIfEmpty) {
|
||||
$this->dico = new Dico();
|
||||
}
|
||||
return $this->dico;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Stylesheet of the ManiaLink
|
||||
*
|
||||
* @param Stylesheet $stylesheet Stylesheet Object
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function setStylesheet(Stylesheet $stylesheet) {
|
||||
$this->stylesheet = $stylesheet;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Stylesheet of the ManiaLink
|
||||
*
|
||||
* @param bool $createIfEmpty (optional) Whether the Script Object should be created if it's not set yet
|
||||
* @return \FML\Stylesheet\Stylesheet
|
||||
*/
|
||||
public function getStylesheet($createIfEmpty = true) {
|
||||
if (!$this->stylesheet && $createIfEmpty) {
|
||||
$this->stylesheet = new Stylesheet();
|
||||
}
|
||||
return $this->stylesheet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Script of the ManiaLink
|
||||
*
|
||||
* @param Script $script The Script for the ManiaLink
|
||||
* @return \FML\ManiaLink
|
||||
*/
|
||||
public function setScript(Script $script) {
|
||||
$this->script = $script;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current Script of the ManiaLink
|
||||
*
|
||||
* @param bool $createIfEmpty (optional) Whether the Script Object should be created if it's not set yet
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function getScript($createIfEmpty = true) {
|
||||
if (!$this->script && $createIfEmpty) {
|
||||
$this->script = new Script();
|
||||
}
|
||||
return $this->script;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the XML Document
|
||||
*
|
||||
* @param bool (optional) $echo If the XML Text should be echoed and the Content-Type Header should be set
|
||||
* @param \DOMDocument $domDocument (optional) DOMDocument for which the XML Element should be created
|
||||
* @return \DOMDocument
|
||||
*/
|
||||
public function render($echo = false, $domDocument = null) {
|
||||
$isChild = (bool) $domDocument;
|
||||
if (!$isChild) {
|
||||
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
||||
$domDocument->xmlStandalone = true;
|
||||
}
|
||||
$maniaLink = $domDocument->createElement($this->tagName);
|
||||
if (!$isChild) {
|
||||
$domDocument->appendChild($maniaLink);
|
||||
}
|
||||
if (strlen($this->id) > 0) {
|
||||
$maniaLink->setAttribute('id', $this->id);
|
||||
}
|
||||
if ($this->version) {
|
||||
$maniaLink->setAttribute('version', $this->version);
|
||||
}
|
||||
if (strlen($this->background) > 0) {
|
||||
$maniaLink->setAttribute('background', $this->background);
|
||||
}
|
||||
if ($this->navigable3d) {
|
||||
// TODO: check default value
|
||||
$maniaLink->setAttribute('navigable3d', $this->navigable3d);
|
||||
}
|
||||
if ($this->timeout) {
|
||||
$timeoutXml = $domDocument->createElement('timeout', $this->timeout);
|
||||
$maniaLink->appendChild($timeoutXml);
|
||||
}
|
||||
foreach ($this->children as $child) {
|
||||
$childXml = $child->render($domDocument);
|
||||
$maniaLink->appendChild($childXml);
|
||||
}
|
||||
if ($this->dico) {
|
||||
$dicoXml = $this->dico->render($domDocument);
|
||||
$maniaLink->appendChild($dicoXml);
|
||||
}
|
||||
if ($this->stylesheet) {
|
||||
$stylesheetXml = $this->stylesheet->render($domDocument);
|
||||
$maniaLink->appendChild($stylesheetXml);
|
||||
}
|
||||
if ($this->script) {
|
||||
$scriptXml = $this->script->render($domDocument);
|
||||
$maniaLink->appendChild($scriptXml);
|
||||
}
|
||||
if ($isChild) {
|
||||
return $maniaLink;
|
||||
}
|
||||
if ($echo) {
|
||||
header('Content-Type: application/xml; charset=utf-8;');
|
||||
echo $domDocument->saveXML();
|
||||
}
|
||||
return $domDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get String Representation
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
$domDocument = $this->render();
|
||||
$xmlText = $domDocument->saveXML();
|
||||
return $xmlText;
|
||||
}
|
||||
}
|
129
application/core/Libs/FML/ManiaLinks.php
Normal file
129
application/core/Libs/FML/ManiaLinks.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace FML;
|
||||
|
||||
/**
|
||||
* Class holding several ManiaLinks at once
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class ManiaLinks {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $encoding = 'utf-8';
|
||||
protected $tagName = 'manialinks';
|
||||
protected $children = array();
|
||||
protected $customUI = null;
|
||||
|
||||
/**
|
||||
* Create a new ManiaLinks Object
|
||||
*
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public static function create() {
|
||||
$maniaLinks = new ManiaLinks();
|
||||
return $maniaLinks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new ManiaLinks Object
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set XML Encoding
|
||||
*
|
||||
* @param string $encoding XML Encoding
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public function setXmlEncoding($encoding) {
|
||||
$this->encoding = (string) $encoding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Child ManiaLink
|
||||
*
|
||||
* @param ManiaLink $child Child ManiaLink
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public function add(ManiaLink $child) {
|
||||
if (!in_array($child, $this->children, true)) {
|
||||
array_push($this->children, $child);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all Child ManiaLinks
|
||||
*
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public function removeChildren() {
|
||||
$this->children = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the CustomUI
|
||||
*
|
||||
* @param CustomUI $customUI The CustomUI Object
|
||||
* @return \FML\ManiaLinks
|
||||
*/
|
||||
public function setCustomUI(CustomUI $customUI) {
|
||||
$this->customUI = $customUI;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current CustomUI
|
||||
*
|
||||
* @param bool $createIfEmpty (optional) Whether the CustomUI Object should be created if it's not set yet
|
||||
* @return \FML\CustomUI
|
||||
*/
|
||||
public function getCustomUI($createIfEmpty = true) {
|
||||
if (!$this->customUI && $createIfEmpty) {
|
||||
$this->customUI = new CustomUI();
|
||||
}
|
||||
return $this->customUI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the XML Document
|
||||
*
|
||||
* @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);
|
||||
$domDocument->xmlStandalone = true;
|
||||
$maniaLinks = $domDocument->createElement($this->tagName);
|
||||
$domDocument->appendChild($maniaLinks);
|
||||
foreach ($this->children as $child) {
|
||||
$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; charset=utf-8;');
|
||||
echo $domDocument->saveXML();
|
||||
}
|
||||
return $domDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get String Representation
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
$domDocument = $this->render();
|
||||
$xmlText = $domDocument->saveXML();
|
||||
return $xmlText;
|
||||
}
|
||||
}
|
64
application/core/Libs/FML/Script/Builder.php
Normal file
64
application/core/Libs/FML/Script/Builder.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Script;
|
||||
|
||||
/**
|
||||
* Builder Class offering Methods to build ManiaScript
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
abstract class Builder {
|
||||
|
||||
/**
|
||||
* Build a Label Implementation Block
|
||||
*
|
||||
* @param string $labelName Name of the Label
|
||||
* @param string $implementationCode Label Implementation Coding (without declaration)
|
||||
* @return string
|
||||
*/
|
||||
public static function getLabelImplementationBlock($labelName, $implementationCode) {
|
||||
$labelText = PHP_EOL . "***{$labelName}***" . PHP_EOL . "***{$implementationCode}***" . PHP_EOL;
|
||||
return $labelText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape dangerous Characters in the given Text
|
||||
*
|
||||
* @param string $text Text to escape
|
||||
* @return string
|
||||
*/
|
||||
public static function escapeText($text) {
|
||||
$escapedText = $text;
|
||||
$dangers = array('\\', '"');
|
||||
$replacements = array('\\\\', '\\"');
|
||||
$escapedText = str_ireplace($dangers, $replacements, $escapedText);
|
||||
return $escapedText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Real String-Representation of the given Value
|
||||
*
|
||||
* @param float $value The Float Value to convert to a ManiaScript Real
|
||||
* @return string
|
||||
*/
|
||||
public static function getReal($value) {
|
||||
$value = (float) $value;
|
||||
$stringVal = (string) $value;
|
||||
if (!fmod($value, 1)) $stringVal .= '.';
|
||||
return $stringVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Boolean String-Representation of the given Value
|
||||
*
|
||||
* @param bool $value The Value to convert to a ManiaScript Boolean
|
||||
* @return string
|
||||
*/
|
||||
public static function getBoolean($value) {
|
||||
$bool = (bool) $value;
|
||||
if ($bool) {
|
||||
return "True";
|
||||
}
|
||||
return "False";
|
||||
}
|
||||
}
|
43
application/core/Libs/FML/Script/EUISound.php
Normal file
43
application/core/Libs/FML/Script/EUISound.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Script;
|
||||
|
||||
/**
|
||||
* Class for EUISound Variants
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
abstract class EUISound {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const SOUND_Bonus = 'Bonus';
|
||||
const SOUND_Capture = 'Capture';
|
||||
const SOUND_Checkpoint = 'Checkpoint';
|
||||
const SOUND_Combo = 'Combo';
|
||||
const SOUND_Custom1 = 'Custom1';
|
||||
const SOUND_Custom2 = 'Custom2';
|
||||
const SOUND_Custom3 = 'Custom3';
|
||||
const SOUND_Custom4 = 'Custom4';
|
||||
const SOUND_Default = 'Default';
|
||||
const SOUND_EndMatch = 'EndMatch';
|
||||
const SOUND_EndRound = 'EndRound';
|
||||
const SOUND_Finish = 'Finish';
|
||||
const SOUND_FirstHit = 'FirstHit';
|
||||
const SOUND_Notice = 'Notice';
|
||||
const SOUND_PhaseChange = 'PhaseChange';
|
||||
const SOUND_PlayerEliminated = 'PlayerEliminated';
|
||||
const SOUND_PlayerHit = 'PlayerHit';
|
||||
const SOUND_PlayersRemaining = 'PlayersRemaining';
|
||||
const SOUND_RankChange = 'RankChange';
|
||||
const SOUND_Record = 'Record';
|
||||
const SOUND_ScoreProgress = 'ScoreProgress';
|
||||
const SOUND_Silence = 'Silence';
|
||||
const SOUND_StartMatch = 'StartMatch';
|
||||
const SOUND_StartRound = 'StartRound';
|
||||
const SOUND_TieBreakPoint = 'TieBreakPoint';
|
||||
const SOUND_TiePoint = 'TiePoint';
|
||||
const SOUND_TimeOut = 'TimeOut';
|
||||
const SOUND_VictoryPoint = 'VictoryPoint';
|
||||
const SOUND_Warning = 'Warning';
|
||||
}
|
4
application/core/Libs/FML/Script/Parts/Header.txt
Normal file
4
application/core/Libs/FML/Script/Parts/Header.txt
Normal file
@ -0,0 +1,4 @@
|
||||
/*********************************
|
||||
* FancyManiaLinks by steeffeen *
|
||||
* http://fml.steeffeen.com *
|
||||
*********************************/
|
34
application/core/Libs/FML/Script/Parts/Main.txt
Normal file
34
application/core/Libs/FML/Script/Parts/Main.txt
Normal file
@ -0,0 +1,34 @@
|
||||
Void Dummy() {}
|
||||
main() {
|
||||
declare FML_ScriptStart = Now;
|
||||
+++OnInit+++
|
||||
declare FML_LoopCounter = 0;
|
||||
declare FML_LastTick = 0;
|
||||
while (True) {
|
||||
yield;
|
||||
foreach (Event in PendingEvents) {
|
||||
switch (Event.Type) {
|
||||
case CMlEvent::Type::EntrySubmit: {
|
||||
+++EntrySubmit+++
|
||||
}
|
||||
case CMlEvent::Type::KeyPress: {
|
||||
+++KeyPress+++
|
||||
}
|
||||
case CMlEvent::Type::MouseClick: {
|
||||
+++MouseClick+++
|
||||
}
|
||||
case CMlEvent::Type::MouseOut: {
|
||||
+++MouseOut+++
|
||||
}
|
||||
case CMlEvent::Type::MouseOver: {
|
||||
+++MouseOver+++
|
||||
}
|
||||
}
|
||||
}
|
||||
FML_LoopCounter += 1;
|
||||
+++Loop+++
|
||||
if (FML_LastTick + 250 > Now) continue;
|
||||
FML_LastTick = Now;
|
||||
+++Tick+++
|
||||
}
|
||||
}
|
988
application/core/Libs/FML/Script/Script.php
Normal file
988
application/core/Libs/FML/Script/Script.php
Normal file
@ -0,0 +1,988 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Script;
|
||||
|
||||
use FML\Controls\Control;
|
||||
use FML\Controls\Label;
|
||||
use FML\Types\Scriptable;
|
||||
use FML\Types\Actionable;
|
||||
|
||||
/**
|
||||
* Class representing the ManiaLink Script
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Script {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const CLASS_TOOLTIP = 'FML_Tooltip';
|
||||
const CLASS_MENU = 'FML_Menu';
|
||||
const CLASS_MENUBUTTON = 'FML_MenuButton';
|
||||
const CLASS_PAGE = 'FML_Page';
|
||||
const CLASS_PAGER = 'FML_Pager';
|
||||
const CLASS_PAGELABEL = 'FML_PageLabel';
|
||||
const CLASS_PROFILE = 'FML_Profile';
|
||||
const CLASS_MAPINFO = 'FML_MapInfo';
|
||||
const CLASS_SOUND = 'FML_Sound';
|
||||
const CLASS_TOGGLE = 'FML_Toggle';
|
||||
const CLASS_SPECTATE = 'FML_Spectate';
|
||||
const CLASS_PAGEACTION = 'FML_PageAction';
|
||||
const CLASS_TIME = 'FML_Time';
|
||||
const OPTION_TOOLTIP_STAYONCLICK = 'FML_StayOnClick_Tooltip';
|
||||
const OPTION_TOOLTIP_INVERT = 'FML_Invert_Tooltip';
|
||||
const OPTION_TOOLTIP_TEXT = 'FML_Text_Tooltip';
|
||||
const OPTION_TOGGLE_SHOW = 'FML_Show_Toggle';
|
||||
const OPTION_TOGGLE_HIDE = 'FML_Hide_Toggle';
|
||||
const OPTION_PROFILE_OWN = 'FML_Own_Profile';
|
||||
const OPTION_TIME_HIDESECONDS = 'FML_HideSeconds_Time';
|
||||
const OPTION_TIME_FULLDATE = 'FML_FullDate_Time';
|
||||
const LABEL_ONINIT = 'OnInit';
|
||||
const LABEL_LOOP = 'Loop';
|
||||
const LABEL_TICK = 'Tick';
|
||||
const LABEL_ENTRYSUBMIT = 'EntrySubmit';
|
||||
const LABEL_KEYPRESS = 'KeyPress';
|
||||
const LABEL_MOUSECLICK = 'MouseClick';
|
||||
const LABEL_MOUSEOUT = 'MouseOut';
|
||||
const LABEL_MOUSEOVER = 'MouseOver';
|
||||
const CONSTANT_TOOLTIPTEXTS = 'C_FML_TooltipTexts';
|
||||
const FUNCTION_GETTOOLTIPCONTROLID = 'FML_GetTooltipControlId';
|
||||
const FUNCTION_SETTOOLTIPTEXT = 'FML_SetTooltipText';
|
||||
const FUNCTION_TOGGLE = 'FML_Toggle';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'script';
|
||||
protected $includes = array();
|
||||
protected $constants = array();
|
||||
protected $functions = array();
|
||||
protected $tooltips = false;
|
||||
protected $tooltipTexts = array();
|
||||
protected $menus = false;
|
||||
protected $pages = false;
|
||||
protected $profile = false;
|
||||
protected $mapInfo = false;
|
||||
protected $sounds = array();
|
||||
protected $toggles = false;
|
||||
protected $spectate = false;
|
||||
protected $pageActions = false;
|
||||
protected $times = false;
|
||||
|
||||
/**
|
||||
* Create a new Script Object
|
||||
*
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public static function create() {
|
||||
$script = new Script();
|
||||
return $script;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Script Object
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an Include of the Script
|
||||
*
|
||||
* @param string $namespace Namespace used for the Include
|
||||
* @param string $file Included File Url
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function setInclude($namespace, $file) {
|
||||
$this->includes[$namespace] = $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Constant of the Script
|
||||
*
|
||||
* @param string $name Variable Name of the Constant
|
||||
* @param string $value Constant Value
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function setConstant($name, $value) {
|
||||
$this->constants[$name] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Function of the Script
|
||||
*
|
||||
* @param string $name Function Name
|
||||
* @param string $coding Complete Function Implementation including Declaration
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function setFunction($name, $coding) {
|
||||
$this->functions[$name] = $coding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Tooltip Behavior
|
||||
*
|
||||
* @param Control $hoverControl The Control that shows the Tooltip
|
||||
* @param Control $tooltipControl The Tooltip to display
|
||||
* @param string $options,... (optional) Unlimited Number of Tooltip Options
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addTooltip(Control $hoverControl, Control $tooltipControl) {
|
||||
if (!($hoverControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as HoverControl for Tooltips!');
|
||||
return $this;
|
||||
}
|
||||
$tooltipControl->checkId();
|
||||
$tooltipControl->setVisible(false);
|
||||
$hoverControl->checkId();
|
||||
$hoverControl->setScriptEvents(true);
|
||||
$hoverControl->addClass(self::CLASS_TOOLTIP);
|
||||
$hoverControl->addClass(self::CLASS_TOOLTIP . '-' . $tooltipControl->getId());
|
||||
$options = $this->spliceParameters(func_get_args(), 2);
|
||||
foreach ($options as $option => $value) {
|
||||
if ($option == self::OPTION_TOOLTIP_TEXT) {
|
||||
if (!($tooltipControl instanceof Label)) {
|
||||
trigger_error('Label needed for Tooltip Text Option!');
|
||||
continue;
|
||||
}
|
||||
$hoverId = $hoverControl->getId();
|
||||
$tooltipId = $tooltipControl->getId();
|
||||
if (!isset($this->tooltipTexts[$tooltipId])) {
|
||||
$this->tooltipTexts[$tooltipId] = array();
|
||||
}
|
||||
$this->tooltipTexts[$tooltipId][$hoverId] = $value;
|
||||
continue;
|
||||
}
|
||||
if ($option == self::OPTION_TOOLTIP_INVERT) {
|
||||
$tooltipControl->setVisible(true);
|
||||
}
|
||||
$hoverControl->addClass($option);
|
||||
}
|
||||
$this->tooltips = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Menu Behavior
|
||||
*
|
||||
* @param Control $clickControl The Control showing the Menu
|
||||
* @param Control $menuControl The Menu to show
|
||||
* @param string $menuId (optional) An identifier to specify the Menu Group
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addMenu(Control $clickControl, Control $menuControl, $menuId = null) {
|
||||
if (!($clickControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as ClickControl for Menus!');
|
||||
return $this;
|
||||
}
|
||||
if (!$menuId) $menuId = '_';
|
||||
$menuControl->checkId();
|
||||
$menuControl->addClass(self::CLASS_MENU);
|
||||
$menuControl->addClass($menuId);
|
||||
$clickControl->setScriptEvents(true);
|
||||
$clickControl->addClass(self::CLASS_MENUBUTTON);
|
||||
$clickControl->addClass($menuId . '-' . $menuControl->getId());
|
||||
$this->menus = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Page for a Paging Behavior
|
||||
*
|
||||
* @param Control $pageControl The Page to display
|
||||
* @param int $pageNumber The Number of the Page
|
||||
* @param string $pagesId (optional) An identifier to specify the Pages Group
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addPage(Control $pageControl, $pageNumber, $pagesId = null) {
|
||||
$pageNumber = (int) $pageNumber;
|
||||
if (!$pagesId) $pagesId = '_';
|
||||
$pageControl->addClass(self::CLASS_PAGE);
|
||||
$pageControl->addClass($pagesId);
|
||||
$pageControl->addClass(self::CLASS_PAGE . '-P' . $pageNumber);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Pager Button for a Paging Behavior
|
||||
*
|
||||
* @param Control $pagerControl The Control to leaf through the Pages
|
||||
* @param int $pagingAction The Number of Pages the Pager leafs
|
||||
* @param string $pagesId (optional) An identifier to specify the Pages Group
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addPager(Control $pagerControl, $pagingAction, $pagesId = null) {
|
||||
if (!($pagerControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as PagerControl for Pages!');
|
||||
return $this;
|
||||
}
|
||||
$pagingAction = (int) $pagingAction;
|
||||
if (!$pagesId) $pagesId = '_';
|
||||
$pagerControl->setScriptEvents(true);
|
||||
$pagerControl->addClass(self::CLASS_PAGER);
|
||||
$pagerControl->addClass(self::CLASS_PAGER . '-I' . $pagesId);
|
||||
$pagerControl->addClass(self::CLASS_PAGER . '-A' . $pagingAction);
|
||||
$this->pages = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Label that shows the current Page Number
|
||||
*
|
||||
* @param Label $pageLabel The Label showing the Number of the currently displayed Page
|
||||
* @param string $pagesId
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addPageLabel(Label $pageLabel, $pagesId = null) {
|
||||
if (!$pagesId) $pagesId = '_';
|
||||
$pageLabel->addClass(self::CLASS_PAGELABEL);
|
||||
$pageLabel->addClass($pagesId);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Button Behavior that will open the Built-In Player Profile
|
||||
* (Works only for Server ManiaLinks)
|
||||
*
|
||||
* @param Control $profileControl The Control opening a Profile
|
||||
* @param string $playerLogin The Player Login
|
||||
* @param string $options,... (optional) Unlimited Number of Profile Options
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addProfileButton(Control $profileControl, $playerLogin) {
|
||||
if (!($profileControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as ClickControl for Profiles!');
|
||||
return $this;
|
||||
}
|
||||
$profileControl->setScriptEvents(true);
|
||||
$profileControl->addClass(self::CLASS_PROFILE);
|
||||
$playerLogin = (string) $playerLogin;
|
||||
$profileControl->addClass(self::CLASS_PROFILE . '-' . $playerLogin);
|
||||
$options = $this->spliceParameters(func_get_args(), 2);
|
||||
foreach ($options as $option => $value) {
|
||||
$profileControl->addClass($option);
|
||||
}
|
||||
$this->profile = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Button Behavior that will open the Built-In Map Info
|
||||
* (Works only on a Server)
|
||||
*
|
||||
* @param Control $mapInfoControl The Control opening the Map Info
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addMapInfoButton(Control $mapInfoControl) {
|
||||
if (!($mapInfoControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as ClickControl for Map Info!');
|
||||
return $this;
|
||||
}
|
||||
$mapInfoControl->setScriptEvents(true);
|
||||
$mapInfoControl->addClass(self::CLASS_MAPINFO);
|
||||
$this->mapInfo = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Sound Playing for the Control
|
||||
* (Works only for Server ManiaLinks)
|
||||
*
|
||||
* @param Control $control The Control playing a Sound
|
||||
* @param string $soundName The Sound to play
|
||||
* @param int $soundVariant (optional) Sound Variant
|
||||
* @param float $soundVolume (optional) Sound Volume
|
||||
* @param string $eventLabel (optional) The Event Label on which the Sound should be played
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addSound(Control $control, $soundName, $soundVariant = 0, $soundVolume = 1., $eventLabel = self::LABEL_MOUSECLICK) {
|
||||
if (!($control instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as ClickControl for Sounds!');
|
||||
return $this;
|
||||
}
|
||||
$control->setScriptEvents(true);
|
||||
$control->checkId();
|
||||
$control->addClass(self::CLASS_SOUND);
|
||||
$soundData = array();
|
||||
$soundData['soundName'] = $soundName;
|
||||
$soundData['soundVariant'] = $soundVariant;
|
||||
$soundData['soundVolume'] = $soundVolume;
|
||||
$soundData['controlId'] = $control->getId();
|
||||
$soundData['eventLabel'] = $eventLabel;
|
||||
array_push($this->sounds, $soundData);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Toggling Behavior
|
||||
*
|
||||
* @param Control $clickControl The Control that toggles another Control on Click
|
||||
* @param Control $toggleControl The Control to toggle
|
||||
* @param string $mode (optional) Whether the Visibility should be toggled or only en-/disabled
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addToggle(Control $clickControl, Control $toggleControl, $option = null) {
|
||||
if (!($clickControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as ClickControl for Toggles!');
|
||||
return $this;
|
||||
}
|
||||
$toggleControl->checkId();
|
||||
if ($option == self::OPTION_TOGGLE_HIDE) {
|
||||
$toggleControl->setVisible(true);
|
||||
$clickControl->addClass($option);
|
||||
}
|
||||
else if ($option == self::OPTION_TOGGLE_SHOW) {
|
||||
$toggleControl->setVisible(false);
|
||||
$clickControl->addClass($option);
|
||||
}
|
||||
$clickControl->setScriptEvents(true);
|
||||
$clickControl->addClass(self::CLASS_TOGGLE);
|
||||
$clickControl->addClass(self::CLASS_TOGGLE . '-' . $toggleControl->getId());
|
||||
$this->toggles = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Spectate Button Behavior
|
||||
*
|
||||
* @param Control $clickControl The Control that works as Spectate Button
|
||||
* @param string $spectateTargetLogin The Login of the Player to Spectate
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addSpectateButton(Control $clickControl, $spectateTargetLogin) {
|
||||
// FIXME: current implementation doesn't support logins with dots in them ('nick.name')
|
||||
if (!($clickControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as ClickControl for Spectating!');
|
||||
return $this;
|
||||
}
|
||||
$clickControl->setScriptEvents(true);
|
||||
$clickControl->addClass(self::CLASS_SPECTATE);
|
||||
$spectateTargetLogin = (string) $spectateTargetLogin;
|
||||
$clickControl->addClass(self::CLASS_SPECTATE . '-' . $spectateTargetLogin);
|
||||
$this->spectate = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger an Action on Control Click
|
||||
*
|
||||
* @param Control $actionControl The Control triggering the Action
|
||||
* @param string $action (optional) The Action to trigger (if empty the Action of the Control will be triggered)
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addPageActionTrigger(Control $actionControl, $action = null) {
|
||||
if (!($actionControl instanceof Scriptable)) {
|
||||
trigger_error('Scriptable Control needed as ActionControl for PageActions!');
|
||||
return $this;
|
||||
}
|
||||
$action = (string) $action;
|
||||
if (strlen($action) <= 0) {
|
||||
if (!($actionControl instanceof Actionable)) {
|
||||
trigger_error('Either Action or Actionable Control needed for PageActions!');
|
||||
return $this;
|
||||
}
|
||||
$action = $actionControl->getAction();
|
||||
}
|
||||
$actionControl->setScriptEvents(true);
|
||||
$actionControl->setAction('');
|
||||
$actionControl->addClass(self::CLASS_PAGEACTION);
|
||||
$actionControl->addClass(self::CLASS_PAGEACTION . '-' . $action);
|
||||
$this->pageActions = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Label showing the current Time
|
||||
*
|
||||
* @param Label $timeLabel The Label showing the current Time
|
||||
* @param bool $hideSeconds Whether the seconds should be hidden
|
||||
* @param bool $showDate Whether to show the full Date Text
|
||||
* @return \FML\Script\Script
|
||||
*/
|
||||
public function addTimeLabel(Label $timeLabel, $hideSeconds = false, $showDate = false) {
|
||||
$timeLabel->addClass(self::CLASS_TIME);
|
||||
if ($hideSeconds) {
|
||||
$timeLabel->addClass(self::OPTION_TIME_HIDESECONDS);
|
||||
}
|
||||
if ($showDate) {
|
||||
$timeLabel->addClass(self::OPTION_TIME_FULLDATE);
|
||||
}
|
||||
$this->times = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Script XML Tag
|
||||
*
|
||||
* @param \DOMDocument $domDocument DOMDocument for which the XML Element should be created
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$scriptXml = $domDocument->createElement($this->tagName);
|
||||
$scriptText = $this->buildScriptText();
|
||||
$scriptComment = $domDocument->createComment($scriptText);
|
||||
$scriptXml->appendChild($scriptComment);
|
||||
return $scriptXml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the complete Script Text
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function buildScriptText() {
|
||||
$mainFunction = $this->getMainFunction();
|
||||
$labels = $this->getLabels();
|
||||
$functions = $this->getFunctions();
|
||||
$constants = $this->getConstants();
|
||||
$includes = $this->getIncludes();
|
||||
$headerComment = $this->getHeaderComment();
|
||||
|
||||
$scriptText = PHP_EOL;
|
||||
$scriptText .= $headerComment;
|
||||
$scriptText .= $includes;
|
||||
$scriptText .= $constants;
|
||||
$scriptText .= $functions;
|
||||
$scriptText .= $labels;
|
||||
$scriptText .= $mainFunction;
|
||||
|
||||
return $scriptText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Header Comment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getHeaderComment() {
|
||||
$headerComment = file_get_contents(__DIR__ . '/Parts/Header.txt');
|
||||
return $headerComment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Includes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getIncludes() {
|
||||
$includesText = PHP_EOL;
|
||||
foreach ($this->includes as $namespace => $file) {
|
||||
$includesText .= "#Include \"{$file}\" as {$namespace}" . PHP_EOL;
|
||||
}
|
||||
return $includesText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Constants
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getConstants() {
|
||||
$this->buildTooltipConstants();
|
||||
$constantsText = PHP_EOL;
|
||||
foreach ($this->constants as $name => $value) {
|
||||
$constantsText .= "#Const {$name} {$value}" . PHP_EOL;
|
||||
}
|
||||
return $constantsText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the Constants needed for tooltips
|
||||
*/
|
||||
private function buildTooltipConstants() {
|
||||
if (!$this->tooltips) return;
|
||||
$constantText = '[';
|
||||
$index = 0;
|
||||
$count = count($this->tooltipTexts);
|
||||
if ($count > 0) {
|
||||
foreach ($this->tooltipTexts as $tooltipId => $tooltipTexts) {
|
||||
$constantText .= '"' . Builder::escapeText($tooltipId) . '" => [';
|
||||
$subIndex = 0;
|
||||
$subCount = count($tooltipTexts);
|
||||
if ($subCount > 0) {
|
||||
foreach ($tooltipTexts as $hoverId => $text) {
|
||||
$constantText .= '"' . Builder::escapeText($hoverId) . '" => "' . Builder::escapeText($text) . '"';
|
||||
if ($subIndex < $subCount - 1) $constantText .= ', ';
|
||||
$subIndex++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$constantText .= '""';
|
||||
}
|
||||
$constantText .= ']';
|
||||
if ($index < $count - 1) $constantText .= ', ';
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$constantText .= '"" => ["" => ""]';
|
||||
}
|
||||
$constantText .= ']';
|
||||
$this->setConstant(self::CONSTANT_TOOLTIPTEXTS, $constantText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Functions
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getFunctions() {
|
||||
$this->buildTooltipFunctions();
|
||||
$functionsText = PHP_EOL;
|
||||
foreach ($this->functions as $name => $coding) {
|
||||
$functionsText .= $coding;
|
||||
}
|
||||
return $functionsText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the Functions needed for Tooltips
|
||||
*/
|
||||
private function buildTooltipFunctions() {
|
||||
if (!$this->tooltips) return;
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$setFunctionText = "
|
||||
Void " . self::FUNCTION_SETTOOLTIPTEXT . "(CMlControl _TooltipControl, CMlControl _HoverControl) {
|
||||
if (!_TooltipControl.Visible) return;
|
||||
declare TooltipId = _TooltipControl.ControlId;
|
||||
declare HoverId = _HoverControl.ControlId;
|
||||
if (!" . self::CONSTANT_TOOLTIPTEXTS . ".existskey(TooltipId)) return;
|
||||
if (!" . self::CONSTANT_TOOLTIPTEXTS . "[TooltipId].existskey(HoverId)) return;
|
||||
declare Label = (_TooltipControl as CMlLabel);
|
||||
Label.Value = " . self::CONSTANT_TOOLTIPTEXTS . "[TooltipId][HoverId];
|
||||
}";
|
||||
$this->setFunction(self::FUNCTION_SETTOOLTIPTEXT, $setFunctionText);
|
||||
$getFunctionText = "
|
||||
Text " . self::FUNCTION_GETTOOLTIPCONTROLID . "(Text _ControlClass) {
|
||||
declare ClassParts = TextLib::Split(\"-\", _ControlClass);
|
||||
if (ClassParts.count < 2) return \"\";
|
||||
if (ClassParts[0] != \"" . self::CLASS_TOOLTIP . "\") return \"\";
|
||||
return ClassParts[1];
|
||||
}";
|
||||
$this->setFunction(self::FUNCTION_GETTOOLTIPCONTROLID, $getFunctionText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getLabels() {
|
||||
$labelsText = PHP_EOL;
|
||||
$labelsText .= $this->getTooltipLabels();
|
||||
$labelsText .= $this->getMenuLabels();
|
||||
$labelsText .= $this->getPagesLabels();
|
||||
$labelsText .= $this->getProfileLabels();
|
||||
$labelsText .= $this->getMapInfoLabels();
|
||||
$labelsText .= $this->getSoundLabels();
|
||||
$labelsText .= $this->getToggleLabels();
|
||||
$labelsText .= $this->getSpectateLabels();
|
||||
$labelsText .= $this->getTimeLabels();
|
||||
return $labelsText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Tooltip Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTooltipLabels() {
|
||||
if (!$this->tooltips) return '';
|
||||
$mouseOverScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIP . "\")) {
|
||||
declare Invert = Event.Control.HasClass(\"" . self::OPTION_TOOLTIP_INVERT . "\");
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ControlId = " . self::FUNCTION_GETTOOLTIPCONTROLID . "(ControlClass);
|
||||
if (ControlId == \"\") continue;
|
||||
declare TooltipControl <=> Page.GetFirstChild(ControlId);
|
||||
if (TooltipControl == Null) continue;
|
||||
TooltipControl.Visible = !Invert;
|
||||
" . self::FUNCTION_SETTOOLTIPTEXT . "(TooltipControl, Event.Control);
|
||||
}
|
||||
}";
|
||||
$mouseOutScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIP . "\")) {
|
||||
declare FML_Clicked for Event.Control = False;
|
||||
declare StayOnClick = Event.Control.HasClass(\"" . self::OPTION_TOOLTIP_STAYONCLICK . "\");
|
||||
if (!StayOnClick || !FML_Clicked) {
|
||||
declare Invert = Event.Control.HasClass(\"" . self::OPTION_TOOLTIP_INVERT . "\");
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ControlId = " . self::FUNCTION_GETTOOLTIPCONTROLID . "(ControlClass);
|
||||
if (ControlId == \"\") continue;
|
||||
declare TooltipControl <=> Page.GetFirstChild(ControlId);
|
||||
if (TooltipControl == Null) continue;
|
||||
TooltipControl.Visible = Invert;
|
||||
" . self::FUNCTION_SETTOOLTIPTEXT . "(TooltipControl, Event.Control);
|
||||
}
|
||||
}
|
||||
}";
|
||||
$mouseClickScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIP . "\")) {
|
||||
declare Handle = True;
|
||||
declare Show = False;
|
||||
declare StayOnClick = Event.Control.HasClass(\"" . self::OPTION_TOOLTIP_STAYONCLICK . "\");
|
||||
if (StayOnClick) {
|
||||
declare FML_Clicked for Event.Control = False;
|
||||
FML_Clicked = !FML_Clicked;
|
||||
if (FML_Clicked) {
|
||||
Handle = False;
|
||||
} else {
|
||||
Show = False;
|
||||
}
|
||||
} else {
|
||||
Handle = False;
|
||||
}
|
||||
if (Handle) {
|
||||
declare Invert = Event.Control.HasClass(\"" . self::OPTION_TOOLTIP_INVERT . "\");
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ControlId = " . self::FUNCTION_GETTOOLTIPCONTROLID . "(ControlClass);
|
||||
if (ControlId == \"\") continue;
|
||||
declare TooltipControl <=> Page.GetFirstChild(ControlId);
|
||||
if (TooltipControl == Null) continue;
|
||||
TooltipControl.Visible = Show && !Invert;
|
||||
" . self::FUNCTION_SETTOOLTIPTEXT . "(TooltipControl, Event.Control);
|
||||
}
|
||||
}
|
||||
}";
|
||||
$tooltipsLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSEOVER, $mouseOverScript);
|
||||
$tooltipsLabels .= Builder::getLabelImplementationBlock(self::LABEL_MOUSEOUT, $mouseOutScript);
|
||||
$tooltipsLabels .= Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mouseClickScript);
|
||||
return $tooltipsLabels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Menu Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getMenuLabels() {
|
||||
if (!$this->menus) return '';
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$mouseClickScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_MENUBUTTON . "\")) {
|
||||
declare Text MenuIdClass;
|
||||
declare Text MenuControlId;
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||
if (ClassParts.count < 2) continue;
|
||||
MenuIdClass = ClassParts[0];
|
||||
MenuControlId = ClassParts[1];
|
||||
break;
|
||||
}
|
||||
Page.GetClassChildren(MenuIdClass, Page.MainFrame, True);
|
||||
foreach (MenuControl in Page.GetClassChildren_Result) {
|
||||
if (!MenuControl.HasClass(\"" . self::CLASS_MENU . "\")) continue;
|
||||
MenuControl.Visible = (MenuControlId == MenuControl.ControlId);
|
||||
}
|
||||
}";
|
||||
$menuLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mouseClickScript);
|
||||
return $menuLabels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Pages Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getPagesLabels() {
|
||||
if (!$this->pages) return "";
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$pagesNumberPrefix = self::CLASS_PAGE . '-P';
|
||||
$pagesNumberPrefixLength = strlen($pagesNumberPrefix);
|
||||
$pagesScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) {
|
||||
declare Text PagesId;
|
||||
declare Integer PagingAction;
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||
if (ClassParts.count < 2) continue;
|
||||
if (ClassParts[0] != \"" . self::CLASS_PAGER . "\") continue;
|
||||
switch (TextLib::SubText(ClassParts[1], 0, 1)) {
|
||||
case \"I\": {
|
||||
PagesId = TextLib::SubText(ClassParts[1], 1, TextLib::Length(ClassParts[1]));
|
||||
}
|
||||
case \"A\": {
|
||||
PagingAction = TextLib::ToInteger(TextLib::SubText(ClassParts[1], 1, TextLib::Length(ClassParts[1])));
|
||||
}
|
||||
}
|
||||
}
|
||||
declare FML_PagesLastScriptStart for This = FML_ScriptStart;
|
||||
declare FML_MinPageNumber for This = Integer[Text];
|
||||
declare FML_MaxPageNumber for This = Integer[Text];
|
||||
declare FML_PageNumber for This = Integer[Text];
|
||||
if (FML_PagesLastScriptStart != FML_ScriptStart || !FML_PageNumber.existskey(PagesId) || !FML_MinPageNumber.existskey(PagesId) || !FML_MaxPageNumber.existskey(PagesId)) {
|
||||
Page.GetClassChildren(PagesId, Page.MainFrame, True);
|
||||
foreach (PageControl in Page.GetClassChildren_Result) {
|
||||
if (!PageControl.HasClass(\"" . self::CLASS_PAGE . "\")) continue;
|
||||
foreach (ControlClass in PageControl.ControlClasses) {
|
||||
if (TextLib::SubText(ControlClass, 0, {$pagesNumberPrefixLength}) != \"{$pagesNumberPrefix}\") continue;
|
||||
declare PageNumber = TextLib::ToInteger(TextLib::SubText(ControlClass, {$pagesNumberPrefixLength}, TextLib::Length(ControlClass)));
|
||||
if (!FML_MinPageNumber.existskey(PagesId) || PageNumber < FML_MinPageNumber[PagesId]) {
|
||||
FML_MinPageNumber[PagesId] = PageNumber;
|
||||
}
|
||||
if (!FML_MaxPageNumber.existskey(PagesId) || PageNumber > FML_MaxPageNumber[PagesId]) {
|
||||
FML_MaxPageNumber[PagesId] = PageNumber;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
FML_PageNumber[PagesId] = FML_MinPageNumber[PagesId];
|
||||
}
|
||||
FML_PageNumber[PagesId] += PagingAction;
|
||||
if (FML_PageNumber[PagesId] < FML_MinPageNumber[PagesId]) {
|
||||
FML_PageNumber[PagesId] = FML_MinPageNumber[PagesId];
|
||||
}
|
||||
if (FML_PageNumber[PagesId] > FML_MaxPageNumber[PagesId]) {
|
||||
FML_PageNumber[PagesId] = FML_MaxPageNumber[PagesId];
|
||||
}
|
||||
FML_PagesLastScriptStart = FML_ScriptStart;
|
||||
Page.GetClassChildren(PagesId, Page.MainFrame, True);
|
||||
foreach (PageControl in Page.GetClassChildren_Result) {
|
||||
if (!PageControl.HasClass(\"" . self::CLASS_PAGE . "\")) continue;
|
||||
declare PageNumber = -1;
|
||||
foreach (ControlClass in PageControl.ControlClasses) {
|
||||
if (TextLib::SubText(ControlClass, 0, {$pagesNumberPrefixLength}) != \"{$pagesNumberPrefix}\") continue;
|
||||
PageNumber = TextLib::ToInteger(TextLib::SubText(ControlClass, {$pagesNumberPrefixLength}, TextLib::Length(ControlClass)));
|
||||
break;
|
||||
}
|
||||
PageControl.Visible = (PageNumber == FML_PageNumber[PagesId]);
|
||||
}
|
||||
Page.GetClassChildren(\"" . self::CLASS_PAGELABEL . "\", Page.MainFrame, True);
|
||||
foreach (PageControl in Page.GetClassChildren_Result) {
|
||||
if (!PageControl.HasClass(PagesId)) continue;
|
||||
declare PageLabel <=> (PageControl as CMlLabel);
|
||||
PageLabel.Value = FML_PageNumber[PagesId]^\"/\"^FML_MaxPageNumber[PagesId];
|
||||
}
|
||||
}";
|
||||
$pagesLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $pagesScript);
|
||||
return $pagesLabels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Profile Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getProfileLabels() {
|
||||
if (!$this->profile) return "";
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$prefixLength = strlen(self::CLASS_PROFILE) + 1;
|
||||
$profileScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_PROFILE . "\")) {
|
||||
declare Login = LocalUser.Login;
|
||||
if (!Event.Control.HasClass(\"" . self::OPTION_PROFILE_OWN . "\")) {
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||
if (ClassParts.count < 2) continue;
|
||||
if (ClassParts[0] != \"" . self::CLASS_PROFILE . "\") continue;
|
||||
Login = TextLib::SubText(ControlClass, {$prefixLength}, TextLib::Length(ControlClass));
|
||||
break;
|
||||
}
|
||||
}
|
||||
ShowProfile(Login);
|
||||
}";
|
||||
$profileLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $profileScript);
|
||||
return $profileLabels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Map Info Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getMapInfoLabels() {
|
||||
if (!$this->mapInfo) return "";
|
||||
$mapInfoScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_MAPINFO . "\")) {
|
||||
ShowCurChallengeCard();
|
||||
}";
|
||||
$mapInfoLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mapInfoScript);
|
||||
return $mapInfoLabels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Sound Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getSoundLabels() {
|
||||
if (!$this->sounds) return '';
|
||||
$labelScripts = array();
|
||||
foreach ($this->sounds as $soundData) {
|
||||
$volume = Builder::getReal($soundData['soundVolume']);
|
||||
$labelScript = "
|
||||
case \"{$soundData['controlId']}\": {
|
||||
PlayUiSound(CMlScriptIngame::EUISound::{$soundData['soundName']}, {$soundData['soundVariant']}, {$volume});
|
||||
}";
|
||||
if (!isset($labelScripts[$soundData['eventLabel']])) {
|
||||
$labelScripts[$soundData['eventLabel']] = '';
|
||||
}
|
||||
$labelScripts[$soundData['eventLabel']] .= $labelScript;
|
||||
}
|
||||
|
||||
$soundScript = '';
|
||||
foreach ($labelScripts as $label => $scriptPart) {
|
||||
$labelScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_SOUND . "\")) {
|
||||
switch (Event.Control.ControlId) {
|
||||
{$scriptPart}
|
||||
}
|
||||
}";
|
||||
$soundScript .= Builder::getLabelImplementationBlock($label, $labelScript);
|
||||
}
|
||||
return $soundScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Toggle Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getToggleLabels() {
|
||||
if (!$this->toggles) return '';
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$toggleScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_TOGGLE . "\")) {
|
||||
declare HasShow = Event.Control.HasClass(\"" . self::OPTION_TOGGLE_SHOW . "\");
|
||||
declare HasHide = Event.Control.HasClass(\"" . self::OPTION_TOGGLE_HIDE . "\");
|
||||
declare Toggle = True;
|
||||
declare Show = True;
|
||||
if (HasShow || HasHide) {
|
||||
Toggle = False;
|
||||
Show = HasShow;
|
||||
}
|
||||
declare PrefixLength = TextLib::Length(\"" . self::CLASS_TOGGLE . "\");
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||
if (ClassParts.count < 2) continue;
|
||||
if (ClassParts[0] != \"" . self::CLASS_TOGGLE . "\") continue;
|
||||
declare ToggleControl <=> Page.GetFirstChild(ClassParts[1]);
|
||||
if (ToggleControl == Null) continue;
|
||||
if (Toggle) {
|
||||
ToggleControl.Visible = !ToggleControl.Visible;
|
||||
} else {
|
||||
ToggleControl.Visible = Show;
|
||||
}
|
||||
}
|
||||
}";
|
||||
$toggleScript = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $toggleScript);
|
||||
return $toggleScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Spectate labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getSpectateLabels() {
|
||||
if (!$this->spectate) return '';
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$prefixLength = strlen(self::CLASS_SPECTATE) + 1;
|
||||
$spectateScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_SPECTATE . "\")) {
|
||||
declare Login = \"\";
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||
if (ClassParts.count < 2) continue;
|
||||
if (ClassParts[0] != \"" . self::CLASS_SPECTATE . "\") continue;
|
||||
Login = TextLib::SubText(ControlClass, {$prefixLength}, TextLib::Length(ControlClass));
|
||||
break;
|
||||
}
|
||||
if (Login != \"\") {
|
||||
SetSpectateTarget(Login);
|
||||
}
|
||||
}";
|
||||
$spectateScript = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $spectateScript);
|
||||
return $spectateScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Page Actions Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getPageActionLabels() {
|
||||
if (!$this->pageActions) return '';
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$prefixLength = strlen(self::CLASS_PAGEACTION) + 1;
|
||||
$pageActionScript = "
|
||||
if (Event.Control.HasClass(\"" . self::CLASS_PAGEACTION . "\")) {
|
||||
declare Action = \"\";
|
||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||
if (ClassParts.count < 2) continue;
|
||||
if (ClassParts[0] != \"" . self::CLASS_PAGEACTION . "\") continue;
|
||||
Action = TextLib::SubText(ControlClass, {$prefixLength}, TextLib::Length(ControlClass));
|
||||
break;
|
||||
}
|
||||
if (Action != \"\") {
|
||||
TriggerPageAction(Action);
|
||||
}
|
||||
}";
|
||||
$pageActionScript = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $pageActionScript);
|
||||
return $pageActionScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Time Labels
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTimeLabels() {
|
||||
if (!$this->times) return '';
|
||||
$this->setInclude('TextLib', 'TextLib');
|
||||
$timesScript = "
|
||||
Page.GetClassChildren(\"" . self::CLASS_TIME . "\", Page.MainFrame, True);
|
||||
foreach (TimeLabelControl in Page.GetClassChildren_Result) {
|
||||
declare TimeLabel = (TimeLabelControl as CMlLabel);
|
||||
declare HideSeconds = TimeLabel.HasClass(\"" . self::OPTION_TIME_HIDESECONDS . "\");
|
||||
declare ShowDate = TimeLabel.HasClass(\"" . self::OPTION_TIME_FULLDATE . "\");
|
||||
declare TimeText = CurrentLocalDateText;
|
||||
if (HideSeconds) {
|
||||
TimeText = TextLib::SubText(TimeText, 0, 16);
|
||||
}
|
||||
if (!ShowDate) {
|
||||
TimeText = TextLib::SubText(TimeText, 11, 9);
|
||||
}
|
||||
TimeLabel.Value = TimeText;
|
||||
}";
|
||||
$timesScript = Builder::getLabelImplementationBlock(self::LABEL_TICK, $timesScript);
|
||||
return $timesScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Main Function
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getMainFunction() {
|
||||
$mainFunction = file_get_contents(__DIR__ . '/Parts/Main.txt');
|
||||
return $mainFunction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Array of additional optional Parameters
|
||||
*
|
||||
* @param array $args The Array of Function Parameters
|
||||
* @param int $offset The Number of obligatory Parameters
|
||||
* @return array
|
||||
*/
|
||||
private function spliceParameters(array $params, $offset) {
|
||||
$args = array_splice($params, $offset);
|
||||
if (!$args) return $args;
|
||||
$parameters = array();
|
||||
foreach ($args as $arg) {
|
||||
if (is_array($arg)) {
|
||||
foreach ($arg as $key => $value) {
|
||||
$parameters[$key] = $value;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$parameters[$arg] = true;
|
||||
}
|
||||
}
|
||||
return $parameters;
|
||||
}
|
||||
}
|
311
application/core/Libs/FML/Stylesheet/Mood.php
Normal file
311
application/core/Libs/FML/Stylesheet/Mood.php
Normal file
@ -0,0 +1,311 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Stylesheet;
|
||||
|
||||
// Warning: The mood class isn't fully supported yet!
|
||||
// Missing attributes: LDir1..
|
||||
|
||||
/**
|
||||
* Class representing a Stylesheets Mood
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Mood {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'mood';
|
||||
protected $lAmbient_LinearRgb = '';
|
||||
protected $cloudsRgbMinLinear = '';
|
||||
protected $cloudsRgbMaxLinear = '';
|
||||
protected $lDir0_LinearRgb = '';
|
||||
protected $lDir0_Intens = 1.;
|
||||
protected $lDir0_DirPhi = 0.;
|
||||
protected $lDir0_DirTheta = 0.;
|
||||
protected $lBall_LinearRgb = '';
|
||||
protected $lBall_Intensity = 1.;
|
||||
protected $lBall_Radius = 0.;
|
||||
protected $fogColorSrgb = '';
|
||||
protected $selfIllumColor = '';
|
||||
protected $skyGradientV_Scale = 1.;
|
||||
protected $skyGradientKeys = array();
|
||||
|
||||
/**
|
||||
* Create a new Mood Object
|
||||
*
|
||||
* @return \FML\Elements\Mood
|
||||
*/
|
||||
public static function create() {
|
||||
$mood = new Mood();
|
||||
return $mood;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Mood Object
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Ambient Color in which the Elements reflect the Light
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLightAmbientColor($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$this->lAmbient_LinearRgb = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Minimum Value for the Background Color Range
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setCloudsColorMin($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$this->cloudsRgbMinLinear = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Maximum Value for the Background Color Range
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setCloudsColorMax($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$this->cloudsRgbMaxLinear = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set RGB Color of Light Source 0
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLight0Color($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$this->lDir0_LinearRgb = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Intensity of Light Source 0
|
||||
*
|
||||
* @param float $intensity Light Intensity
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLight0Intensity($intensity) {
|
||||
$this->lDir0_Intens = (float) $intensity;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Phi-Angle of Light Source 0
|
||||
*
|
||||
* @param float $phiAngle Phi-Angle
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLight0PhiAngle($phiAngle) {
|
||||
$this->lDir0_DirPhi = (float) $phiAngle;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Theta-Angle of Light Source 0
|
||||
*
|
||||
* @param float $thetaAngle Theta-Angle
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLight0ThetaAngle($thetaAngle) {
|
||||
$this->lDir0_DirTheta = (float) $thetaAngle;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Ball Color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLightBallColor($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$this->lBall_LinearRgb = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Ball Intensity
|
||||
*
|
||||
* @param float $intensity Light Ball Intensity
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLightBallIntensity($intensity) {
|
||||
$this->lBall_Intens = (float) $intensity;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Ball Radius
|
||||
*
|
||||
* @param float $radius Light Ball Radius
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setLightBallRadius($radius) {
|
||||
$this->lBall_Radius = (float) $radius;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fog Color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setFogColor($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$this->fogColorSrgb = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Self Illumination Color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setSelfIllumColor($red, $green, $blue) {
|
||||
$red = (float) $red;
|
||||
$green = (float) $green;
|
||||
$blue = (float) $blue;
|
||||
$this->selfIllumColor = "{$red} {$green} {$blue}";
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Sky Gradient Scale
|
||||
*
|
||||
* @param float $vScale Gradient Scale Scale
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function setSkyGradientScale($scale) {
|
||||
$this->skyGradientV_Scale = (float) $scale;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Key for the SkyGradient
|
||||
*
|
||||
* @param float $x Scale Value
|
||||
* @param string $color Gradient Color
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function addSkyGradientKey($x, $color) {
|
||||
$x = (float) $x;
|
||||
$color = (string) $color;
|
||||
$gradientKey = array('x' => $x, 'color' => $color);
|
||||
array_push($this->skyGradientKeys, $gradientKey);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all SkyGradient Keys
|
||||
*
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function removeSkyGradientKeys() {
|
||||
$this->skyGradientKeys = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Mood XML Element
|
||||
*
|
||||
* @param \DOMDocument $domDocument DomDocument for which the Mood XML Element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$moodXml = $domDocument->createElement($this->tagName);
|
||||
if ($this->lAmbient_LinearRgb) {
|
||||
$moodXml->setAttribute('LAmbient_LinearRgb', $this->lAmbient_LinearRgb);
|
||||
}
|
||||
if ($this->cloudsRgbMinLinear) {
|
||||
$moodXml->setAttribute('CloudsRgbMinLinear', $this->cloudsRgbMinLinear);
|
||||
}
|
||||
if ($this->cloudsRgbMaxLinear) {
|
||||
$moodXml->setAttribute('CloudsRgbMaxLinear', $this->cloudsRgbMaxLinear);
|
||||
}
|
||||
if ($this->lDir0_LinearRgb) {
|
||||
$moodXml->setAttribute('LDir0_LinearRgb', $this->lDir0_LinearRgb);
|
||||
}
|
||||
if ($this->lDir0_Intens) {
|
||||
$moodXml->setAttribute('LDir0_Intens', $this->lDir0_Intens);
|
||||
}
|
||||
if ($this->lDir0_DirPhi) {
|
||||
$moodXml->setAttribute('LDir0_DirPhi', $this->lDir0_DirPhi);
|
||||
}
|
||||
if ($this->lDir0_DirTheta) {
|
||||
$moodXml->setAttribute('LDir0_DirTheta', $this->lDir0_DirTheta);
|
||||
}
|
||||
if ($this->lBall_LinearRgb) {
|
||||
$moodXml->setAttribute('LBall_LinearRgb', $this->lBall_LinearRgb);
|
||||
}
|
||||
if ($this->lBall_Intens) {
|
||||
$moodXml->setAttribute('LBall_Intens', $this->lBall_Intens);
|
||||
}
|
||||
if ($this->lBall_Radius) {
|
||||
$moodXml->setAttribute('LBall_Radius', $this->lBall_Radius);
|
||||
}
|
||||
if ($this->fogColorSrgb) {
|
||||
$moodXml->setAttribute('FogColorSrgb', $this->fogColorSrgb);
|
||||
}
|
||||
if ($this->selfIllumColor) {
|
||||
$moodXml->setAttribute('SelfIllumColor', $this->selfIllumColor);
|
||||
}
|
||||
if ($this->skyGradientV_Scale) {
|
||||
$moodXml->setAttribute('SkyGradientV_Scale', $this->skyGradientV_Scale);
|
||||
}
|
||||
if ($this->skyGradientKeys) {
|
||||
$skyGradientXml = $domDocument->createElement('skygradient');
|
||||
$moodXml->appendChild($skyGradientXml);
|
||||
foreach ($this->skyGradientKeys as $gradientKey) {
|
||||
$keyXml = $domDocument->createElement('key');
|
||||
$skyGradientXml->appendChild($keyXml);
|
||||
$keyXml->setAttribute('x', $gradientKey['x']);
|
||||
$keyXml->setAttribute('color', $gradientKey['color']);
|
||||
}
|
||||
}
|
||||
return $moodXml;
|
||||
}
|
||||
}
|
245
application/core/Libs/FML/Stylesheet/Style3d.php
Normal file
245
application/core/Libs/FML/Stylesheet/Style3d.php
Normal file
@ -0,0 +1,245 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Stylesheet;
|
||||
|
||||
/**
|
||||
* Class representing a specific Style3d
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Style3d {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const MODEL_Box = 'Box';
|
||||
const MODEL_Button = 'Button';
|
||||
const MODEL_ButtonH = 'ButtonH';
|
||||
const MODEL_Title = 'Title';
|
||||
const MODEL_Window = 'Window';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'style3d';
|
||||
protected $id = '';
|
||||
protected $model = self::MODEL_Box;
|
||||
// TODO: check what happens for negative thickness values + adapt rendering
|
||||
protected $thickness = null;
|
||||
protected $color = '';
|
||||
protected $focusColor = '';
|
||||
protected $lightColor = '';
|
||||
protected $focusLightColor = '';
|
||||
// TODO: check offset value ranges + apapt rendering
|
||||
protected $yOffset = 0.;
|
||||
protected $focusYOffset = 0.;
|
||||
protected $zOffset = 0.;
|
||||
protected $focusZOffset = 0.;
|
||||
|
||||
/**
|
||||
* Create a new Style3d Object
|
||||
*
|
||||
* @return \FML\Elements\Style3d
|
||||
*/
|
||||
public static function create() {
|
||||
$style3d = new Style3d();
|
||||
return $style3d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Style3d Object
|
||||
*
|
||||
* @param string $id (optional) Style Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
if ($id !== null) {
|
||||
$this->setId($id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Style Id
|
||||
*
|
||||
* @param string $id Style Id
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = (string) $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for Id and assign one if necessary
|
||||
*
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function checkId() {
|
||||
if (!$this->id) {
|
||||
$this->id = uniqid();
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Style Id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Model
|
||||
*
|
||||
* @param string $model Style Model
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setModel($model) {
|
||||
$this->model = (string) $model;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Thickness
|
||||
*
|
||||
* @param float $thickness Style Thickness
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setThickness($thickness) {
|
||||
$this->thickness = (float) $thickness;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Color
|
||||
*
|
||||
* @param string $color Style Color
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setColor($color) {
|
||||
$this->color = (string) $color;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Color
|
||||
*
|
||||
* @param string $focusColor Style Focus Color
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setFocusColor($focusColor) {
|
||||
$this->focusColor = (string) $focusColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Color
|
||||
*
|
||||
* @param string $lightColor Light Color
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setLightColor($lightColor) {
|
||||
$this->lightColor = (string) $lightColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Light Color
|
||||
*
|
||||
* @param string $focusLightColor Focus Light Color
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setFocusLightColor($focusLightColor) {
|
||||
$this->focusLightColor = (string) $focusLightColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Y-Offset
|
||||
*
|
||||
* @param flaot $yOffset Y-Offset
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setYOffset($yOffset) {
|
||||
$this->yOffset = (float) $yOffset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Y-Offset
|
||||
*
|
||||
* @param float $focusYOffset Focus Y-Offset
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setFocusYOffset($focusYOffset) {
|
||||
$this->focusYOffset = (float) $focusYOffset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Z-Offset
|
||||
*
|
||||
* @param float $zOffset Z-Offset
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setZOffset($zOffset) {
|
||||
$this->zOffset = (float) $zOffset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Z-Offset
|
||||
*
|
||||
* @param float $focusZOffset Focus Z-Offset
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
*/
|
||||
public function setFocusZOffset($focusZOffset) {
|
||||
$this->focusZOffset = (float) $focusZOffset;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Style3d XML Element
|
||||
*
|
||||
* @param \DOMDocument $domDocument DomDocument for which the Style3d XML Element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$style3dXml = $domDocument->createElement($this->tagName);
|
||||
$this->checkId();
|
||||
if ($this->id) {
|
||||
$style3dXml->setAttribute('id', $this->id);
|
||||
}
|
||||
if ($this->model) {
|
||||
$style3dXml->setAttribute('model', $this->model);
|
||||
}
|
||||
if ($this->thickness) {
|
||||
$style3dXml->setAttribute('thickness', $this->thickness);
|
||||
}
|
||||
if ($this->color) {
|
||||
$style3dXml->setAttribute('color', $this->color);
|
||||
}
|
||||
if ($this->focusColor) {
|
||||
$style3dXml->setAttribute('fcolor', $this->focusColor);
|
||||
}
|
||||
if ($this->lightColor) {
|
||||
$style3dXml->setAttribute('lightcolor', $this->lightColor);
|
||||
}
|
||||
if ($this->focusLightColor) {
|
||||
$style3dXml->setAttribute('flightcolor', $this->focusLightColor);
|
||||
}
|
||||
if ($this->yOffset) {
|
||||
$style3dXml->setAttribute('yoffset', $this->yOffset);
|
||||
}
|
||||
if ($this->focusYOffset) {
|
||||
$style3dXml->setAttribute('fyoffset', $this->focusYOffset);
|
||||
}
|
||||
if ($this->zOffset) {
|
||||
$style3dXml->setAttribute('zoffset', $this->zOffset);
|
||||
}
|
||||
if ($this->focusZOffset) {
|
||||
$style3dXml->setAttribute('fzoffset', $this->focusZOffset);
|
||||
}
|
||||
return $style3dXml;
|
||||
}
|
||||
}
|
103
application/core/Libs/FML/Stylesheet/Stylesheet.php
Normal file
103
application/core/Libs/FML/Stylesheet/Stylesheet.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Stylesheet;
|
||||
|
||||
/**
|
||||
* Class representing the ManiaLinks Stylesheet
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Stylesheet {
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'stylesheet';
|
||||
protected $styles3d = array();
|
||||
protected $mood = null;
|
||||
|
||||
/**
|
||||
* Create a new Stylesheet Object
|
||||
*
|
||||
* @return \FML\Elements\Stylesheet
|
||||
*/
|
||||
public static function create() {
|
||||
$stylesheet = new Stylesheet();
|
||||
return $stylesheet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Stylesheet Object
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new Style3d
|
||||
*
|
||||
* @param Style3d $style3d The Style3d to add
|
||||
* @return \FML\Stylesheet\Frame3dStyles
|
||||
*/
|
||||
public function addStyle3d(Style3d $style3d) {
|
||||
if (!in_array($style3d, $this->styles3d, true)) {
|
||||
array_push($this->styles3d, $style3d);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all Styles
|
||||
*
|
||||
* @return \FML\Stylesheet\Frame3dStyles
|
||||
*/
|
||||
public function removeStyles() {
|
||||
$this->styles3d = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Mood Object of the Stylesheet
|
||||
*
|
||||
* @param Mood $mood Mood Object
|
||||
* @return \FML\Stylesheet\Stylesheet
|
||||
*/
|
||||
public function setMood(Mood $mood) {
|
||||
$this->mood = $mood;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Mood Object
|
||||
*
|
||||
* @param bool $createIfEmpty (optional) Whether the Mood Object should be created if it's not set yet
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function getMood($createIfEmpty = true) {
|
||||
if (!$this->mood && $createIfEmpty) {
|
||||
$this->mood = new Mood();
|
||||
}
|
||||
return $this->mood;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Stylesheet XML Element
|
||||
*
|
||||
* @param \DOMDocument $domDocument DomDocument for which the Stylesheet XML Element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$stylesheetXml = $domDocument->createElement($this->tagName);
|
||||
if ($this->styles3d) {
|
||||
$stylesXml = $domDocument->createElement('frame3dstyles');
|
||||
$stylesheetXml->appendChild($stylesXml);
|
||||
foreach ($this->styles3d as $style3d) {
|
||||
$style3dXml = $style3d->render($domDocument);
|
||||
$stylesXml->appendChild($style3dXml);
|
||||
}
|
||||
}
|
||||
if ($this->mood) {
|
||||
$moodXml = $this->mood->render($domDocument);
|
||||
$stylesheetXml->appendChild($moodXml);
|
||||
}
|
||||
return $stylesheetXml;
|
||||
}
|
||||
}
|
55
application/core/Libs/FML/Types/Actionable.php
Normal file
55
application/core/Libs/FML/Types/Actionable.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements that support the Action Attribute
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface Actionable {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const ACTION_0 = '0';
|
||||
const ACTION_BACK = 'back';
|
||||
const ACTION_ENTER = 'enter';
|
||||
const ACTION_HOME = 'home';
|
||||
const ACTION_MENU_SOLO = 'menu_solo';
|
||||
const ACTION_MENU_COMPETITIONS = 'menu_competitions';
|
||||
const ACTION_MENU_LOCAL = 'menu_local';
|
||||
const ACTION_MENU_INTERNET = 'menu_internet';
|
||||
const ACTION_MENU_EDITORS = 'menu_editors';
|
||||
const ACTION_MENU_PROFILE = 'menu_profile';
|
||||
const ACTION_QUIT = 'quit';
|
||||
const ACTION_QUITSERVER = 'maniaplanet:quitserver';
|
||||
const ACTION_SAVEREPLAY = 'maniaplanet:savereplay';
|
||||
const ACTION_TOGGLESPEC = 'maniaplanet:togglespec';
|
||||
const ACTIONKEY_F5 = 1;
|
||||
const ACTIONKEY_F6 = 2;
|
||||
const ACTIONKEY_F7 = 3;
|
||||
const ACTIONKEY_F8 = 4;
|
||||
|
||||
/**
|
||||
* Set Action
|
||||
*
|
||||
* @param string $action Action Name
|
||||
* @return \FML\Types\Actionable
|
||||
*/
|
||||
public function setAction($action);
|
||||
|
||||
/**
|
||||
* Get the assigned Action
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAction();
|
||||
|
||||
/**
|
||||
* Set Action Key
|
||||
*
|
||||
* @param int $actionKey Action Key Number
|
||||
* @return \FML\Types\Actionable
|
||||
*/
|
||||
public function setActionKey($actionKey);
|
||||
}
|
19
application/core/Libs/FML/Types/BgColorable.php
Normal file
19
application/core/Libs/FML/Types/BgColorable.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements with Background Color Attribute
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface BgColorable {
|
||||
|
||||
/**
|
||||
* Set Background Color
|
||||
*
|
||||
* @param string $bgColor Background Color
|
||||
* @return \FML\Types\BgColorable
|
||||
*/
|
||||
public function setBgColor($bgColor);
|
||||
}
|
45
application/core/Libs/FML/Types/Container.php
Normal file
45
application/core/Libs/FML/Types/Container.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
use FML\Controls\Control;
|
||||
use FML\Elements\Format;
|
||||
|
||||
/**
|
||||
* Interface for Element being able to contain other Controls
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface Container {
|
||||
|
||||
/**
|
||||
* Add a new Child Control
|
||||
*
|
||||
* @param Control $child The Child Control to add
|
||||
* @return \FML\Types\Container
|
||||
*/
|
||||
public function add(Control $child);
|
||||
|
||||
/**
|
||||
* Remove all Children
|
||||
*
|
||||
* @return \FML\Types\Container
|
||||
*/
|
||||
public function removeChildren();
|
||||
|
||||
/**
|
||||
* Set the Format Object of the Container
|
||||
*
|
||||
* @param Format $format New Format Object
|
||||
* @return \FML\Types\Container
|
||||
*/
|
||||
public function setFormat(Format $format);
|
||||
|
||||
/**
|
||||
* Get the Format Object of the Container
|
||||
*
|
||||
* @param bool $createIfEmpty (optional) Whether the Format Object should be created if it's not set yet
|
||||
* @return \FML\Elements\Format
|
||||
*/
|
||||
public function getFormat($createIfEmpty = true);
|
||||
}
|
43
application/core/Libs/FML/Types/Linkable.php
Normal file
43
application/core/Libs/FML/Types/Linkable.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements with Url Attributes
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface Linkable {
|
||||
|
||||
/**
|
||||
* Set Url
|
||||
*
|
||||
* @param string $url Link Url
|
||||
* @return \FML\Types\Linkable
|
||||
*/
|
||||
public function setUrl($url);
|
||||
|
||||
/**
|
||||
* Set Url Id to use from the Dico
|
||||
*
|
||||
* @param string $urlId
|
||||
* @return \FML\Types\Linkable
|
||||
*/
|
||||
public function setUrlId($urlId);
|
||||
|
||||
/**
|
||||
* Set Manialink
|
||||
*
|
||||
* @param string $manialink Manialink Name
|
||||
* @return \FML\Types\Linkable
|
||||
*/
|
||||
public function setManialink($manialink);
|
||||
|
||||
/**
|
||||
* Set Manialink Id to use from the Dico
|
||||
*
|
||||
* @param string $manialinkId Manialink Id
|
||||
* @return \FML\Types\Linkable
|
||||
*/
|
||||
public function setManialinkId($manialinkId);
|
||||
}
|
19
application/core/Libs/FML/Types/NewLineable.php
Normal file
19
application/core/Libs/FML/Types/NewLineable.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements with AutoNewLine Attribute
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface NewLineable {
|
||||
|
||||
/**
|
||||
* Set Auto New Line
|
||||
*
|
||||
* @param bool $autoNewLine Whether the Control should insert New Lines automatically
|
||||
* @return \FML\Types\NewLineable
|
||||
*/
|
||||
public function setAutoNewLine($autoNewLine);
|
||||
}
|
59
application/core/Libs/FML/Types/Playable.php
Normal file
59
application/core/Libs/FML/Types/Playable.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements with Media Attributes
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface Playable {
|
||||
|
||||
/**
|
||||
* Set Data
|
||||
*
|
||||
* @param string $data Media Url
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setData($data);
|
||||
|
||||
/**
|
||||
* Set Data Id to use from the Dico
|
||||
*
|
||||
* @param string $dataId
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setDataId($dataId);
|
||||
|
||||
/**
|
||||
* Set Play
|
||||
*
|
||||
* @param bool $play Whether the Control should start playing automatically
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setPlay($play);
|
||||
|
||||
/**
|
||||
* Set Looping
|
||||
*
|
||||
* @param bool $looping Whether the Control should play looping
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setLooping($looping);
|
||||
|
||||
/**
|
||||
* Set Music
|
||||
*
|
||||
* @param bool $music Whether the Control represents Background Music
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setMusic($music);
|
||||
|
||||
/**
|
||||
* Set Volume
|
||||
*
|
||||
* @param float $volume Media Volume
|
||||
* @return \FML\Types\Playable
|
||||
*/
|
||||
public function setVolume($volume);
|
||||
}
|
19
application/core/Libs/FML/Types/Renderable.php
Normal file
19
application/core/Libs/FML/Types/Renderable.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for renderable Elements
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface Renderable {
|
||||
|
||||
/**
|
||||
* Render the XML Element
|
||||
*
|
||||
* @param \DOMDocument $domDocument DomDocument for which the XML Element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument);
|
||||
}
|
19
application/core/Libs/FML/Types/Scriptable.php
Normal file
19
application/core/Libs/FML/Types/Scriptable.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements with ScriptEvents Attribute
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface Scriptable {
|
||||
|
||||
/**
|
||||
* Set ScriptEvents
|
||||
*
|
||||
* @param bool $scriptEvents Whether Script Events should be enabled
|
||||
* @return \FML\Types\Scriptable
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents);
|
||||
}
|
19
application/core/Libs/FML/Types/Styleable.php
Normal file
19
application/core/Libs/FML/Types/Styleable.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements with Style Attribute
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface Styleable {
|
||||
|
||||
/**
|
||||
* Set Style
|
||||
*
|
||||
* @param string $style Style Name
|
||||
* @return \FML\Types\Styleable
|
||||
*/
|
||||
public function setStyle($style);
|
||||
}
|
28
application/core/Libs/FML/Types/SubStyleable.php
Normal file
28
application/core/Libs/FML/Types/SubStyleable.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements with SubStyle Attribute
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface SubStyleable {
|
||||
|
||||
/**
|
||||
* Set SubStyle
|
||||
*
|
||||
* @param string $subStyle SubStyle Name
|
||||
* @return \FML\Types\SubStyleable
|
||||
*/
|
||||
public function setSubStyle($subStyle);
|
||||
|
||||
/**
|
||||
* Set Style and SubStyle
|
||||
*
|
||||
* @param string $style Style Name
|
||||
* @param string $subStyle SubStyle Name
|
||||
* @return \FML\Types\SubStyleable
|
||||
*/
|
||||
public function setStyles($style, $subStyle);
|
||||
}
|
43
application/core/Libs/FML/Types/TextFormatable.php
Normal file
43
application/core/Libs/FML/Types/TextFormatable.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Types;
|
||||
|
||||
/**
|
||||
* Interface for Elements with Formatable Text
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
interface TextFormatable {
|
||||
|
||||
/**
|
||||
* Set Text Size
|
||||
*
|
||||
* @param int $textSize Text Size
|
||||
* @return \FML\Types\TextFormatable
|
||||
*/
|
||||
public function setTextSize($textSize);
|
||||
|
||||
/**
|
||||
* Set Text Color
|
||||
*
|
||||
* @param string $textColor Text Color
|
||||
* @return \FML\Types\TextFormatable
|
||||
*/
|
||||
public function setTextColor($textColor);
|
||||
|
||||
/**
|
||||
* Set Area Color
|
||||
*
|
||||
* @param string $areaColor Area Color
|
||||
* @return \FML\Types\TextFormatable
|
||||
*/
|
||||
public function setAreaColor($areaColor);
|
||||
|
||||
/**
|
||||
* Set Area Focus Color
|
||||
*
|
||||
* @param string $areaFocusColor Area Focus Color
|
||||
* @return \FML\Types\TextFormatable
|
||||
*/
|
||||
public function setAreaFocusColor($areaFocusColor);
|
||||
}
|
26
application/core/Libs/FML/autoload.php
Normal file
26
application/core/Libs/FML/autoload.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FancyManiaLinks - Automatic ManiaLink Generator Framework
|
||||
*
|
||||
* @author steeffeen
|
||||
* @version 1.0
|
||||
*/
|
||||
if (!defined('FML_PATH')) {
|
||||
define('FML_PATH', __DIR__ . '/../');
|
||||
}
|
||||
if (!defined('FML_VERSION')) {
|
||||
define('FML_VERSION', 1.0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Autoload Function that loads FML Class Files on Demand
|
||||
*/
|
||||
spl_autoload_register(
|
||||
function ($className) {
|
||||
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className);
|
||||
$filePath = FML_PATH . DIRECTORY_SEPARATOR . $classPath . '.php';
|
||||
if (file_exists($filePath)) {
|
||||
require_once $filePath;
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user