- Moved FML into core folder
- Endurance plugin - map class nbCheckpoints - added script callbacks registration
This commit is contained in:
72
application/core/FML/Controls/Frame.php
Normal file
72
application/core/FML/Controls/Frame.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Types\Container;
|
||||
use FML\Types\Renderable;
|
||||
|
||||
/**
|
||||
* Class representing CMlFrame
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Frame extends Control implements Container {
|
||||
/**
|
||||
* Protected properties
|
||||
*/
|
||||
protected $children = array();
|
||||
|
||||
/**
|
||||
* Construct a new frame control
|
||||
*
|
||||
* @param string $id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
parent::__construct($id);
|
||||
$this->tagName = 'frame';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::add()
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function add(Renderable $child) {
|
||||
array_push($this->children, $child);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Types\Container::removeChildren()
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function removeChildren() {
|
||||
$this->children = array();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\Renderable::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xml = parent::render($domDocument);
|
||||
foreach ($this->children as $child) {
|
||||
$childXml = $child->render($domDocument);
|
||||
$xml->appendChild($childXml);
|
||||
}
|
||||
return $xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return class name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getClass() {
|
||||
return __CLASS__;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user