FML Update 1.4
This commit is contained in:
parent
44cc71c328
commit
300d817409
@ -69,7 +69,7 @@ class CheckBox implements Renderable, ScriptFeatureable {
|
||||
* @return static
|
||||
*/
|
||||
public function setEnabledDesign($style, $subStyle = null) {
|
||||
if (is_object($style) && ($style instanceof CheckBoxDesign)) {
|
||||
if ($style instanceof CheckBoxDesign) {
|
||||
$this->feature->setEnabledDesign($style);
|
||||
} else {
|
||||
$checkBoxDesign = new CheckBoxDesign($style, $subStyle);
|
||||
@ -86,7 +86,7 @@ class CheckBox implements Renderable, ScriptFeatureable {
|
||||
* @return static
|
||||
*/
|
||||
public function setDisabledDesign($style, $subStyle = null) {
|
||||
if (is_object($style) && ($style instanceof CheckBoxDesign)) {
|
||||
if ($style instanceof CheckBoxDesign) {
|
||||
$this->feature->setDisabledDesign($style);
|
||||
} else {
|
||||
$checkBoxDesign = new CheckBoxDesign($style, $subStyle);
|
||||
|
@ -71,7 +71,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
* @param string $controlId (optional) Control id
|
||||
*/
|
||||
public function __construct($controlId = null) {
|
||||
if (!is_null($controlId)) {
|
||||
if ($controlId !== null) {
|
||||
$this->setId($controlId);
|
||||
}
|
||||
}
|
||||
@ -141,7 +141,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
public function setPosition($posX, $posY, $posZ = null) {
|
||||
$this->setX($posX);
|
||||
$this->setY($posY);
|
||||
if (!is_null($posZ)) {
|
||||
if ($posZ !== null) {
|
||||
$this->setZ($posZ);
|
||||
}
|
||||
return $this;
|
||||
@ -325,7 +325,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
|
||||
* @return static
|
||||
*/
|
||||
public function addActionTriggerFeature($actionName, $eventLabel = ScriptLabel::MOUSECLICK) {
|
||||
if (is_object($actionName) && ($actionName instanceof ActionTrigger)) {
|
||||
if ($actionName instanceof ActionTrigger) {
|
||||
$this->addScriptFeature($actionName);
|
||||
} else {
|
||||
$actionTrigger = new ActionTrigger($actionName, $this, $eventLabel);
|
||||
|
@ -175,7 +175,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
|
||||
if ($this->name) {
|
||||
$xmlElement->setAttribute('name', $this->name);
|
||||
}
|
||||
if (!is_null($this->default)) {
|
||||
if ($this->default !== null) {
|
||||
$xmlElement->setAttribute('default', $this->default);
|
||||
} else if ($this->autoComplete) {
|
||||
$value = null;
|
||||
|
@ -40,7 +40,7 @@ class FrameInstance extends Control {
|
||||
*/
|
||||
public function __construct($modelId = null, $controlId = null) {
|
||||
parent::__construct($controlId);
|
||||
if (!is_null($modelId)) {
|
||||
if ($modelId !== null) {
|
||||
$this->setModelId($modelId);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ class Gauge extends Control implements Styleable {
|
||||
protected $ratio = 0.;
|
||||
protected $grading = 1.;
|
||||
protected $color = null;
|
||||
protected $rotation = 0.;
|
||||
protected $centered = null;
|
||||
protected $clan = null;
|
||||
protected $drawBg = 1;
|
||||
@ -75,17 +74,6 @@ class Gauge extends Control implements Styleable {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set rotation
|
||||
*
|
||||
* @param float $rotation Gauge rotation
|
||||
* @return static
|
||||
*/
|
||||
public function setRotation($rotation) {
|
||||
$this->rotation = (float)$rotation;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set centered
|
||||
*
|
||||
@ -152,9 +140,6 @@ class Gauge extends Control implements Styleable {
|
||||
if ($this->color) {
|
||||
$xmlElement->setAttribute('color', $this->color);
|
||||
}
|
||||
if ($this->rotation) {
|
||||
$xmlElement->setAttribute('rotation', $this->rotation);
|
||||
}
|
||||
if ($this->centered) {
|
||||
$xmlElement->setAttribute('centered', $this->centered);
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ class Quad_Bgs1 extends Quad {
|
||||
const SUBSTYLE_BgColorContour = 'BgColorContour';
|
||||
const SUBSTYLE_BgDialogBlur = 'BgDialogBlur';
|
||||
const SUBSTYLE_BgEmpty = 'BgEmpty';
|
||||
const SUBSTYLE_BgGlow2 = 'BgGlow2';
|
||||
const SUBSTYLE_BgGradBottom = 'BgGradBottom';
|
||||
const SUBSTYLE_BgGradLeft = 'BgGradLeft';
|
||||
const SUBSTYLE_BgGradRight = 'BgGradRight';
|
||||
@ -53,11 +54,13 @@ class Quad_Bgs1 extends Quad {
|
||||
const SUBSTYLE_BgIconBorder = 'BgIconBorder';
|
||||
const SUBSTYLE_BgList = 'BgList';
|
||||
const SUBSTYLE_BgListLine = 'BgListLine';
|
||||
const SUBSTYLE_BgMetalBar = 'BgMetalBar';
|
||||
const SUBSTYLE_BgPager = 'BgPager';
|
||||
const SUBSTYLE_BgProgressBar = 'BgProgressBar';
|
||||
const SUBSTYLE_BgShadow = 'BgShadow';
|
||||
const SUBSTYLE_BgSlider = 'BgSlider';
|
||||
const SUBSTYLE_BgSystemBar = 'BgSystemBar';
|
||||
const SUBSTYLE_BgTitle = 'BgTitle';
|
||||
const SUBSTYLE_BgTitle2 = 'BgTitle2';
|
||||
const SUBSTYLE_BgTitle3 = 'BgTitle3';
|
||||
const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1';
|
||||
|
@ -44,6 +44,7 @@ class Quad_Bgs1InRace extends Quad {
|
||||
const SUBSTYLE_BgColorContour = 'BgColorContour';
|
||||
const SUBSTYLE_BgDialogBlur = 'BgDialogBlur';
|
||||
const SUBSTYLE_BgEmpty = 'BgEmpty';
|
||||
const SUBSTYLE_BgGlow2 = 'BgGlow2';
|
||||
const SUBSTYLE_BgGradBottom = 'BgGradBottom';
|
||||
const SUBSTYLE_BgGradLeft = 'BgGradLeft';
|
||||
const SUBSTYLE_BgGradRight = 'BgGradRight';
|
||||
@ -53,11 +54,13 @@ class Quad_Bgs1InRace extends Quad {
|
||||
const SUBSTYLE_BgIconBorder = 'BgIconBorder';
|
||||
const SUBSTYLE_BgList = 'BgList';
|
||||
const SUBSTYLE_BgListLine = 'BgListLine';
|
||||
const SUBSTYLE_BgMetalBar = 'BgMetalBar';
|
||||
const SUBSTYLE_BgPager = 'BgPager';
|
||||
const SUBSTYLE_BgProgressBar = 'BgProgressBar';
|
||||
const SUBSTYLE_BgShadow = 'BgShadow';
|
||||
const SUBSTYLE_BgSlider = 'BgSlider';
|
||||
const SUBSTYLE_BgSystemBar = 'BgSystemBar';
|
||||
const SUBSTYLE_BgTitle = 'BgTitle';
|
||||
const SUBSTYLE_BgTitle2 = 'BgTitle2';
|
||||
const SUBSTYLE_BgTitle3 = 'BgTitle3';
|
||||
const SUBSTYLE_BgTitle3_1 = 'BgTitle3_1';
|
||||
|
@ -21,6 +21,7 @@ class Quad_BgsButtons extends Quad {
|
||||
const SUBSTYLE_BgButtonMediumSelector = 'BgButtonMediumSelector';
|
||||
const SUBSTYLE_BgButtonMediumSpecial = 'BgButtonMediumSpecial';
|
||||
const SUBSTYLE_BgButtonSmall = 'BgButtonSmall';
|
||||
const SUBSTYLE_BgButtonSmall2 = 'BgButtonSmall2';
|
||||
const SUBSTYLE_BgButtonXSmall = 'BgButtonXSmall';
|
||||
|
||||
/*
|
||||
|
@ -16,6 +16,10 @@ class Quad_Icons128x32_1 extends Quad {
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons128x32_1';
|
||||
const SUBSTYLE_ArrowUp = 'ArrowUp';
|
||||
const SUBSTYLE_BgQuadWhite = 'BgQuadWhite';
|
||||
// TODO: validate existence of 'close'
|
||||
const SUBSTYLE_Close = 'Close';
|
||||
const SUBSTYLE_Empty = 'Empty';
|
||||
const SUBSTYLE_ManiaLinkHome = 'ManiaLinkHome';
|
||||
const SUBSTYLE_ManiaLinkSwitch = 'ManiaLinkSwitch';
|
||||
|
@ -18,6 +18,7 @@ class Quad_Icons64x64_2 extends Quad {
|
||||
const STYLE = 'Icons64x64_2';
|
||||
const SUBSTYLE_ArrowElimination = 'ArrowElimination';
|
||||
const SUBSTYLE_ArrowHit = 'ArrowHit';
|
||||
const SUBSTYLE_Calendar = 'Calendar';
|
||||
const SUBSTYLE_Disconnected = 'Disconnected';
|
||||
const SUBSTYLE_DisconnectedLight = 'DisconnectedLight';
|
||||
const SUBSTYLE_LaserElimination = 'LaserElimination';
|
||||
|
@ -35,6 +35,7 @@ class Quad_UIConstruction_Buttons extends Quad {
|
||||
const SUBSTYLE_Down = 'Down';
|
||||
const SUBSTYLE_Drive = 'Drive';
|
||||
const SUBSTYLE_Erase = 'Erase';
|
||||
const SUBSTYLE_FreeItems = 'FreeItems';
|
||||
const SUBSTYLE_GhostBlocks = 'GhostBlocks';
|
||||
const SUBSTYLE_Help = 'Help';
|
||||
const SUBSTYLE_Item = 'Item';
|
||||
|
@ -150,7 +150,7 @@ class CustomUI {
|
||||
}
|
||||
$settings = $this->getSettings();
|
||||
foreach ($settings as $setting => $value) {
|
||||
if (is_null($value)) {
|
||||
if ($value === null) {
|
||||
continue;
|
||||
}
|
||||
$xmlSubElement = $domDocument->createElement($setting);
|
||||
|
@ -34,7 +34,7 @@ class Including implements Renderable {
|
||||
* @param string $url (optional) Include url
|
||||
*/
|
||||
public function __construct($url = null) {
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class Music implements Renderable {
|
||||
* @param string $data (optional) Media url
|
||||
*/
|
||||
public function __construct($data = null) {
|
||||
if (!is_null($data)) {
|
||||
if ($data !== null) {
|
||||
$this->setData($data);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class SimpleScript implements Renderable {
|
||||
* @param string $text (optional) Script text
|
||||
*/
|
||||
public function __construct($text = null) {
|
||||
if (!is_null($text)) {
|
||||
if ($text !== null) {
|
||||
$this->setText($text);
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class AddBuddy extends Element {
|
||||
* @param string $login (optional) Buddy login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if (!is_null($login)) {
|
||||
if ($login !== null) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class AddFavorite extends Element {
|
||||
* @param string $login (optional) Server login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if (!is_null($login)) {
|
||||
if ($login !== null) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
@ -71,7 +71,7 @@ class AddFavorite extends Element {
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if (is_null($this->serverIp)) {
|
||||
if ($this->serverIp === null) {
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
} else {
|
||||
|
@ -38,13 +38,13 @@ class GetSkin extends Element {
|
||||
* @param string $url (optional) Skin url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($file)) {
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class Go_To extends Element {
|
||||
* @param string $link (optional) Goto link
|
||||
*/
|
||||
public function __construct($link = null) {
|
||||
if (!is_null($link)) {
|
||||
if ($link !== null) {
|
||||
$this->setLink($link);
|
||||
}
|
||||
}
|
||||
|
@ -37,13 +37,13 @@ class InstallMacroblock extends Element {
|
||||
* @param string $url (optional) Macroblock url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($file)) {
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -35,10 +35,10 @@ class InstallMap extends Element {
|
||||
* @param string $url (optional) Map url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -38,13 +38,13 @@ class InstallPack extends Element {
|
||||
* @param string $url (optional) Pack url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($file)) {
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -35,10 +35,10 @@ class InstallReplay extends Element {
|
||||
* @param string $url (optional) Replay url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name!== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url!== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -38,13 +38,13 @@ class InstallScript extends Element {
|
||||
* @param string $url (optional) Script url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($file)) {
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -38,13 +38,13 @@ class InstallSkin extends Element {
|
||||
* @param string $url (optional) Skin url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($file)) {
|
||||
if ($file !== null) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class JoinServer extends Element {
|
||||
* @param string $login (optional) Server login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if (!is_null($login)) {
|
||||
if ($login !== null) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
@ -71,7 +71,7 @@ class JoinServer extends Element {
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if (is_null($this->serverIp)) {
|
||||
if ($this->serverIp === null) {
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
} else {
|
||||
|
@ -35,10 +35,10 @@ class PlayMap extends Element {
|
||||
* @param string $url (optional) Map url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -35,10 +35,10 @@ class PlayReplay extends Element {
|
||||
* @param string $url (optional) Replay url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class ShowMessage extends Element {
|
||||
* @param string $message (optional) Message text
|
||||
*/
|
||||
public function __construct($message = null) {
|
||||
if (!is_null($message)) {
|
||||
if ($message !== null) {
|
||||
$this->setMessage($message);
|
||||
}
|
||||
}
|
||||
|
@ -35,10 +35,10 @@ class ViewReplay extends Element {
|
||||
* @param string $url (optional) Replay url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if (!is_null($name)) {
|
||||
if ($name !== null) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if (!is_null($url)) {
|
||||
if ($url !== null) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
@ -49,21 +49,30 @@ class ManiaLink {
|
||||
* Create a new ManiaLink object
|
||||
*
|
||||
* @param string $maniaLinkId (optional) ManiaLink id
|
||||
* @param string $maniaLinkName (optional) ManiaLink Name
|
||||
* @return static
|
||||
*/
|
||||
public static function create($maniaLinkId = null) {
|
||||
return new static($maniaLinkId);
|
||||
public static function create($maniaLinkId = null, $maniaLinkName = null) {
|
||||
return new static($maniaLinkId, $maniaLinkName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new ManiaLink object
|
||||
*
|
||||
* @param string $maniaLinkId (optional) ManiaLink id
|
||||
* @param string $maniaLinkName (optional) ManiaLink Name
|
||||
*/
|
||||
public function __construct($maniaLinkId = null) {
|
||||
if (!is_null($maniaLinkId)) {
|
||||
public function __construct($maniaLinkId = null, $maniaLinkName = null) {
|
||||
if ($maniaLinkId !== null) {
|
||||
$this->setId($maniaLinkId);
|
||||
}
|
||||
if ($maniaLinkName !== false) {
|
||||
if ($maniaLinkName) {
|
||||
$this->setName($maniaLinkName);
|
||||
} else {
|
||||
$this->setName($maniaLinkId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ class CheckBoxDesign implements Styleable, SubStyleable {
|
||||
* @param string $subStyle (optional) SubStyle name
|
||||
*/
|
||||
public function __construct($style, $subStyle = null) {
|
||||
if (is_null($subStyle)) {
|
||||
if ($subStyle === null) {
|
||||
$this->setImageUrl($style);
|
||||
} else {
|
||||
$this->setStyle($style);
|
||||
@ -116,7 +116,7 @@ class CheckBoxDesign implements Styleable, SubStyleable {
|
||||
* @return string
|
||||
*/
|
||||
public function getDesignString($escaped = true, $addApostrophes = true) {
|
||||
if (!is_null($this->url)) {
|
||||
if ($this->url !== null) {
|
||||
$string = $this->url;
|
||||
} else {
|
||||
$string = $this->style . '|' . $this->subStyle;;
|
||||
|
@ -32,13 +32,13 @@ class ActionTrigger extends ScriptFeature {
|
||||
* @param string $labelName (optional) Script Label name
|
||||
*/
|
||||
public function __construct($actionName = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK) {
|
||||
if (!is_null($actionName)) {
|
||||
if ($actionName !== null) {
|
||||
$this->setActionName($actionName);
|
||||
}
|
||||
if (!is_null($control)) {
|
||||
if ($control !== null) {
|
||||
$this->setControl($control);
|
||||
}
|
||||
if (!is_null($labelName)) {
|
||||
if ($labelName !== null) {
|
||||
$this->setLabelName($labelName);
|
||||
}
|
||||
}
|
||||
|
@ -47,13 +47,13 @@ class CheckBoxFeature extends ScriptFeature {
|
||||
* @param bool $default (optional) Default value
|
||||
*/
|
||||
public function __construct(Quad $quad = null, Entry $entry = null, $default = null) {
|
||||
if (!is_null($quad)) {
|
||||
if ($quad !== null) {
|
||||
$this->setQuad($quad);
|
||||
}
|
||||
if (!is_null($entry)) {
|
||||
if ($entry !== null) {
|
||||
$this->setEntry($entry);
|
||||
}
|
||||
if (!is_null($default)) {
|
||||
if ($default !== null) {
|
||||
$this->setDefault($default);
|
||||
}
|
||||
$this->setEnabledDesign(CheckBoxDesign::defaultEnabledDesign());
|
||||
|
@ -31,7 +31,7 @@ class Clock extends ScriptFeature {
|
||||
* @param bool $showFullDate (optional) Whether the date should be shown
|
||||
*/
|
||||
public function __construct(Label $label = null, $showSeconds = true, $showFullDate = false) {
|
||||
if (!is_null($label)) {
|
||||
if ($label !== null) {
|
||||
$this->setLabel($label);
|
||||
}
|
||||
$this->setShowSeconds($showSeconds);
|
||||
|
@ -30,7 +30,7 @@ class EntrySubmit extends ScriptFeature {
|
||||
* @param string $url (optional) Submit url
|
||||
*/
|
||||
public function __construct(Entry $entry = null, $url = null) {
|
||||
if (!is_null($entry)) {
|
||||
if ($entry !== null) {
|
||||
$this->setEntry($entry);
|
||||
}
|
||||
$this->setUrl($url);
|
||||
|
@ -30,10 +30,10 @@ class KeyAction extends ScriptFeature {
|
||||
* @param string $keyName (optional) Key name
|
||||
*/
|
||||
public function __construct($actionName = null, $keyName = null) {
|
||||
if (!is_null($actionName)) {
|
||||
if ($actionName !== null) {
|
||||
$this->setActionName($actionName);
|
||||
}
|
||||
if (!is_null($keyName)) {
|
||||
if ($keyName !== null) {
|
||||
$this->setKeyName($keyName);
|
||||
}
|
||||
}
|
||||
@ -105,13 +105,13 @@ class KeyAction extends ScriptFeature {
|
||||
$actionName = Builder::escapeText($this->actionName, true);
|
||||
$key = null;
|
||||
$value = null;
|
||||
if (!is_null($this->keyName)) {
|
||||
if ($this->keyName !== null) {
|
||||
$key = 'KeyName';
|
||||
$value = $this->keyName;
|
||||
} else if (!is_null($this->keyCode)) {
|
||||
} else if ($this->keyCode !== null) {
|
||||
$key = 'KeyCode';
|
||||
$value = $this->keyCode;
|
||||
} else if (!is_null($this->charPressed)) {
|
||||
} else if ($this->charPressed !== null) {
|
||||
$key = 'CharPressed';
|
||||
$value = $this->charPressed;
|
||||
}
|
||||
|
@ -26,10 +26,10 @@ class MenuElement {
|
||||
* @param Control $control (optional) Toggled Menu Control
|
||||
*/
|
||||
public function __construct(Control $item = null, Control $control = null) {
|
||||
if (!is_null($item)) {
|
||||
if ($item !== null) {
|
||||
$this->setItem($item);
|
||||
}
|
||||
if (!is_null($control)) {
|
||||
if ($control !== null) {
|
||||
$this->setControl($control);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class Paging extends ScriptFeature {
|
||||
* @param Label $label (optional) Page number Label
|
||||
*/
|
||||
public function __construct(Label $label = null) {
|
||||
if (!is_null($label)) {
|
||||
if ($label !== null) {
|
||||
$this->setLabel($label);
|
||||
}
|
||||
}
|
||||
@ -57,7 +57,7 @@ class Paging extends ScriptFeature {
|
||||
* @return static
|
||||
*/
|
||||
public function addPage(Control $pageControl, $pageNumber = null) {
|
||||
if (is_null($pageNumber)) {
|
||||
if ($pageNumber === null) {
|
||||
$pageNumber = count($this->pages) + 1;
|
||||
}
|
||||
$page = new PagingPage($pageControl, $pageNumber);
|
||||
@ -86,7 +86,7 @@ class Paging extends ScriptFeature {
|
||||
* @return static
|
||||
*/
|
||||
public function addButton(Control $buttonControl, $browseAction = null) {
|
||||
if (is_null($browseAction)) {
|
||||
if ($browseAction === null) {
|
||||
$buttonCount = count($this->buttons);
|
||||
if ($buttonCount % 2 === 0) {
|
||||
$browseAction = $buttonCount / 2 + 1;
|
||||
@ -288,7 +288,7 @@ Void {$updatePageFunction}(Text _PagingId, Text _PageLabelId, Integer _BrowseAct
|
||||
$minPage = null;
|
||||
foreach ($this->pages as $page) {
|
||||
$pageNumber = $page->getPageNumber();
|
||||
if (is_null($minPageNumber) || $pageNumber < $minPageNumber) {
|
||||
if ($minPageNumber === null || $pageNumber < $minPageNumber) {
|
||||
$minPageNumber = $pageNumber;
|
||||
$minPage = $page;
|
||||
}
|
||||
@ -306,7 +306,7 @@ Void {$updatePageFunction}(Text _PagingId, Text _PageLabelId, Integer _BrowseAct
|
||||
$maxPage = null;
|
||||
foreach ($this->pages as $page) {
|
||||
$pageNumber = $page->getPageNumber();
|
||||
if (is_null($maxPageNumber) || $pageNumber > $maxPageNumber) {
|
||||
if ($maxPageNumber === null || $pageNumber > $maxPageNumber) {
|
||||
$maxPageNumber = $pageNumber;
|
||||
$maxPage = $page;
|
||||
}
|
||||
|
@ -27,10 +27,10 @@ class PagingButton {
|
||||
* @param int $browseAction (optional) Number of browsed Pages per Click
|
||||
*/
|
||||
public function __construct(Control $control = null, $browseAction = null) {
|
||||
if (!is_null($control)) {
|
||||
if ($control !== null) {
|
||||
$this->setControl($control);
|
||||
}
|
||||
if (!is_null($browseAction)) {
|
||||
if ($browseAction !== null) {
|
||||
$this->setBrowseAction($browseAction);
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ class PagingPage {
|
||||
* @param int $pageNumber (optional) Number of the Page
|
||||
*/
|
||||
public function __construct(Control $control = null, $pageNumber = 1) {
|
||||
if (!is_null($control)) {
|
||||
if ($control !== null) {
|
||||
$this->setControl($control);
|
||||
}
|
||||
$this->setPageNumber($pageNumber);
|
||||
|
@ -33,7 +33,7 @@ class PlayerProfile extends ScriptFeature {
|
||||
*/
|
||||
public function __construct($login = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK) {
|
||||
$this->setLogin($login);
|
||||
if (!is_null($control)) {
|
||||
if ($control !== null) {
|
||||
$this->setControl($control);
|
||||
}
|
||||
$this->setLabelName($labelName);
|
||||
|
@ -37,10 +37,10 @@ class Toggle extends ScriptFeature {
|
||||
*/
|
||||
public function __construct(Control $togglingControl = null, Control $toggledControl = null, $labelName = ScriptLabel::MOUSECLICK,
|
||||
$onlyShow = false, $onlyHide = false) {
|
||||
if (!is_null($togglingControl)) {
|
||||
if ($togglingControl !== null) {
|
||||
$this->setTogglingControl($togglingControl);
|
||||
}
|
||||
if (!is_null($toggledControl)) {
|
||||
if ($toggledControl !== null) {
|
||||
$this->setToggledControl($toggledControl);
|
||||
}
|
||||
$this->setLabelName($labelName);
|
||||
|
@ -38,15 +38,15 @@ class Tooltip extends ScriptFeature {
|
||||
* @param string $text (optional) Text to display if the TooltipControl is a Label
|
||||
*/
|
||||
public function __construct(Control $hoverControl = null, Control $tooltipControl = null, $stayOnClick = false, $invert = false, $text = null) {
|
||||
if (!is_null($hoverControl)) {
|
||||
if ($hoverControl !== null) {
|
||||
$this->setHoverControl($hoverControl);
|
||||
}
|
||||
if (!is_null($tooltipControl)) {
|
||||
if ($tooltipControl !== null) {
|
||||
$this->setTooltipControl($tooltipControl);
|
||||
}
|
||||
$this->setStayOnClick($stayOnClick);
|
||||
$this->setInvert($invert);
|
||||
if (!is_null($text)) {
|
||||
if ($text !== null) {
|
||||
$this->setText($text);
|
||||
}
|
||||
}
|
||||
|
@ -68,10 +68,10 @@ class UISound extends ScriptFeature {
|
||||
* @param string $labelName (optional) Script Label name
|
||||
*/
|
||||
public function __construct($soundName = null, Control $control = null, $variant = 0, $labelName = ScriptLabel::MOUSECLICK) {
|
||||
if (!is_null($soundName)) {
|
||||
if ($soundName !== null) {
|
||||
$this->setSoundName($soundName);
|
||||
}
|
||||
if (!is_null($control)) {
|
||||
if ($control !== null) {
|
||||
$this->setControl($control);
|
||||
}
|
||||
$this->setVariant($variant);
|
||||
|
@ -44,16 +44,16 @@ class ValuePickerFeature extends ScriptFeature {
|
||||
* @param string $default (optional) Default value
|
||||
*/
|
||||
public function __construct(Label $label = null, Entry $entry = null, array $values = array(), $default = null) {
|
||||
if (!is_null($label)) {
|
||||
if ($label !== null) {
|
||||
$this->setLabel($label);
|
||||
}
|
||||
if (!is_null($entry)) {
|
||||
if ($entry !== null) {
|
||||
$this->setEntry($entry);
|
||||
}
|
||||
if (!empty($values)) {
|
||||
$this->setValues($values);
|
||||
}
|
||||
if (!is_null($default)) {
|
||||
if ($default !== null) {
|
||||
$this->setDefault($default);
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class Script {
|
||||
* @return static
|
||||
*/
|
||||
public function setScriptInclude($file, $namespace = null) {
|
||||
if (is_object($file) && ($file instanceof ScriptInclude)) {
|
||||
if ($file instanceof ScriptInclude) {
|
||||
$scriptInclude = $file;
|
||||
} else {
|
||||
$scriptInclude = new ScriptInclude($file, $namespace);
|
||||
@ -56,7 +56,7 @@ class Script {
|
||||
* @return static
|
||||
*/
|
||||
public function addScriptConstant($name, $value = null) {
|
||||
if (is_object($name) && ($name instanceof ScriptConstant)) {
|
||||
if ($name instanceof ScriptConstant) {
|
||||
$scriptConstant = $name;
|
||||
} else {
|
||||
$scriptConstant = new ScriptConstant($name, $value);
|
||||
@ -75,7 +75,7 @@ class Script {
|
||||
* @return static
|
||||
*/
|
||||
public function addScriptFunction($name, $text = null) {
|
||||
if (is_object($name) && ($name instanceof ScriptFunction)) {
|
||||
if ($name instanceof ScriptFunction) {
|
||||
$scriptFunction = $name;
|
||||
} else {
|
||||
$scriptFunction = new ScriptFunction($name, $text);
|
||||
@ -94,7 +94,7 @@ class Script {
|
||||
* @return static
|
||||
*/
|
||||
public function addCustomScriptLabel($name, $text = null) {
|
||||
if (is_object($name) && ($name instanceof ScriptLabel)) {
|
||||
if ($name instanceof ScriptLabel) {
|
||||
$scriptLabel = $name;
|
||||
} else {
|
||||
$scriptLabel = new ScriptLabel($name, $text);
|
||||
@ -112,7 +112,7 @@ class Script {
|
||||
* @return static
|
||||
*/
|
||||
public function appendGenericScriptLabel($name, $text = null, $isolated = false) {
|
||||
if (is_object($name) && ($name instanceof ScriptLabel)) {
|
||||
if ($name instanceof ScriptLabel) {
|
||||
$scriptLabel = $name;
|
||||
} else {
|
||||
$scriptLabel = new ScriptLabel($name, $text, $isolated);
|
||||
@ -218,7 +218,11 @@ class Script {
|
||||
*/
|
||||
protected function getHeaderComment() {
|
||||
$headerComment = '/****************************************************
|
||||
* FancyManiaLinks v' . FML_VERSION . ' by steeffeen *
|
||||
* FancyManiaLinks';
|
||||
if (defined('FML_VERSION')) {
|
||||
$headerComment .= ' v' . FML_VERSION;
|
||||
}
|
||||
$headerComment .= ' by steeffeen *
|
||||
* http://github.com/steeffeen/FancyManiaLinks *
|
||||
****************************************************/
|
||||
|
||||
|
@ -53,7 +53,7 @@ class Style3d {
|
||||
* @param string $styleId (optional) Style id
|
||||
*/
|
||||
public function __construct($styleId = null) {
|
||||
if (!is_null($styleId)) {
|
||||
if ($styleId !== null) {
|
||||
$this->setId($styleId);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class UniqueID {
|
||||
*/
|
||||
protected static $currentIndex = 0;
|
||||
|
||||
/**
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
protected $index = null;
|
||||
|
@ -4,16 +4,16 @@
|
||||
* FancyManiaLinks - Automatic ManiaLink Generator Framework
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @version 1.3
|
||||
* @version 1.4
|
||||
* @link http://github.com/steeffeen/FancyManiaLinks
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
if (!defined('FML_PATH')) {
|
||||
define('FML_PATH', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
|
||||
define('FML_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
if (!defined('FML_VERSION')) {
|
||||
define('FML_VERSION', '1.3');
|
||||
define('FML_VERSION', '1.4');
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user