FML Improvements
This commit is contained in:
@ -9,9 +9,9 @@ use FML\Types\Scriptable;
|
||||
* Audio Control
|
||||
* (CMlMediaPlayer)
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Audio extends Control implements Playable, Scriptable {
|
||||
/*
|
||||
@ -25,6 +25,16 @@ class Audio extends Control implements Playable, Scriptable {
|
||||
protected $volume = 1.;
|
||||
protected $scriptEvents = 0;
|
||||
|
||||
/**
|
||||
* Construct a new Audio Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'audio';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Audio Control
|
||||
*
|
||||
@ -37,35 +47,29 @@ class Audio extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Audio Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'audio';
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlMediaPlayer';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setData()
|
||||
*/
|
||||
public function setData($data) {
|
||||
$this->data = (string) $data;
|
||||
$this->data = (string)$data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setDataId()
|
||||
*/
|
||||
public function setDataId($dataId) {
|
||||
$this->dataId = (string) $dataId;
|
||||
$this->dataId = (string)$dataId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setPlay()
|
||||
*/
|
||||
public function setPlay($play) {
|
||||
@ -74,7 +78,6 @@ class Audio extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setLooping()
|
||||
*/
|
||||
public function setLooping($looping) {
|
||||
@ -83,7 +86,6 @@ class Audio extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setMusic()
|
||||
*/
|
||||
public function setMusic($music) {
|
||||
@ -92,16 +94,14 @@ class Audio extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setVolume()
|
||||
*/
|
||||
public function setVolume($volume) {
|
||||
$this->volume = (float) $volume;
|
||||
$this->volume = (float)$volume;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
@ -110,7 +110,6 @@ class Audio extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
|
@ -67,30 +67,6 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Control Id
|
||||
*
|
||||
* @param bool $escaped (optional) Whether the Id should be escaped for ManiaScript
|
||||
* @return string
|
||||
*/
|
||||
public function getId($escaped = false) {
|
||||
if ($escaped) {
|
||||
return Builder::escapeText($this->id);
|
||||
}
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Id
|
||||
*
|
||||
* @param string $id Control Id
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = (string)$id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Id for dangerous Characters and assign a unique Id if necessary
|
||||
*
|
||||
@ -121,6 +97,47 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Control Id
|
||||
*
|
||||
* @param bool $escaped (optional) Whether the Id should be escaped for ManiaScript
|
||||
* @return string
|
||||
*/
|
||||
public function getId($escaped = false) {
|
||||
if ($escaped) {
|
||||
return Builder::escapeText($this->id);
|
||||
}
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Id
|
||||
*
|
||||
* @param string $id Control Id
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = (string)$id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Position
|
||||
*
|
||||
* @param float $x Horizontal Position
|
||||
* @param float $y Vertical Position
|
||||
* @param float $z (optional) Depth
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setPosition($x, $y, $z = null) {
|
||||
$this->setX($x);
|
||||
$this->setY($y);
|
||||
if ($z !== null) {
|
||||
$this->setZ($z);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set X Position
|
||||
*
|
||||
@ -155,19 +172,15 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Position
|
||||
* Set Control Size
|
||||
*
|
||||
* @param float $x Horizontal Position
|
||||
* @param float $y Vertical Position
|
||||
* @param float $z (optional) Depth
|
||||
* @param float $width Control Width
|
||||
* @param float $height Control Height
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setPosition($x, $y, $z = null) {
|
||||
$this->setX($x);
|
||||
$this->setY($y);
|
||||
if ($z !== null) {
|
||||
$this->setZ($z);
|
||||
}
|
||||
public function setSize($width, $height) {
|
||||
$this->setWidth($width);
|
||||
$this->setHeight($height);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -194,15 +207,25 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Control Size
|
||||
* Center Alignment
|
||||
*
|
||||
* @param float $width Control Width
|
||||
* @param float $height Control Height
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setSize($width, $height) {
|
||||
$this->setWidth($width);
|
||||
$this->setHeight($height);
|
||||
public function centerAlign() {
|
||||
$this->setAlign(self::CENTER, self::CENTER2);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Horizontal and Vertical Alignment
|
||||
*
|
||||
* @param string $hAlign Horizontal Alignment
|
||||
* @param string $vAlign Vertical Alignment
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setAlign($hAlign, $vAlign) {
|
||||
$this->setHAlign($hAlign);
|
||||
$this->setVAlign($vAlign);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -228,29 +251,6 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Horizontal and Vertical Alignment
|
||||
*
|
||||
* @param string $hAlign Horizontal Alignment
|
||||
* @param string $vAlign Vertical Alignment
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function setAlign($hAlign, $vAlign) {
|
||||
$this->setHAlign($hAlign);
|
||||
$this->setVAlign($vAlign);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Center Alignment
|
||||
*
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function centerAlign() {
|
||||
$this->setAlign(self::CENTER, self::CENTER2);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset Alignment
|
||||
*
|
||||
@ -310,6 +310,17 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Script Feature
|
||||
*
|
||||
* @param ScriptFeature $scriptFeature Script Feature
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function addScriptFeature(ScriptFeature $scriptFeature) {
|
||||
array_push($this->scriptFeatures, $scriptFeature);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a dynamic Feature opening the current Map Info
|
||||
*
|
||||
@ -398,26 +409,14 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
*
|
||||
* @param string $scriptText Script Text
|
||||
* @param string $label (optional) Script Label Name
|
||||
* @param bool $isolated (optional) Whether to isolate the Script Text
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function addScriptText($scriptText, $label = ScriptLabel::MOUSECLICK, $isolated = true) {
|
||||
$customText = new ControlScript($this, $scriptText, $label, $isolated);
|
||||
public function addScriptText($scriptText, $label = ScriptLabel::MOUSECLICK) {
|
||||
$customText = new ControlScript($this, $scriptText, $label);
|
||||
$this->addScriptFeature($customText);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Script Feature
|
||||
*
|
||||
* @param ScriptFeature $scriptFeature Script Feature
|
||||
* @return \FML\Controls\Control
|
||||
*/
|
||||
public function addScriptFeature(ScriptFeature $scriptFeature) {
|
||||
array_push($this->scriptFeatures, $scriptFeature);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all Script Features
|
||||
*
|
||||
@ -467,4 +466,11 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
}
|
||||
return $xmlElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ManiaScript Class of the Control
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public abstract function getManiaScriptClass();
|
||||
}
|
||||
|
@ -32,6 +32,16 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
||||
protected $focusAreaColor2 = '';
|
||||
protected $autoComplete = null;
|
||||
|
||||
/**
|
||||
* Construct a new Entry Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'entry';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Entry Control
|
||||
*
|
||||
@ -44,13 +54,19 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Entry Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'entry';
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlEntry';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Entry Name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,12 +81,12 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Entry Name
|
||||
* Get the Default Value
|
||||
*
|
||||
* @return string
|
||||
* @return mixed
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
public function getDefault() {
|
||||
return $this->default;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,15 +100,6 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Default Value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDefault() {
|
||||
return $this->default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\NewLineable::setAutoNewLine()
|
||||
*/
|
||||
|
@ -6,9 +6,9 @@ namespace FML\Controls;
|
||||
* FileEntry Control
|
||||
* (CMlFileEntry)
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class FileEntry extends Entry {
|
||||
/*
|
||||
@ -16,6 +16,16 @@ class FileEntry extends Entry {
|
||||
*/
|
||||
protected $folder = '';
|
||||
|
||||
/**
|
||||
* Construct a new FileEntry Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'fileentry';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new FileEntry Control
|
||||
*
|
||||
@ -28,13 +38,10 @@ class FileEntry extends Entry {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new FileEntry Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'fileentry';
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlFileEntry';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,12 +51,11 @@ class FileEntry extends Entry {
|
||||
* @return \FML\Controls\FileEntry
|
||||
*/
|
||||
public function setFolder($folder) {
|
||||
$this->folder = (string) $folder;
|
||||
$this->folder = (string)$folder;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Entry::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
|
@ -23,6 +23,16 @@ class Frame extends Control implements Container {
|
||||
/** @var Format $format */
|
||||
protected $format = null;
|
||||
|
||||
/**
|
||||
* Construct a new Frame Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'frame';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Frame Control
|
||||
*
|
||||
@ -35,13 +45,10 @@ class Frame extends Control implements Container {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Frame Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'frame';
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlFrame';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,14 +69,6 @@ class Frame extends Control implements Container {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Container::setFormat()
|
||||
*/
|
||||
public function setFormat(Format $format) {
|
||||
$this->format = $format;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Container::getFormat()
|
||||
*/
|
||||
@ -80,6 +79,14 @@ class Frame extends Control implements Container {
|
||||
return $this->format;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Container::setFormat()
|
||||
*/
|
||||
public function setFormat(Format $format) {
|
||||
$this->format = $format;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Controls\Control::getScriptFeatures()
|
||||
*/
|
||||
|
@ -20,18 +20,6 @@ class FrameInstance extends Control {
|
||||
/** @var FrameModel $model */
|
||||
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
|
||||
*
|
||||
@ -58,6 +46,25 @@ class FrameInstance extends Control {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlFrame';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Frame Model to use
|
||||
*
|
||||
|
@ -8,19 +8,19 @@ use FML\Types\Styleable;
|
||||
* Gauge Control
|
||||
* (CMlGauge)
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Gauge extends Control implements Styleable {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE_BgCard = 'BgCard';
|
||||
const STYLE_EnergyBar = 'EnergyBar';
|
||||
const STYLE_ProgressBar = 'ProgressBar';
|
||||
const STYLE_BgCard = 'BgCard';
|
||||
const STYLE_EnergyBar = 'EnergyBar';
|
||||
const STYLE_ProgressBar = 'ProgressBar';
|
||||
const STYLE_ProgressBarSmall = 'ProgressBarSmall';
|
||||
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
*/
|
||||
@ -34,6 +34,16 @@ class Gauge extends Control implements Styleable {
|
||||
protected $drawBlockBg = 1;
|
||||
protected $style = '';
|
||||
|
||||
/**
|
||||
* Construct a new Gauge Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'gauge';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Gauge Control
|
||||
*
|
||||
@ -46,13 +56,10 @@ class Gauge extends Control implements Styleable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Gauge Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'gauge';
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlGauge';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,7 +69,7 @@ class Gauge extends Control implements Styleable {
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setRatio($ratio) {
|
||||
$this->ratio = (float) $ratio;
|
||||
$this->ratio = (float)$ratio;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -73,7 +80,7 @@ class Gauge extends Control implements Styleable {
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setGrading($grading) {
|
||||
$this->grading = (float) $grading;
|
||||
$this->grading = (float)$grading;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -84,7 +91,7 @@ class Gauge extends Control implements Styleable {
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setColor($color) {
|
||||
$this->color = (string) $color;
|
||||
$this->color = (string)$color;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -95,7 +102,7 @@ class Gauge extends Control implements Styleable {
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setRotation($rotation) {
|
||||
$this->rotation = (float) $rotation;
|
||||
$this->rotation = (float)$rotation;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -117,7 +124,7 @@ class Gauge extends Control implements Styleable {
|
||||
* @return \FML\Controls\Gauge
|
||||
*/
|
||||
public function setClan($clan) {
|
||||
$this->clan = (int) $clan;
|
||||
$this->clan = (int)$clan;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -144,16 +151,14 @@ class Gauge extends Control implements Styleable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Styleable::setStyle()
|
||||
*/
|
||||
public function setStyle($style) {
|
||||
$this->style = (string) $style;
|
||||
$this->style = (string)$style;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
|
@ -2,21 +2,21 @@
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Script\Features\Clock;
|
||||
use FML\Types\Actionable;
|
||||
use FML\Types\Linkable;
|
||||
use FML\Types\NewLineable;
|
||||
use FML\Types\Scriptable;
|
||||
use FML\Types\Styleable;
|
||||
use FML\Types\TextFormatable;
|
||||
use FML\Script\Features\Clock;
|
||||
|
||||
/**
|
||||
* Label Control
|
||||
* (CMlLabel)
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Label extends Control implements Actionable, Linkable, NewLineable, Scriptable, Styleable, TextFormatable {
|
||||
/*
|
||||
@ -42,17 +42,6 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
protected $focusAreaColor1 = '';
|
||||
protected $focusAreaColor2 = '';
|
||||
|
||||
/**
|
||||
* Create a new Label Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$label = new Label($id);
|
||||
return $label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Label Control
|
||||
*
|
||||
@ -64,6 +53,24 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
$this->setZ(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlLabel';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Text
|
||||
*
|
||||
@ -71,7 +78,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setText($text) {
|
||||
$this->text = (string) $text;
|
||||
$this->text = (string)$text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -82,7 +89,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setTextId($textId) {
|
||||
$this->textId = (string) $textId;
|
||||
$this->textId = (string)$textId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -93,7 +100,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setTextPrefix($textPrefix) {
|
||||
$this->textPrefix = (string) $textPrefix;
|
||||
$this->textPrefix = (string)$textPrefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -126,21 +133,11 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
public function setMaxLines($maxLines) {
|
||||
$this->maxLines = (int) $maxLines;
|
||||
$this->maxLines = (int)$maxLines;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::setAction()
|
||||
*/
|
||||
public function setAction($action) {
|
||||
$this->action = (string) $action;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::getAction()
|
||||
*/
|
||||
public function getAction() {
|
||||
@ -148,52 +145,54 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Actionable::setAction()
|
||||
*/
|
||||
public function setAction($action) {
|
||||
$this->action = (string)$action;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Actionable::setActionKey()
|
||||
*/
|
||||
public function setActionKey($actionKey) {
|
||||
$this->actionKey = (int) $actionKey;
|
||||
$this->actionKey = (int)$actionKey;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setUrl()
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
$this->url = (string)$url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setUrlId()
|
||||
*/
|
||||
public function setUrlId($urlId) {
|
||||
$this->urlId = (string) $urlId;
|
||||
$this->urlId = (string)$urlId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setManialink()
|
||||
*/
|
||||
public function setManialink($manialink) {
|
||||
$this->manialink = (string) $manialink;
|
||||
$this->manialink = (string)$manialink;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Linkable::setManialinkId()
|
||||
*/
|
||||
public function setManialinkId($manialinkId) {
|
||||
$this->manialinkId = (string) $manialinkId;
|
||||
$this->manialinkId = (string)$manialinkId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\NewLineable::setAutoNewLine()
|
||||
*/
|
||||
public function setAutoNewLine($autoNewLine) {
|
||||
@ -202,7 +201,6 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
@ -211,54 +209,49 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Styleable::setStyle()
|
||||
*/
|
||||
public function setStyle($style) {
|
||||
$this->style = (string) $style;
|
||||
$this->style = (string)$style;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setTextSize()
|
||||
*/
|
||||
public function setTextSize($textSize) {
|
||||
$this->textSize = (int) $textSize;
|
||||
$this->textSize = (int)$textSize;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setTextColor()
|
||||
*/
|
||||
public function setTextColor($textColor) {
|
||||
$this->textColor = (string) $textColor;
|
||||
$this->textColor = (string)$textColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setAreaColor()
|
||||
*/
|
||||
public function setAreaColor($areaColor) {
|
||||
$this->focusAreaColor1 = (string) $areaColor;
|
||||
$this->focusAreaColor1 = (string)$areaColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\TextFormatable::setAreaFocusColor()
|
||||
*/
|
||||
public function setAreaFocusColor($areaFocusColor) {
|
||||
$this->focusAreaColor2 = (string) $areaFocusColor;
|
||||
$this->focusAreaColor2 = (string)$areaFocusColor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a dynamic Feature showing the current Time
|
||||
*
|
||||
* @param bool $showSeconds (optional) Whether the Seconds should be shown
|
||||
* @param bool $showSeconds (optional) Whether the Seconds should be shown
|
||||
* @param bool $showFullDate (optional) Whether the Date should be shown
|
||||
* @return \FML\Controls\Label
|
||||
*/
|
||||
@ -269,7 +262,6 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
|
@ -40,6 +40,17 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
||||
protected $style = '';
|
||||
protected $subStyle = '';
|
||||
|
||||
/**
|
||||
* Construct a new Quad Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'quad';
|
||||
$this->setZ(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Quad Control
|
||||
*
|
||||
@ -52,14 +63,10 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Quad Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'quad';
|
||||
$this->setZ(-1);
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlQuad';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,6 +146,13 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Actionable::getAction()
|
||||
*/
|
||||
public function getAction() {
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Actionable::setAction()
|
||||
*/
|
||||
@ -147,13 +161,6 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Actionable::getAction()
|
||||
*/
|
||||
public function getAction() {
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Actionable::setActionKey()
|
||||
*/
|
||||
@ -210,6 +217,15 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\SubStyleable::setStyles()
|
||||
*/
|
||||
public function setStyles($style, $subStyle) {
|
||||
$this->setStyle($style);
|
||||
$this->setSubStyle($subStyle);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\Styleable::setStyle()
|
||||
*/
|
||||
@ -226,15 +242,6 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \FML\Types\SubStyleable::setStyles()
|
||||
*/
|
||||
public function setStyles($style, $subStyle) {
|
||||
$this->setStyle($style);
|
||||
$this->setSubStyle($subStyle);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the given CheckBox Design
|
||||
*
|
||||
|
@ -9,9 +9,9 @@ use FML\Types\Scriptable;
|
||||
* Video Control
|
||||
* (CMlMediaPlayer)
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Video extends Control implements Playable, Scriptable {
|
||||
/*
|
||||
@ -25,6 +25,16 @@ class Video extends Control implements Playable, Scriptable {
|
||||
protected $volume = 1.;
|
||||
protected $scriptEvents = 0;
|
||||
|
||||
/**
|
||||
* Construct a new Video Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'video';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Video Control
|
||||
*
|
||||
@ -37,35 +47,29 @@ class Video extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Video Control
|
||||
*
|
||||
* @param string $id (optional) Control Id
|
||||
* @see \FML\Controls\Control::getManiaScriptClass()
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'video';
|
||||
public function getManiaScriptClass() {
|
||||
return 'CMlMediaPlayer';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setData()
|
||||
*/
|
||||
public function setData($data) {
|
||||
$this->data = (string) $data;
|
||||
$this->data = (string)$data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setDataId()
|
||||
*/
|
||||
public function setDataId($dataId) {
|
||||
$this->dataId = (string) $dataId;
|
||||
$this->dataId = (string)$dataId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setPlay()
|
||||
*/
|
||||
public function setPlay($play) {
|
||||
@ -74,7 +78,6 @@ class Video extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setLooping()
|
||||
*/
|
||||
public function setLooping($looping) {
|
||||
@ -83,7 +86,6 @@ class Video extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setMusic()
|
||||
*/
|
||||
public function setMusic($music) {
|
||||
@ -92,16 +94,14 @@ class Video extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Playable::setVolume()
|
||||
*/
|
||||
public function setVolume($volume) {
|
||||
$this->volume = (float) $volume;
|
||||
$this->volume = (float)$volume;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Scriptable::setScriptEvents()
|
||||
*/
|
||||
public function setScriptEvents($scriptEvents) {
|
||||
@ -110,7 +110,6 @@ class Video extends Control implements Playable, Scriptable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Control::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
|
Reference in New Issue
Block a user