2013-11-25 00:02:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FML\Controls;
|
|
|
|
|
|
|
|
use FML\Types\Scriptable;
|
2014-01-19 19:30:21 +01:00
|
|
|
use FML\Stylesheet\Style3d;
|
2013-11-25 00:02:07 +01:00
|
|
|
|
|
|
|
/**
|
2014-01-19 19:30:21 +01:00
|
|
|
* Frame3d Control
|
2014-01-12 00:51:46 +01:00
|
|
|
* (CMlFrame)
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
|
|
|
* @author steeffeen
|
2014-04-13 18:21:40 +02:00
|
|
|
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
class Frame3d extends Frame implements Scriptable {
|
2014-01-21 20:30:40 +01:00
|
|
|
/*
|
2013-12-31 02:55:19 +01:00
|
|
|
* Protected Properties
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
2014-01-19 19:30:21 +01:00
|
|
|
protected $style3dId = '';
|
|
|
|
protected $style3d = null;
|
2013-11-25 00:02:07 +01:00
|
|
|
protected $scriptEvents = 0;
|
|
|
|
|
2014-01-19 19:30:21 +01:00
|
|
|
/**
|
|
|
|
* Create a new Frame3d Control
|
|
|
|
*
|
|
|
|
* @param string $id (optional) Control Id
|
|
|
|
* @return \FML\Controls\Frame3d
|
|
|
|
*/
|
|
|
|
public static function create($id = null) {
|
|
|
|
$frame3d = new Frame3d($id);
|
|
|
|
return $frame3d;
|
|
|
|
}
|
|
|
|
|
2013-11-25 00:02:07 +01:00
|
|
|
/**
|
2013-12-31 02:55:19 +01:00
|
|
|
* Construct a new Frame3d Control
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
2014-01-12 00:51:46 +01:00
|
|
|
* @param string $id (optional) Control Id
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
public function __construct($id = null) {
|
|
|
|
parent::__construct($id);
|
|
|
|
$this->tagName = 'frame3d';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-01-19 19:30:21 +01:00
|
|
|
* Set Style3d Id
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
2014-01-19 19:30:21 +01:00
|
|
|
* @param string $style3dId Style3d Id
|
2013-11-25 00:02:07 +01:00
|
|
|
* @return \FML\Controls\Frame3d
|
|
|
|
*/
|
2014-01-19 19:30:21 +01:00
|
|
|
public function setStyle3dId($style3dId) {
|
|
|
|
$this->style3dId = (string) $style3dId;
|
|
|
|
$this->style3d = null;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set Style3d
|
|
|
|
*
|
|
|
|
* @param Style3d $style3d Style3d Object
|
|
|
|
* @return \FML\Controls\Frame3d
|
|
|
|
*/
|
|
|
|
public function setStyle3d(Style3d $style3d) {
|
|
|
|
$this->style3d = $style3d;
|
2013-11-25 00:02:07 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @see \FML\Types\Scriptable::setScriptEvents()
|
|
|
|
*/
|
|
|
|
public function setScriptEvents($scriptEvents) {
|
|
|
|
$this->scriptEvents = ($scriptEvents ? 1 : 0);
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @see \FML\Controls\Frame::render()
|
|
|
|
*/
|
|
|
|
public function render(\DOMDocument $domDocument) {
|
2014-01-12 00:51:46 +01:00
|
|
|
$xmlElement = parent::render($domDocument);
|
2013-11-25 00:02:07 +01:00
|
|
|
if ($this->style3d) {
|
2014-01-19 19:30:21 +01:00
|
|
|
$this->style3d->checkId();
|
|
|
|
$xmlElement->setAttribute('style3d', $this->style3d->getId());
|
|
|
|
}
|
|
|
|
else if ($this->style3dId) {
|
|
|
|
$xmlElement->setAttribute('style3d', $this->style3dId);
|
2013-11-25 00:02:07 +01:00
|
|
|
}
|
|
|
|
if ($this->scriptEvents) {
|
2014-01-12 00:51:46 +01:00
|
|
|
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
|
2013-11-25 00:02:07 +01:00
|
|
|
}
|
2014-01-12 00:51:46 +01:00
|
|
|
return $xmlElement;
|
2013-11-25 00:02:07 +01:00
|
|
|
}
|
|
|
|
}
|