FML Update

This commit is contained in:
Steffen Schröder
2014-06-21 03:18:21 +02:00
parent 816ff486ef
commit c8d599189c
107 changed files with 2484 additions and 3099 deletions

View File

@ -18,40 +18,20 @@ use FML\Types\TextFormatable;
*/
class Entry extends Control implements NewLineable, Scriptable, Styleable, TextFormatable {
/*
* Protected Properties
* Protected properties
*/
protected $name = '';
protected $tagName = 'entry';
protected $name = null;
protected $default = null;
protected $autoNewLine = 0;
protected $scriptEvents = 0;
protected $style = '';
protected $textColor = '';
protected $autoNewLine = null;
protected $scriptEvents = null;
protected $style = null;
protected $textColor = null;
protected $textSize = -1;
protected $focusAreaColor1 = '';
protected $focusAreaColor2 = '';
protected $focusAreaColor1 = null;
protected $focusAreaColor2 = null;
protected $autoComplete = null;
/**
* Construct a new Entry Control
*
* @param string $id (optional) Control Id
*/
public function __construct($id = null) {
parent::__construct($id);
$this->tagName = 'entry';
}
/**
* Create a new Entry Control
*
* @param string $id (optional) Control Id
* @return \FML\Controls\Entry
*/
public static function create($id = null) {
$entry = new Entry($id);
return $entry;
}
/**
* @see \FML\Controls\Control::getManiaScriptClass()
*/
@ -60,7 +40,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
}
/**
* Get the Entry Name
* Get the Entry name
*
* @return string
*/
@ -69,9 +49,9 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
}
/**
* Set Entry Name
* Set Entry name
*
* @param string $name Entry Name
* @param string $name Entry name
* @return \FML\Controls\Entry
*/
public function setName($name) {
@ -80,7 +60,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
}
/**
* Get the Default Value
* Get the default value
*
* @return mixed
*/
@ -89,10 +69,10 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
}
/**
* Set Default Value
* Set default value
*
* @param string $default Default Value
* @return \FML\Controls\Entry
* @param string $default Default value
* @return \FML\Controls\Entry|static
*/
public function setDefault($default) {
$this->default = $default;
@ -156,10 +136,10 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
}
/**
* Set Auto Completion
* Set auto completion
*
* @param bool $autoComplete Whether the Default Value should be automatically completed based on the current Request Parameters
* @return \FML\Controls\Entry
* @param bool $autoComplete Whether the default value should be automatically completed based on the current request parameters
* @return \FML\Controls\Entry|static
*/
public function setAutoComplete($autoComplete) {
$this->autoComplete = (bool)$autoComplete;
@ -169,8 +149,8 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
/**
* Add a dynamic Feature submitting the Entry
*
* @param string $url Submit Url
* @return \FML\Controls\Entry
* @param string $url Submit url
* @return \FML\Controls\Entry|static
*/
public function addSubmitFeature($url) {
$entrySubmit = new EntrySubmit($this, $url);
@ -186,7 +166,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
if ($this->name) {
$xmlElement->setAttribute('name', $this->name);
}
if ($this->default !== null) {
if (!is_null($this->default)) {
$xmlElement->setAttribute('default', $this->default);
} else if ($this->autoComplete) {
$value = null;