Jocy 2017-05-12 11:04:26 +02:00
parent 023581c195
commit 2a70e840e2
8 changed files with 26 additions and 16 deletions

View File

@ -15,7 +15,7 @@ namespace ManiaControl\Manialinks;
interface SidebarMenuEntryRenderable {
/**
* Call here the function which updates the MenuIcon Manialink
* Call here the function which updates the MenuIcon ManiaLink
*/
public function renderMenuEntry();
}

View File

@ -13,7 +13,6 @@ use FML\Types\ScriptFeatureable;
/**
* CheckBox Component
*
* @uses Quad
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
@ -74,6 +73,8 @@ class CheckBox implements Renderable, ScriptFeatureable
public function setName($name)
{
$this->name = (string)$name;
$this->getEntry()
->setName($this->name);
return $this;
}
@ -221,6 +222,7 @@ class CheckBox implements Renderable, ScriptFeatureable
*
* @param Entry $entry Hidden Entry
* @return static
* @deprecated
*/
public function setEntry(Entry $entry)
{
@ -236,9 +238,11 @@ class CheckBox implements Renderable, ScriptFeatureable
protected function createEntry()
{
$entry = new Entry();
$entry->setVisible(false)
->setName($this->name);
$this->setEntry($entry);
$entry->setVisible(false);
if ($this->name) {
$entry->setName($this->name);
}
$this->feature->setEntry($entry);
return $entry;
}
@ -247,7 +251,7 @@ class CheckBox implements Renderable, ScriptFeatureable
*/
public function getScriptFeatures()
{
return ScriptFeature::collect($this->feature, $this->getQuad(), $this->feature->getEntry());
return ScriptFeature::collect($this->feature, $this->getQuad(), $this->getEntry());
}
/**

View File

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

View File

@ -65,7 +65,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL
/**
* @var int $actionKey Action key
*/
protected $actionKey = -1;
protected $actionKey = null;
/**
* @var string $url Url
@ -651,7 +651,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL
if ($this->action) {
$domElement->setAttribute("action", $this->action);
}
if ($this->actionKey >= 0) {
if ($this->actionKey) {
$domElement->setAttribute("actionkey", $this->actionKey);
}
if ($this->url) {

View File

@ -98,7 +98,7 @@ class Quad extends Control implements Actionable, BackgroundColorable, BgColorab
/**
* @var int $actionKey Action key
*/
protected $actionKey = -1;
protected $actionKey = null;
/**
* @var string $url Link url
@ -676,6 +676,8 @@ class Quad extends Control implements Actionable, BackgroundColorable, BgColorab
* @api
* @param CheckBoxDesign $checkBoxDesign CheckBox Design
* @return static
* @deprecated Use CheckBoxDesign::applyToQuad()
* @see CheckBoxDesign::applyToQuad()
*/
public function applyCheckBoxDesign(CheckBoxDesign $checkBoxDesign)
{

View File

@ -146,7 +146,7 @@ abstract class Builder
* @param bool $associative (optional) Whether the array should be associative
* @return string
*/
public static function getArray(array $array, $associative = false)
public static function getArray(array $array, $associative = true)
{
$arrayText = "[";
$index = 0;
@ -180,6 +180,9 @@ abstract class Builder
if (is_bool($value)) {
return static::getBoolean($value);
}
if (is_array($value)) {
return static::getArray($value);
}
return $value;
}

View File

@ -265,14 +265,14 @@ class Script
*/
protected function getHeaderComment()
{
$headerComment = '/****************************************************
$headerComment = '/**************************************************
* FancyManiaLinks';
if (defined('FML_VERSION')) {
$headerComment .= ' v' . FML_VERSION;
}
$headerComment .= ' by steeffeen *
* http://github.com/steeffeen/FancyManiaLinks *
****************************************************/
**************************************************/
';
return $headerComment;
@ -349,6 +349,7 @@ main() {
}
case CMlEvent::Type::MouseClick: {
+++' . ScriptLabel::MOUSECLICK . '+++
+++' . ScriptLabel::MOUSECLICK2 . '+++
}
case CMlEvent::Type::MouseOut: {
+++' . ScriptLabel::MOUSEOUT . '+++

View File

@ -21,6 +21,7 @@ class ScriptLabel
const ENTRYSUBMIT = 'FML_EntrySubmit';
const KEYPRESS = 'FML_KeyPress';
const MOUSECLICK = 'FML_MouseClick';
const MOUSECLICK2 = 'FML_MouseClick2';
const MOUSEOUT = 'FML_MouseOut';
const MOUSEOVER = 'FML_MouseOver';