From 5447588749b500150abf70f6b485b33250d87263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schr=C3=B6der?= Date: Tue, 31 Dec 2013 02:55:19 +0100 Subject: [PATCH] Huge FML Update --- application/core/FML/Controls/Audio.php | 7 +- application/core/FML/Controls/Control.php | 559 +++++++-------- application/core/FML/Controls/Entry.php | 14 +- application/core/FML/Controls/FileEntry.php | 12 +- application/core/FML/Controls/Frame.php | 16 +- application/core/FML/Controls/Frame3d.php | 12 +- application/core/FML/Controls/Gauge.php | 48 +- application/core/FML/Controls/Label.php | 32 +- application/core/FML/Controls/Quad.php | 27 +- .../core/FML/Controls/Quads/Quad_321Go.php | 7 +- .../FML/Controls/Quads/Quad_BgRaceScore2.php | 7 +- .../core/FML/Controls/Quads/Quad_Bgs1.php | 135 ++-- .../FML/Controls/Quads/Quad_Bgs1InRace.php | 135 ++-- .../Quads/Quad_BgsChallengeMedals.php | 19 +- .../FML/Controls/Quads/Quad_BgsPlayerCard.php | 7 +- .../core/FML/Controls/Quads/Quad_Copilot.php | 31 +- .../core/FML/Controls/Quads/Quad_Emblems.php | 7 +- .../FML/Controls/Quads/Quad_EnergyBar.php | 7 +- .../FML/Controls/Quads/Quad_Hud3dEchelons.php | 25 +- .../Controls/Quads/Quad_Icons128x128_1.php | 132 ++-- .../Quads/Quad_Icons128x128_Blink.php | 135 ++-- .../FML/Controls/Quads/Quad_Icons128x32_1.php | 57 +- .../FML/Controls/Quads/Quad_Icons64x64_1.php | 7 +- .../FML/Controls/Quads/Quad_Icons64x64_2.php | 33 +- .../Controls/Quads/Quad_ManiaPlanetLogos.php | 7 +- .../Controls/Quads/Quad_ManiaplanetSystem.php | 7 +- .../FML/Controls/Quads/Quad_MedalsBig.php | 21 +- .../FML/Controls/Quads/Quad_TitleLogos.php | 15 +- .../Quads/Quad_UIConstruction_Buttons.php | 115 +-- .../Quads/Quad_UiSMSpectatorScoreBig.php | 7 +- application/core/FML/Controls/Video.php | 5 +- .../core/FML/{Elements => }/CustomUI.php | 326 +++++---- application/core/FML/Elements/Format.php | 2 +- application/core/FML/Elements/Including.php | 11 +- application/core/FML/Elements/Music.php | 7 +- .../core/FML/Elements/SimpleScript.php | 4 +- application/core/FML/ManiaLink.php | 369 +++++----- application/core/FML/ManiaLinks.php | 20 +- application/core/FML/Script/Builder.php | 23 + application/core/FML/Script/Menus.php | 100 --- application/core/FML/Script/Pages.php | 147 ---- .../Script/{Templates => Parts}/Header.txt | 2 +- .../FML/Script/{Templates => Parts}/Main.txt | 6 +- application/core/FML/Script/Script.php | 659 ++++++++++++------ application/core/FML/Script/ScriptFeature.php | 11 - .../core/FML/Script/Sections/Constants.php | 16 - .../core/FML/Script/Sections/Functions.php | 18 - .../core/FML/Script/Sections/Globals.php | 18 - .../core/FML/Script/Sections/Includes.php | 18 - .../core/FML/Script/Sections/Labels.php | 28 - .../FML/Script/Templates/MenuMouseClick.txt | 12 - .../FML/Script/Templates/PageMouseClick.txt | 27 - .../core/FML/Script/Templates/PageOnInit.txt | 18 - .../FML/Script/Templates/TooltipMouseOut.txt | 6 - .../FML/Script/Templates/TooltipMouseOver.txt | 6 - application/core/FML/Script/Tooltips.php | 81 --- application/core/FML/Types/Actionable.php | 3 +- application/core/FML/Types/BgColorable.php | 7 +- application/core/FML/Types/Container.php | 7 +- application/core/FML/Types/Linkable.php | 10 +- application/core/FML/Types/NewLineable.php | 5 +- application/core/FML/Types/Playable.php | 25 +- application/core/FML/Types/Renderable.php | 2 +- application/core/FML/Types/Scriptable.php | 3 +- application/core/FML/Types/Styleable.php | 5 +- application/core/FML/Types/SubStyleable.php | 11 +- application/core/FML/Types/TextFormatable.php | 20 +- 67 files changed, 1783 insertions(+), 1898 deletions(-) rename application/core/FML/{Elements => }/CustomUI.php (64%) create mode 100644 application/core/FML/Script/Builder.php delete mode 100644 application/core/FML/Script/Menus.php delete mode 100644 application/core/FML/Script/Pages.php rename application/core/FML/Script/{Templates => Parts}/Header.txt (74%) rename application/core/FML/Script/{Templates => Parts}/Main.txt (84%) delete mode 100644 application/core/FML/Script/ScriptFeature.php delete mode 100644 application/core/FML/Script/Sections/Constants.php delete mode 100644 application/core/FML/Script/Sections/Functions.php delete mode 100644 application/core/FML/Script/Sections/Globals.php delete mode 100644 application/core/FML/Script/Sections/Includes.php delete mode 100644 application/core/FML/Script/Sections/Labels.php delete mode 100644 application/core/FML/Script/Templates/MenuMouseClick.txt delete mode 100644 application/core/FML/Script/Templates/PageMouseClick.txt delete mode 100644 application/core/FML/Script/Templates/PageOnInit.txt delete mode 100644 application/core/FML/Script/Templates/TooltipMouseOut.txt delete mode 100644 application/core/FML/Script/Templates/TooltipMouseOver.txt delete mode 100644 application/core/FML/Script/Tooltips.php diff --git a/application/core/FML/Controls/Audio.php b/application/core/FML/Controls/Audio.php index 3f0c1cc8..f2361800 100644 --- a/application/core/FML/Controls/Audio.php +++ b/application/core/FML/Controls/Audio.php @@ -3,16 +3,17 @@ namespace FML\Controls; /** - * Class representing audio (CMlMediaPlayer) + * Class representing Audio (CMlMediaPlayer) * * @author steeffeen */ class Audio extends Control implements Playable, Scriptable { /** - * Construct a new audio control + * Construct a new Audio Control * - * @param string $id + * @param string $id + * Control Id */ public function __construct($id = null) { parent::__construct($id); diff --git a/application/core/FML/Controls/Control.php b/application/core/FML/Controls/Control.php index 0e77ccef..da287efb 100644 --- a/application/core/FML/Controls/Control.php +++ b/application/core/FML/Controls/Control.php @@ -1,274 +1,287 @@ -setId($id); - } - } - - /** - * Get control id - * - * @return string - */ - public function getId() { - return $this->id; - } - - /** - * Set control id - * - * @param string $id - * @return \FML\Controls\Control - */ - public function setId($id) { - $this->id = $id; - return $this; - } - - /** - * Assign an unique id if necessary - * - * @return \FML\Controls\Control - */ - public function assignId() { - if ($this->getId()) { - return $this; - } - $this->setId(uniqid()); - return $this; - } - - /** - * Set x position - * - * @param float $x - * @return \FML\Controls\Control - */ - public function setX($x) { - $this->x = $x; - return $this; - } - - /** - * Set y position - * - * @param float $y - * @return \FML\Controls\Control - */ - public function setY($y) { - $this->y = $y; - return $this; - } - - /** - * Set z position - * - * @param float $z - * @return \FML\Controls\Control - */ - public function setZ($z) { - $this->z = $z; - return $this; - } - - /** - * Set position - * - * @param float $x - * @param float $y - * @param float $z - * @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 width - * - * @param float $width - * @return \FML\Controls\Control - */ - public function setWidth($width) { - $this->width = $width; - return $this; - } - - /** - * Set height - * - * @param float $height - * @return \FML\Controls\Control - */ - public function setHeight($height) { - $this->height = $height; - return $this; - } - - /** - * Set size - * - * @param float $width - * @param float $height - * @return \FML\Controls\Control - */ - public function setSize($width, $height) { - $this->setWidth($width); - $this->setHeight($height); - return $this; - } - - /** - * Set horizontal alignment - * - * @param string $hAlign - * @return \FML\Controls\Control - */ - public function setHAlign($hAlign) { - $this->hAlign = $hAlign; - return $this; - } - - /** - * Set vertical alignment - * - * @param string $vAlign - * @return \FML\Controls\Control - */ - public function setVAlign($vAlign) { - $this->vAlign = $vAlign; - return $this; - } - - /** - * Set horizontal and vertical alignment - * - * @param string $hAlign - * @param string $vAlign - * @return \FML\Controls\Control - */ - public function setAlign($hAlign, $vAlign) { - $this->setHAlign($hAlign); - $this->setVAlign($vAlign); - return $this; - } - - /** - * Set scale - * - * @param float $scale - * @return \FML\Controls\Control - */ - public function setScale($scale) { - $this->scale = $scale; - return $this; - } - - /** - * Set visible - * - * @param bool $visible - * @return \FML\Controls\Control - */ - public function setVisible($visible) { - $this->hidden = ($visible ? 0 : 1); - return $this; - } - - /** - * Add class name - * - * @param string $class - * @return \FML\Controls\Control - */ - public function addClass($class) { - array_push($this->classes, $class); - return $this; - } - - /** - * - * @see \FML\Types\Renderable::render() - */ - public function render(\DOMDocument $domDocument) { - $xml = $domDocument->createElement($this->tagName); - if ($this->id) { - $xml->setAttribute('id', $this->id); - } - if ($this->x !== 0. || $this->y !== 0. || $this->z !== 0.) { - $xml->setAttribute('posn', "{$this->x} {$this->y} {$this->z}"); - } - if ($this->width >= 0. || $this->height >= 0.) { - $xml->setAttribute('sizen', "{$this->width} {$this->height}"); - } - if (get_class($this) !== Frame::getClass()) { - if ($this->hAlign) { - $xml->setAttribute('halign', $this->hAlign); - } - if ($this->vAlign) { - $xml->setAttribute('valign', $this->vAlign); - } - } - if ($this->scale !== 1.) { - $xml->setAttribute('scale', $this->scale); - } - if ($this->hidden) { - $xml->setAttribute('hidden', $this->hidden); - } - $classes = ''; - foreach ($this->classes as $class) { - $classes .= $class . ' '; - } - if ($classes) { - $xml->setAttribute('class', $classes); - } - return $xml; - } +setId($id); + } + } + + /** + * Get Control Id + * + * @return string + */ + public function getId() { + return $this->id; + } + + /** + * Set Control Id + * + * @param string $id Control Id + * @return \FML\Controls\Control + */ + public function setId($id) { + $this->id = $id; + return $this; + } + + /** + * Check Id for dangerous Characters and assign an unique Id if necessary + * + * @return \FML\Controls\Control + */ + public function checkId() { + if (!$this->getId()) { + $this->setId(uniqid()); + return $this; + } + $dangerousCharacters = array(' ', ' ', '.', '|', '-', PHP_EOL); + $idCharacters = str_split($this->getId()); + $danger = false; + foreach ($idCharacters as $character) { + if (!in_array($character, $dangerousCharacters)) continue; + $danger = true; + break; + } + if ($danger) { + trigger_error("Please don't use special Characters in Ids, they might cause Problems! (I stripped them for You.)"); + $id = str_ireplace($dangerousCharacters, '', $this->getId()); + $this->setId($id); + } + return $this; + } + + /** + * Set X Position + * + * @param float $x Horizontal Position + * @return \FML\Controls\Control + */ + public function setX($x) { + $this->x = $x; + return $this; + } + + /** + * Set Y Position + * + * @param float $y Vertical Position + * @return \FML\Controls\Control + */ + public function setY($y) { + $this->y = $y; + return $this; + } + + /** + * Set Z Position + * + * @param float $z Depth + * @return \FML\Controls\Control + */ + public function setZ($z) { + $this->z = $z; + return $this; + } + + /** + * Set Control Position + * + * @param float $x Horizontal Position + * @param float $y Vertical Position + * @param float $z Depth + * @return \FML\Controls\Control + */ + public function setPosition($x, $y, $z = null) { + $this->setX($x); + $this->setY($y); + if ($z !== null) { + $this->setZ($z); + } + return $this; + } + + /** + * Set Control Width + * + * @param float $width Control Width + * @return \FML\Controls\Control + */ + public function setWidth($width) { + $this->width = $width; + return $this; + } + + /** + * Set Control Height + * + * @param float $height Control Height + * @return \FML\Controls\Control + */ + public function setHeight($height) { + $this->height = $height; + return $this; + } + + /** + * Set Control Size + * + * @param float $width Control Width + * @param float $height Control Height + * @return \FML\Controls\Control + */ + public function setSize($width, $height) { + $this->setWidth($width); + $this->setHeight($height); + return $this; + } + + /** + * Set Horizontal Alignment + * + * @param string $hAlign Horizontal Alignment + * @return \FML\Controls\Control + */ + public function setHAlign($hAlign) { + $this->hAlign = $hAlign; + return $this; + } + + /** + * Set Vertical Alignment + * + * @param string $vAlign Vertical Alignment + * @return \FML\Controls\Control + */ + public function setVAlign($vAlign) { + $this->vAlign = $vAlign; + return $this; + } + + /** + * Set Horizontal and Vertical Alignment + * + * @param string $hAlign Horizontal Alignment + * @param string $vAlign Vertical Alignment + * @return \FML\Controls\Control + */ + public function setAlign($hAlign, $vAlign) { + $this->setHAlign($hAlign); + $this->setVAlign($vAlign); + return $this; + } + + /** + * Set Control Scale + * + * @param float $scale Control Scale + * @return \FML\Controls\Control + */ + public function setScale($scale) { + $this->scale = $scale; + return $this; + } + + /** + * Set Visibility + * + * @param bool $visible If Control should be visible + * @return \FML\Controls\Control + */ + public function setVisible($visible) { + $this->hidden = ($visible ? 0 : 1); + return $this; + } + + /** + * Add new Class Name + * + * @param string $class Class Name + * @return \FML\Controls\Control + */ + public function addClass($class) { + if (!in_array($class, $this->classes)) { + array_push($this->classes, $class); + } + return $this; + } + + /** + * + * @see \FML\Types\Renderable::render() + */ + public function render(\DOMDocument $domDocument) { + $xml = $domDocument->createElement($this->tagName); + if ($this->id) { + $xml->setAttribute('id', $this->id); + } + if ($this->x !== 0. || $this->y !== 0. || $this->z !== 0.) { + $xml->setAttribute('posn', "{$this->x} {$this->y} {$this->z}"); + } + if ($this->width >= 0. || $this->height >= 0.) { + $xml->setAttribute('sizen', "{$this->width} {$this->height}"); + } + if ($this->hAlign) { + $xml->setAttribute('halign', $this->hAlign); + } + if ($this->vAlign) { + $xml->setAttribute('valign', $this->vAlign); + } + if ($this->scale !== 1.) { + $xml->setAttribute('scale', $this->scale); + } + if ($this->hidden) { + $xml->setAttribute('hidden', $this->hidden); + } + $classes = ''; + foreach ($this->classes as $class) { + $classes .= $class . ' '; + } + if ($classes) { + $xml->setAttribute('class', $classes); + } + return $xml; + } } diff --git a/application/core/FML/Controls/Entry.php b/application/core/FML/Controls/Entry.php index e26a595c..c7960f2e 100644 --- a/application/core/FML/Controls/Entry.php +++ b/application/core/FML/Controls/Entry.php @@ -14,7 +14,7 @@ use FML\Types\TextFormatable; */ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextFormatable { /** - * Protected properties + * Protected Properties */ protected $name = ''; protected $default = null; @@ -27,7 +27,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF protected $areaFocusColor = ''; /** - * Construct a new entry control + * Construct a new Entry Control * * @param string $id */ @@ -37,9 +37,10 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF } /** - * Set name + * Set Entry Name * - * @param string $name + * @param string $name + * Entry Name * @return \FML\Controls\Entry */ public function setName($name) { @@ -48,9 +49,10 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF } /** - * Set default + * Set Default Value * - * @param string $default + * @param string $default + * Default Value * @return \FML\Controls\Entry */ public function setDefault($default) { diff --git a/application/core/FML/Controls/FileEntry.php b/application/core/FML/Controls/FileEntry.php index 432207b5..7d0787cd 100644 --- a/application/core/FML/Controls/FileEntry.php +++ b/application/core/FML/Controls/FileEntry.php @@ -9,14 +9,15 @@ namespace FML\Controls; */ class FileEntry extends Entry { /** - * Protected properties + * Protected Properties */ protected $folder = ''; /** - * Construct a new FileEntry control + * Construct a new FileEntry Control * - * @param string $id + * @param string $id + * Control Id */ public function __construct($id = null) { parent::__construct($id); @@ -24,9 +25,10 @@ class FileEntry extends Entry { } /** - * Set folder + * Set Folder * - * @param string $folder + * @param string $folder + * Base Folder * @return \FML\Controls\FileEntry */ public function setFolder($folder) { diff --git a/application/core/FML/Controls/Frame.php b/application/core/FML/Controls/Frame.php index 0a699045..e642de49 100644 --- a/application/core/FML/Controls/Frame.php +++ b/application/core/FML/Controls/Frame.php @@ -12,14 +12,15 @@ use FML\Types\Renderable; */ class Frame extends Control implements Container { /** - * Protected properties + * Protected Properties */ protected $children = array(); /** - * Construct a new frame control + * Construct a new Frame Control * - * @param string $id + * @param string $id + * Control Id */ public function __construct($id = null) { parent::__construct($id); @@ -58,13 +59,4 @@ class Frame extends Control implements Container { } return $xml; } - - /** - * Return class name - * - * @return string - */ - public static function getClass() { - return __CLASS__; - } } diff --git a/application/core/FML/Controls/Frame3d.php b/application/core/FML/Controls/Frame3d.php index b83c2b65..c625c1f2 100644 --- a/application/core/FML/Controls/Frame3d.php +++ b/application/core/FML/Controls/Frame3d.php @@ -5,21 +5,22 @@ namespace FML\Controls; use FML\Types\Scriptable; /** - * Class representing frame3d elements (CMlFrame) + * Class representing Frame3d Elements (CMlFrame) * * @author steeffeen */ class Frame3d extends Frame implements Scriptable { /** - * Protected properties + * Protected Properties */ protected $style3d = ''; protected $scriptEvents = 0; /** - * Construct a new frame3d control + * Construct a new Frame3d Control * - * @param string $id + * @param string $id + * Control Id */ public function __construct($id = null) { parent::__construct($id); @@ -29,7 +30,8 @@ class Frame3d extends Frame implements Scriptable { /** * Set style3d * - * @param string $style3d + * @param string $style3d + * 3D Style * @return \FML\Controls\Frame3d */ public function setStyle3d($style3d) { diff --git a/application/core/FML/Controls/Gauge.php b/application/core/FML/Controls/Gauge.php index 52c02437..c11e62c1 100644 --- a/application/core/FML/Controls/Gauge.php +++ b/application/core/FML/Controls/Gauge.php @@ -11,7 +11,7 @@ use FML\Types\Styleable; */ class Gauge extends Control implements Styleable { /** - * Protected properties + * Protected Properties */ protected $ratio = 1.; protected $grading = 1.; @@ -24,9 +24,10 @@ class Gauge extends Control implements Styleable { protected $style = ''; /** - * Construct a new gauge control + * Construct a new Gauge Control * - * @param string $id + * @param string $id + * Control Id */ public function __construct($id = null) { parent::__construct($id); @@ -34,9 +35,10 @@ class Gauge extends Control implements Styleable { } /** - * Set ratio + * Set Ratio * - * @param float $ratio + * @param float $ratio + * Ratio Value * @return \FML\Controls\Gauge */ public function setRatio($ratio) { @@ -45,9 +47,10 @@ class Gauge extends Control implements Styleable { } /** - * Set grading + * Set Grading * - * @param float $grading + * @param float $grading + * Grading Value * @return \FML\Controls\Gauge */ public function setGrading($grading) { @@ -56,9 +59,10 @@ class Gauge extends Control implements Styleable { } /** - * Set color + * Set Color * - * @param string $color + * @param string $color + * Gauge Color * @return \FML\Controls\Gauge */ public function setColor($color) { @@ -67,9 +71,10 @@ class Gauge extends Control implements Styleable { } /** - * Set rotation + * Set Rotation * - * @param float $rotation + * @param float $rotation + * Gauge Rotation * @return \FML\Controls\Gauge */ public function setRotation($rotation) { @@ -78,9 +83,10 @@ class Gauge extends Control implements Styleable { } /** - * Set centered + * Set Centered * - * @param bool $centered + * @param bool $centered + * If Gauge is centered * @return \FML\Controls\Gauge */ public function setCentered($centered) { @@ -89,9 +95,10 @@ class Gauge extends Control implements Styleable { } /** - * Set clan + * Set Clan * - * @param int $clan + * @param int $clan + * Clan number * @return \FML\Controls\Gauge */ public function setClan($clan) { @@ -100,9 +107,10 @@ class Gauge extends Control implements Styleable { } /** - * Set draw background + * Set Draw Background * - * @param bool $drawBg + * @param bool $drawBg + * If Gauge Background should be drawn * @return \FML\Controls\Gauge */ public function setDrawBg($drawBg) { @@ -111,9 +119,10 @@ class Gauge extends Control implements Styleable { } /** - * Set draw block background + * Set Draw Block Background * - * @param bool $drawBlockBg + * @param bool $drawBlockBg + * If Gauge Block Background should be drawn * @return \FML\Controls\Gauge */ public function setDrawBlockBg($drawBlockBg) { @@ -124,6 +133,7 @@ class Gauge extends Control implements Styleable { /** * * @see \FML\Types\Styleable::setStyle() + * @return \FML\Controls\Gauge */ public function setStyle($style) { $this->style = $style; diff --git a/application/core/FML/Controls/Label.php b/application/core/FML/Controls/Label.php index 05368098..9b61e94e 100644 --- a/application/core/FML/Controls/Label.php +++ b/application/core/FML/Controls/Label.php @@ -16,7 +16,7 @@ use FML\Types\TextFormatable; */ class Label extends Control implements Actionable, Linkable, NewLineable, Scriptable, Styleable, TextFormatable { /** - * Protected properties + * Protected Properties */ protected $text = ''; protected $textPrefix = ''; @@ -35,9 +35,10 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script protected $areaFocusColor = ''; /** - * Construct label control + * Construct a new Label Control * - * @param string $id + * @param string $id + * Control Id */ public function __construct($id = null) { parent::__construct($id); @@ -46,9 +47,10 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script } /** - * Set text + * Set Text * - * @param string $text + * @param string $text + * Text Value * @return \FML\Controls\Label */ public function setText($text) { @@ -57,9 +59,10 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script } /** - * Set text prefix + * Set Text Prefix * - * @param string $textPrefix + * @param string $textPrefix + * Text Pefix * @return \FML\Controls\Label */ public function setTextPrefix($textPrefix) { @@ -68,9 +71,10 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script } /** - * Set text emboss + * Set Text Emboss * - * @param bool $textEmboss + * @param bool $textEmboss + * If Text should be embossed * @return \FML\Controls\Label */ public function setTextEmboss($textEmboss) { @@ -79,9 +83,10 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script } /** - * Set translate + * Set Translate * - * @param bool $translate + * @param bool $translate + * If Text should be translated * @return \FML\Controls\Label */ public function setTranslate($translate) { @@ -90,9 +95,10 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script } /** - * Set max lines + * Set Max Lines Count * - * @param int $maxLines + * @param int $maxLines + * Max Lines Count * @return \FML\Controls\Label */ public function setMaxLines($maxLines) { diff --git a/application/core/FML/Controls/Quad.php b/application/core/FML/Controls/Quad.php index 7e6e7050..00f9c4cb 100644 --- a/application/core/FML/Controls/Quad.php +++ b/application/core/FML/Controls/Quad.php @@ -16,7 +16,7 @@ use FML\Types\SubStyleable; */ class Quad extends Control implements Actionable, BgColorable, Linkable, Scriptable, Styleable, SubStyleable { /** - * Protected properties + * Protected Properties */ protected $image = ''; protected $imageFocus = ''; @@ -31,9 +31,10 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta protected $subStyle = ''; /** - * Construct a new quad control + * Construct a new Quad Control * - * @param string $id + * @param string $id + * Control Id */ public function __construct($id = null) { parent::__construct($id); @@ -42,9 +43,10 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta } /** - * Set image + * Set Image Url * - * @param string $image + * @param string $image + * Image Url * @return \FML\Controls\Quad */ public function setImage($image) { @@ -53,9 +55,10 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta } /** - * Set focus image + * Set Focus Image Url * - * @param string $imageFocus + * @param string $imageFocus + * Focus Image Url * @return \FML\Controls\Quad */ public function setImageFocus($imageFocus) { @@ -64,9 +67,10 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta } /** - * Set colorize + * Set Colorization * - * @param string $colorize + * @param string $colorize + * Colorize Value * @return \FML\Controls\Quad */ public function setColorize($colorize) { @@ -75,9 +79,10 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta } /** - * Set modulize color + * Set Modulization * - * @param string $modulizeColor + * @param string $modulizeColor + * Modulize Value * @return \FML\Controls\Quad */ public function setModulizeColor($modulizeColor) { diff --git a/application/core/FML/Controls/Quads/Quad_321Go.php b/application/core/FML/Controls/Quads/Quad_321Go.php index 3dbdebb6..5c5cb0c4 100644 --- a/application/core/FML/Controls/Quads/Quad_321Go.php +++ b/application/core/FML/Controls/Quads/Quad_321Go.php @@ -20,10 +20,11 @@ class Quad_321Go extends Quad { const SUBSTYLE_Go = 'Go!'; /** - * Construct 321Go quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_BgRaceScore2.php b/application/core/FML/Controls/Quads/Quad_BgRaceScore2.php index e652b2ef..43af6f86 100644 --- a/application/core/FML/Controls/Quads/Quad_BgRaceScore2.php +++ b/application/core/FML/Controls/Quads/Quad_BgRaceScore2.php @@ -43,10 +43,11 @@ class Quad_BgRaceScore2 extends Quad { const SUBSTYLE_Warmup = 'Warmup'; /** - * Construct BgRaceScore2 quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Bgs1.php b/application/core/FML/Controls/Quads/Quad_Bgs1.php index eec3c7b8..0d942460 100644 --- a/application/core/FML/Controls/Quads/Quad_Bgs1.php +++ b/application/core/FML/Controls/Quads/Quad_Bgs1.php @@ -14,76 +14,77 @@ class Quad_Bgs1 extends Quad { * Constants */ const STYLE = 'Bgs1'; - const SUBSTYLE_ArrowDown = 'ArrowDown'; - const SUBSTYLE_ArrowLeft = 'ArrowLeft'; - const SUBSTYLE_ArrowRight = 'ArrowRight'; - const SUBSTYLE_ArrowUp = 'ArrowUp'; - const SUBSTYLE_BgButton = 'BgButton'; - const SUBSTYLE_BgButtonBig = 'BgButtonBig'; - const SUBSTYLE_BgButtonGlow = 'BgButtonGlow'; - const SUBSTYLE_BgButtonGrayed = 'BgButtonGrayed'; - const SUBSTYLE_BgButtonOff = 'BgButtonOff'; - const SUBSTYLE_BgButtonShadow = 'BgButtonShadow'; - const SUBSTYLE_BgButtonSmall = 'BgButtonSmall'; - const SUBSTYLE_BgCard = 'BgCard'; - const SUBSTYLE_BgCard1 = 'BgCard1'; - const SUBSTYLE_BgCard2 = 'BgCard2'; - const SUBSTYLE_BgCard3 = 'BgCard3'; - const SUBSTYLE_BgCardBuddy = 'BgCardBuddy'; - const SUBSTYLE_BgCardChallenge = 'BgCardChallenge'; - const SUBSTYLE_BgCardFolder = 'BgCardFolder'; - const SUBSTYLE_BgCardInventoryItem = 'BgCardInventoryItem'; - const SUBSTYLE_BgCardList = 'BgCardList'; - const SUBSTYLE_BgCardOnline = 'BgCardOnline'; - const SUBSTYLE_BgCardPlayer = 'BgCardPlayer'; - const SUBSTYLE_BgCardSystem = 'BgCardSystem'; - const SUBSTYLE_BgCardZone = 'BgCardZone'; - const SUBSTYLE_BgColorContour = 'BgColorContour'; - const SUBSTYLE_BgDialogBlur = 'BgDialogBlur'; - const SUBSTYLE_BgEmpty = 'BgEmpty'; - const SUBSTYLE_BgGradBottom = 'BgGradBottom'; - const SUBSTYLE_BgGradLeft = 'BgGradLeft'; - const SUBSTYLE_BgGradRight = 'BgGradRight'; - const SUBSTYLE_BgGradTop = 'BgGradTop'; - const SUBSTYLE_BgGradV = 'BgGradV'; - const SUBSTYLE_BgHealthBar = 'BgHealthBar'; - const SUBSTYLE_BgIconBorder = 'BgIconBorder'; - const SUBSTYLE_BgList = 'BgList'; - const SUBSTYLE_BgListLine = 'BgListLine'; - const SUBSTYLE_BgPager = 'BgPager'; - const SUBSTYLE_BgProgressBar = 'BgProgressBar'; - const SUBSTYLE_BgShadow = 'BgShadow'; - const SUBSTYLE_BgSlider = 'BgSlider'; - const SUBSTYLE_BgSystemBar = 'BgSystemBar'; - const SUBSTYLE_BgTitle2 = 'BgTitle2'; - const SUBSTYLE_BgTitle3 = 'BgTitle3'; - const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1'; - const SUBSTYLE_BgTitle3_2 = 'BgTitle3_2'; - const SUBSTYLE_BgTitle3_3 = 'BgTitle3_3'; - const SUBSTYLE_BgTitle3_4 = 'BgTitle3_4'; - const SUBSTYLE_BgTitle3_5 = 'BgTitle3_5'; - const SUBSTYLE_BgTitleGlow = 'BgTitleGlow'; - const SUBSTYLE_BgTitlePage = 'BgTitlePage'; - const SUBSTYLE_BgTitleShadow = 'BgTitleShadow'; - const SUBSTYLE_BgWindow1 = 'BgWindow1'; - const SUBSTYLE_BgWindow2 = 'BgWindow2'; - const SUBSTYLE_BgWindow3 = 'BgWindow3'; - const SUBSTYLE_EnergyBar = 'EnergyBar'; - const SUBSTYLE_EnergyTeam2 = 'EnergyTeam2'; - const SUBSTYLE_Glow = 'Glow'; - const SUBSTYLE_HealthBar = 'HealthBar'; - const SUBSTYLE_NavButton = 'NavButton'; - const SUBSTYLE_NavButtonBlink = 'NavButtonBlink'; - const SUBSTYLE_NavButtonQuit = 'NavButtonQuit'; - const SUBSTYLE_ProgressBar = 'ProgressBar'; - const SUBSTYLE_ProgressBarSmall = 'ProgressBarSmall'; - const SUBSTYLE_Shadow = 'Shadow'; + const SUBSTYLE_ArrowDown = 'ArrowDown'; + const SUBSTYLE_ArrowLeft = 'ArrowLeft'; + const SUBSTYLE_ArrowRight = 'ArrowRight'; + const SUBSTYLE_ArrowUp = 'ArrowUp'; + const SUBSTYLE_BgButton = 'BgButton'; + const SUBSTYLE_BgButtonBig = 'BgButtonBig'; + const SUBSTYLE_BgButtonGlow = 'BgButtonGlow'; + const SUBSTYLE_BgButtonGrayed = 'BgButtonGrayed'; + const SUBSTYLE_BgButtonOff = 'BgButtonOff'; + const SUBSTYLE_BgButtonShadow = 'BgButtonShadow'; + const SUBSTYLE_BgButtonSmall = 'BgButtonSmall'; + const SUBSTYLE_BgCard = 'BgCard'; + const SUBSTYLE_BgCard1 = 'BgCard1'; + const SUBSTYLE_BgCard2 = 'BgCard2'; + const SUBSTYLE_BgCard3 = 'BgCard3'; + const SUBSTYLE_BgCardBuddy = 'BgCardBuddy'; + const SUBSTYLE_BgCardChallenge = 'BgCardChallenge'; + const SUBSTYLE_BgCardFolder = 'BgCardFolder'; + const SUBSTYLE_BgCardInventoryItem = 'BgCardInventoryItem'; + const SUBSTYLE_BgCardList = 'BgCardList'; + const SUBSTYLE_BgCardOnline = 'BgCardOnline'; + const SUBSTYLE_BgCardPlayer = 'BgCardPlayer'; + const SUBSTYLE_BgCardSystem = 'BgCardSystem'; + const SUBSTYLE_BgCardZone = 'BgCardZone'; + const SUBSTYLE_BgColorContour = 'BgColorContour'; + const SUBSTYLE_BgDialogBlur = 'BgDialogBlur'; + const SUBSTYLE_BgEmpty = 'BgEmpty'; + const SUBSTYLE_BgGradBottom = 'BgGradBottom'; + const SUBSTYLE_BgGradLeft = 'BgGradLeft'; + const SUBSTYLE_BgGradRight = 'BgGradRight'; + const SUBSTYLE_BgGradTop = 'BgGradTop'; + const SUBSTYLE_BgGradV = 'BgGradV'; + const SUBSTYLE_BgHealthBar = 'BgHealthBar'; + const SUBSTYLE_BgIconBorder = 'BgIconBorder'; + const SUBSTYLE_BgList = 'BgList'; + const SUBSTYLE_BgListLine = 'BgListLine'; + const SUBSTYLE_BgPager = 'BgPager'; + const SUBSTYLE_BgProgressBar = 'BgProgressBar'; + const SUBSTYLE_BgShadow = 'BgShadow'; + const SUBSTYLE_BgSlider = 'BgSlider'; + const SUBSTYLE_BgSystemBar = 'BgSystemBar'; + const SUBSTYLE_BgTitle2 = 'BgTitle2'; + const SUBSTYLE_BgTitle3 = 'BgTitle3'; + const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1'; + const SUBSTYLE_BgTitle3_2 = 'BgTitle3_2'; + const SUBSTYLE_BgTitle3_3 = 'BgTitle3_3'; + const SUBSTYLE_BgTitle3_4 = 'BgTitle3_4'; + const SUBSTYLE_BgTitle3_5 = 'BgTitle3_5'; + const SUBSTYLE_BgTitleGlow = 'BgTitleGlow'; + const SUBSTYLE_BgTitlePage = 'BgTitlePage'; + const SUBSTYLE_BgTitleShadow = 'BgTitleShadow'; + const SUBSTYLE_BgWindow1 = 'BgWindow1'; + const SUBSTYLE_BgWindow2 = 'BgWindow2'; + const SUBSTYLE_BgWindow3 = 'BgWindow3'; + const SUBSTYLE_EnergyBar = 'EnergyBar'; + const SUBSTYLE_EnergyTeam2 = 'EnergyTeam2'; + const SUBSTYLE_Glow = 'Glow'; + const SUBSTYLE_HealthBar = 'HealthBar'; + const SUBSTYLE_NavButton = 'NavButton'; + const SUBSTYLE_NavButtonBlink = 'NavButtonBlink'; + const SUBSTYLE_NavButtonQuit = 'NavButtonQuit'; + const SUBSTYLE_ProgressBar = 'ProgressBar'; + const SUBSTYLE_ProgressBarSmall = 'ProgressBarSmall'; + const SUBSTYLE_Shadow = 'Shadow'; /** - * Construct Bgs1 quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Bgs1InRace.php b/application/core/FML/Controls/Quads/Quad_Bgs1InRace.php index c4159a63..7dbcd232 100644 --- a/application/core/FML/Controls/Quads/Quad_Bgs1InRace.php +++ b/application/core/FML/Controls/Quads/Quad_Bgs1InRace.php @@ -14,76 +14,77 @@ class Quad_Bgs1InRace extends Quad { * Constants */ const STYLE = 'Bgs1InRace'; - const SUBSTYLE_ArrowDown = 'ArrowDown'; - const SUBSTYLE_ArrowLeft = 'ArrowLeft'; - const SUBSTYLE_ArrowRight = 'ArrowRight'; - const SUBSTYLE_ArrowUp = 'ArrowUp'; - const SUBSTYLE_BgButton = 'BgButton'; - const SUBSTYLE_BgButtonBig = 'BgButtonBig'; - const SUBSTYLE_BgButtonGlow = 'BgButtonGlow'; - const SUBSTYLE_BgButtonGrayed = 'BgButtonGrayed'; - const SUBSTYLE_BgButtonOff = 'BgButtonOff'; - const SUBSTYLE_BgButtonShadow = 'BgButtonShadow'; - const SUBSTYLE_BgButtonSmall = 'BgButtonSmall'; - const SUBSTYLE_BgCard = 'BgCard'; - const SUBSTYLE_BgCard1 = 'BgCard1'; - const SUBSTYLE_BgCard2 = 'BgCard2'; - const SUBSTYLE_BgCard3 = 'BgCard3'; - const SUBSTYLE_BgCardBuddy = 'BgCardBuddy'; - const SUBSTYLE_BgCardChallenge = 'BgCardChallenge'; - const SUBSTYLE_BgCardFolder = 'BgCardFolder'; - const SUBSTYLE_BgCardInventoryItem = 'BgCardInventoryItem'; - const SUBSTYLE_BgCardList = 'BgCardList'; - const SUBSTYLE_BgCardOnline = 'BgCardOnline'; - const SUBSTYLE_BgCardPlayer = 'BgCardPlayer'; - const SUBSTYLE_BgCardSystem = 'BgCardSystem'; - const SUBSTYLE_BgCardZone = 'BgCardZone'; - const SUBSTYLE_BgColorContour = 'BgColorContour'; - const SUBSTYLE_BgDialogBlur = 'BgDialogBlur'; - const SUBSTYLE_BgEmpty = 'BgEmpty'; - const SUBSTYLE_BgGradBottom = 'BgGradBottom'; - const SUBSTYLE_BgGradLeft = 'BgGradLeft'; - const SUBSTYLE_BgGradRight = 'BgGradRight'; - const SUBSTYLE_BgGradTop = 'BgGradTop'; - const SUBSTYLE_BgGradV = 'BgGradV'; - const SUBSTYLE_BgHealthBar = 'BgHealthBar'; - const SUBSTYLE_BgIconBorder = 'BgIconBorder'; - const SUBSTYLE_BgList = 'BgList'; - const SUBSTYLE_BgListLine = 'BgListLine'; - const SUBSTYLE_BgPager = 'BgPager'; - const SUBSTYLE_BgProgressBar = 'BgProgressBar'; - const SUBSTYLE_BgShadow = 'BgShadow'; - const SUBSTYLE_BgSlider = 'BgSlider'; - const SUBSTYLE_BgSystemBar = 'BgSystemBar'; - const SUBSTYLE_BgTitle2 = 'BgTitle2'; - const SUBSTYLE_BgTitle3 = 'BgTitle3'; - const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1'; - const SUBSTYLE_BgTitle3_2 = 'BgTitle3_2'; - const SUBSTYLE_BgTitle3_3 = 'BgTitle3_3'; - const SUBSTYLE_BgTitle3_4 = 'BgTitle3_4'; - const SUBSTYLE_BgTitle3_5 = 'BgTitle3_5'; - const SUBSTYLE_BgTitleGlow = 'BgTitleGlow'; - const SUBSTYLE_BgTitlePage = 'BgTitlePage'; - const SUBSTYLE_BgTitleShadow = 'BgTitleShadow'; - const SUBSTYLE_BgWindow1 = 'BgWindow1'; - const SUBSTYLE_BgWindow2 = 'BgWindow2'; - const SUBSTYLE_BgWindow3 = 'BgWindow3'; - const SUBSTYLE_EnergyBar = 'EnergyBar'; - const SUBSTYLE_EnergyTeam2 = 'EnergyTeam2'; - const SUBSTYLE_Glow = 'Glow'; - const SUBSTYLE_HealthBar = 'HealthBar'; - const SUBSTYLE_NavButton = 'NavButton'; - const SUBSTYLE_NavButtonBlink = 'NavButtonBlink'; - const SUBSTYLE_NavButtonQuit = 'NavButtonQuit'; - const SUBSTYLE_ProgressBar = 'ProgressBar'; - const SUBSTYLE_ProgressBarSmall = 'ProgressBarSmall'; - const SUBSTYLE_Shadow = 'Shadow'; + const SUBSTYLE_ArrowDown = 'ArrowDown'; + const SUBSTYLE_ArrowLeft = 'ArrowLeft'; + const SUBSTYLE_ArrowRight = 'ArrowRight'; + const SUBSTYLE_ArrowUp = 'ArrowUp'; + const SUBSTYLE_BgButton = 'BgButton'; + const SUBSTYLE_BgButtonBig = 'BgButtonBig'; + const SUBSTYLE_BgButtonGlow = 'BgButtonGlow'; + const SUBSTYLE_BgButtonGrayed = 'BgButtonGrayed'; + const SUBSTYLE_BgButtonOff = 'BgButtonOff'; + const SUBSTYLE_BgButtonShadow = 'BgButtonShadow'; + const SUBSTYLE_BgButtonSmall = 'BgButtonSmall'; + const SUBSTYLE_BgCard = 'BgCard'; + const SUBSTYLE_BgCard1 = 'BgCard1'; + const SUBSTYLE_BgCard2 = 'BgCard2'; + const SUBSTYLE_BgCard3 = 'BgCard3'; + const SUBSTYLE_BgCardBuddy = 'BgCardBuddy'; + const SUBSTYLE_BgCardChallenge = 'BgCardChallenge'; + const SUBSTYLE_BgCardFolder = 'BgCardFolder'; + const SUBSTYLE_BgCardInventoryItem = 'BgCardInventoryItem'; + const SUBSTYLE_BgCardList = 'BgCardList'; + const SUBSTYLE_BgCardOnline = 'BgCardOnline'; + const SUBSTYLE_BgCardPlayer = 'BgCardPlayer'; + const SUBSTYLE_BgCardSystem = 'BgCardSystem'; + const SUBSTYLE_BgCardZone = 'BgCardZone'; + const SUBSTYLE_BgColorContour = 'BgColorContour'; + const SUBSTYLE_BgDialogBlur = 'BgDialogBlur'; + const SUBSTYLE_BgEmpty = 'BgEmpty'; + const SUBSTYLE_BgGradBottom = 'BgGradBottom'; + const SUBSTYLE_BgGradLeft = 'BgGradLeft'; + const SUBSTYLE_BgGradRight = 'BgGradRight'; + const SUBSTYLE_BgGradTop = 'BgGradTop'; + const SUBSTYLE_BgGradV = 'BgGradV'; + const SUBSTYLE_BgHealthBar = 'BgHealthBar'; + const SUBSTYLE_BgIconBorder = 'BgIconBorder'; + const SUBSTYLE_BgList = 'BgList'; + const SUBSTYLE_BgListLine = 'BgListLine'; + const SUBSTYLE_BgPager = 'BgPager'; + const SUBSTYLE_BgProgressBar = 'BgProgressBar'; + const SUBSTYLE_BgShadow = 'BgShadow'; + const SUBSTYLE_BgSlider = 'BgSlider'; + const SUBSTYLE_BgSystemBar = 'BgSystemBar'; + const SUBSTYLE_BgTitle2 = 'BgTitle2'; + const SUBSTYLE_BgTitle3 = 'BgTitle3'; + const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1'; + const SUBSTYLE_BgTitle3_2 = 'BgTitle3_2'; + const SUBSTYLE_BgTitle3_3 = 'BgTitle3_3'; + const SUBSTYLE_BgTitle3_4 = 'BgTitle3_4'; + const SUBSTYLE_BgTitle3_5 = 'BgTitle3_5'; + const SUBSTYLE_BgTitleGlow = 'BgTitleGlow'; + const SUBSTYLE_BgTitlePage = 'BgTitlePage'; + const SUBSTYLE_BgTitleShadow = 'BgTitleShadow'; + const SUBSTYLE_BgWindow1 = 'BgWindow1'; + const SUBSTYLE_BgWindow2 = 'BgWindow2'; + const SUBSTYLE_BgWindow3 = 'BgWindow3'; + const SUBSTYLE_EnergyBar = 'EnergyBar'; + const SUBSTYLE_EnergyTeam2 = 'EnergyTeam2'; + const SUBSTYLE_Glow = 'Glow'; + const SUBSTYLE_HealthBar = 'HealthBar'; + const SUBSTYLE_NavButton = 'NavButton'; + const SUBSTYLE_NavButtonBlink = 'NavButtonBlink'; + const SUBSTYLE_NavButtonQuit = 'NavButtonQuit'; + const SUBSTYLE_ProgressBar = 'ProgressBar'; + const SUBSTYLE_ProgressBarSmall = 'ProgressBarSmall'; + const SUBSTYLE_Shadow = 'Shadow'; /** - * Construct Bgs1InRace quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_BgsChallengeMedals.php b/application/core/FML/Controls/Quads/Quad_BgsChallengeMedals.php index aee04ce1..05fc0207 100644 --- a/application/core/FML/Controls/Quads/Quad_BgsChallengeMedals.php +++ b/application/core/FML/Controls/Quads/Quad_BgsChallengeMedals.php @@ -14,18 +14,19 @@ class Quad_BgsChallengeMedals extends Quad { * Constants */ const STYLE = 'BgsChallengeMedals'; - const SUBSTYLE_BgBronze = 'BgBronze'; - const SUBSTYLE_BgGold = 'BgGold'; - const SUBSTYLE_BgNadeo = 'BgNadeo'; - const SUBSTYLE_BgNotPlayed = 'BgNotPlayed'; - const SUBSTYLE_BgPlayed = 'BgPlayed'; - const SUBSTYLE_BgSilver = 'BgSilver'; + const SUBSTYLE_BgBronze = 'BgBronze'; + const SUBSTYLE_BgGold = 'BgGold'; + const SUBSTYLE_BgNadeo = 'BgNadeo'; + const SUBSTYLE_BgNotPlayed = 'BgNotPlayed'; + const SUBSTYLE_BgPlayed = 'BgPlayed'; + const SUBSTYLE_BgSilver = 'BgSilver'; /** - * Construct BgsChallengeMedals quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_BgsPlayerCard.php b/application/core/FML/Controls/Quads/Quad_BgsPlayerCard.php index 99f78960..4e78e5e4 100644 --- a/application/core/FML/Controls/Quads/Quad_BgsPlayerCard.php +++ b/application/core/FML/Controls/Quads/Quad_BgsPlayerCard.php @@ -30,10 +30,11 @@ class Quad_BgsPlayerCard extends Quad { const SUBSTYLE_ProgressBar = 'ProgressBar'; /** - * Construct BgsPlayerCard quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Copilot.php b/application/core/FML/Controls/Quads/Quad_Copilot.php index 69a2230f..b18b74a4 100644 --- a/application/core/FML/Controls/Quads/Quad_Copilot.php +++ b/application/core/FML/Controls/Quads/Quad_Copilot.php @@ -14,24 +14,25 @@ class Quad_Copilot extends Quad { * Constants */ const STYLE = 'Copilot'; - const SUBSTYLE_Down = 'Down'; - const SUBSTYLE_DownGood = 'DownGood'; - const SUBSTYLE_DownWrong = 'DownWrong'; - const SUBSTYLE_Left = 'Left'; - const SUBSTYLE_LeftGood = 'LeftGood'; - const SUBSTYLE_LeftWrong = 'LeftWrong'; - const SUBSTYLE_Right = 'Right'; - const SUBSTYLE_RightGood = 'RightGood'; - const SUBSTYLE_RightWrong = 'RightWrong'; - const SUBSTYLE_Up = 'Up'; - const SUBSTYLE_UpGood = 'UpGood'; - const SUBSTYLE_UpWrong = 'UpWrong'; + const SUBSTYLE_Down = 'Down'; + const SUBSTYLE_DownGood = 'DownGood'; + const SUBSTYLE_DownWrong = 'DownWrong'; + const SUBSTYLE_Left = 'Left'; + const SUBSTYLE_LeftGood = 'LeftGood'; + const SUBSTYLE_LeftWrong = 'LeftWrong'; + const SUBSTYLE_Right = 'Right'; + const SUBSTYLE_RightGood = 'RightGood'; + const SUBSTYLE_RightWrong = 'RightWrong'; + const SUBSTYLE_Up = 'Up'; + const SUBSTYLE_UpGood = 'UpGood'; + const SUBSTYLE_UpWrong = 'UpWrong'; /** - * Construct Copilot quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Emblems.php b/application/core/FML/Controls/Quads/Quad_Emblems.php index 3612b243..d862d575 100644 --- a/application/core/FML/Controls/Quads/Quad_Emblems.php +++ b/application/core/FML/Controls/Quads/Quad_Emblems.php @@ -19,10 +19,11 @@ class Quad_Emblems extends Quad { const SUBSTYLE_2 = '#2'; /** - * Construct Emblems quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_EnergyBar.php b/application/core/FML/Controls/Quads/Quad_EnergyBar.php index c17e6045..19cac8f0 100644 --- a/application/core/FML/Controls/Quads/Quad_EnergyBar.php +++ b/application/core/FML/Controls/Quads/Quad_EnergyBar.php @@ -22,10 +22,11 @@ class Quad_EnergyBar extends Quad { const SUBSTYLE_HeaderGaugeRight = 'HeaderGaugeRight'; /** - * Construct EnergyBar quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Hud3dEchelons.php b/application/core/FML/Controls/Quads/Quad_Hud3dEchelons.php index 92a9953b..29e0cf4c 100644 --- a/application/core/FML/Controls/Quads/Quad_Hud3dEchelons.php +++ b/application/core/FML/Controls/Quads/Quad_Hud3dEchelons.php @@ -14,21 +14,22 @@ class Quad_Hud3dEchelons extends Quad { * Constants */ const STYLE = 'Hud3dEchelons'; - const SUBSTYLE_EchelonBronze1 = 'EchelonBronze1'; - const SUBSTYLE_EchelonBronze2 = 'EchelonBronze2'; - const SUBSTYLE_EchelonBronze3 = 'EchelonBronze3'; - const SUBSTYLE_EchelonGold1 = 'EchelonGold1'; - const SUBSTYLE_EchelonGold2 = 'EchelonGold2'; - const SUBSTYLE_EchelonGold3 = 'EchelonGold3'; - const SUBSTYLE_EchelonSilver1 = 'EchelonSilver1'; - const SUBSTYLE_EchelonSilver2 = 'EchelonSilver2'; - const SUBSTYLE_EchelonSilver3 = 'EchelonSilver3'; + const SUBSTYLE_EchelonBronze1 = 'EchelonBronze1'; + const SUBSTYLE_EchelonBronze2 = 'EchelonBronze2'; + const SUBSTYLE_EchelonBronze3 = 'EchelonBronze3'; + const SUBSTYLE_EchelonGold1 = 'EchelonGold1'; + const SUBSTYLE_EchelonGold2 = 'EchelonGold2'; + const SUBSTYLE_EchelonGold3 = 'EchelonGold3'; + const SUBSTYLE_EchelonSilver1 = 'EchelonSilver1'; + const SUBSTYLE_EchelonSilver2 = 'EchelonSilver2'; + const SUBSTYLE_EchelonSilver3 = 'EchelonSilver3'; /** - * Construct Hud3dEchelons quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Icons128x128_1.php b/application/core/FML/Controls/Quads/Quad_Icons128x128_1.php index 5789aa18..7e60f895 100644 --- a/application/core/FML/Controls/Quads/Quad_Icons128x128_1.php +++ b/application/core/FML/Controls/Quads/Quad_Icons128x128_1.php @@ -14,76 +14,76 @@ class Quad_Icons128x128_1 extends Quad { * Constants */ const STYLE = 'Icons128x128_1'; - const SUBSTYLE_Advanced = 'Advanced'; - const SUBSTYLE_Back = 'Back'; - const SUBSTYLE_BackFocusable = 'BackFocusable'; - const SUBSTYLE_Beginner = 'Beginner'; - const SUBSTYLE_Browse = 'Browse'; - const SUBSTYLE_Buddies = 'Buddies'; - const SUBSTYLE_Challenge = 'Challenge'; - const SUBSTYLE_ChallengeAuthor = 'ChallengeAuthor'; - const SUBSTYLE_Coppers = 'Coppers'; - const SUBSTYLE_Create = 'Create'; - const SUBSTYLE_Credits = 'Credits'; - const SUBSTYLE_Custom = 'Custom'; - const SUBSTYLE_CustomStars = 'CustomStars'; - const SUBSTYLE_Default = 'Default'; - const SUBSTYLE_Download = 'Download'; - const SUBSTYLE_Easy = 'Easy'; - const SUBSTYLE_Editor = 'Editor'; - const SUBSTYLE_Event = 'Event'; - const SUBSTYLE_Extreme = 'Extreme'; - const SUBSTYLE_Forever = 'Forever'; - const SUBSTYLE_GhostEditor = 'GhostEditor'; - const SUBSTYLE_Hard = 'Hard'; - const SUBSTYLE_Hotseat = 'Hotseat'; - const SUBSTYLE_Inputs = 'Inputs'; - const SUBSTYLE_Invite = 'Invite'; - const SUBSTYLE_LadderPoints = 'LadderPoints'; - const SUBSTYLE_Lan = 'Lan'; - const SUBSTYLE_Launch = 'Launch'; - const SUBSTYLE_Load = 'Load'; - const SUBSTYLE_LoadTrack = 'LoadTrack'; - const SUBSTYLE_Manialink = 'Manialink'; - const SUBSTYLE_ManiaZones = 'ManiaZones'; - const SUBSTYLE_MedalCount = 'MedalCount'; - const SUBSTYLE_MediaTracker = 'MediaTracker'; - const SUBSTYLE_Medium = 'Medium'; - const SUBSTYLE_Multiplayer = 'Multiplayer'; - const SUBSTYLE_Nations = 'Nations'; - const SUBSTYLE_NewTrack = 'NewTrack'; - const SUBSTYLE_Options = 'Options'; - const SUBSTYLE_Padlock = 'Padlock'; - const SUBSTYLE_Paint = 'Paint'; - const SUBSTYLE_Platform = 'Platform'; - const SUBSTYLE_PlayerPage = 'PlayerPage'; - const SUBSTYLE_Profile = 'Profile'; - const SUBSTYLE_ProfileAdvanced = 'ProfileAdvanced'; - const SUBSTYLE_ProfileVehicle = 'ProfileVehicle'; - const SUBSTYLE_Puzzle = 'Puzzle'; - const SUBSTYLE_Quit = 'Quit'; - const SUBSTYLE_Race = 'Race'; - const SUBSTYLE_Rankings = 'Rankings'; - const SUBSTYLE_Replay = 'Replay'; - const SUBSTYLE_Save = 'Save'; - const SUBSTYLE_ServersAll = 'ServersAll'; - const SUBSTYLE_ServersFavorites = 'ServersFavorites'; - const SUBSTYLE_ServersSuggested = 'ServersSuggested'; - const SUBSTYLE_Share = 'Share'; - const SUBSTYLE_ShareBlink = 'ShareBlink'; - const SUBSTYLE_SkillPoints = 'SkillPoints'; - const SUBSTYLE_Solo = 'Solo'; - const SUBSTYLE_Statistics = 'Statistics'; - const SUBSTYLE_Stunts = 'Stunts'; - const SUBSTYLE_United = 'United'; - const SUBSTYLE_Upload = 'Upload'; - const SUBSTYLE_Vehicles = 'Vehicles'; + const SUBSTYLE_Advanced = 'Advanced'; + const SUBSTYLE_Back = 'Back'; + const SUBSTYLE_BackFocusable = 'BackFocusable'; + const SUBSTYLE_Beginner = 'Beginner'; + const SUBSTYLE_Browse = 'Browse'; + const SUBSTYLE_Buddies = 'Buddies'; + const SUBSTYLE_Challenge = 'Challenge'; + const SUBSTYLE_ChallengeAuthor = 'ChallengeAuthor'; + const SUBSTYLE_Coppers = 'Coppers'; + const SUBSTYLE_Create = 'Create'; + const SUBSTYLE_Credits = 'Credits'; + const SUBSTYLE_Custom = 'Custom'; + const SUBSTYLE_CustomStars = 'CustomStars'; + const SUBSTYLE_Default = 'Default'; + const SUBSTYLE_Download = 'Download'; + const SUBSTYLE_Easy = 'Easy'; + const SUBSTYLE_Editor = 'Editor'; + const SUBSTYLE_Event = 'Event'; + const SUBSTYLE_Extreme = 'Extreme'; + const SUBSTYLE_Forever = 'Forever'; + const SUBSTYLE_GhostEditor = 'GhostEditor'; + const SUBSTYLE_Hard = 'Hard'; + const SUBSTYLE_Hotseat = 'Hotseat'; + const SUBSTYLE_Inputs = 'Inputs'; + const SUBSTYLE_Invite = 'Invite'; + const SUBSTYLE_LadderPoints = 'LadderPoints'; + const SUBSTYLE_Lan = 'Lan'; + const SUBSTYLE_Launch = 'Launch'; + const SUBSTYLE_Load = 'Load'; + const SUBSTYLE_LoadTrack = 'LoadTrack'; + const SUBSTYLE_Manialink = 'Manialink'; + const SUBSTYLE_ManiaZones = 'ManiaZones'; + const SUBSTYLE_MedalCount = 'MedalCount'; + const SUBSTYLE_MediaTracker = 'MediaTracker'; + const SUBSTYLE_Medium = 'Medium'; + const SUBSTYLE_Multiplayer = 'Multiplayer'; + const SUBSTYLE_Nations = 'Nations'; + const SUBSTYLE_NewTrack = 'NewTrack'; + const SUBSTYLE_Options = 'Options'; + const SUBSTYLE_Padlock = 'Padlock'; + const SUBSTYLE_Paint = 'Paint'; + const SUBSTYLE_Platform = 'Platform'; + const SUBSTYLE_PlayerPage = 'PlayerPage'; + const SUBSTYLE_Profile = 'Profile'; + const SUBSTYLE_ProfileAdvanced = 'ProfileAdvanced'; + const SUBSTYLE_ProfileVehicle = 'ProfileVehicle'; + const SUBSTYLE_Puzzle = 'Puzzle'; + const SUBSTYLE_Quit = 'Quit'; + const SUBSTYLE_Race = 'Race'; + const SUBSTYLE_Rankings = 'Rankings'; + const SUBSTYLE_Replay = 'Replay'; + const SUBSTYLE_Save = 'Save'; + const SUBSTYLE_ServersAll = 'ServersAll'; + const SUBSTYLE_ServersFavorites = 'ServersFavorites'; + const SUBSTYLE_ServersSuggested = 'ServersSuggested'; + const SUBSTYLE_Share = 'Share'; + const SUBSTYLE_ShareBlink = 'ShareBlink'; + const SUBSTYLE_SkillPoints = 'SkillPoints'; + const SUBSTYLE_Solo = 'Solo'; + const SUBSTYLE_Statistics = 'Statistics'; + const SUBSTYLE_Stunts = 'Stunts'; + const SUBSTYLE_United = 'United'; + const SUBSTYLE_Upload = 'Upload'; + const SUBSTYLE_Vehicles = 'Vehicles'; /** * Construct Icons128x128_1 quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Icons128x128_Blink.php b/application/core/FML/Controls/Quads/Quad_Icons128x128_Blink.php index 00112c48..b3d19384 100644 --- a/application/core/FML/Controls/Quads/Quad_Icons128x128_Blink.php +++ b/application/core/FML/Controls/Quads/Quad_Icons128x128_Blink.php @@ -14,76 +14,77 @@ class Quad_Icons128x128_Blink extends Quad { * Constants */ const STYLE = 'Icons128x128_Blink'; - const SUBSTYLE_Advanced = 'Advanced'; - const SUBSTYLE_Back = 'Back'; - const SUBSTYLE_BackFocusable = 'BackFocusable'; - const SUBSTYLE_Beginner = 'Beginner'; - const SUBSTYLE_Browse = 'Browse'; - const SUBSTYLE_Buddies = 'Buddies'; - const SUBSTYLE_Challenge = 'Challenge'; - const SUBSTYLE_ChallengeAuthor = 'ChallengeAuthor'; - const SUBSTYLE_Coppers = 'Coppers'; - const SUBSTYLE_Create = 'Create'; - const SUBSTYLE_Credits = 'Credits'; - const SUBSTYLE_Custom = 'Custom'; - const SUBSTYLE_CustomStars = 'CustomStars'; - const SUBSTYLE_Default = 'Default'; - const SUBSTYLE_Download = 'Download'; - const SUBSTYLE_Easy = 'Easy'; - const SUBSTYLE_Editor = 'Editor'; - const SUBSTYLE_Event = 'Event'; - const SUBSTYLE_Extreme = 'Extreme'; - const SUBSTYLE_Forever = 'Forever'; - const SUBSTYLE_GhostEditor = 'GhostEditor'; - const SUBSTYLE_Hard = 'Hard'; - const SUBSTYLE_Hotseat = 'Hotseat'; - const SUBSTYLE_Inputs = 'Inputs'; - const SUBSTYLE_Invite = 'Invite'; - const SUBSTYLE_LadderPoints = 'LadderPoints'; - const SUBSTYLE_Lan = 'Lan'; - const SUBSTYLE_Launch = 'Launch'; - const SUBSTYLE_Load = 'Load'; - const SUBSTYLE_LoadTrack = 'LoadTrack'; - const SUBSTYLE_Manialink = 'Manialink'; - const SUBSTYLE_ManiaZones = 'ManiaZones'; - const SUBSTYLE_MedalCount = 'MedalCount'; - const SUBSTYLE_MediaTracker = 'MediaTracker'; - const SUBSTYLE_Medium = 'Medium'; - const SUBSTYLE_Multiplayer = 'Multiplayer'; - const SUBSTYLE_Nations = 'Nations'; - const SUBSTYLE_NewTrack = 'NewTrack'; - const SUBSTYLE_Options = 'Options'; - const SUBSTYLE_Padlock = 'Padlock'; - const SUBSTYLE_Paint = 'Paint'; - const SUBSTYLE_Platform = 'Platform'; - const SUBSTYLE_PlayerPage = 'PlayerPage'; - const SUBSTYLE_Profile = 'Profile'; - const SUBSTYLE_ProfileAdvanced = 'ProfileAdvanced'; - const SUBSTYLE_ProfileVehicle = 'ProfileVehicle'; - const SUBSTYLE_Puzzle = 'Puzzle'; - const SUBSTYLE_Quit = 'Quit'; - const SUBSTYLE_Race = 'Race'; - const SUBSTYLE_Rankings = 'Rankings'; - const SUBSTYLE_Replay = 'Replay'; - const SUBSTYLE_Save = 'Save'; - const SUBSTYLE_ServersAll = 'ServersAll'; - const SUBSTYLE_ServersFavorites = 'ServersFavorites'; - const SUBSTYLE_ServersSuggested = 'ServersSuggested'; - const SUBSTYLE_Share = 'Share'; - const SUBSTYLE_ShareBlink = 'ShareBlink'; - const SUBSTYLE_SkillPoints = 'SkillPoints'; - const SUBSTYLE_Solo = 'Solo'; - const SUBSTYLE_Statistics = 'Statistics'; - const SUBSTYLE_Stunts = 'Stunts'; - const SUBSTYLE_United = 'United'; - const SUBSTYLE_Upload = 'Upload'; - const SUBSTYLE_Vehicles = 'Vehicles'; + const SUBSTYLE_Advanced = 'Advanced'; + const SUBSTYLE_Back = 'Back'; + const SUBSTYLE_BackFocusable = 'BackFocusable'; + const SUBSTYLE_Beginner = 'Beginner'; + const SUBSTYLE_Browse = 'Browse'; + const SUBSTYLE_Buddies = 'Buddies'; + const SUBSTYLE_Challenge = 'Challenge'; + const SUBSTYLE_ChallengeAuthor = 'ChallengeAuthor'; + const SUBSTYLE_Coppers = 'Coppers'; + const SUBSTYLE_Create = 'Create'; + const SUBSTYLE_Credits = 'Credits'; + const SUBSTYLE_Custom = 'Custom'; + const SUBSTYLE_CustomStars = 'CustomStars'; + const SUBSTYLE_Default = 'Default'; + const SUBSTYLE_Download = 'Download'; + const SUBSTYLE_Easy = 'Easy'; + const SUBSTYLE_Editor = 'Editor'; + const SUBSTYLE_Event = 'Event'; + const SUBSTYLE_Extreme = 'Extreme'; + const SUBSTYLE_Forever = 'Forever'; + const SUBSTYLE_GhostEditor = 'GhostEditor'; + const SUBSTYLE_Hard = 'Hard'; + const SUBSTYLE_Hotseat = 'Hotseat'; + const SUBSTYLE_Inputs = 'Inputs'; + const SUBSTYLE_Invite = 'Invite'; + const SUBSTYLE_LadderPoints = 'LadderPoints'; + const SUBSTYLE_Lan = 'Lan'; + const SUBSTYLE_Launch = 'Launch'; + const SUBSTYLE_Load = 'Load'; + const SUBSTYLE_LoadTrack = 'LoadTrack'; + const SUBSTYLE_Manialink = 'Manialink'; + const SUBSTYLE_ManiaZones = 'ManiaZones'; + const SUBSTYLE_MedalCount = 'MedalCount'; + const SUBSTYLE_MediaTracker = 'MediaTracker'; + const SUBSTYLE_Medium = 'Medium'; + const SUBSTYLE_Multiplayer = 'Multiplayer'; + const SUBSTYLE_Nations = 'Nations'; + const SUBSTYLE_NewTrack = 'NewTrack'; + const SUBSTYLE_Options = 'Options'; + const SUBSTYLE_Padlock = 'Padlock'; + const SUBSTYLE_Paint = 'Paint'; + const SUBSTYLE_Platform = 'Platform'; + const SUBSTYLE_PlayerPage = 'PlayerPage'; + const SUBSTYLE_Profile = 'Profile'; + const SUBSTYLE_ProfileAdvanced = 'ProfileAdvanced'; + const SUBSTYLE_ProfileVehicle = 'ProfileVehicle'; + const SUBSTYLE_Puzzle = 'Puzzle'; + const SUBSTYLE_Quit = 'Quit'; + const SUBSTYLE_Race = 'Race'; + const SUBSTYLE_Rankings = 'Rankings'; + const SUBSTYLE_Replay = 'Replay'; + const SUBSTYLE_Save = 'Save'; + const SUBSTYLE_ServersAll = 'ServersAll'; + const SUBSTYLE_ServersFavorites = 'ServersFavorites'; + const SUBSTYLE_ServersSuggested = 'ServersSuggested'; + const SUBSTYLE_Share = 'Share'; + const SUBSTYLE_ShareBlink = 'ShareBlink'; + const SUBSTYLE_SkillPoints = 'SkillPoints'; + const SUBSTYLE_Solo = 'Solo'; + const SUBSTYLE_Statistics = 'Statistics'; + const SUBSTYLE_Stunts = 'Stunts'; + const SUBSTYLE_United = 'United'; + const SUBSTYLE_Upload = 'Upload'; + const SUBSTYLE_Vehicles = 'Vehicles'; /** - * Construct Icons128x128_Blink quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Icons128x32_1.php b/application/core/FML/Controls/Quads/Quad_Icons128x32_1.php index 68a19ea1..2528b346 100644 --- a/application/core/FML/Controls/Quads/Quad_Icons128x32_1.php +++ b/application/core/FML/Controls/Quads/Quad_Icons128x32_1.php @@ -14,37 +14,38 @@ class Quad_Icons128x32_1 extends Quad { * Constants */ const STYLE = 'Icons128x32_1'; - const SUBSTYLE_Empty = 'Empty'; - const SUBSTYLE_ManiaLinkHome = 'ManiaLinkHome'; - const SUBSTYLE_ManiaLinkSwitch = 'ManiaLinkSwitch'; - const SUBSTYLE_ManiaPlanet = 'ManiaPlanet'; - const SUBSTYLE_Music = 'Music'; - const SUBSTYLE_PainterBrush = 'PainterBrush'; - const SUBSTYLE_PainterFill = 'PainterFill'; - const SUBSTYLE_PainterLayer = 'PainterLayer'; - const SUBSTYLE_PainterMirror = 'PainterMirror'; - const SUBSTYLE_PainterSticker = 'PainterSticker'; - const SUBSTYLE_PainterTeam = 'PainterTeam'; - const SUBSTYLE_RT_Cup = 'RT_Cup'; - const SUBSTYLE_RT_Laps = 'RT_Laps'; - const SUBSTYLE_RT_Rounds = 'RT_Rounds'; - const SUBSTYLE_RT_Script = 'RT_Script'; - const SUBSTYLE_RT_Team = 'RT_Team'; - const SUBSTYLE_RT_TimeAttack = 'RT_TimeAttack'; - const SUBSTYLE_RT_Stunts = 'RT_Stunts'; - const SUBSTYLE_Settings = 'Settings'; - const SUBSTYLE_SliderBar = 'SliderBar'; - const SUBSTYLE_SliderBar2 = 'SliderBar2'; - const SUBSTYLE_SliderCursor = 'SliderCursor'; - const SUBSTYLE_Sound = 'Sound'; - const SUBSTYLE_UrlBg = 'UrlBg'; - const SUBSTYLE_Windowed = 'Windowed'; + const SUBSTYLE_Empty = 'Empty'; + const SUBSTYLE_ManiaLinkHome = 'ManiaLinkHome'; + const SUBSTYLE_ManiaLinkSwitch = 'ManiaLinkSwitch'; + const SUBSTYLE_ManiaPlanet = 'ManiaPlanet'; + const SUBSTYLE_Music = 'Music'; + const SUBSTYLE_PainterBrush = 'PainterBrush'; + const SUBSTYLE_PainterFill = 'PainterFill'; + const SUBSTYLE_PainterLayer = 'PainterLayer'; + const SUBSTYLE_PainterMirror = 'PainterMirror'; + const SUBSTYLE_PainterSticker = 'PainterSticker'; + const SUBSTYLE_PainterTeam = 'PainterTeam'; + const SUBSTYLE_RT_Cup = 'RT_Cup'; + const SUBSTYLE_RT_Laps = 'RT_Laps'; + const SUBSTYLE_RT_Rounds = 'RT_Rounds'; + const SUBSTYLE_RT_Script = 'RT_Script'; + const SUBSTYLE_RT_Team = 'RT_Team'; + const SUBSTYLE_RT_TimeAttack = 'RT_TimeAttack'; + const SUBSTYLE_RT_Stunts = 'RT_Stunts'; + const SUBSTYLE_Settings = 'Settings'; + const SUBSTYLE_SliderBar = 'SliderBar'; + const SUBSTYLE_SliderBar2 = 'SliderBar2'; + const SUBSTYLE_SliderCursor = 'SliderCursor'; + const SUBSTYLE_Sound = 'Sound'; + const SUBSTYLE_UrlBg = 'UrlBg'; + const SUBSTYLE_Windowed = 'Windowed'; /** - * Construct Icons128x32_1 quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Icons64x64_1.php b/application/core/FML/Controls/Quads/Quad_Icons64x64_1.php index 0f649b0f..7d0698d4 100644 --- a/application/core/FML/Controls/Quads/Quad_Icons64x64_1.php +++ b/application/core/FML/Controls/Quads/Quad_Icons64x64_1.php @@ -101,10 +101,11 @@ class Quad_Icons64x64_1 extends Quad { const SUBSTYLE_YellowLow = 'YellowLow'; /** - * Construct Icons64x64_1 quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_Icons64x64_2.php b/application/core/FML/Controls/Quads/Quad_Icons64x64_2.php index 5d054966..1c11e37a 100644 --- a/application/core/FML/Controls/Quads/Quad_Icons64x64_2.php +++ b/application/core/FML/Controls/Quads/Quad_Icons64x64_2.php @@ -14,25 +14,26 @@ class Quad_Icons64x64_2 extends Quad { * Constants */ const STYLE = 'Icons64x64_2'; - const SUBSTYLE_ArrowElimination = 'ArrowElimination'; - const SUBSTYLE_ArrowHit = 'ArrowHit'; - const SUBSTYLE_Disconnected = 'Disconnected'; - const SUBSTYLE_DisconnectedLight = 'DisconnectedLight'; - const SUBSTYLE_LaserElimination = 'LaserElimination'; - const SUBSTYLE_LaserHit = 'LaserHit'; - const SUBSTYLE_NucleusElimination = 'NucleusElimination'; - const SUBSTYLE_NucleusHit = 'NucleusHit'; - const SUBSTYLE_RocketElimination = 'RocketElimination'; - const SUBSTYLE_RocketHit = 'RocketHit'; - const SUBSTYLE_ServerNotice = 'ServerNotice'; - const SUBSTYLE_UnknownElimination = 'UnknownElimination'; - const SUBSTYLE_UnknownHit = 'UnknownHit'; + const SUBSTYLE_ArrowElimination = 'ArrowElimination'; + const SUBSTYLE_ArrowHit = 'ArrowHit'; + const SUBSTYLE_Disconnected = 'Disconnected'; + const SUBSTYLE_DisconnectedLight = 'DisconnectedLight'; + const SUBSTYLE_LaserElimination = 'LaserElimination'; + const SUBSTYLE_LaserHit = 'LaserHit'; + const SUBSTYLE_NucleusElimination = 'NucleusElimination'; + const SUBSTYLE_NucleusHit = 'NucleusHit'; + const SUBSTYLE_RocketElimination = 'RocketElimination'; + const SUBSTYLE_RocketHit = 'RocketHit'; + const SUBSTYLE_ServerNotice = 'ServerNotice'; + const SUBSTYLE_UnknownElimination = 'UnknownElimination'; + const SUBSTYLE_UnknownHit = 'UnknownHit'; /** - * Construct Icons64x64_2 quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_ManiaPlanetLogos.php b/application/core/FML/Controls/Quads/Quad_ManiaPlanetLogos.php index a780291f..789a2686 100644 --- a/application/core/FML/Controls/Quads/Quad_ManiaPlanetLogos.php +++ b/application/core/FML/Controls/Quads/Quad_ManiaPlanetLogos.php @@ -23,10 +23,11 @@ class Quad_ManiaPlanetLogos extends Quad { const SUBSTYLE_ManiaPlanetLogoWhiteSmall = 'ManiaPlanetLogoWhiteSmall'; /** - * Construct ManiaPlanetLogos quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_ManiaplanetSystem.php b/application/core/FML/Controls/Quads/Quad_ManiaplanetSystem.php index 19be2425..3565ac0d 100644 --- a/application/core/FML/Controls/Quads/Quad_ManiaplanetSystem.php +++ b/application/core/FML/Controls/Quads/Quad_ManiaplanetSystem.php @@ -22,10 +22,11 @@ class Quad_ManiaplanetSystem extends Quad { const SUBSTYLE_Statistics = 'Statistics'; /** - * Construct ManiaplanetSystem quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_MedalsBig.php b/application/core/FML/Controls/Quads/Quad_MedalsBig.php index ee84b7b3..78fc620b 100644 --- a/application/core/FML/Controls/Quads/Quad_MedalsBig.php +++ b/application/core/FML/Controls/Quads/Quad_MedalsBig.php @@ -14,19 +14,20 @@ class Quad_MedalsBig extends Quad { * Constants */ const STYLE = 'MedalsBig'; - const SUBSTYLE_MedalBronze = 'MedalBronze'; - const SUBSTYLE_MedalGold = 'MedalGold'; - const SUBSTYLE_MedalGoldPerspective = 'MedalGoldPerspective'; - const SUBSTYLE_MedalNadeo = 'MedalNadeo'; - const SUBSTYLE_MedalNadeoPerspective = 'MedalNadeoPerspective'; - const SUBSTYLE_MedalSilver = 'MedalSilver'; - const SUBSTYLE_MedalSlot = 'MedalSlot'; + const SUBSTYLE_MedalBronze = 'MedalBronze'; + const SUBSTYLE_MedalGold = 'MedalGold'; + const SUBSTYLE_MedalGoldPerspective = 'MedalGoldPerspective'; + const SUBSTYLE_MedalNadeo = 'MedalNadeo'; + const SUBSTYLE_MedalNadeoPerspective = 'MedalNadeoPerspective'; + const SUBSTYLE_MedalSilver = 'MedalSilver'; + const SUBSTYLE_MedalSlot = 'MedalSlot'; /** - * Construct MedalsBig quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_TitleLogos.php b/application/core/FML/Controls/Quads/Quad_TitleLogos.php index c562c789..faa0d6f6 100644 --- a/application/core/FML/Controls/Quads/Quad_TitleLogos.php +++ b/application/core/FML/Controls/Quads/Quad_TitleLogos.php @@ -14,16 +14,17 @@ class Quad_TitleLogos extends Quad { * Constants */ const STYLE = 'TitleLogos'; - const SUBSTYLE_Author = 'Author'; - const SUBSTYLE_Collection = 'Collection'; - const SUBSTYLE_Icon = 'Icon'; - const SUBSTYLE_Title = 'Title'; + const SUBSTYLE_Author = 'Author'; + const SUBSTYLE_Collection = 'Collection'; + const SUBSTYLE_Icon = 'Icon'; + const SUBSTYLE_Title = 'Title'; /** - * Construct TitleLogos quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_UIConstruction_Buttons.php b/application/core/FML/Controls/Quads/Quad_UIConstruction_Buttons.php index f5adf7da..16a34ce5 100644 --- a/application/core/FML/Controls/Quads/Quad_UIConstruction_Buttons.php +++ b/application/core/FML/Controls/Quads/Quad_UIConstruction_Buttons.php @@ -14,66 +14,67 @@ class Quad_UIConstruction_Buttons extends Quad { * Constants */ const STYLE = 'UIConstruction_Buttons'; - const SUBSTYLE_ActionMaker = 'ActionMaker'; - const SUBSTYLE_Add = 'Add'; - const SUBSTYLE_Author = 'Author'; - const SUBSTYLE_AuthorTime = 'AuthorTime'; - const SUBSTYLE_BgEditors = 'BgEditors'; - const SUBSTYLE_BgIcons = 'BgIcons'; - const SUBSTYLE_BgMain = 'BgMain'; - const SUBSTYLE_BgTools = 'BgTools'; - const SUBSTYLE_BlockEditor = 'BlockEditor'; - const SUBSTYLE_Camera = 'Camera'; - const SUBSTYLE_Challenge = 'Challenge'; - const SUBSTYLE_CopyPaste = 'CopyPaste'; - const SUBSTYLE_DecalEditor = 'DecalEditor'; - const SUBSTYLE_Delete = 'Delete'; - const SUBSTYLE_Directory = 'Directory'; - const SUBSTYLE_Down = 'Down'; - const SUBSTYLE_Drive = 'Drive'; - const SUBSTYLE_Erase = 'Erase'; - const SUBSTYLE_Help = 'Help'; - const SUBSTYLE_Item = 'Item'; - const SUBSTYLE_Left = 'Left'; - const SUBSTYLE_MacroBlockEditor = 'MacroBlockEditor'; - const SUBSTYLE_MediaTracker = 'MediaTracker'; - const SUBSTYLE_ObjectEditor = 'ObjectEditor'; - const SUBSTYLE_OffZone = 'OffZone'; - const SUBSTYLE_Options = 'Options'; - const SUBSTYLE_Paint = 'Paint'; - const SUBSTYLE_Pick = 'Pick'; - const SUBSTYLE_Plugins = 'Plugins'; - const SUBSTYLE_Quit = 'Quit'; - const SUBSTYLE_Redo = 'Redo'; - const SUBSTYLE_Reload = 'Reload'; - const SUBSTYLE_Right = 'Right'; - const SUBSTYLE_Save = 'Save'; - const SUBSTYLE_SaveAs = 'SaveAs'; - const SUBSTYLE_ScriptEditor = 'ScriptEditor'; - const SUBSTYLE_SpotModelClearUnused = 'SpotModelClearUnused'; - const SUBSTYLE_SpotModelDuplicate = 'SpotModelDuplicate'; - const SUBSTYLE_SpotModelNew = 'SpotModelNew'; - const SUBSTYLE_SpotModelRename = 'SpotModelRename'; - const SUBSTYLE_Square = 'Square'; - const SUBSTYLE_Stats = 'Stats'; - const SUBSTYLE_Sub = 'Sub'; - const SUBSTYLE_TerrainEditor = 'TerrainEditor'; - const SUBSTYLE_TestSm = 'TestSm'; - const SUBSTYLE_Text = 'Text'; - const SUBSTYLE_Tools = 'Tools'; - const SUBSTYLE_Underground = 'Underground'; - const SUBSTYLE_Undo = 'Undo'; - const SUBSTYLE_Up = 'Up'; - const SUBSTYLE_Validate = 'Validate'; - const SUBSTYLE_Validate_Step1 = 'Validate_Step1'; - const SUBSTYLE_Validate_Step2 = 'Validate_Step2'; - const SUBSTYLE_Validate_Step3 = 'Validate_Step3'; + const SUBSTYLE_ActionMaker = 'ActionMaker'; + const SUBSTYLE_Add = 'Add'; + const SUBSTYLE_Author = 'Author'; + const SUBSTYLE_AuthorTime = 'AuthorTime'; + const SUBSTYLE_BgEditors = 'BgEditors'; + const SUBSTYLE_BgIcons = 'BgIcons'; + const SUBSTYLE_BgMain = 'BgMain'; + const SUBSTYLE_BgTools = 'BgTools'; + const SUBSTYLE_BlockEditor = 'BlockEditor'; + const SUBSTYLE_Camera = 'Camera'; + const SUBSTYLE_Challenge = 'Challenge'; + const SUBSTYLE_CopyPaste = 'CopyPaste'; + const SUBSTYLE_DecalEditor = 'DecalEditor'; + const SUBSTYLE_Delete = 'Delete'; + const SUBSTYLE_Directory = 'Directory'; + const SUBSTYLE_Down = 'Down'; + const SUBSTYLE_Drive = 'Drive'; + const SUBSTYLE_Erase = 'Erase'; + const SUBSTYLE_Help = 'Help'; + const SUBSTYLE_Item = 'Item'; + const SUBSTYLE_Left = 'Left'; + const SUBSTYLE_MacroBlockEditor = 'MacroBlockEditor'; + const SUBSTYLE_MediaTracker = 'MediaTracker'; + const SUBSTYLE_ObjectEditor = 'ObjectEditor'; + const SUBSTYLE_OffZone = 'OffZone'; + const SUBSTYLE_Options = 'Options'; + const SUBSTYLE_Paint = 'Paint'; + const SUBSTYLE_Pick = 'Pick'; + const SUBSTYLE_Plugins = 'Plugins'; + const SUBSTYLE_Quit = 'Quit'; + const SUBSTYLE_Redo = 'Redo'; + const SUBSTYLE_Reload = 'Reload'; + const SUBSTYLE_Right = 'Right'; + const SUBSTYLE_Save = 'Save'; + const SUBSTYLE_SaveAs = 'SaveAs'; + const SUBSTYLE_ScriptEditor = 'ScriptEditor'; + const SUBSTYLE_SpotModelClearUnused = 'SpotModelClearUnused'; + const SUBSTYLE_SpotModelDuplicate = 'SpotModelDuplicate'; + const SUBSTYLE_SpotModelNew = 'SpotModelNew'; + const SUBSTYLE_SpotModelRename = 'SpotModelRename'; + const SUBSTYLE_Square = 'Square'; + const SUBSTYLE_Stats = 'Stats'; + const SUBSTYLE_Sub = 'Sub'; + const SUBSTYLE_TerrainEditor = 'TerrainEditor'; + const SUBSTYLE_TestSm = 'TestSm'; + const SUBSTYLE_Text = 'Text'; + const SUBSTYLE_Tools = 'Tools'; + const SUBSTYLE_Underground = 'Underground'; + const SUBSTYLE_Undo = 'Undo'; + const SUBSTYLE_Up = 'Up'; + const SUBSTYLE_Validate = 'Validate'; + const SUBSTYLE_Validate_Step1 = 'Validate_Step1'; + const SUBSTYLE_Validate_Step2 = 'Validate_Step2'; + const SUBSTYLE_Validate_Step3 = 'Validate_Step3'; /** - * Construct UIConstruction_Buttons quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Quads/Quad_UiSMSpectatorScoreBig.php b/application/core/FML/Controls/Quads/Quad_UiSMSpectatorScoreBig.php index c8f1bda4..5233451a 100644 --- a/application/core/FML/Controls/Quads/Quad_UiSMSpectatorScoreBig.php +++ b/application/core/FML/Controls/Quads/Quad_UiSMSpectatorScoreBig.php @@ -37,10 +37,11 @@ class Quad_UiSMSpectatorScoreBig extends Quad { CONST SUBSTYLE_UIRange2Bg = 'UIRange2Bg'; /** - * Construct UiSMSpectatorScoreBig quad + * + * @see \FML\Controls\Quad */ - public function __construct() { - parent::__construct(); + public function __construct($id = null) { + parent::__construct($id); $this->setStyle(self::STYLE); } } diff --git a/application/core/FML/Controls/Video.php b/application/core/FML/Controls/Video.php index 39bbf13a..56ea12cc 100644 --- a/application/core/FML/Controls/Video.php +++ b/application/core/FML/Controls/Video.php @@ -10,7 +10,10 @@ namespace FML\Controls; class Video extends Control implements Playable, Scriptable { /** - * Construct a new video control + * Construct a new Video Control + * + * @param string $id + * Control Id */ public function __construct($id = null) { parent::__construct($id); diff --git a/application/core/FML/Elements/CustomUI.php b/application/core/FML/CustomUI.php similarity index 64% rename from application/core/FML/Elements/CustomUI.php rename to application/core/FML/CustomUI.php index bfb3c08f..885db46d 100644 --- a/application/core/FML/Elements/CustomUI.php +++ b/application/core/FML/CustomUI.php @@ -1,147 +1,181 @@ -noticeVisible = $visible; - return $this; - } - - /** - * Set Showing of the Challenge Info - * - * @param bool $visible - * @return \FML\Elements\CustomUI - */ - public function setChallengeInfoVisible($visible) { - $this->challengeInfoVisible = $visible; - return $this; - } - - /** - * Set Showing of the Net Infos - * - * @param bool $visible - * @return \FML\Elements\CustomUI - */ - public function setNetInfosVisible($visible) { - $this->netInfosVisible = $visible; - return $this; - } - - /** - * Set Showing of the Chat - * - * @param bool $visible - * @return \FML\Elements\CustomUI - */ - public function setChatVisible($visible) { - $this->chatVisible = $visible; - return $this; - } - - /** - * Set Showing of the Checkpoint List - * - * @param bool $visible - * @return \FML\Elements\CustomUI - */ - public function setCheckpointListVisible($visible) { - $this->checkpointListVisible = $visible; - return $this; - } - - /** - * Set Showing of Round Scores - * - * @param bool $visible - * @return \FML\Elements\CustomUI - */ - public function setRoundScoresVisible($visible) { - $this->roundScoresVisible = $visible; - return $this; - } - - /** - * Set Showing of the Scoretable - * - * @param bool $visible - * @return \FML\Elements\CustomUI - */ - public function setScoretableVisible($visible) { - $this->scoretableVisible = $visible; - return $this; - } - - /** - * Set Global Showing - * - * @param bool $visible - * @return \FML\Elements\CustomUI - */ - public function setGlobalVisible($visible) { - $this->globalVisible = $visible; - return $this; - } - - /** - * - * @see \FML\Renderable::render() - */ - public function render(\DOMDocument $domDocument) { - $settings = $this->getSettings(); - $xml = $domDocument->createElement($this->tagName); - foreach ($settings as $setting => $value) { - if ($value === null) continue; - $xmlElement = $domDocument->createElement($setting); - $xmlElement->setAttribute('visible', ($value ? 'true' : 'false')); - $xml->appendChild($xmlElement); - } - return $xml; - } - - /** - * Get associative Array of all CustomUI Settings - * - * @return array - */ - private function getSettings() { - $settings = array(); - $settings['challenge_info'] = $this->challengeInfoVisible; - $settings['chat'] = $this->chatVisible; - $settings['checkpoint_list'] = $this->checkpointListVisible; - $settings['global'] = $this->globalVisible; - $settings['net_infos'] = $this->netInfosVisible; - $settings['notice'] = $this->noticeVisible; - $settings['round_scores'] = $this->roundScoresVisible; - $settings['scoretable'] = $this->scoretableVisible; - return $settings; - } +encoding = $encoding; + return $this; + } + + /** + * Set Showing of Notices + * + * @param bool $visible + * @return \FML\CustomUI + */ + public function setNoticeVisible($visible) { + $this->noticeVisible = $visible; + return $this; + } + + /** + * Set Showing of the Challenge Info + * + * @param bool $visible + * @return \FML\CustomUI + */ + public function setChallengeInfoVisible($visible) { + $this->challengeInfoVisible = $visible; + return $this; + } + + /** + * Set Showing of the Net Infos + * + * @param bool $visible + * @return \FML\CustomUI + */ + public function setNetInfosVisible($visible) { + $this->netInfosVisible = $visible; + return $this; + } + + /** + * Set Showing of the Chat + * + * @param bool $visible + * @return \FML\CustomUI + */ + public function setChatVisible($visible) { + $this->chatVisible = $visible; + return $this; + } + + /** + * Set Showing of the Checkpoint List + * + * @param bool $visible + * @return \FML\CustomUI + */ + public function setCheckpointListVisible($visible) { + $this->checkpointListVisible = $visible; + return $this; + } + + /** + * Set Showing of Round Scores + * + * @param bool $visible + * @return \FML\CustomUI + */ + public function setRoundScoresVisible($visible) { + $this->roundScoresVisible = $visible; + return $this; + } + + /** + * Set Showing of the Scoretable + * + * @param bool $visible + * @return \FML\CustomUI + */ + public function setScoretableVisible($visible) { + $this->scoretableVisible = $visible; + return $this; + } + + /** + * Set Global Showing + * + * @param bool $visible + * @return \FML\CustomUI + */ + public function setGlobalVisible($visible) { + $this->globalVisible = $visible; + return $this; + } + + /** + * Render the XML Document + * + * @param \DOMDocument $domDocument + * @return \DOMDocument + */ + public function render($domDocument = null) { + $isChild = false; + if ($domDocument) { + $isChild = true; + } + if (!$isChild) { + $domDocument = new \DOMDocument('1.0', $this->encoding); + } + $xmlElement = $domDocument->createElement($this->tagName); + $settings = $this->getSettings(); + foreach ($settings as $setting => $value) { + if ($value === null) continue; + $xmlSubElement = $domDocument->createElement($setting); + $xmlSubElement->setAttribute('visible', ($value ? 1 : 0)); + $xmlElement->appendChild($xmlSubElement); + } + if ($isChild) { + return $xmlElement; + } + return $domDocument; + } + + /** + * Get String Representation + * + * @return string + */ + public function __toString() { + $domDocument = $this->render(); + $xmlText = $domDocument->saveXML(); + return $xmlText; + } + + /** + * Get associative Array of all CustomUI Settings + * + * @return array + */ + private function getSettings() { + $settings = array(); + $settings['challenge_info'] = $this->challengeInfoVisible; + $settings['chat'] = $this->chatVisible; + $settings['checkpoint_list'] = $this->checkpointListVisible; + $settings['global'] = $this->globalVisible; + $settings['net_infos'] = $this->netInfosVisible; + $settings['notice'] = $this->noticeVisible; + $settings['round_scores'] = $this->roundScoresVisible; + $settings['scoretable'] = $this->scoretableVisible; + return $settings; + } } diff --git a/application/core/FML/Elements/Format.php b/application/core/FML/Elements/Format.php index 8f4388d2..3d9af0c7 100644 --- a/application/core/FML/Elements/Format.php +++ b/application/core/FML/Elements/Format.php @@ -9,7 +9,7 @@ namespace FML\Elements; */ class Format implements BgColorable, Renderable, Styleable, TextFormatable { /** - * Protected properties + * Protected Properties */ protected $tagName = 'format'; diff --git a/application/core/FML/Elements/Including.php b/application/core/FML/Elements/Including.php index 70137542..fe5f23d0 100644 --- a/application/core/FML/Elements/Including.php +++ b/application/core/FML/Elements/Including.php @@ -9,15 +9,16 @@ namespace FML\Elements; */ class Including implements Renderable { /** - * Protected properties + * Protected Properties */ protected $url = ''; protected $tagName = 'include'; /** - * Set url + * Set Url * - * @param string $url + * @param string $url + * Include Url */ public function setUrl($url) { $this->url = $url; @@ -29,7 +30,9 @@ class Including implements Renderable { */ public function render(\DOMDocument $domDocument) { $xml = $domDocument->createElement($this->tagName); - $xml->setAttribute('url', $this->url); + if ($this->url) { + $xml->setAttribute('url', $this->url); + } return $xml; } } diff --git a/application/core/FML/Elements/Music.php b/application/core/FML/Elements/Music.php index 2a57b773..5c58475c 100644 --- a/application/core/FML/Elements/Music.php +++ b/application/core/FML/Elements/Music.php @@ -9,15 +9,16 @@ namespace FML\Elements; */ class Music implements Renderable { /** - * Protected properties + * Protected Properties */ protected $data = ''; protected $tagName = 'music'; /** - * Set data + * Set Data Url * - * @param string $data + * @param string $data + * Media Url * @return \FML\Elements\Music */ public function setData($data) { diff --git a/application/core/FML/Elements/SimpleScript.php b/application/core/FML/Elements/SimpleScript.php index 33e0f05f..367d50f4 100644 --- a/application/core/FML/Elements/SimpleScript.php +++ b/application/core/FML/Elements/SimpleScript.php @@ -11,13 +11,13 @@ use FML\Types\Renderable; */ class SimpleScript implements Renderable { /** - * Protected properties + * Protected Properties */ protected $tagName = 'script'; protected $text = ''; /** - * Set script text + * Set Script Text * * @param string $text * @return \FML\Script\Script diff --git a/application/core/FML/ManiaLink.php b/application/core/FML/ManiaLink.php index 2ec8793d..b663d423 100644 --- a/application/core/FML/ManiaLink.php +++ b/application/core/FML/ManiaLink.php @@ -1,176 +1,195 @@ -setId($id); - } - } - - /** - * Set xml encoding - * - * @param string $encoding - * @return \FML\ManiaLink - */ - public function setXmlEncoding($encoding) { - $this->encoding = $encoding; - return $this; - } - - /** - * Set id - * - * @param string $id - * @return \FML\ManiaLink - */ - public function setId($id) { - $this->id = $id; - return $this; - } - - /** - * Set background - * - * @param string $background - * @return \FML\ManiaLink - */ - public function setBackground($background) { - $this->background = $background; - return $this; - } - - /** - * Set navigable3d - * - * @param bool $navigable3d - * @return \FML\ManiaLink - */ - public function setNavigable3d($navigable3d) { - $this->navigable3d = ($navigable3d ? 1 : 0); - return $this; - } - - /** - * Set timeout - * - * @param int $timeout - * @return \FML\ManiaLink - */ - public function setTimeout($timeout) { - $this->timeout = $timeout; - return $this; - } - - /** - * - * @see \FML\Types\Container::add() - * @return \FML\ManiaLink - */ - public function add(Renderable $child) { - array_push($this->children, $child); - return $this; - } - - /** - * - * @see \FML\Types\Container::removeChildren() - * @return \FML\ManiaLink - */ - public function removeChildren() { - $this->children = array(); - return $this; - } - - /** - * Set the script object of the Manialink - * - * @param Script $script - * @return \FML\ManiaLink - */ - public function setScript(Script $script) { - $this->script = $script; - return $this; - } - - /** - * Render the xml document - * - * @param bool $echo - * If the xml should be echoed and the content-type header should be set - * @param \DOMDocument $domDocument - * @return \DOMDocument - */ - public function render($echo = false, $domDocument = null) { - $isChild = false; - if ($domDocument) { - $isChild = true; - } - if (!$isChild) { - $domDocument = new \DOMDocument('1.0', $this->encoding); - } - $manialink = $domDocument->createElement($this->tagName); - if (!$isChild) { - $domDocument->appendChild($manialink); - } - if ($this->id) { - $manialink->setAttribute('id', $this->id); - } - if ($this->version) { - $manialink->setAttribute('version', $this->version); - } - if ($this->background) { - $manialink->setAttribute('background', $this->background); - } - if ($this->navigable3d) { - $manialink->setAttribute('navigable3d', $this->navigable3d); - } - if ($this->timeout) { - $timeoutXml = $domDocument->createElement('timeout', $this->timeout); - $manialink->appendChild($timeoutXml); - } - foreach ($this->children as $child) { - $childXml = $child->render($domDocument); - $manialink->appendChild($childXml); - } - if ($this->script) { - $scriptXml = $this->script->render($domDocument); - $manialink->appendChild($scriptXml); - } - if ($isChild) { - return $manialink; - } - if ($echo) { - header('Content-Type: application/xml'); - echo $domDocument->saveXML(); - } - return $domDocument; - } +setId($id); + } + } + + /** + * Set XML Encoding + * + * @param string $encoding + * XML Encoding + * @return \FML\ManiaLink + */ + public function setXmlEncoding($encoding) { + $this->encoding = $encoding; + return $this; + } + + /** + * Set Manialink Id + * + * @param string $id + * Manialink Id + * @return \FML\ManiaLink + */ + public function setId($id) { + $this->id = $id; + return $this; + } + + /** + * Set Background + * + * @param string $background + * Background Value + * @return \FML\ManiaLink + */ + public function setBackground($background) { + $this->background = $background; + return $this; + } + + /** + * Set Navigable3d + * + * @param bool $navigable3d + * If the manialink is 3d navigable + * @return \FML\ManiaLink + */ + public function setNavigable3d($navigable3d) { + $this->navigable3d = ($navigable3d ? 1 : 0); + return $this; + } + + /** + * Set Timeout + * + * @param int $timeout + * Timeout Duration + * @return \FML\ManiaLink + */ + public function setTimeout($timeout) { + $this->timeout = $timeout; + return $this; + } + + /** + * + * @see \FML\Types\Container::add() + * @return \FML\ManiaLink + */ + public function add(Renderable $child) { + array_push($this->children, $child); + return $this; + } + + /** + * + * @see \FML\Types\Container::removeChildren() + * @return \FML\ManiaLink + */ + public function removeChildren() { + $this->children = array(); + return $this; + } + + /** + * Set the script object of the Manialink + * + * @param Script $script + * @return \FML\ManiaLink + */ + public function setScript(Script $script) { + $this->script = $script; + return $this; + } + + /** + * Render the XML Document + * + * @param bool $echo + * If the xml should be echoed and the content-type header should be set + * @param \DOMDocument $domDocument + * @return \DOMDocument + */ + public function render($echo = false, $domDocument = null) { + $isChild = false; + if ($domDocument) { + $isChild = true; + } + if (!$isChild) { + $domDocument = new \DOMDocument('1.0', $this->encoding); + } + $manialink = $domDocument->createElement($this->tagName); + if (!$isChild) { + $domDocument->appendChild($manialink); + } + if ($this->id) { + $manialink->setAttribute('id', $this->id); + } + if ($this->version) { + $manialink->setAttribute('version', $this->version); + } + if ($this->background) { + $manialink->setAttribute('background', $this->background); + } + if ($this->navigable3d) { + $manialink->setAttribute('navigable3d', $this->navigable3d); + } + if ($this->timeout) { + $timeoutXml = $domDocument->createElement('timeout', $this->timeout); + $manialink->appendChild($timeoutXml); + } + foreach ($this->children as $child) { + $childXml = $child->render($domDocument); + $manialink->appendChild($childXml); + } + if ($this->script) { + $scriptXml = $this->script->render($domDocument); + $manialink->appendChild($scriptXml); + } + if ($isChild) { + return $manialink; + } + if ($echo) { + header('Content-Type: application/xml'); + echo $domDocument->saveXML(); + } + return $domDocument; + } + + /** + * Get String Representation + * + * @return string + */ + public function __toString() { + $domDocument = $this->render(); + $xmlText = $domDocument->saveXML(); + return $xmlText; + } } diff --git a/application/core/FML/ManiaLinks.php b/application/core/FML/ManiaLinks.php index 88df08b6..5b374f53 100644 --- a/application/core/FML/ManiaLinks.php +++ b/application/core/FML/ManiaLinks.php @@ -9,16 +9,17 @@ namespace FML; */ class ManiaLinks { /** - * Protected properties + * Protected Properties */ protected $encoding = 'utf-8'; protected $tagName = 'manialinks'; protected $children = array(); /** - * Set xml encoding + * Set XML Encoding * - * @param string $encoding + * @param string $encoding + * XML Encoding * @return \FML\ManiaLinks */ public function setXmlEncoding($encoding) { @@ -27,18 +28,21 @@ class ManiaLinks { } /** - * Add a child manialink + * Add a Child Manialink * - * @param ManiaLink $child + * @param ManiaLink $child + * Child Manialink * @return \FML\ManiaLinks */ public function add(ManiaLink $child) { - array_push($this->children, $child); + if (!in_array($child, $this->children)) { + array_push($this->children, $child); + } return $this; } /** - * Remove all child manialinks + * Remove all Child Manialinks * * @return \FML\ManiaLinks */ @@ -48,7 +52,7 @@ class ManiaLinks { } /** - * Render the xml document + * Render the XML Document * * @param bool $echo * If the xml should be echoed and the content-type header should be set diff --git a/application/core/FML/Script/Builder.php b/application/core/FML/Script/Builder.php new file mode 100644 index 00000000..2c7bb325 --- /dev/null +++ b/application/core/FML/Script/Builder.php @@ -0,0 +1,23 @@ +assignId(); - $menuItemControl->setScriptEvents(true); - $subMenuControl->assignId(); - - array_push($menus, array($menuItemControl->getId(), $subMenuControl->getId())); - array_push($subMenus, $subMenuControl->getId()); - } - array_push($this->menus, array($menus, $subMenus)); - return $this; - } - - /** - * - * @see \FML\Script\Sections\Constants::getConstants() - */ - public function getConstants() { - $constant = '['; - $index = 0; - foreach ($this->menus as $menu) { - $constant .= '['; - foreach ($menu[0] as $menuRel) { - $constant .= '"' . $menuRel[0] . '" => ["' . $menuRel[1] . '"], '; - } - $constant .= '"__FML__Sub__Menus__" => ['; - $subIndex = 0; - foreach ($menu[1] as $subMenu) { - $constant .= '"' . $subMenu . '"'; - if ($subIndex < count($menu[1]) - 1) { - $constant .= ', '; - } - $subIndex++; - } - $constant .= ']]'; - if ($index < count($this->menus) - 1) { - $constant .= ', '; - } - $index++; - } - $constant .= ']'; - $constants = array(); - $constants[self::C_MENUIDS] = $constant; - return $constants; - } - - /** - * - * @see \FML\Script\Sections\Labels::getLabels() - */ - public function getLabels() { - $labels = array(); - $labelMouseClick = file_get_contents(__DIR__ . '/Templates/MenuMouseClick.txt'); - $labels[Labels::MOUSECLICK] = $labelMouseClick; - return $labels; - } -} diff --git a/application/core/FML/Script/Pages.php b/application/core/FML/Script/Pages.php deleted file mode 100644 index 31981cc9..00000000 --- a/application/core/FML/Script/Pages.php +++ /dev/null @@ -1,147 +0,0 @@ - $pageButton) { - if (!($pageButton instanceof Control)) { - trigger_error('No Control instance given.', E_USER_ERROR); - } - $pageButton->assignId(); - if (!($pageButton instanceof Scriptable)) { - trigger_error('No Scriptable instance given.', E_USER_ERROR); - } - $pageButton->setScriptEvents(true); - - $actionIds[$pageButton->getId()] = $action; - } - - $pageIds = array(); - foreach ($pages as $page) { - if (!($page instanceof Control)) { - trigger_error('No Control instance given.', E_USER_ERROR); - } - $page->assignId(); - if (!empty($pageIds)) { - $page->setVisible(false); - } - array_push($pageIds, $page->getId()); - } - - if ($counterLabel) { - $counterLabel->assignId(); - $counterId = $counterLabel->getId(); - } - else { - $counterId = uniqid(); - } - - array_push($this->pages, array($actionIds, $pageIds, $counterId)); - } - - /** - * - * @see \FML\Script\Sections\Includes::getIncludes() - */ - public function getIncludes() { - $includes = array(); - $includes["TextLib"] = "TextLib"; - return $includes; - } - - /** - * - * @see \FML\Script\Sections\Constants::getConstants() - */ - public function getConstants() { - $constant = '['; - $index = 0; - foreach ($this->pages as $page) { - $constant .= '['; - $actionIds = $page[0]; - foreach ($actionIds as $actionId => $action) { - $constant .= '"' . $actionId . '" => ["' . $action . '"], '; - } - $constant .= '"__FML__Pages__Id__" => ["' . $page[2] . '"], '; - $constant .= '"__FML__Pages__Ids__" => ['; - if (count($page[1]) <= 0) { - $constant .= '""'; - } - else { - $subIndex = 0; - foreach ($page[1] as $pageId) { - $constant .= '"' . $pageId . '"'; - if ($subIndex < count($page[1]) - 1) { - $constant .= ', '; - } - $subIndex++; - } - } - $constant .= ']]'; - if ($index < count($this->pages) - 1) { - $constant .= ', '; - } - $index++; - } - $constant .= ']'; - $constants = array(); - $constants[self::C_PAGEIDS] = $constant; - return $constants; - } - - /** - * - * @see \FML\Script\Sections\Globals::getGlobals() - */ - public function getGlobals() { - $globals = array(); - $globals['G_FML_PageIndexes'] = 'Integer[Text]'; - return $globals; - } - - /** - * - * @see \FML\Script\Sections\Labels::getLabels() - */ - public function getLabels() { - $labels = array(); - $labelOnInit = file_get_contents(__DIR__ . '/Templates/PageOnInit.txt'); - $labels[Labels::ONINIT] = $labelOnInit; - $labelMouseClick = file_get_contents(__DIR__ . '/Templates/PageMouseClick.txt'); - $labels[Labels::MOUSECLICK] = $labelMouseClick; - return $labels; - } -} diff --git a/application/core/FML/Script/Templates/Header.txt b/application/core/FML/Script/Parts/Header.txt similarity index 74% rename from application/core/FML/Script/Templates/Header.txt rename to application/core/FML/Script/Parts/Header.txt index 6cdfb5cd..f299f5cb 100644 --- a/application/core/FML/Script/Templates/Header.txt +++ b/application/core/FML/Script/Parts/Header.txt @@ -1,4 +1,4 @@ /********************************* * FancyManiaLinks by steeffeen * * http://fml.steeffeen.com * -*********************************/ +*********************************/ \ No newline at end of file diff --git a/application/core/FML/Script/Templates/Main.txt b/application/core/FML/Script/Parts/Main.txt similarity index 84% rename from application/core/FML/Script/Templates/Main.txt rename to application/core/FML/Script/Parts/Main.txt index b41ec1d5..558de16a 100644 --- a/application/core/FML/Script/Templates/Main.txt +++ b/application/core/FML/Script/Parts/Main.txt @@ -1,7 +1,8 @@ Void Dummy() {} - main() { + declare FML_ScriptStart = Now; +++OnInit+++ + declare FML_LoopCounter = 0; while (True) { yield; foreach (Event in PendingEvents) { @@ -24,5 +25,6 @@ main() { } } +++Loop+++ + FML_LoopCounter += 1; } -} +} \ No newline at end of file diff --git a/application/core/FML/Script/Script.php b/application/core/FML/Script/Script.php index db9a7627..f4a4500e 100644 --- a/application/core/FML/Script/Script.php +++ b/application/core/FML/Script/Script.php @@ -1,216 +1,445 @@ -features, $scriptFeature); - return $this; - } - - /** - * Remove all script features - * - * @return \FML\Script\Script - */ - public function removeFeatures() { - $this->features = array(); - return $this; - } - - /** - * Create the script xml tag - * - * @param \DOMDocument $domDocument - * @return \DOMElement - */ - public function render(\DOMDocument $domDocument) { - $scriptXml = $domDocument->createElement('script'); - $scriptText = $this->buildScriptText(); - $scriptComment = $domDocument->createComment($scriptText); - $scriptXml->appendChild($scriptComment); - return $scriptXml; - } - - /** - * Build the complete script text based on all script items - * - * @return string - */ - private function buildScriptText() { - $scriptText = ""; - $scriptText = $this->addHeaderPart($scriptText); - $scriptText = $this->addIncludesPart($scriptText); - $scriptText = $this->addConstantsPart($scriptText); - $scriptText = $this->addGlobalsPart($scriptText); - $scriptText = $this->addLabelsPart($scriptText); - $scriptText = $this->addFunctionsPart($scriptText); - $scriptText = $this->addMainPart($scriptText); - return $scriptText; - } - - /** - * Add the header comment to the script - * - * @param string $scriptText - * @return string - */ - private function addHeaderPart($scriptText) { - $headerPart = file_get_contents(__DIR__ . '/Templates/Header.txt'); - return $scriptText . $headerPart; - } - - /** - * Add the includes to the script - * - * @param string $scriptText - * @return string - */ - private function addIncludesPart($scriptText) { - $includes = array(); - foreach ($this->features as $feature) { - if (!($feature instanceof Includes)) { - continue; - } - $featureIncludes = $feature->getIncludes(); - foreach ($featureIncludes as $namespace => $fileName) { - $includes[$namespace] = $fileName; - } - } - $includesPart = PHP_EOL; - foreach ($includes as $namespace => $fileName) { - $includesPart .= "#Include \"{$fileName}\" as {$namespace}" . PHP_EOL; - } - return $scriptText . $includesPart; - } - - /** - * Add the declared constants to the script - * - * @param string $scriptText - * @return string - */ - private function addConstantsPart($scriptText) { - $constants = array(); - foreach ($this->features as $feature) { - if (!($feature instanceof Constants)) { - continue; - } - $featureConstants = $feature->getConstants(); - foreach ($featureConstants as $name => $value) { - $constants[$name] = $value; - } - } - $constantsPart = PHP_EOL; - foreach ($constants as $name => $value) { - $constantsPart .= "#Const {$name} {$value}" . PHP_EOL; - } - return $scriptText . $constantsPart; - } - - /** - * Add the declared global variables to the script - * - * @param string $scriptText - * @return string - */ - private function addGlobalsPart($scriptText) { - $globals = array(); - foreach ($this->features as $feature) { - if (!($feature instanceof Globals)) { - continue; - } - $featureGlobals = $feature->getGlobals(); - foreach ($featureGlobals as $name => $type) { - $globals[$name] = $type; - } - } - $globalsPart = PHP_EOL; - foreach ($globals as $name => $type) { - $globalsPart .= "declare {$type} {$name};" . PHP_EOL; - } - return $scriptText . $globalsPart; - } - - /** - * Add the implemented labels to the script - * - * @param string $scriptText - * @return string - */ - private function addLabelsPart($scriptText) { - $labels = array(); - foreach ($this->features as $feature) { - if (!($feature instanceof Labels)) { - continue; - } - $featureLabels = $feature->getLabels(); - foreach ($featureLabels as $name => $implementation) { - $label = array($name, $implementation); - array_push($labels, $label); - } - } - $labelsPart = PHP_EOL; - foreach ($labels as $label) { - $labelsPart .= '***' . $label[0] . '***' . PHP_EOL . '***' . PHP_EOL . $label[1] . PHP_EOL . '***' . PHP_EOL; - } - return $scriptText . $labelsPart; - } - - /** - * Add the declared functions to the script - * - * @param string $scriptText - * @return string - */ - private function addFunctionsPart($scriptText) { - $functions = array(); - foreach ($this->features as $feature) { - if (!($feature instanceof Functions)) { - continue; - } - $featureFunctions = $feature->getFunctions(); - foreach ($featureFunctions as $signature => $implementation) { - $functions[$signature] = $implementation; - } - } - $functionsPart = PHP_EOL; - foreach ($functions as $signature => $implementation) { - $functionsPart .= $signature . '{' . PHP_EOL . $implementation . PHP_EOL . '}' . PHP_EOL; - } - return $scriptText . $functionsPart; - } - - /** - * Add the main function to the script - * - * @param string $scriptText - * @return string - */ - private function addMainPart($scriptText) { - $mainPart = file_get_contents(__DIR__ . '/Templates/Main.txt'); - return $scriptText . $mainPart; - } +includes[$namespace] = $file; + return $this; + } + + /** + * Add a Tooltip Behavior + * + * @param Control $hoverControl + * @param Control $tooltipControl + * @return \FML\Script\Script + */ + public function addTooltip(Control $hoverControl, Control $tooltipControl) { + if (!($hoverControl instanceof Scriptable)) { + trigger_error('Scriptable Control needed as HoverControl for Tooltips!'); + return $this; + } + $tooltipControl->checkId(); + $tooltipControl->setVisible(false); + $hoverControl->setScriptEvents(true); + $hoverControl->addClass(self::CLASS_TOOLTIPS); + $hoverControl->addClass($tooltipControl->getId()); + $this->tooltips = true; + return $this; + } + + /** + * Add a Menu Behavior + * + * @param Control $clickControl + * @param Control $menuControl + * @param string $menuId + * @return \FML\Script\Script + */ + public function addMenu(Control $clickControl, Control $menuControl, $menuId = null) { + if (!($clickControl instanceof Scriptable)) { + trigger_error('Scriptable Control needed as ClickControl for Menus!'); + return $this; + } + if (!$menuId) $menuId = '_'; + $menuControl->checkId(); + $menuControl->addClass(self::CLASS_MENU); + $menuControl->addClass($menuId); + $clickControl->setScriptEvents(true); + $clickControl->addClass(self::CLASS_MENUBUTTON); + $clickControl->addClass($menuId . '-' . $menuControl->getId()); + $this->addInclude('TextLib', 'TextLib'); + $this->menus = true; + return $this; + } + + /** + * Add a Page for a Paging Behavior + * + * @param Control $pageControl + * @param int $pageNumber + * @param string $pagesId + * @return \FML\Script\Script + */ + public function addPage(Control $pageControl, $pageNumber, $pagesId = null) { + $pageNumber = (int) $pageNumber; + if (!$pagesId) $pagesId = '_'; + $pageControl->addClass(self::CLASS_PAGE); + $pageControl->addClass($pagesId); + $pageControl->addClass(self::CLASS_PAGE . '-P' . $pageNumber); + return $this; + } + + /** + * Add a Pager Button for a Paging Behavior + * + * @param Control $pagerControl + * @param int $pagingAction + * @param string $pagesId + * @return \FML\Script\Script + */ + public function addPager(Control $pagerControl, $pagingAction, $pagesId = null) { + if (!($pagerControl instanceof Scriptable)) { + trigger_error('Scriptable Control needed as PagerControl for Pages!'); + return $this; + } + $pagingAction = (int) $pagingAction; + if (!$pagesId) $pagesId = '_'; + $pagerControl->setScriptEvents(true); + $pagerControl->addClass(self::CLASS_PAGER); + $pagerControl->addClass(self::CLASS_PAGER . '-I' . $pagesId); + $pagerControl->addClass(self::CLASS_PAGER . '-A' . $pagingAction); + $this->addInclude('TextLib', 'TextLib'); + $this->pages = true; + return $this; + } + + /** + * Add a Label that shows the current Page Number + * + * @param Label $pageLabel + * @param string $pagesId + * @return \FML\Script\Script + */ + public function addPageLabel(Label $pageLabel, $pagesId = null) { + if (!$pagesId) $pagesId = '_'; + $pageLabel->addClass(self::CLASS_PAGELABEL); + $pageLabel->addClass($pagesId); + return $this; + } + + /** + * Add a Button Behavior that will open the Built-In Player Profile + * + * @param Control $profileControl + * @param string $playerLogin + * @return \FML\Script\Script + */ + public function addProfileButton(Control $profileControl, $playerLogin) { + if (!($profileControl instanceof Scriptable)) { + trigger_error('Scriptable Control needed as ClickControl for Profiles!'); + return $this; + } + $profileControl->setScriptEvents(true); + $profileControl->addClass(self::CLASS_PROFILE); + if ($playerLogin) { + $profilControl->addClass(self::CLASS_PROFILE . '-' . $playerLogin); + } + $this->profile = true; + return $this; + } + + /** + * Add a Button Behavior that will open the Built-In Map Info + * + * @param Control $mapInfoControl + * @return \FML\Script\Script + */ + public function addMapInfoButton(Control $mapInfoControl) { + if (!($mapInfoControl instanceof Scriptable)) { + trigger_error('Scriptable Control needed as ClickControl for Map Info!'); + return $this; + } + $mapInfoControl->setScriptEvents(true); + $mapInfoControl->addClass(self::CLASS_MAPINFO); + $this->mapInfo = true; + return $this; + } + + /** + * Create the Script XML Tag + * + * @param \DOMDocument $domDocument + * @return \DOMElement + */ + public function render(\DOMDocument $domDocument) { + $scriptXml = $domDocument->createElement($this->tagName); + $scriptText = $this->buildScriptText(); + $scriptComment = $domDocument->createComment($scriptText); + $scriptXml->appendChild($scriptComment); + return $scriptXml; + } + + /** + * Build the complete Script Text + * + * @return string + */ + private function buildScriptText() { + $scriptText = ""; + $scriptText .= $this->getHeaderComment(); + $scriptText .= $this->getIncludes(); + if ($this->tooltips) { + $scriptText .= $this->getTooltipLabels(); + } + if ($this->menus) { + $scriptText .= $this->getMenuLabels(); + } + if ($this->pages) { + $scriptText .= $this->getPagesLabels(); + } + if ($this->profile) { + $scriptText .= $this->getProfileLabels(); + } + if ($this->mapInfo) { + $scriptText .= $this->getMapInfoLabels(); + } + $scriptText .= $this->getMainFunction(); + return $scriptText; + } + + /** + * Get the Header Comment + * + * @return string + */ + private function getHeaderComment() { + $headerComment = file_get_contents(__DIR__ . '/Parts/Header.txt'); + return $headerComment; + } + + /** + * Get the Includes + * + * @return string + */ + private function getIncludes() { + $includesText = PHP_EOL; + foreach ($this->includes as $namespace => $file) { + $includesText .= "#Include \"{$file}\" as {$namespace}" . PHP_EOL; + } + return $includesText; + } + + /** + * Get the Tooltip Labels + * + * @return string + */ + private function getTooltipLabels() { + $mouseOverScript = " +if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIPS . "\")) { + foreach (ControlClass in Event.Control.ControlClasses) { + declare TooltipControl <=> Page.GetFirstChild(ControlClass); + if (TooltipControl == Null) continue; + TooltipControl.Show(); + } +}"; + $mouseOutScript = " +if (Event.Control.HasClass(\"" . self::CLASS_TOOLTIPS . "\")) { + foreach (ControlClass in Event.Control.ControlClasses) { + declare TooltipControl <=> Page.GetFirstChild(ControlClass); + if (TooltipControl == Null) continue; + TooltipControl.Hide(); + } +}"; + $tooltipsLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSEOVER, $mouseOverScript); + $tooltipsLabels .= Builder::getLabelImplementationBlock(self::LABEL_MOUSEOUT, $mouseOutScript); + return $tooltipsLabels; + } + + /** + * Get the Menu Labels + * + * @return string + */ + private function getMenuLabels() { + $mouseClickScript = " +if (Event.Control.HasClass(\"" . self::CLASS_MENUBUTTON . "\")) { + declare Text MenuIdClass; + declare Text MenuControlId; + foreach (ControlClass in Event.Control.ControlClasses) { + declare ClassParts = TextLib::Split(\"-\", ControlClass); + if (ClassParts.count <= 1) continue; + MenuIdClass = ClassParts[0]; + MenuControlId = ClassParts[1]; + break; + } + Page.GetClassChildren(MenuIdClass, Page.MainFrame, True); + foreach (MenuControl in Page.GetClassChildren_Result) { + if (!MenuControl.HasClass(\"" . self::CLASS_MENU . "\")) continue; + if (MenuControlId != MenuControl.Id) { + MenuControl.Hide(); + } else { + MenuControl.Show(); + } + } +}"; + $menuLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mouseClickScript); + return $menuLabels; + } + + /** + * Get the Pages Labels + * + * @return string + */ + private function getPagesLabels() { + $pagesNumberPrefix = self::CLASS_PAGE . '-P'; + $pagesNumberPrefixLength = strlen($pagesNumberPrefix); + $pagesScript = " +if (Event.Control.HasClass(\"" . self::CLASS_PAGER . "\")) { + declare Text PagesId; + declare Integer PagingAction; + foreach (ControlClass in Event.Control.ControlClasses) { + declare ClassParts = TextLib::Split(\"-\", ControlClass); + if (ClassParts.count <= 1) continue; + if (ClassParts[0] != \"" . self::CLASS_PAGER . "\") continue; + switch (TextLib::SubText(ClassParts[1], 0, 1)) { + case \"I\": { + PagesId = TextLib::SubText(ClassParts[1], 1, 99); + } + case \"A\": { + PagingAction = TextLib::ToInteger(TextLib::SubText(ClassParts[1], 1, 99)); + } + } + } + declare FML_PagesLastScriptStart for This = FML_ScriptStart; + declare FML_MinPageNumber for This = Integer[Text]; + declare FML_MaxPageNumber for This = Integer[Text]; + declare FML_PageNumber for This = Integer[Text]; + if (FML_PagesLastScriptStart != FML_ScriptStart || !FML_PageNumber.existskey(PagesId) || !FML_MinPageNumber.existskey(PagesId) || !FML_MaxPageNumber.existskey(PagesId)) { + Page.GetClassChildren(PagesId, Page.MainFrame, True); + foreach (PageControl in Page.GetClassChildren_Result) { + if (!PageControl.HasClass(\"" . self::CLASS_PAGE . "\")) continue; + foreach (ControlClass in PageControl.ControlClasses) { + if (TextLib::SubText(ControlClass, 0, {$pagesNumberPrefixLength}) != \"{$pagesNumberPrefix}\") continue; + declare PageNumber = TextLib::ToInteger(TextLib::SubText(ControlClass, {$pagesNumberPrefixLength}, 99)); + if (!FML_MinPageNumber.existskey(PagesId) || PageNumber < FML_MinPageNumber[PagesId]) { + FML_MinPageNumber[PagesId] = PageNumber; + } + if (!FML_MaxPageNumber.existskey(PagesId) || PageNumber > FML_MaxPageNumber[PagesId]) { + FML_MaxPageNumber[PagesId] = PageNumber; + } + break; + } + } + FML_PageNumber[PagesId] = FML_MinPageNumber[PagesId]; + } + FML_PageNumber[PagesId] += PagingAction; + if (FML_PageNumber[PagesId] < FML_MinPageNumber[PagesId]) { + FML_PageNumber[PagesId] = FML_MinPageNumber[PagesId]; + } + if (FML_PageNumber[PagesId] > FML_MaxPageNumber[PagesId]) { + FML_PageNumber[PagesId] = FML_MaxPageNumber[PagesId]; + } + FML_PagesLastScriptStart = FML_ScriptStart; + Page.GetClassChildren(PagesId, Page.MainFrame, True); + foreach (PageControl in Page.GetClassChildren_Result) { + if (!PageControl.HasClass(\"" . self::CLASS_PAGE . "\")) continue; + declare PageNumber = -1; + foreach (ControlClass in PageControl.ControlClasses) { + if (TextLib::SubText(ControlClass, 0, {$pagesNumberPrefixLength}) != \"{$pagesNumberPrefix}\") continue; + PageNumber = TextLib::ToInteger(TextLib::SubText(ControlClass, {$pagesNumberPrefixLength}, 99)); + break; + } + if (PageNumber != FML_PageNumber[PagesId]) { + PageControl.Hide(); + } else { + PageControl.Show(); + } + } + Page.GetClassChildren(\"".self::CLASS_PAGELABEL."\", Page.MainFrame, True); + foreach (PageControl in Page.GetClassChildren_Result) { + if (!PageControl.HasClass(PagesId)) continue; + declare PageLabel <=> (PageControl as CMlLabel); + PageLabel.Value = (FML_PageNumber[PagesId]+1)^\"/\"^(FML_MaxPageNumber[PagesId]+1); + } +}"; + $pagesLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $pagesScript); + return $pagesLabels; + } + + /** + * Get the Profile Labels + * + * @return string + */ + private function getProfileLabels() { + $profileScript = " +if (Event.Control.HasClass(\"" . self::CLASS_PROFILE . "\") { + declare Login = LocalUser.Login; + foreach (ControlClass in Event.Control.ControlClasses) { + declare ClassParts = TextLib::Split(\"-\", ControlClass); + if (ClassParts.count <= 1) continue; + if (ClassParts[0] != \"" . self::CLASS_PROFILE . "\") continue; + Login = ClassParts[1]; + break; + } + ShowProfile(Login); +}"; + $profileLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $profileScript); + return $profileLabels; + } + + /** + * Get the Map Info Labels + * + * @return string + */ + private function getMapInfoLabels() { + $mapInfoScript = " +if (Event.Control.HasClass(\"" . self::CLASS_MAPINFO . "\") { + ShowCurChallengeCard(); +}"; + $mapInfoLabels = Builder::getLabelImplementationBlock(self::LABEL_MOUSECLICK, $mapInfoScript); + return $mapInfoLabels; + } + + /** + * Get the Main Function + * + * @return string + */ + private function getMainFunction() { + $mainFunction = file_get_contents(__DIR__ . '/Parts/Main.txt'); + return $mainFunction; + } } diff --git a/application/core/FML/Script/ScriptFeature.php b/application/core/FML/Script/ScriptFeature.php deleted file mode 100644 index d752cb97..00000000 --- a/application/core/FML/Script/ScriptFeature.php +++ /dev/null @@ -1,11 +0,0 @@ - Page.GetFirstChild(SubMenuId); - if (SubMenu == Null) continue; - SubMenu.Visible = (SubMenu.ControlId == MenuId); - } -} diff --git a/application/core/FML/Script/Templates/PageMouseClick.txt b/application/core/FML/Script/Templates/PageMouseClick.txt deleted file mode 100644 index 112e2b44..00000000 --- a/application/core/FML/Script/Templates/PageMouseClick.txt +++ /dev/null @@ -1,27 +0,0 @@ -foreach (PageIds in C_FML_PageIds) { - if (!PageIds.existskey(Event.ControlId)) continue; - - declare Action = TextLib::ToInteger(PageIds[Event.ControlId][0]); - declare PagesId = PageIds["__FML__Pages__Id__"][0]; - declare PagesIds = PageIds["__FML__Pages__Ids__"]; - - if (!G_FML_PageIndexes.existskey(PagesId)) { - G_FML_PageIndexes[PagesId] = 0; - } - G_FML_PageIndexes[PagesId] += Action; - if (G_FML_PageIndexes[PagesId] < 0) { - G_FML_PageIndexes[PagesId] = 0; - } else if (G_FML_PageIndexes[PagesId] >= PagesIds.count) { - G_FML_PageIndexes[PagesId] = PagesIds.count - 1; - } - - foreach (PageIndex => PageId in PagesIds) { - declare Control <=> Page.GetFirstChild(PageId); - if (Control == Null) continue; - Control.Visible = (PageIndex == G_FML_PageIndexes[PagesId]); - } - - declare Label_Counter <=> (Page.GetFirstChild(PagesId) as CMlLabel); - if (Label_Counter == Null) continue; - Label_Counter.Value = (G_FML_PageIndexes[PagesId]+1)^"/"^PagesIds.count; -} diff --git a/application/core/FML/Script/Templates/PageOnInit.txt b/application/core/FML/Script/Templates/PageOnInit.txt deleted file mode 100644 index 6dc1a546..00000000 --- a/application/core/FML/Script/Templates/PageOnInit.txt +++ /dev/null @@ -1,18 +0,0 @@ -foreach (PageIds in C_FML_PageIds) { - declare PagesId = PageIds["__FML__Pages__Id__"][0]; - declare PagesIds = PageIds["__FML__Pages__Ids__"]; - - if (!G_FML_PageIndexes.existskey(PagesId)) { - G_FML_PageIndexes[PagesId] = 0; - } - - foreach (PageIndex => PageId in PagesIds) { - declare Control <=> Page.GetFirstChild(PageId); - if (Control == Null) continue; - Control.Visible = (PageIndex == G_FML_PageIndexes[PagesId]); - } - - declare Label_Counter <=> (Page.GetFirstChild(PagesId) as CMlLabel); - if (Label_Counter == Null) continue; - Label_Counter.Value = (G_FML_PageIndexes[PagesId]+1)^"/"^PagesIds.count; -} diff --git a/application/core/FML/Script/Templates/TooltipMouseOut.txt b/application/core/FML/Script/Templates/TooltipMouseOut.txt deleted file mode 100644 index ef7e29f7..00000000 --- a/application/core/FML/Script/Templates/TooltipMouseOut.txt +++ /dev/null @@ -1,6 +0,0 @@ -if (C_FML_TooltipIds.existskey(Event.ControlId)) { - declare TooltipControl <=> Page.GetFirstChild(C_FML_TooltipIds[Event.ControlId]); - if (TooltipControl != Null) { - TooltipControl.Hide(); - } -} diff --git a/application/core/FML/Script/Templates/TooltipMouseOver.txt b/application/core/FML/Script/Templates/TooltipMouseOver.txt deleted file mode 100644 index 5f238325..00000000 --- a/application/core/FML/Script/Templates/TooltipMouseOver.txt +++ /dev/null @@ -1,6 +0,0 @@ -if (C_FML_TooltipIds.existskey(Event.ControlId)) { - declare TooltipControl <=> Page.GetFirstChild(C_FML_TooltipIds[Event.ControlId]); - if (TooltipControl != Null) { - TooltipControl.Show(); - } -} diff --git a/application/core/FML/Script/Tooltips.php b/application/core/FML/Script/Tooltips.php deleted file mode 100644 index 46053a2c..00000000 --- a/application/core/FML/Script/Tooltips.php +++ /dev/null @@ -1,81 +0,0 @@ -assignId(); - } - $hoverControl->setScriptEvents(true); - $tooltipControl->assignId(); - $tooltipControl->setVisible(false); - $this->tooltips[$hoverControl->getId()] = $tooltipControl->getId(); - return $this; - } - - /** - * - * @see \FML\Script\Sections\Constants::getConstants() - */ - public function getConstants() { - $constant = '['; - if (count($this->tooltips) <= 0) { - $constant .= '"" => ""'; - } - else { - $index = 0; - foreach ($this->tooltips as $hoverId => $tooltipId) { - $constant .= '"' . $hoverId . '" => "' . $tooltipId . '"'; - if ($index < count($this->tooltips) - 1) { - $constant .= ','; - } - $index++; - } - } - $constant .= ']'; - $constants = array(); - $constants[self::C_TOOLTIPIDS] = $constant; - return $constants; - } - - /** - * - * @see \FML\Script\Sections\Labels::getLabels() - */ - public function getLabels() { - $labels = array(); - $labelMouseOut = file_get_contents(__DIR__ . '/Templates/TooltipMouseOut.txt'); - $labels[Labels::MOUSEOUT] = $labelMouseOut; - $labelMouseOver = file_get_contents(__DIR__ . '/Templates/TooltipMouseOver.txt'); - $labels[Labels::MOUSEOVER] = $labelMouseOver; - return $labels; - } -} diff --git a/application/core/FML/Types/Actionable.php b/application/core/FML/Types/Actionable.php index ff563cf5..727f4475 100644 --- a/application/core/FML/Types/Actionable.php +++ b/application/core/FML/Types/Actionable.php @@ -12,7 +12,8 @@ interface Actionable { /** * Set action * - * @param string $action + * @param string $action + * Action Name */ public function setAction($action); } diff --git a/application/core/FML/Types/BgColorable.php b/application/core/FML/Types/BgColorable.php index 0c15d3ed..74314194 100644 --- a/application/core/FML/Types/BgColorable.php +++ b/application/core/FML/Types/BgColorable.php @@ -4,15 +4,16 @@ namespace FML\Types; /** * Interface for elements with background color attribute - * + * * @author steeffeen */ interface BgColorable { /** - * Set background color + * Set Background Color * - * @param string $bgColor + * @param string $bgColor + * Background Color */ public function setBgColor($bgColor); } diff --git a/application/core/FML/Types/Container.php b/application/core/FML/Types/Container.php index f75ef0ca..d478dcdd 100644 --- a/application/core/FML/Types/Container.php +++ b/application/core/FML/Types/Container.php @@ -10,14 +10,15 @@ namespace FML\Types; interface Container { /** - * Add a new child + * Add a new Child * - * @param Renderable $child + * @param Renderable $child + * The child to add */ public function add(Renderable $child); /** - * Remove all children + * Remove all Children */ public function removeChildren(); } diff --git a/application/core/FML/Types/Linkable.php b/application/core/FML/Types/Linkable.php index d8552fe4..d0f44878 100644 --- a/application/core/FML/Types/Linkable.php +++ b/application/core/FML/Types/Linkable.php @@ -10,16 +10,18 @@ namespace FML\Types; interface Linkable { /** - * Set url + * Set Url * - * @param string $url + * @param string $url + * Link Url */ public function setUrl($url); /** - * Set manialink + * Set Manialink * - * @param string $manialink + * @param string $manialink + * Manialink Name */ public function setManialink($manialink); } diff --git a/application/core/FML/Types/NewLineable.php b/application/core/FML/Types/NewLineable.php index fdead5a1..de259f12 100644 --- a/application/core/FML/Types/NewLineable.php +++ b/application/core/FML/Types/NewLineable.php @@ -10,9 +10,10 @@ namespace FML\Types; interface NewLineable { /** - * Set auto new line + * Set Auto New Line * - * @param bool $autoNewLine + * @param bool $autoNewLine + * If the Control should insert New Lines automatically */ public function setAutoNewLine($autoNewLine); } diff --git a/application/core/FML/Types/Playable.php b/application/core/FML/Types/Playable.php index 1e08b270..77a6c74c 100644 --- a/application/core/FML/Types/Playable.php +++ b/application/core/FML/Types/Playable.php @@ -10,37 +10,42 @@ namespace FML\Types; interface Playable { /** - * Set data + * Set Data * - * @param string $data + * @param string $data + * Media Url */ public function setData($data); /** - * Set play + * Set Play * - * @param bool $play + * @param bool $play + * If the Control should start playing automatically */ public function setPlay($play); /** - * Set looping + * Set Looping * - * @param bool $looping + * @param bool $looping + * If the Control should playback looping */ public function setLooping($looping); /** - * Set music + * Set Music * - * @param bool $music + * @param bool $music + * If the Control is Background Music */ public function setMusic($music); /** - * Set volume + * Set Volume * - * @param float $volume + * @param float $volume + * Control Volume */ public function setVolume($volume); } diff --git a/application/core/FML/Types/Renderable.php b/application/core/FML/Types/Renderable.php index c64f9996..c4f4f575 100644 --- a/application/core/FML/Types/Renderable.php +++ b/application/core/FML/Types/Renderable.php @@ -10,7 +10,7 @@ namespace FML\Types; interface Renderable { /** - * Render the xml element + * Render the XML Element * * @param \DOMDocument $domDocument * @return \DOMElement diff --git a/application/core/FML/Types/Scriptable.php b/application/core/FML/Types/Scriptable.php index 107fd5db..42145b8d 100644 --- a/application/core/FML/Types/Scriptable.php +++ b/application/core/FML/Types/Scriptable.php @@ -10,9 +10,10 @@ namespace FML\Types; interface Scriptable { /** - * Set scriptevents + * Set ScriptEvents * * @param bool $scriptEvents + * If Script Events should be enabled */ public function setScriptEvents($scriptEvents); } diff --git a/application/core/FML/Types/Styleable.php b/application/core/FML/Types/Styleable.php index f98dc078..91620f69 100644 --- a/application/core/FML/Types/Styleable.php +++ b/application/core/FML/Types/Styleable.php @@ -10,9 +10,10 @@ namespace FML\Types; interface Styleable { /** - * Set style + * Set Style * - * @param string $style + * @param string $style + * Style */ public function setStyle($style); } diff --git a/application/core/FML/Types/SubStyleable.php b/application/core/FML/Types/SubStyleable.php index c411c16a..15640a6f 100644 --- a/application/core/FML/Types/SubStyleable.php +++ b/application/core/FML/Types/SubStyleable.php @@ -12,15 +12,18 @@ interface SubStyleable { /** * Set SubStyle * - * @param string $subStyle + * @param string $subStyle + * Sub-Style */ public function setSubStyle($subStyle); /** * Set Style and SubStyle - * - * @param string $style - * @param string $subStyle + * + * @param string $style + * Style + * @param string $subStyle + * Sub-Style */ public function setStyles($style, $subStyle); } diff --git a/application/core/FML/Types/TextFormatable.php b/application/core/FML/Types/TextFormatable.php index 36ee78a5..ffed2cd0 100644 --- a/application/core/FML/Types/TextFormatable.php +++ b/application/core/FML/Types/TextFormatable.php @@ -10,30 +10,34 @@ namespace FML\Types; interface TextFormatable { /** - * Set text size + * Set Text Size * - * @param int $textSize + * @param int $textSize + * Text Size */ public function setTextSize($textSize); /** - * Set text color + * Set Text Color * - * @param string $textColor + * @param string $textColor + * Text Color */ public function setTextColor($textColor); /** - * Set area color + * Set Area Color * - * @param string $areaColor + * @param string $areaColor + * Area Text Color */ public function setAreaColor($areaColor); /** - * Set area focus color + * Set Area Focus Color * - * @param string $areaFocusColor + * @param string $areaFocusColor + * Focus Area Color */ public function setAreaFocusColor($areaFocusColor); }