fml update (1.2 final)

This commit is contained in:
Steffen Schröder 2014-05-20 15:44:45 +02:00
parent 63981d8002
commit 0fc03e1d08
77 changed files with 166 additions and 152 deletions

View File

@ -14,7 +14,7 @@ use FML\Types\ScriptFeatureable;
/**
* CheckBox Component
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -13,7 +13,7 @@ use FML\Types\ScriptFeatureable;
/**
* ValuePicker Component
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -19,7 +19,7 @@ use FML\Types\ScriptFeatureable;
* Base Control
* (CMlControl)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -1,5 +1,4 @@
<?php
// TODO: add entry styles
namespace FML\Controls;
@ -13,7 +12,7 @@ use FML\Types\TextFormatable;
* Entry Control
* (CMlEntry)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -6,7 +6,7 @@ namespace FML\Controls;
* FileEntry Control
* (CMlFileEntry)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -11,7 +11,7 @@ use FML\Types\ScriptFeatureable;
* Frame Control
* (CMlFrame)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -9,7 +9,7 @@ use FML\Types\Scriptable;
* Frame3d Control
* (CMlFrame)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -8,7 +8,7 @@ use FML\Elements\FrameModel;
* Class representing an Instance of a Frame Model
* (CMlFrame)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -8,7 +8,7 @@ use FML\Types\Styleable;
* Gauge Control
* (CMlGauge)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -14,7 +14,7 @@ use FML\Types\TextFormatable;
* Label Control
* (CMlLabel)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Label;
/**
* Label Class for Button Styles
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Label;
/**
* Label Class for Text Styles
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -14,7 +14,7 @@ use FML\Types\SubStyleable;
* Quad Control
* (CMlQuad)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'Icons128x128_1' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'Icons128x128_Blink' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'ManiaPlanetLogos' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'ManiaPlanetMainMenu' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'ManiaplanetSystem' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'MedalsBig' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'TitleLogos' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'UIConstruction_Buttons' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'UIConstruction_Buttons2' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Quad;
/**
* Quad Class for 'UiSMSpectatorScoreBig' Style
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -9,7 +9,7 @@ use FML\Types\Scriptable;
* Video Control
* (CMlMediaPlayer)
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Elements;
/**
* Dictionary Element
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -10,7 +10,7 @@ use FML\Types\TextFormatable;
/**
* Format Element
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -8,7 +8,7 @@ use FML\Types\Renderable;
/**
* Class representing a Frame Model
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Types\Renderable;
/**
* Include Element
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Types\Renderable;
/**
* Music Element
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Types\Renderable;
/**
* Class representing a ManiaLink Script Tag with a simple Script Text
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -22,7 +22,7 @@ use FML\ManiaCode\ViewReplay;
/**
* Class representing a ManiaCode
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element installing a Map
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element installing a Title Pack
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element installing a Replay
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element installing a Script
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element installing a Skin
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element joining a Server
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element playing a Map
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element playing a Replay
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element showing a Message
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\ManiaCode;
/**
* ManiaCode Element viewing a Replay
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -11,7 +11,7 @@ use FML\Types\ScriptFeatureable;
/**
* Class representing a ManiaLink
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML;
/**
* Class holding several ManiaLinks at once
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -11,7 +11,7 @@ use FML\Types\SubStyleable;
/**
* Class representing CheckBox Design
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Script;
/**
* Builder Class offering Methods to build ManiaScript
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
@ -111,11 +111,18 @@ abstract class Builder {
* Get the Include Command for the given File and Namespace
*
* @param string $file Include File
* @param string $namespace Include Namespace
* @param string $namespace (optional) Include Namespace
* @return string
*/
public static function getInclude($file, $namespace) {
$includeText = "#Include \"{$file}\" as {$namespace}" . PHP_EOL;
public static function getInclude($file, $namespace = null) {
if (!$namespace && stripos($file, '.') === false) {
$namespace = $file;
}
$includeText = "#Include \"{$file}\"";
if ($namespace) {
$includeText .= " as {$namespace}";
}
$includeText .= PHP_EOL;
return $includeText;
}

View File

@ -44,10 +44,12 @@ class CheckBoxFeature extends ScriptFeature {
*
* @param Quad $quad (optional) CheckBox Quad
* @param Entry $entry (optional) Hidden Entry
* @param bool $default (optional) Default Value
*/
public function __construct(Quad $quad = null, Entry $entry = null, $default = null) {
$this->setQuad($quad);
$this->setEntry($entry);
$this->setDefault($default);
$this->setEnabledDesign(CheckBoxDesign::defaultEnabledDesign());
$this->setDisabledDesign(CheckBoxDesign::defaultDisabledDesign());
}

View File

@ -44,10 +44,8 @@ class ControlScript extends ScriptFeature {
*/
public function setControl(Control $control) {
$control->checkId();
if ($control instanceof Scriptable) {
$control->setScriptEvents(true);
}
$this->control = $control;
$this->updateScriptEvents();
return $this;
}
@ -70,14 +68,31 @@ class ControlScript extends ScriptFeature {
*/
public function setLabelName($labelName) {
$this->labelName = $labelName;
$this->updateScriptEvents();
return $this;
}
/**
* Enable Script Events on the Control if needed
*/
protected function updateScriptEvents() {
if (!$this->control) {
return;
}
if (!ScriptLabel::isEventLabel($this->labelName)) {
return;
}
if ($this->control instanceof Scriptable) {
$this->control->setScriptEvents(true);
}
}
/**
* @see \FML\Script\Features\ScriptFeature::prepare()
*/
public function prepare(Script $script) {
$script->appendGenericScriptLabel($this->labelName, $this->buildScriptText(), true);
$isolated = !ScriptLabel::isEventLabel($this->labelName);
$script->appendGenericScriptLabel($this->labelName, $this->buildScriptText(), $isolated);
return $this;
}

View File

@ -63,7 +63,8 @@ class EntrySubmit extends ScriptFeature {
*/
public function prepare(Script $script) {
$script->setScriptInclude(ScriptInclude::TEXTLIB);
$script->appendGenericScriptLabel(ScriptLabel::ENTRYSUBMIT, $this->getScriptText());
$controlScript = new ControlScript($this->entry, $this->getScriptText(), ScriptLabel::ENTRYSUBMIT);
$controlScript->prepare($script);
return $this;
}
@ -73,15 +74,12 @@ class EntrySubmit extends ScriptFeature {
* @return string
*/
protected function getScriptText() {
$controlId = $this->entry->getId(true);
$url = $this->buildCompatibleUrl();
$entryName = Builder::escapeText($this->entry->getName());
$scriptText = "
if (Event.Control.ControlId == \"{$controlId}\") {
declare Entry <=> (Event.Control as CMlEntry);
declare Value = TextLib::URLEncode(Entry.Value);
OpenLink(\"{$url}{$entryName}=\"^Value, CMlScript::LinkType::Goto);
}";
declare Value = TextLib::URLEncode(Entry.Value);
OpenLink(\"{$url}{$entryName}=\"^Value, CMlScript::LinkType::Goto);
";
return $scriptText;
}

View File

@ -8,7 +8,7 @@ use FML\Types\Scriptable;
/**
* An Element for the Menu Feature
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -12,7 +12,7 @@ use FML\Script\ScriptLabel;
/**
* Script Feature realising a Mechanism for browsing through Pages
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -8,7 +8,7 @@ use FML\Types\Scriptable;
/**
* A Button for browsing through Pages
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Controls\Control;
/**
* A Page Control
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -11,7 +11,7 @@ use FML\Types\Scriptable;
/**
* Script Feature for opening a Player Profile
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -8,7 +8,7 @@ use FML\Types\ScriptFeatureable;
/**
* ManiaLink Script Feature Class
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -10,7 +10,7 @@ use FML\Types\Scriptable;
/**
* Script Feature for toggling Controls
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -12,7 +12,7 @@ use FML\Types\Scriptable;
/**
* Script Feature for Showing Tooltips
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -11,7 +11,7 @@ use FML\Types\Scriptable;
/**
* Script Feature for playing an UI Sound
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -12,7 +12,7 @@ use FML\Script\ScriptLabel;
/**
* Script Feature for creating a ValuePicker Behavior
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
@ -50,29 +50,6 @@ class ValuePickerFeature extends ScriptFeature {
$this->setDefault($default);
}
/**
* Set the possible Values
*
* @param array $values Possible Values
* @return \FML\Script\Features\ValuePickerFeature
*/
public function setValues(array $values) {
$this->values = array();
foreach ($values as $value) {
array_push($this->values, (string)$value);
}
return $this;
}
/**
* Get the ValuePicker Label
*
* @return \FML\Controls\Label
*/
public function getLabel() {
return $this->label;
}
/**
* Set the ValuePicker Label
*
@ -89,12 +66,12 @@ class ValuePickerFeature extends ScriptFeature {
}
/**
* Get the hidden Entry
* Get the ValuePicker Label
*
* @return \FML\Controls\Entry
* @return \FML\Controls\Label
*/
public function getEntry() {
return $this->entry;
public function getLabel() {
return $this->label;
}
/**
@ -111,6 +88,54 @@ class ValuePickerFeature extends ScriptFeature {
return $this;
}
/**
* Get the hidden Entry
*
* @return \FML\Controls\Entry
*/
public function getEntry() {
return $this->entry;
}
/**
* Set the possible Values
*
* @param array $values Possible Values
* @return \FML\Script\Features\ValuePickerFeature
*/
public function setValues(array $values) {
$this->values = array();
foreach ($values as $value) {
array_push($this->values, (string)$value);
}
return $this;
}
/**
* Set the default Value
*
* @param string $default Default Value
* @return \FML\Script\Features\ValuePickerFeature
*/
public function setDefault($default) {
$this->default = (string)$default;
}
/**
* Get the default Value
*
* @return string
*/
public function getDefault() {
if ($this->default) {
return $this->default;
}
if ($this->values) {
return reset($this->values);
}
return null;
}
/**
* @see \FML\Script\Features\ScriptFeature::prepare()
*/
@ -186,31 +211,6 @@ EntryId = \"{$entryId}\";
return $scriptText;
}
/**
* Get the default Value
*
* @return string
*/
public function getDefault() {
if ($this->default) {
return $this->default;
}
if ($this->values) {
return reset($this->values);
}
return null;
}
/**
* Set the default Value
*
* @param string $default Default Value
* @return \FML\Script\Features\ValuePickerFeature
*/
public function setDefault($default) {
$this->default = (string)$default;
}
/**
* Build the Script Text for Label Clicks
*

View File

@ -7,7 +7,7 @@ use FML\Script\Features\ScriptFeature;
/**
* Class representing the ManiaLink Script
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Script;
/**
* Class representing a Constant of the ManiaLink Script
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Script;
/**
* Class representing a Function of the ManiaLink Script
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -30,14 +30,7 @@ class ScriptInclude {
*/
public function __construct($file = null, $namespace = null) {
$this->setFile($file);
if ($namespace) {
$this->setNamespace($namespace);
} else {
$fileParts = explode('.', $file);
if (count($fileParts) === 1) {
$this->setNamespace($file);
}
}
}
/**
@ -47,7 +40,7 @@ class ScriptInclude {
* @return \FML\Script\ScriptInclude
*/
public function setFile($file) {
$this->file = $file;
$this->file = (string)$file;
return $this;
}
@ -58,7 +51,7 @@ class ScriptInclude {
* @return \FML\Script\ScriptInclude
*/
public function setNamespace($namespace) {
$this->namespace = $namespace;
$this->namespace = (string)$namespace;
return $this;
}

View File

@ -5,7 +5,7 @@ namespace FML\Script;
/**
* Class representing a Part of the ManiaLink Script
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -8,7 +8,7 @@ namespace FML\Stylesheet;
/**
* Class representing a Stylesheets Mood
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Stylesheet;
/**
* Class representing a specific Style3d
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Stylesheet;
/**
* Class representing the ManiaLinks Stylesheet
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -7,7 +7,7 @@ use FML\Elements\Format;
/**
* Interface for Element being able to contain other Controls
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for Elements with Url Attributes
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for Elements with AutoNewLine Attribute
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for Elements with Media Attributes
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for renderable Elements
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for Elements supporting Script Features
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for Elements with ScriptEvents Attribute
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for Elements with Style Attribute
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for Elements with SubStyle Attribute
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -5,7 +5,7 @@ namespace FML\Types;
/**
* Interface for Elements with Formatable Text
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/

View File

@ -3,7 +3,7 @@
/**
* FancyManiaLinks - Automatic ManiaLink Generator Framework
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @version 1.2
* @link http://github.com/steeffeen/FancyManiaLinks
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder