Updated FML to newest version

This commit is contained in:
Jocy
2017-04-02 16:32:57 +02:00
parent 83710a9269
commit c5926aded2
21 changed files with 1425 additions and 995 deletions

View File

@ -2,7 +2,9 @@
namespace FML\Elements;
use FML\Stylesheet\Style;
use FML\Types\BackgroundColorable;
use FML\Types\BgColorable;
use FML\Types\Renderable;
use FML\Types\Styleable;
use FML\Types\TextFormatable;
@ -10,11 +12,13 @@ use FML\Types\TextFormatable;
/**
* Format Element
*
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
* @deprecated Use Style
* @see Style
*/
class Format implements BackgroundColorable, Renderable, Styleable, TextFormatable
class Format implements BackgroundColorable, BgColorable, Renderable, Styleable, TextFormatable
{
/**
@ -22,6 +26,11 @@ class Format implements BackgroundColorable, Renderable, Styleable, TextFormatab
*/
protected $backgroundColor = null;
/**
* @var string $focusBackgroundColor Focus background color
*/
protected $focusBackgroundColor = null;
/**
* @var string $style Style
*/
@ -64,7 +73,7 @@ class Format implements BackgroundColorable, Renderable, Styleable, TextFormatab
}
/**
* @see BgColorable::getBackgroundColor()
* @see BackgroundColorable::getBackgroundColor()
*/
public function getBackgroundColor()
{
@ -72,7 +81,7 @@ class Format implements BackgroundColorable, Renderable, Styleable, TextFormatab
}
/**
* @see BgColorable::setBackgroundColor()
* @see BackgroundColorable::setBackgroundColor()
*/
public function setBackgroundColor($backgroundColor)
{
@ -80,6 +89,32 @@ class Format implements BackgroundColorable, Renderable, Styleable, TextFormatab
return $this;
}
/**
* @deprecated Use setBackgroundColor()
* @see Format::setBackgroundColor()
*/
public function setBgColor($bgColor)
{
return $this->setBackgroundColor($bgColor);
}
/**
* @see BackgroundColorable::getFocusBackgroundColor()
*/
public function getFocusBackgroundColor()
{
return $this->focusBackgroundColor;
}
/**
* @see BackgroundColorable::setFocusBackgroundColor()
*/
public function setFocusBackgroundColor($focusBackgroundColor)
{
$this->focusBackgroundColor = (string)$focusBackgroundColor;
return $this;
}
/**
* @see Styleable::getStyle()
*/
@ -191,6 +226,9 @@ class Format implements BackgroundColorable, Renderable, Styleable, TextFormatab
if ($this->backgroundColor) {
$domElement->setAttribute("bgcolor", $this->backgroundColor);
}
if ($this->focusBackgroundColor) {
$domElement->setAttribute("bgcolorfocus", $this->focusBackgroundColor);
}
if ($this->style) {
$domElement->setAttribute("style", $this->style);
}