huge fml update
This commit is contained in:
parent
9654b26f2b
commit
771409b8eb
@ -6,7 +6,7 @@ use FML\Types\Playable;
|
|||||||
use FML\Types\Scriptable;
|
use FML\Types\Scriptable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Audio Element
|
* Audio Control
|
||||||
* (CMlMediaPlayer)
|
* (CMlMediaPlayer)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
@ -16,12 +16,24 @@ class Audio extends Control implements Playable, Scriptable {
|
|||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
protected $data = '';
|
protected $data = '';
|
||||||
|
protected $dataId = '';
|
||||||
protected $play = 0;
|
protected $play = 0;
|
||||||
protected $looping = 0;
|
protected $looping = 0;
|
||||||
protected $music = 0;
|
protected $music = 0;
|
||||||
protected $volume = 1.;
|
protected $volume = 1.;
|
||||||
protected $scriptEvents = 0;
|
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
|
* Construct a new Audio Control
|
||||||
*
|
*
|
||||||
@ -42,6 +54,16 @@ class Audio extends Control implements Playable, Scriptable {
|
|||||||
return $this;
|
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()
|
* @see \FML\Types\Playable::setPlay()
|
||||||
@ -104,7 +126,7 @@ class Audio extends Control implements Playable, Scriptable {
|
|||||||
if ($this->play) {
|
if ($this->play) {
|
||||||
$xmlElement->setAttribute('play', $this->play);
|
$xmlElement->setAttribute('play', $this->play);
|
||||||
}
|
}
|
||||||
if ($this->looping) {
|
if (!$this->looping) {
|
||||||
$xmlElement->setAttribute('looping', $this->looping);
|
$xmlElement->setAttribute('looping', $this->looping);
|
||||||
}
|
}
|
||||||
if ($this->music) {
|
if ($this->music) {
|
||||||
|
@ -5,7 +5,7 @@ namespace FML\Controls;
|
|||||||
use FML\Types\Renderable;
|
use FML\Types\Renderable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base Control Element
|
* Base Control
|
||||||
* (CMlControl)
|
* (CMlControl)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
@ -43,7 +43,9 @@ abstract class Control implements Renderable {
|
|||||||
* @param string $id (optional) Control Id
|
* @param string $id (optional) Control Id
|
||||||
*/
|
*/
|
||||||
public function __construct($id = null) {
|
public function __construct($id = null) {
|
||||||
$this->setId($id);
|
if ($id !== null) {
|
||||||
|
$this->setId($id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,7 +8,7 @@ use FML\Types\Styleable;
|
|||||||
use FML\Types\TextFormatable;
|
use FML\Types\TextFormatable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry Element
|
* Entry Control
|
||||||
* (CMlEntry)
|
* (CMlEntry)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
@ -24,8 +24,19 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
|||||||
protected $style = '';
|
protected $style = '';
|
||||||
protected $textColor = '';
|
protected $textColor = '';
|
||||||
protected $textSize = -1;
|
protected $textSize = -1;
|
||||||
protected $areaColor = '';
|
protected $focusAreaColor1 = '';
|
||||||
protected $areaFocusColor = '';
|
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
|
* Construct a new Entry Control
|
||||||
@ -115,7 +126,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
|||||||
* @return \FML\Controls\Entry
|
* @return \FML\Controls\Entry
|
||||||
*/
|
*/
|
||||||
public function setAreaColor($areaColor) {
|
public function setAreaColor($areaColor) {
|
||||||
$this->areaColor = (string) $areaColor;
|
$this->focusAreaColor1 = (string) $areaColor;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +136,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
|||||||
* @return \FML\Controls\Entry
|
* @return \FML\Controls\Entry
|
||||||
*/
|
*/
|
||||||
public function setAreaFocusColor($areaFocusColor) {
|
public function setAreaFocusColor($areaFocusColor) {
|
||||||
$this->areaFocusColor = (string) $areaFocusColor;
|
$this->focusAreaColor2 = (string) $areaFocusColor;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,11 +167,11 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
|||||||
if ($this->textSize >= 0.) {
|
if ($this->textSize >= 0.) {
|
||||||
$xmlElement->setAttribute('textsize', $this->textSize);
|
$xmlElement->setAttribute('textsize', $this->textSize);
|
||||||
}
|
}
|
||||||
if ($this->areaColor) {
|
if ($this->focusAreaColor1) {
|
||||||
$xmlElement->setAttribute('areacolor', $this->areaColor);
|
$xmlElement->setAttribute('focusareacolor1', $this->focusAreaColor1);
|
||||||
}
|
}
|
||||||
if ($this->areaFocusColor) {
|
if ($this->focusAreaColor2) {
|
||||||
$xmlElement->setAttribute('areafocuscolor', $this->areaFocusColor);
|
$xmlElement->setAttribute('focusareacolor2', $this->focusAreaColor2);
|
||||||
}
|
}
|
||||||
return $xmlElement;
|
return $xmlElement;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
namespace FML\Controls;
|
namespace FML\Controls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class representing CMlFileEntry
|
* FileEntry Control
|
||||||
|
* (CMlFileEntry)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
*/
|
*/
|
||||||
@ -13,6 +14,17 @@ class FileEntry extends Entry {
|
|||||||
*/
|
*/
|
||||||
protected $folder = '';
|
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
|
* Construct a new FileEntry Control
|
||||||
*
|
*
|
||||||
|
@ -4,9 +4,11 @@ namespace FML\Controls;
|
|||||||
|
|
||||||
use FML\Types\Container;
|
use FML\Types\Container;
|
||||||
use FML\Types\Renderable;
|
use FML\Types\Renderable;
|
||||||
|
use FML\Elements\Format;
|
||||||
|
use FML\Elements\FrameModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frame Element
|
* Frame Control
|
||||||
* (CMlFrame)
|
* (CMlFrame)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
@ -16,6 +18,18 @@ class Frame extends Control implements Container {
|
|||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
protected $children = array();
|
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
|
* Construct a new Frame Control
|
||||||
@ -32,7 +46,7 @@ class Frame extends Control implements Container {
|
|||||||
* @see \FML\Types\Container::add()
|
* @see \FML\Types\Container::add()
|
||||||
* @return \FML\Controls\Frame
|
* @return \FML\Controls\Frame
|
||||||
*/
|
*/
|
||||||
public function add(Renderable $child) {
|
public function add(Control $child) {
|
||||||
if (!in_array($child, $this->children, true)) {
|
if (!in_array($child, $this->children, true)) {
|
||||||
array_push($this->children, $child);
|
array_push($this->children, $child);
|
||||||
}
|
}
|
||||||
@ -49,12 +63,37 @@ class Frame extends Control implements Container {
|
|||||||
return $this;
|
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()
|
* @see \FML\Renderable::render()
|
||||||
*/
|
*/
|
||||||
public function render(\DOMDocument $domDocument) {
|
public function render(\DOMDocument $domDocument) {
|
||||||
$xmlElement = parent::render($domDocument);
|
$xmlElement = parent::render($domDocument);
|
||||||
|
if ($this->format) {
|
||||||
|
$formatXml = $this->format->render($domDocument);
|
||||||
|
$xmlElement->appendChild($formatXml);
|
||||||
|
}
|
||||||
foreach ($this->children as $child) {
|
foreach ($this->children as $child) {
|
||||||
$childXmlElement = $child->render($domDocument);
|
$childXmlElement = $child->render($domDocument);
|
||||||
$xmlElement->appendChild($childXmlElement);
|
$xmlElement->appendChild($childXmlElement);
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
namespace FML\Controls;
|
namespace FML\Controls;
|
||||||
|
|
||||||
use FML\Types\Scriptable;
|
use FML\Types\Scriptable;
|
||||||
|
use FML\Stylesheet\Style3d;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frame3d Element
|
* Frame3d Control
|
||||||
* (CMlFrame)
|
* (CMlFrame)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
@ -14,9 +15,21 @@ class Frame3d extends Frame implements Scriptable {
|
|||||||
/**
|
/**
|
||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
protected $style3d = '';
|
protected $style3dId = '';
|
||||||
|
protected $style3d = null;
|
||||||
protected $scriptEvents = 0;
|
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
|
* Construct a new Frame3d Control
|
||||||
*
|
*
|
||||||
@ -28,13 +41,26 @@ class Frame3d extends Frame implements Scriptable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set style3d
|
* Set Style3d Id
|
||||||
*
|
*
|
||||||
* @param string $style3d 3D Style
|
* @param string $style3dId Style3d Id
|
||||||
* @return \FML\Controls\Frame3d
|
* @return \FML\Controls\Frame3d
|
||||||
*/
|
*/
|
||||||
public function setStyle3d($style3d) {
|
public function setStyle3dId($style3dId) {
|
||||||
$this->style3d = (string) $style3d;
|
$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;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +81,11 @@ class Frame3d extends Frame implements Scriptable {
|
|||||||
public function render(\DOMDocument $domDocument) {
|
public function render(\DOMDocument $domDocument) {
|
||||||
$xmlElement = parent::render($domDocument);
|
$xmlElement = parent::render($domDocument);
|
||||||
if ($this->style3d) {
|
if ($this->style3d) {
|
||||||
$xmlElement->setAttribute('style3d', $this->style3d);
|
$this->style3d->checkId();
|
||||||
|
$xmlElement->setAttribute('style3d', $this->style3d->getId());
|
||||||
|
}
|
||||||
|
else if ($this->style3dId) {
|
||||||
|
$xmlElement->setAttribute('style3d', $this->style3dId);
|
||||||
}
|
}
|
||||||
if ($this->scriptEvents) {
|
if ($this->scriptEvents) {
|
||||||
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
||||||
|
86
application/core/FML/Controls/FrameInstance.php
Normal file
86
application/core/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;
|
||||||
|
}
|
||||||
|
}
|
@ -5,17 +5,17 @@ namespace FML\Controls;
|
|||||||
use FML\Types\Styleable;
|
use FML\Types\Styleable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gauge Element
|
* Gauge Control
|
||||||
* (CMlGauge)
|
* (CMlGauge)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
*/
|
*/
|
||||||
|
// TODO: gauge styles
|
||||||
class Gauge extends Control implements Styleable {
|
class Gauge extends Control implements Styleable {
|
||||||
/**
|
/**
|
||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
protected $ratio = 1.;
|
protected $ratio = 0.;
|
||||||
// TODO: validate grading
|
|
||||||
protected $grading = 1.;
|
protected $grading = 1.;
|
||||||
protected $color = '';
|
protected $color = '';
|
||||||
protected $rotation = 0.;
|
protected $rotation = 0.;
|
||||||
@ -25,6 +25,17 @@ class Gauge extends Control implements Styleable {
|
|||||||
protected $drawBlockBg = 1;
|
protected $drawBlockBg = 1;
|
||||||
protected $style = '';
|
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
|
* Construct a new Gauge Control
|
||||||
*
|
*
|
||||||
@ -139,9 +150,12 @@ class Gauge extends Control implements Styleable {
|
|||||||
*/
|
*/
|
||||||
public function render(\DOMDocument $domDocument) {
|
public function render(\DOMDocument $domDocument) {
|
||||||
$xmlElement = parent::render($domDocument);
|
$xmlElement = parent::render($domDocument);
|
||||||
// TODO: validate default values
|
if ($this->ratio) {
|
||||||
$xmlElement->setAttribute('ratio', $this->ratio);
|
$xmlElement->setAttribute('ratio', $this->ratio);
|
||||||
$xmlElement->setAttribute('grading', $this->grading);
|
}
|
||||||
|
if ($this->grading != 1.) {
|
||||||
|
$xmlElement->setAttribute('grading', $this->grading);
|
||||||
|
}
|
||||||
if ($this->color) {
|
if ($this->color) {
|
||||||
$xmlElement->setAttribute('color', $this->color);
|
$xmlElement->setAttribute('color', $this->color);
|
||||||
}
|
}
|
||||||
@ -154,8 +168,12 @@ class Gauge extends Control implements Styleable {
|
|||||||
if ($this->clan) {
|
if ($this->clan) {
|
||||||
$xmlElement->setAttribute('clan', $this->clan);
|
$xmlElement->setAttribute('clan', $this->clan);
|
||||||
}
|
}
|
||||||
$xmlElement->setAttribute('drawbg', $this->drawBg);
|
if (!$this->drawBg) {
|
||||||
$xmlElement->setAttribute('drawblockbg', $this->drawBlockBg);
|
$xmlElement->setAttribute('drawbg', $this->drawBg);
|
||||||
|
}
|
||||||
|
if (!$this->drawBlockBg) {
|
||||||
|
$xmlElement->setAttribute('drawblockbg', $this->drawBlockBg);
|
||||||
|
}
|
||||||
if ($this->style) {
|
if ($this->style) {
|
||||||
$xmlElement->setAttribute('style', $this->style);
|
$xmlElement->setAttribute('style', $this->style);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ use FML\Types\Styleable;
|
|||||||
use FML\Types\TextFormatable;
|
use FML\Types\TextFormatable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Label Element
|
* Label Control
|
||||||
* (CMlLabel)
|
* (CMlLabel)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
@ -20,6 +20,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
protected $text = '';
|
protected $text = '';
|
||||||
|
protected $textId = '';
|
||||||
protected $textPrefix = '';
|
protected $textPrefix = '';
|
||||||
protected $textEmboss = 0;
|
protected $textEmboss = 0;
|
||||||
protected $translate = 0;
|
protected $translate = 0;
|
||||||
@ -27,14 +28,27 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
protected $action = '';
|
protected $action = '';
|
||||||
protected $actionKey = -1;
|
protected $actionKey = -1;
|
||||||
protected $url = '';
|
protected $url = '';
|
||||||
|
protected $urlId = '';
|
||||||
protected $manialink = '';
|
protected $manialink = '';
|
||||||
|
protected $manialinkId = '';
|
||||||
protected $autoNewLine = 0;
|
protected $autoNewLine = 0;
|
||||||
protected $scriptEvents = 0;
|
protected $scriptEvents = 0;
|
||||||
protected $style = '';
|
protected $style = '';
|
||||||
protected $textSize = -1;
|
protected $textSize = -1;
|
||||||
protected $textColor = '';
|
protected $textColor = '';
|
||||||
protected $areaColor = '';
|
protected $focusAreaColor1 = '';
|
||||||
protected $areaFocusColor = '';
|
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
|
* Construct a new Label Control
|
||||||
@ -58,6 +72,17 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
return $this;
|
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
|
* Set Text Prefix
|
||||||
*
|
*
|
||||||
@ -132,6 +157,16 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
return $this;
|
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()
|
* @see \FML\Types\Linkable::setManialink()
|
||||||
@ -142,6 +177,16 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
return $this;
|
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()
|
* @see \FML\Types\NewLineable::setAutoNewLine()
|
||||||
@ -198,7 +243,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
* @return \FML\Controls\Label
|
* @return \FML\Controls\Label
|
||||||
*/
|
*/
|
||||||
public function setAreaColor($areaColor) {
|
public function setAreaColor($areaColor) {
|
||||||
$this->areaColor = (string) $areaColor;
|
$this->focusAreaColor1 = (string) $areaColor;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +253,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
* @return \FML\Controls\Label
|
* @return \FML\Controls\Label
|
||||||
*/
|
*/
|
||||||
public function setAreaFocusColor($areaFocusColor) {
|
public function setAreaFocusColor($areaFocusColor) {
|
||||||
$this->areaFocusColor = (string) $areaFocusColor;
|
$this->focusAreaColor2 = (string) $areaFocusColor;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,6 +266,9 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
if ($this->text) {
|
if ($this->text) {
|
||||||
$xmlElement->setAttribute('text', $this->text);
|
$xmlElement->setAttribute('text', $this->text);
|
||||||
}
|
}
|
||||||
|
if ($this->textId) {
|
||||||
|
$xmlElement->setAttribute('textid', $this->textId);
|
||||||
|
}
|
||||||
if ($this->textPrefix) {
|
if ($this->textPrefix) {
|
||||||
$xmlElement->setAttribute('textprefix', $this->textPrefix);
|
$xmlElement->setAttribute('textprefix', $this->textPrefix);
|
||||||
}
|
}
|
||||||
@ -260,11 +308,11 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
|||||||
if ($this->textColor) {
|
if ($this->textColor) {
|
||||||
$xmlElement->setAttribute('textcolor', $this->textColor);
|
$xmlElement->setAttribute('textcolor', $this->textColor);
|
||||||
}
|
}
|
||||||
if ($this->areaColor) {
|
if ($this->focusAreaColor1) {
|
||||||
$xmlElement->setAttribute('areacolor', $this->areaColor);
|
$xmlElement->setAttribute('focusareacolor1', $this->focusAreaColor1);
|
||||||
}
|
}
|
||||||
if ($this->areaFocusColor) {
|
if ($this->focusAreaColor2) {
|
||||||
$xmlElement->setAttribute('areafocuscolor', $this->areaFocusColor);
|
$xmlElement->setAttribute('focusareacolor2', $this->focusAreaColor2);
|
||||||
}
|
}
|
||||||
return $xmlElement;
|
return $xmlElement;
|
||||||
}
|
}
|
||||||
|
@ -31,4 +31,24 @@ class Label_Button extends Label {
|
|||||||
const STYLE_CardButtonSmallXXXL = 'CardButtonSmallXXXL';
|
const STYLE_CardButtonSmallXXXL = 'CardButtonSmallXXXL';
|
||||||
const STYLE_CardMain_Quit = 'CardMain_Quit';
|
const STYLE_CardMain_Quit = 'CardMain_Quit';
|
||||||
const STYLE_CardMain_Tool = 'CardMain_Tool';
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,4 +88,24 @@ class Label_Text extends Label {
|
|||||||
const STYLE_UiDriving_BgBottom = 'UiDriving_BgBottom';
|
const STYLE_UiDriving_BgBottom = 'UiDriving_BgBottom';
|
||||||
const STYLE_UiDriving_BgCard = 'UiDriving_BgCard';
|
const STYLE_UiDriving_BgCard = 'UiDriving_BgCard';
|
||||||
const STYLE_UiDriving_BgCenter = 'UiDriving_BgCenter';
|
const STYLE_UiDriving_BgCenter = 'UiDriving_BgCenter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new Label_Text Control
|
||||||
|
*
|
||||||
|
* @param string $id (optional) Control Id
|
||||||
|
* @return \FML\Controls\Labels\Label_Button
|
||||||
|
*/
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ use FML\Types\Styleable;
|
|||||||
use FML\Types\SubStyleable;
|
use FML\Types\SubStyleable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Quad Element
|
* Quad Control
|
||||||
* (CMlQuad)
|
* (CMlQuad)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
@ -20,7 +20,9 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
|||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
protected $image = '';
|
protected $image = '';
|
||||||
|
protected $imageId = '';
|
||||||
protected $imageFocus = '';
|
protected $imageFocus = '';
|
||||||
|
protected $imageFocusId = '';
|
||||||
protected $colorize = '';
|
protected $colorize = '';
|
||||||
protected $modulizeColor = '';
|
protected $modulizeColor = '';
|
||||||
protected $autoScale = 1;
|
protected $autoScale = 1;
|
||||||
@ -28,11 +30,24 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
|||||||
protected $actionKey = -1;
|
protected $actionKey = -1;
|
||||||
protected $bgColor = '';
|
protected $bgColor = '';
|
||||||
protected $url = '';
|
protected $url = '';
|
||||||
|
protected $urlId = '';
|
||||||
protected $manialink = '';
|
protected $manialink = '';
|
||||||
|
protected $manialinkId = '';
|
||||||
protected $scriptEvents = 0;
|
protected $scriptEvents = 0;
|
||||||
protected $style = '';
|
protected $style = '';
|
||||||
protected $subStyle = '';
|
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
|
* Construct a new Quad Control
|
||||||
*
|
*
|
||||||
@ -55,6 +70,17 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
|||||||
return $this;
|
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
|
* Set Focus Image Url
|
||||||
*
|
*
|
||||||
@ -66,6 +92,17 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
|||||||
return $this;
|
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
|
* Set Colorization
|
||||||
*
|
*
|
||||||
@ -139,6 +176,16 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
|||||||
return $this;
|
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()
|
* @see \FML\Types\Linkable::setManialink()
|
||||||
@ -149,6 +196,16 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
|||||||
return $this;
|
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()
|
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||||
@ -199,9 +256,15 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
|||||||
if ($this->image) {
|
if ($this->image) {
|
||||||
$xmlElement->setAttribute('image', $this->image);
|
$xmlElement->setAttribute('image', $this->image);
|
||||||
}
|
}
|
||||||
|
if ($this->imageId) {
|
||||||
|
$xmlElement->setAttribute('imageid', $this->imageId);
|
||||||
|
}
|
||||||
if ($this->imageFocus) {
|
if ($this->imageFocus) {
|
||||||
$xmlElement->setAttribute('imagefocus', $this->imageFocus);
|
$xmlElement->setAttribute('imagefocus', $this->imageFocus);
|
||||||
}
|
}
|
||||||
|
if ($this->imageFocusId) {
|
||||||
|
$xmlElement->setAttribute('imagefocusid', $this->imageFocusId);
|
||||||
|
}
|
||||||
if ($this->colorize) {
|
if ($this->colorize) {
|
||||||
$xmlElement->setAttribute('colorize', $this->colorize);
|
$xmlElement->setAttribute('colorize', $this->colorize);
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,20 @@ class Quad_321Go extends Quad {
|
|||||||
const SUBSTYLE_Go = 'Go!';
|
const SUBSTYLE_Go = 'Go!';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_321Go Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -43,8 +43,20 @@ class Quad_BgRaceScore2 extends Quad {
|
|||||||
const SUBSTYLE_Warmup = 'Warmup';
|
const SUBSTYLE_Warmup = 'Warmup';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_BgRaceScore2 Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -80,8 +80,20 @@ class Quad_Bgs1 extends Quad {
|
|||||||
const SUBSTYLE_Shadow = 'Shadow';
|
const SUBSTYLE_Shadow = 'Shadow';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Bgs1 Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -80,8 +80,20 @@ class Quad_Bgs1InRace extends Quad {
|
|||||||
const SUBSTYLE_Shadow = 'Shadow';
|
const SUBSTYLE_Shadow = 'Shadow';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Bgs1InRace Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -22,8 +22,20 @@ class Quad_BgsChallengeMedals extends Quad {
|
|||||||
const SUBSTYLE_BgSilver = 'BgSilver';
|
const SUBSTYLE_BgSilver = 'BgSilver';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_BgsChallengeMedals Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -30,8 +30,20 @@ class Quad_BgsPlayerCard extends Quad {
|
|||||||
const SUBSTYLE_ProgressBar = 'ProgressBar';
|
const SUBSTYLE_ProgressBar = 'ProgressBar';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_BgsPlayerCard Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -28,8 +28,20 @@ class Quad_Copilot extends Quad {
|
|||||||
const SUBSTYLE_UpWrong = 'UpWrong';
|
const SUBSTYLE_UpWrong = 'UpWrong';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Copilot Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -19,8 +19,20 @@ class Quad_Emblems extends Quad {
|
|||||||
const SUBSTYLE_2 = '#2';
|
const SUBSTYLE_2 = '#2';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Emblems Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -22,8 +22,20 @@ class Quad_EnergyBar extends Quad {
|
|||||||
const SUBSTYLE_HeaderGaugeRight = 'HeaderGaugeRight';
|
const SUBSTYLE_HeaderGaugeRight = 'HeaderGaugeRight';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_EnergyBar Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -25,8 +25,20 @@ class Quad_Hud3dEchelons extends Quad {
|
|||||||
const SUBSTYLE_EchelonSilver3 = 'EchelonSilver3';
|
const SUBSTYLE_EchelonSilver3 = 'EchelonSilver3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Hud3dEchelons Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -80,7 +80,20 @@ class Quad_Icons128x128_1 extends Quad {
|
|||||||
const SUBSTYLE_Vehicles = 'Vehicles';
|
const SUBSTYLE_Vehicles = 'Vehicles';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct Icons128x128_1 quad
|
* 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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -80,8 +80,20 @@ class Quad_Icons128x128_Blink extends Quad {
|
|||||||
const SUBSTYLE_Vehicles = 'Vehicles';
|
const SUBSTYLE_Vehicles = 'Vehicles';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Icons128x128_Blink Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -41,8 +41,20 @@ class Quad_Icons128x32_1 extends Quad {
|
|||||||
const SUBSTYLE_Windowed = 'Windowed';
|
const SUBSTYLE_Windowed = 'Windowed';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Icons128x32_1 Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -101,8 +101,20 @@ class Quad_Icons64x64_1 extends Quad {
|
|||||||
const SUBSTYLE_YellowLow = 'YellowLow';
|
const SUBSTYLE_YellowLow = 'YellowLow';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Icons64x64_1 Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -29,8 +29,20 @@ class Quad_Icons64x64_2 extends Quad {
|
|||||||
const SUBSTYLE_UnknownHit = 'UnknownHit';
|
const SUBSTYLE_UnknownHit = 'UnknownHit';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_Icons64x64_2 Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -23,8 +23,20 @@ class Quad_ManiaPlanetLogos extends Quad {
|
|||||||
const SUBSTYLE_ManiaPlanetLogoWhiteSmall = 'ManiaPlanetLogoWhiteSmall';
|
const SUBSTYLE_ManiaPlanetLogoWhiteSmall = 'ManiaPlanetLogoWhiteSmall';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_ManiaPlanetLogos Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -22,8 +22,20 @@ class Quad_ManiaplanetSystem extends Quad {
|
|||||||
const SUBSTYLE_Statistics = 'Statistics';
|
const SUBSTYLE_Statistics = 'Statistics';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_ManiaplanetSystem Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -23,8 +23,20 @@ class Quad_MedalsBig extends Quad {
|
|||||||
const SUBSTYLE_MedalSlot = 'MedalSlot';
|
const SUBSTYLE_MedalSlot = 'MedalSlot';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_MedalsBig Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -20,8 +20,20 @@ class Quad_TitleLogos extends Quad {
|
|||||||
const SUBSTYLE_Title = 'Title';
|
const SUBSTYLE_Title = 'Title';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_TitleLogos Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -70,8 +70,20 @@ class Quad_UIConstruction_Buttons extends Quad {
|
|||||||
const SUBSTYLE_Validate_Step3 = 'Validate_Step3';
|
const SUBSTYLE_Validate_Step3 = 'Validate_Step3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_UIConstruction_Buttons Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -37,8 +37,20 @@ class Quad_UiSMSpectatorScoreBig extends Quad {
|
|||||||
CONST SUBSTYLE_UIRange2Bg = 'UIRange2Bg';
|
CONST SUBSTYLE_UIRange2Bg = 'UIRange2Bg';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new Quad_UiSMSpectatorScoreBig Control
|
||||||
*
|
*
|
||||||
* @see \FML\Controls\Quad
|
* @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) {
|
public function __construct($id = null) {
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
|
@ -6,7 +6,7 @@ use FML\Types\Playable;
|
|||||||
use FML\Types\Scriptable;
|
use FML\Types\Scriptable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Video Element
|
* Video Control
|
||||||
* (CMlMediaPlayer)
|
* (CMlMediaPlayer)
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
@ -16,12 +16,24 @@ class Video extends Control implements Playable, Scriptable {
|
|||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
protected $data = '';
|
protected $data = '';
|
||||||
|
protected $dataId = '';
|
||||||
protected $play = 0;
|
protected $play = 0;
|
||||||
protected $looping = 0;
|
protected $looping = 0;
|
||||||
protected $music = 0;
|
protected $music = 0;
|
||||||
protected $volume = 1.;
|
protected $volume = 1.;
|
||||||
protected $scriptEvents = 0;
|
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
|
* Construct a new Video Control
|
||||||
*
|
*
|
||||||
@ -42,6 +54,16 @@ class Video extends Control implements Playable, Scriptable {
|
|||||||
return $this;
|
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()
|
* @see \FML\Types\Playable::setPlay()
|
||||||
@ -104,7 +126,7 @@ class Video extends Control implements Playable, Scriptable {
|
|||||||
if ($this->play) {
|
if ($this->play) {
|
||||||
$xmlElement->setAttribute('play', $this->play);
|
$xmlElement->setAttribute('play', $this->play);
|
||||||
}
|
}
|
||||||
if ($this->looping) {
|
if (!$this->looping) {
|
||||||
$xmlElement->setAttribute('looping', $this->looping);
|
$xmlElement->setAttribute('looping', $this->looping);
|
||||||
}
|
}
|
||||||
if ($this->music) {
|
if ($this->music) {
|
||||||
|
@ -22,6 +22,22 @@ class CustomUI {
|
|||||||
protected $scoretableVisible = null;
|
protected $scoretableVisible = null;
|
||||||
protected $globalVisible = 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
|
* Set XML Encoding
|
||||||
*
|
*
|
||||||
@ -131,6 +147,7 @@ class CustomUI {
|
|||||||
$isChild = (bool) $domDocument;
|
$isChild = (bool) $domDocument;
|
||||||
if (!$isChild) {
|
if (!$isChild) {
|
||||||
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
||||||
|
$domDocument->xmlStandalone = true;
|
||||||
}
|
}
|
||||||
$xmlElement = $domDocument->createElement($this->tagName);
|
$xmlElement = $domDocument->createElement($this->tagName);
|
||||||
if (!$isChild) {
|
if (!$isChild) {
|
||||||
|
274
application/core/FML/Elements/Dico.php
Normal file
274
application/core/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;
|
||||||
|
}
|
||||||
|
}
|
@ -21,8 +21,24 @@ class Format implements BgColorable, Renderable, Styleable, TextFormatable {
|
|||||||
protected $style = '';
|
protected $style = '';
|
||||||
protected $textSize = -1;
|
protected $textSize = -1;
|
||||||
protected $textColor = '';
|
protected $textColor = '';
|
||||||
protected $areaColor = '';
|
protected $focusAreaColor1 = '';
|
||||||
protected $areaFocusColor = '';
|
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() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -70,7 +86,7 @@ class Format implements BgColorable, Renderable, Styleable, TextFormatable {
|
|||||||
* @return \FML\Elements\Format
|
* @return \FML\Elements\Format
|
||||||
*/
|
*/
|
||||||
public function setAreaColor($areaColor) {
|
public function setAreaColor($areaColor) {
|
||||||
$this->areaColor = (string) $areaColor;
|
$this->focusAreaColor1 = (string) $areaColor;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +96,7 @@ class Format implements BgColorable, Renderable, Styleable, TextFormatable {
|
|||||||
* @return \FML\Elements\Format
|
* @return \FML\Elements\Format
|
||||||
*/
|
*/
|
||||||
public function setAreaFocusColor($areaFocusColor) {
|
public function setAreaFocusColor($areaFocusColor) {
|
||||||
$this->areaFocusColor = (string) $areaFocusColor;
|
$this->focusAreaColor2 = (string) $areaFocusColor;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,25 +105,25 @@ class Format implements BgColorable, Renderable, Styleable, TextFormatable {
|
|||||||
* @see \FML\Renderable::render()
|
* @see \FML\Renderable::render()
|
||||||
*/
|
*/
|
||||||
public function render(\DOMDocument $domDocument) {
|
public function render(\DOMDocument $domDocument) {
|
||||||
$xmlElement = $domDocument->createElement($this->tagName);
|
$formatXmlElement = $domDocument->createElement($this->tagName);
|
||||||
if ($this->bgColor) {
|
if ($this->bgColor) {
|
||||||
$xmlElement->setAttribute('bgcolor', $this->bgColor);
|
$formatXmlElement->setAttribute('bgcolor', $this->bgColor);
|
||||||
}
|
}
|
||||||
if ($this->style) {
|
if ($this->style) {
|
||||||
$xmlElement->setAttribute('style', $this->style);
|
$formatXmlElement->setAttribute('style', $this->style);
|
||||||
}
|
}
|
||||||
if ($this->textSize >= 0) {
|
if ($this->textSize >= 0) {
|
||||||
$xmlElement->setAttribute('textsize', $this->textSize);
|
$formatXmlElement->setAttribute('textsize', $this->textSize);
|
||||||
}
|
}
|
||||||
if ($this->textColor) {
|
if ($this->textColor) {
|
||||||
$xmlElement->setAttribute('textcolor', $this->textColor);
|
$formatXmlElement->setAttribute('textcolor', $this->textColor);
|
||||||
}
|
}
|
||||||
if ($this->areaColor) {
|
if ($this->focusAreaColor1) {
|
||||||
$xmlElement->setAttribute('areacolor', $this->areaColor);
|
$formatXmlElement->setAttribute('focusareacolor1', $this->focusAreaColor1);
|
||||||
}
|
}
|
||||||
if ($this->areaFocusColor) {
|
if ($this->focusAreaColor2) {
|
||||||
$xmlElement->setAttribute('areafocuscolor', $this->areaFocusColor);
|
$formatXmlElement->setAttribute('focusareacolor2', $this->focusAreaColor2);
|
||||||
}
|
}
|
||||||
return $xmlElement;
|
return $formatXmlElement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
116
application/core/FML/Elements/FrameModel.php
Normal file
116
application/core/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;
|
||||||
|
}
|
||||||
|
}
|
@ -16,6 +16,28 @@ class Including implements Renderable {
|
|||||||
protected $tagName = 'include';
|
protected $tagName = 'include';
|
||||||
protected $url = '';
|
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
|
* Set Url
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,28 @@ class Music implements Renderable {
|
|||||||
protected $tagName = 'music';
|
protected $tagName = 'music';
|
||||||
protected $data = '';
|
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
|
* Set Data Url
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,28 @@ class SimpleScript implements Renderable {
|
|||||||
protected $tagName = 'script';
|
protected $tagName = 'script';
|
||||||
protected $text = '';
|
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
|
* Set Script Text
|
||||||
*
|
*
|
||||||
@ -23,7 +45,7 @@ class SimpleScript implements Renderable {
|
|||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function setText($text) {
|
public function setText($text) {
|
||||||
$this->text = $text;
|
$this->text = (string) $text;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,8 +55,10 @@ class SimpleScript implements Renderable {
|
|||||||
*/
|
*/
|
||||||
public function render(\DOMDocument $domDocument) {
|
public function render(\DOMDocument $domDocument) {
|
||||||
$xmlElement = $domDocument->createElement($this->tagName);
|
$xmlElement = $domDocument->createElement($this->tagName);
|
||||||
$scriptComment = $domDocument->createComment($this->text);
|
if ($this->text) {
|
||||||
$xmlElement->appendChild($scriptComment);
|
$scriptComment = $domDocument->createComment($this->text);
|
||||||
|
$xmlElement->appendChild($scriptComment);
|
||||||
|
}
|
||||||
return $xmlElement;
|
return $xmlElement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
namespace FML;
|
namespace FML;
|
||||||
|
|
||||||
use FML\ManiaCode\Message;
|
|
||||||
use FML\ManiaCode\Element;
|
|
||||||
use FML\ManiaCode\ShowMessage;
|
|
||||||
use FML\ManiaCode\InstallMap;
|
|
||||||
use FML\ManiaCode\PlayMap;
|
|
||||||
use FML\ManiaCode\InstallReplay;
|
|
||||||
use FML\ManiaCode\ViewReplay;
|
|
||||||
use FML\ManiaCode\PlayReplay;
|
|
||||||
use FML\ManiaCode\InstallSkin;
|
|
||||||
use FML\ManiaCode\GetSkin;
|
|
||||||
use FML\ManiaCode\AddBuddy;
|
use FML\ManiaCode\AddBuddy;
|
||||||
use FML\ManiaCode\Go_To;
|
|
||||||
use FML\ManiaCode\JoinServer;
|
|
||||||
use FML\ManiaCode\AddFavorite;
|
use FML\ManiaCode\AddFavorite;
|
||||||
use FML\ManiaCode\InstallScript;
|
use FML\ManiaCode\Element;
|
||||||
|
use FML\ManiaCode\GetSkin;
|
||||||
|
use FML\ManiaCode\Go_To;
|
||||||
|
use FML\ManiaCode\InstallMap;
|
||||||
use FML\ManiaCode\InstallPack;
|
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
|
* Class representing a ManiaCode
|
||||||
@ -33,6 +33,22 @@ class ManiaCode {
|
|||||||
protected $noConfirmation = null;
|
protected $noConfirmation = null;
|
||||||
protected $elements = array();
|
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
|
* Set XML Encoding
|
||||||
*
|
*
|
||||||
@ -265,6 +281,7 @@ class ManiaCode {
|
|||||||
*/
|
*/
|
||||||
public function render($echo = false) {
|
public function render($echo = false) {
|
||||||
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
||||||
|
$domDocument->xmlStandalone = true;
|
||||||
$maniaCode = $domDocument->createElement($this->tagName);
|
$maniaCode = $domDocument->createElement($this->tagName);
|
||||||
$domDocument->appendChild($maniaCode);
|
$domDocument->appendChild($maniaCode);
|
||||||
if ($this->noConfirmation) {
|
if ($this->noConfirmation) {
|
||||||
@ -275,7 +292,7 @@ class ManiaCode {
|
|||||||
$maniaCode->appendChild($xmlElement);
|
$maniaCode->appendChild($xmlElement);
|
||||||
}
|
}
|
||||||
if ($echo) {
|
if ($echo) {
|
||||||
header('Content-Type: application/xml');
|
header('Content-Type: application/xml; charset=utf-8;');
|
||||||
echo $domDocument->saveXML();
|
echo $domDocument->saveXML();
|
||||||
}
|
}
|
||||||
return $domDocument;
|
return $domDocument;
|
||||||
|
@ -14,6 +14,17 @@ class AddBuddy implements Element {
|
|||||||
protected $tagName = 'add_buddy';
|
protected $tagName = 'add_buddy';
|
||||||
protected $login = '';
|
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
|
* Construct a new AddBuddy Element
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,17 @@ class AddFavorite implements Element {
|
|||||||
protected $ip = null;
|
protected $ip = null;
|
||||||
protected $port = 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
|
* Construct a new AddFavorite Element
|
||||||
*
|
*
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
namespace FML\ManiaCode;
|
namespace FML\ManiaCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ManiaCode Element getting a Skin
|
* ManiaCode Element downloading a Skin
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
*/
|
*/
|
||||||
@ -16,6 +16,19 @@ class GetSkin implements Element {
|
|||||||
protected $file = '';
|
protected $file = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new GetSkin Element
|
||||||
*
|
*
|
||||||
|
@ -14,6 +14,17 @@ class Go_To implements Element {
|
|||||||
protected $tagName = 'goto';
|
protected $tagName = 'goto';
|
||||||
protected $link = '';
|
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
|
* Construct a new Go_To Element
|
||||||
*
|
*
|
||||||
|
@ -15,6 +15,18 @@ class InstallMap implements Element {
|
|||||||
protected $name = '';
|
protected $name = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new InstallMap Element
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,19 @@ class InstallPack implements Element {
|
|||||||
protected $file = '';
|
protected $file = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new InstallPack Element
|
||||||
*
|
*
|
||||||
|
@ -15,6 +15,18 @@ class InstallReplay implements Element {
|
|||||||
protected $name = '';
|
protected $name = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new InstallReplay Element
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,19 @@ class InstallScript implements Element {
|
|||||||
protected $file = '';
|
protected $file = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new InstallScript Element
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,19 @@ class InstallSkin implements Element {
|
|||||||
protected $file = '';
|
protected $file = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new InstallSkin Element
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,17 @@ class JoinServer implements Element {
|
|||||||
protected $ip = null;
|
protected $ip = null;
|
||||||
protected $port = 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
|
* Construct a new JoinServer Element
|
||||||
*
|
*
|
||||||
|
@ -15,6 +15,18 @@ class PlayMap implements Element {
|
|||||||
protected $name = '';
|
protected $name = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new PlayMap Element
|
||||||
*
|
*
|
||||||
|
@ -15,6 +15,18 @@ class PlayReplay implements Element {
|
|||||||
protected $name = '';
|
protected $name = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new PlayReplay Element
|
||||||
*
|
*
|
||||||
|
@ -14,6 +14,17 @@ class ShowMessage implements Element {
|
|||||||
protected $tagName = 'show_message';
|
protected $tagName = 'show_message';
|
||||||
protected $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
|
* Construct a new ShowMessage Element
|
||||||
*
|
*
|
||||||
|
@ -15,6 +15,18 @@ class ViewReplay implements Element {
|
|||||||
protected $name = '';
|
protected $name = '';
|
||||||
protected $url = '';
|
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
|
* Construct a new ViewReplay Element
|
||||||
*
|
*
|
||||||
|
@ -2,16 +2,25 @@
|
|||||||
|
|
||||||
namespace FML;
|
namespace FML;
|
||||||
|
|
||||||
use FML\Types\Container;
|
|
||||||
use FML\Types\Renderable;
|
use FML\Types\Renderable;
|
||||||
use FML\Script\Script;
|
use FML\Script\Script;
|
||||||
|
use FML\Elements\Dico;
|
||||||
|
use FML\Stylesheet\Stylesheet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class representing a ManiaLink
|
* Class representing a ManiaLink
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
*/
|
*/
|
||||||
class ManiaLink implements Container {
|
class ManiaLink {
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
*/
|
||||||
|
const BACKGROUND_0 = '0';
|
||||||
|
const BACKGROUND_STARS = 'stars';
|
||||||
|
const BACKGROUND_STATIONS = 'stations';
|
||||||
|
const BACKGROUND_TITLE = 'title';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protected Properties
|
* Protected Properties
|
||||||
*/
|
*/
|
||||||
@ -23,15 +32,30 @@ class ManiaLink implements Container {
|
|||||||
protected $navigable3d = 0;
|
protected $navigable3d = 0;
|
||||||
protected $timeout = 0;
|
protected $timeout = 0;
|
||||||
protected $children = array();
|
protected $children = array();
|
||||||
|
protected $dico = null;
|
||||||
|
protected $stylesheet = null;
|
||||||
protected $script = null;
|
protected $script = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new ManiaLink
|
* Create a new ManiaLink Object
|
||||||
*
|
*
|
||||||
* @param string $id Manialink Id
|
* @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) {
|
public function __construct($id = null) {
|
||||||
$this->setId($id);
|
if ($id !== null) {
|
||||||
|
$this->setId($id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,8 +114,8 @@ class ManiaLink implements Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Add an Element to the ManiaLink
|
||||||
*
|
*
|
||||||
* @see \FML\Types\Container::add()
|
|
||||||
* @return \FML\ManiaLink
|
* @return \FML\ManiaLink
|
||||||
*/
|
*/
|
||||||
public function add(Renderable $child) {
|
public function add(Renderable $child) {
|
||||||
@ -102,8 +126,8 @@ class ManiaLink implements Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Remove all Elements from the ManiaLinks
|
||||||
*
|
*
|
||||||
* @see \FML\Types\Container::removeChildren()
|
|
||||||
* @return \FML\ManiaLink
|
* @return \FML\ManiaLink
|
||||||
*/
|
*/
|
||||||
public function removeChildren() {
|
public function removeChildren() {
|
||||||
@ -111,6 +135,54 @@ class ManiaLink implements Container {
|
|||||||
return $this;
|
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
|
* Set the Script of the ManiaLink
|
||||||
*
|
*
|
||||||
@ -125,7 +197,7 @@ class ManiaLink implements Container {
|
|||||||
/**
|
/**
|
||||||
* Get the current Script of the ManiaLink
|
* Get the current Script of the ManiaLink
|
||||||
*
|
*
|
||||||
* @param string $createIfEmpty (optional) Whether the Script Object should be created if it's not set yet
|
* @param bool $createIfEmpty (optional) Whether the Script Object should be created if it's not set yet
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function getScript($createIfEmpty = true) {
|
public function getScript($createIfEmpty = true) {
|
||||||
@ -146,24 +218,25 @@ class ManiaLink implements Container {
|
|||||||
$isChild = (bool) $domDocument;
|
$isChild = (bool) $domDocument;
|
||||||
if (!$isChild) {
|
if (!$isChild) {
|
||||||
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
||||||
|
$domDocument->xmlStandalone = true;
|
||||||
}
|
}
|
||||||
$maniaLink = $domDocument->createElement($this->tagName);
|
$maniaLink = $domDocument->createElement($this->tagName);
|
||||||
if (!$isChild) {
|
if (!$isChild) {
|
||||||
$domDocument->appendChild($maniaLink);
|
$domDocument->appendChild($maniaLink);
|
||||||
}
|
}
|
||||||
if ($this->id !== null) {
|
if ($this->id) {
|
||||||
$maniaLink->setAttribute('id', $this->id);
|
$maniaLink->setAttribute('id', $this->id);
|
||||||
}
|
}
|
||||||
if ($this->version !== null) {
|
if ($this->version) {
|
||||||
$maniaLink->setAttribute('version', $this->version);
|
$maniaLink->setAttribute('version', $this->version);
|
||||||
}
|
}
|
||||||
if ($this->background !== null) {
|
if ($this->background) {
|
||||||
$maniaLink->setAttribute('background', $this->background);
|
$maniaLink->setAttribute('background', $this->background);
|
||||||
}
|
}
|
||||||
if ($this->navigable3d !== null) {
|
if (!$this->navigable3d) {
|
||||||
$maniaLink->setAttribute('navigable3d', $this->navigable3d);
|
$maniaLink->setAttribute('navigable3d', $this->navigable3d);
|
||||||
}
|
}
|
||||||
if ($this->timeout !== null) {
|
if ($this->timeout) {
|
||||||
$timeoutXml = $domDocument->createElement('timeout', $this->timeout);
|
$timeoutXml = $domDocument->createElement('timeout', $this->timeout);
|
||||||
$maniaLink->appendChild($timeoutXml);
|
$maniaLink->appendChild($timeoutXml);
|
||||||
}
|
}
|
||||||
@ -171,6 +244,14 @@ class ManiaLink implements Container {
|
|||||||
$childXml = $child->render($domDocument);
|
$childXml = $child->render($domDocument);
|
||||||
$maniaLink->appendChild($childXml);
|
$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) {
|
if ($this->script) {
|
||||||
$scriptXml = $this->script->render($domDocument);
|
$scriptXml = $this->script->render($domDocument);
|
||||||
$maniaLink->appendChild($scriptXml);
|
$maniaLink->appendChild($scriptXml);
|
||||||
@ -179,7 +260,7 @@ class ManiaLink implements Container {
|
|||||||
return $maniaLink;
|
return $maniaLink;
|
||||||
}
|
}
|
||||||
if ($echo) {
|
if ($echo) {
|
||||||
header('Content-Type: application/xml');
|
header('Content-Type: application/xml; charset=utf-8;');
|
||||||
echo $domDocument->saveXML();
|
echo $domDocument->saveXML();
|
||||||
}
|
}
|
||||||
return $domDocument;
|
return $domDocument;
|
||||||
|
@ -16,6 +16,22 @@ class ManiaLinks {
|
|||||||
protected $children = array();
|
protected $children = array();
|
||||||
protected $customUI = null;
|
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
|
* Set XML Encoding
|
||||||
*
|
*
|
||||||
@ -61,6 +77,19 @@ class ManiaLinks {
|
|||||||
return $this;
|
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
|
* Render the XML Document
|
||||||
*
|
*
|
||||||
@ -69,6 +98,7 @@ class ManiaLinks {
|
|||||||
*/
|
*/
|
||||||
public function render($echo = false) {
|
public function render($echo = false) {
|
||||||
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
$domDocument = new \DOMDocument('1.0', $this->encoding);
|
||||||
|
$domDocument->xmlStandalone = true;
|
||||||
$maniaLinks = $domDocument->createElement($this->tagName);
|
$maniaLinks = $domDocument->createElement($this->tagName);
|
||||||
$domDocument->appendChild($maniaLinks);
|
$domDocument->appendChild($maniaLinks);
|
||||||
foreach ($this->children as $child) {
|
foreach ($this->children as $child) {
|
||||||
@ -80,7 +110,7 @@ class ManiaLinks {
|
|||||||
$maniaLinks->appendChild($customUIXml);
|
$maniaLinks->appendChild($customUIXml);
|
||||||
}
|
}
|
||||||
if ($echo) {
|
if ($echo) {
|
||||||
header('Content-Type: application/xml');
|
header('Content-Type: application/xml; charset=utf-8;');
|
||||||
echo $domDocument->saveXML();
|
echo $domDocument->saveXML();
|
||||||
}
|
}
|
||||||
return $domDocument;
|
return $domDocument;
|
||||||
|
@ -21,6 +21,20 @@ abstract class Builder {
|
|||||||
return $labelText;
|
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
|
* Get the Real String-Representation of the given Value
|
||||||
*
|
*
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
namespace FML\Script;
|
namespace FML\Script;
|
||||||
|
|
||||||
use FML\Controls\Control;
|
use FML\Controls\Control;
|
||||||
use FML\Types\Scriptable;
|
|
||||||
use FML\Controls\Label;
|
use FML\Controls\Label;
|
||||||
|
use FML\Types\Scriptable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class representing the ManiaLink Script
|
* Class representing the ManiaLink Script
|
||||||
@ -31,6 +31,7 @@ class Script {
|
|||||||
const OPTION_TOOLTIP_TEXT = 'FML_Text_Tooltip';
|
const OPTION_TOOLTIP_TEXT = 'FML_Text_Tooltip';
|
||||||
const OPTION_TOGGLE_SHOW = 'FML_Show_Toggle';
|
const OPTION_TOGGLE_SHOW = 'FML_Show_Toggle';
|
||||||
const OPTION_TOGGLE_HIDE = 'FML_Hide_Toggle';
|
const OPTION_TOGGLE_HIDE = 'FML_Hide_Toggle';
|
||||||
|
const OPTION_PROFILE_OWN = 'FML_Own_Profile';
|
||||||
const LABEL_ONINIT = 'OnInit';
|
const LABEL_ONINIT = 'OnInit';
|
||||||
const LABEL_LOOP = 'Loop';
|
const LABEL_LOOP = 'Loop';
|
||||||
const LABEL_ENTRYSUBMIT = 'EntrySubmit';
|
const LABEL_ENTRYSUBMIT = 'EntrySubmit';
|
||||||
@ -60,6 +61,22 @@ class Script {
|
|||||||
protected $toggles = false;
|
protected $toggles = false;
|
||||||
protected $spectate = false;
|
protected $spectate = 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
|
* Set an Include of the Script
|
||||||
*
|
*
|
||||||
@ -223,6 +240,7 @@ class Script {
|
|||||||
*
|
*
|
||||||
* @param Control $profileControl The Control opening a Profile
|
* @param Control $profileControl The Control opening a Profile
|
||||||
* @param string $playerLogin The Player Login
|
* @param string $playerLogin The Player Login
|
||||||
|
* @param string $options,... (optional) Unlimited Number of Profile Options
|
||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addProfileButton(Control $profileControl, $playerLogin) {
|
public function addProfileButton(Control $profileControl, $playerLogin) {
|
||||||
@ -234,6 +252,10 @@ class Script {
|
|||||||
$profileControl->addClass(self::CLASS_PROFILE);
|
$profileControl->addClass(self::CLASS_PROFILE);
|
||||||
$playerLogin = (string) $playerLogin;
|
$playerLogin = (string) $playerLogin;
|
||||||
$profileControl->addClass(self::CLASS_PROFILE . '-' . $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;
|
$this->profile = true;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -322,6 +344,7 @@ class Script {
|
|||||||
* @return \FML\Script\Script
|
* @return \FML\Script\Script
|
||||||
*/
|
*/
|
||||||
public function addSpectateButton(Control $clickControl, $spectateTargetLogin) {
|
public function addSpectateButton(Control $clickControl, $spectateTargetLogin) {
|
||||||
|
// FIXME: current implementation doesn't support logins with dots in them ('nick.name')
|
||||||
if (!($clickControl instanceof Scriptable)) {
|
if (!($clickControl instanceof Scriptable)) {
|
||||||
trigger_error('Scriptable Control needed as ClickControl for Spectating!');
|
trigger_error('Scriptable Control needed as ClickControl for Spectating!');
|
||||||
return $this;
|
return $this;
|
||||||
@ -419,12 +442,12 @@ class Script {
|
|||||||
$count = count($this->tooltipTexts);
|
$count = count($this->tooltipTexts);
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
foreach ($this->tooltipTexts as $tooltipId => $tooltipTexts) {
|
foreach ($this->tooltipTexts as $tooltipId => $tooltipTexts) {
|
||||||
$constantText .= '"' . $tooltipId . '" => [';
|
$constantText .= '"' . Builder::escapeText($tooltipId) . '" => [';
|
||||||
$subIndex = 0;
|
$subIndex = 0;
|
||||||
$subCount = count($tooltipTexts);
|
$subCount = count($tooltipTexts);
|
||||||
if ($subCount > 0) {
|
if ($subCount > 0) {
|
||||||
foreach ($tooltipTexts as $hoverId => $text) {
|
foreach ($tooltipTexts as $hoverId => $text) {
|
||||||
$constantText .= '"' . $hoverId . '" => "' . $text . '"';
|
$constantText .= '"' . Builder::escapeText($hoverId) . '" => "' . Builder::escapeText($text) . '"';
|
||||||
if ($subIndex < $subCount - 1) $constantText .= ', ';
|
if ($subIndex < $subCount - 1) $constantText .= ', ';
|
||||||
$subIndex++;
|
$subIndex++;
|
||||||
}
|
}
|
||||||
@ -688,19 +711,18 @@ if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) {
|
|||||||
private function getProfileLabels() {
|
private function getProfileLabels() {
|
||||||
if (!$this->profile) return "";
|
if (!$this->profile) return "";
|
||||||
$this->setInclude('TextLib', 'TextLib');
|
$this->setInclude('TextLib', 'TextLib');
|
||||||
|
$prefixLength = strlen(self::CLASS_PROFILE) + 1;
|
||||||
$profileScript = "
|
$profileScript = "
|
||||||
if (Event.Control.HasClass(\"" . self::CLASS_PROFILE . "\")) {
|
if (Event.Control.HasClass(\"" . self::CLASS_PROFILE . "\")) {
|
||||||
declare Login = LocalUser.Login;
|
declare Login = LocalUser.Login;
|
||||||
foreach (ControlClass in Event.Control.ControlClasses) {
|
if (!Event.Control.HasClass(\"" . self::OPTION_PROFILE_OWN . "\") {
|
||||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||||
if (ClassParts.count < 2) continue;
|
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||||
if (ClassParts[0] != \"" . self::CLASS_PROFILE . "\") continue;
|
if (ClassParts.count < 2) continue;
|
||||||
Login = \"\";
|
if (ClassParts[0] != \"" . self::CLASS_PROFILE . "\") continue;
|
||||||
for (Index, 1, ClassParts.count - 1) {
|
Login = TextLib::SubText(ControlClass, {$prefixLength}, TextLib::Length(ControlClass));
|
||||||
Login ^= ClassParts[Index];
|
break;
|
||||||
if (Index < ClassParts.count - 1) Login ^= \"-\";
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
ShowProfile(Login);
|
ShowProfile(Login);
|
||||||
}";
|
}";
|
||||||
@ -800,17 +822,16 @@ if (Event.Control.HasClass(\"" . self::CLASS_TOGGLE . "\")) {
|
|||||||
private function getSpectateLabels() {
|
private function getSpectateLabels() {
|
||||||
if (!$this->spectate) return '';
|
if (!$this->spectate) return '';
|
||||||
$this->setInclude('TextLib', 'TextLib');
|
$this->setInclude('TextLib', 'TextLib');
|
||||||
|
$prefixLength = strlen(self::CLASS_SPECTATE) + 1;
|
||||||
$spectateScript = "
|
$spectateScript = "
|
||||||
if (Event.Control.HasClass(\"" . self::CLASS_SPECTATE . "\")) {
|
if (Event.Control.HasClass(\"" . self::CLASS_SPECTATE . "\")) {
|
||||||
declare Login = \"\";
|
declare Login = \"\";
|
||||||
foreach (ControlClass in Event.Control.ControlClass) {
|
foreach (ControlClass in Event.Control.ControlClasses) {
|
||||||
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
declare ClassParts = TextLib::Split(\"-\", ControlClass);
|
||||||
if (ClassParts.count < 2) continue;
|
if (ClassParts.count < 2) continue;
|
||||||
if (ClassParts[0] != \"" . self::CLASS_SPECTATE . "\") continue;
|
if (ClassParts[0] != \"" . self::CLASS_SPECTATE . "\") continue;
|
||||||
for (Index, 1, ClassParts.count - 1) {
|
Login = TextLib::SubText(ControlClass, {$prefixLength}, TextLib::Length(ControlClass));
|
||||||
Login ^= ClassParts[Index];
|
break;
|
||||||
if (Index < ClassParts.count - 1) Login ^= \"-\";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (Login != \"\") {
|
if (Login != \"\") {
|
||||||
SetSpectateTarget(Login);
|
SetSpectateTarget(Login);
|
||||||
|
311
application/core/FML/Stylesheet/Mood.php
Normal file
311
application/core/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/FML/Stylesheet/Style3d.php
Normal file
245
application/core/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/FML/Stylesheet/Stylesheet.php
Normal file
103
application/core/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;
|
||||||
|
}
|
||||||
|
}
|
@ -2,22 +2,44 @@
|
|||||||
|
|
||||||
namespace FML\Types;
|
namespace FML\Types;
|
||||||
|
|
||||||
|
use FML\Controls\Control;
|
||||||
|
use FML\Elements\Format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for Elements being able to contain other Elements
|
* Interface for Element being able to contain other Controls
|
||||||
*
|
*
|
||||||
* @author steeffeen
|
* @author steeffeen
|
||||||
*/
|
*/
|
||||||
interface Container {
|
interface Container {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new Child
|
* Add a new Child Control
|
||||||
*
|
*
|
||||||
* @param Renderable $child The Child Element to add
|
* @param Control $child The Child Control to add
|
||||||
|
* @return \FML\Types\Container
|
||||||
*/
|
*/
|
||||||
public function add(Renderable $child);
|
public function add(Control $child);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all Children
|
* Remove all Children
|
||||||
|
*
|
||||||
|
* @return \FML\Types\Container
|
||||||
*/
|
*/
|
||||||
public function removeChildren();
|
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);
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,24 @@ interface Linkable {
|
|||||||
*/
|
*/
|
||||||
public function setUrl($url);
|
public function setUrl($url);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Url Id to use from the Dico
|
||||||
|
*
|
||||||
|
* @param string $urlId
|
||||||
|
*/
|
||||||
|
public function setUrlId($urlId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Manialink
|
* Set Manialink
|
||||||
*
|
*
|
||||||
* @param string $manialink Manialink Name
|
* @param string $manialink Manialink Name
|
||||||
*/
|
*/
|
||||||
public function setManialink($manialink);
|
public function setManialink($manialink);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Manialink Id to use from the Dico
|
||||||
|
*
|
||||||
|
* @param string $manialinkId Manialink Id
|
||||||
|
*/
|
||||||
|
public function setManialinkId($manialinkId);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,13 @@ interface Playable {
|
|||||||
*/
|
*/
|
||||||
public function setData($data);
|
public function setData($data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Data Id to use from the Dico
|
||||||
|
*
|
||||||
|
* @param string $dataId
|
||||||
|
*/
|
||||||
|
public function setDataId($dataId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Play
|
* Set Play
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user