TrackManiaControl/application/core/FML/Controls/Frame3d.php

66 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace FML\Controls;
use FML\Types\Scriptable;
/**
2014-01-12 00:51:46 +01:00
* Frame3d Element
* (CMlFrame)
*
* @author steeffeen
*/
class Frame3d extends Frame implements Scriptable {
/**
2013-12-31 02:55:19 +01:00
* Protected Properties
*/
protected $style3d = '';
protected $scriptEvents = 0;
/**
2013-12-31 02:55:19 +01:00
* Construct a new Frame3d Control
*
2014-01-12 00:51:46 +01:00
* @param string $id (optional) Control Id
*/
public function __construct($id = null) {
parent::__construct($id);
$this->tagName = 'frame3d';
}
/**
* Set style3d
*
2014-01-12 00:51:46 +01:00
* @param string $style3d 3D Style
* @return \FML\Controls\Frame3d
*/
public function setStyle3d($style3d) {
2014-01-12 00:51:46 +01:00
$this->style3d = (string) $style3d;
return $this;
}
/**
*
* @see \FML\Types\Scriptable::setScriptEvents()
* @return \FML\Controls\Frame3d
*/
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);
if ($this->style3d) {
2014-01-12 00:51:46 +01:00
$xmlElement->setAttribute('style3d', $this->style3d);
}
if ($this->scriptEvents) {
2014-01-12 00:51:46 +01:00
$xmlElement->setAttribute('scriptevents', $this->scriptEvents);
}
2014-01-12 00:51:46 +01:00
return $xmlElement;
}
}