TrackManiaControl/application/core/FML/Controls/FileEntry.php
Steffen Schröder 11abd5ee6e fml update
2014-05-01 17:35:03 +02:00

61 lines
1.1 KiB
PHP

<?php
namespace FML\Controls;
/**
* FileEntry Control
* (CMlFileEntry)
*
* @author steeffeen
*/
class FileEntry extends Entry {
/*
* Protected Properties
*/
protected $folder = '';
/**
* Create a new FileEntry Control
*
* @param string $id (optional) Control Id
* @return \FML\Controls\FileEntry
*/
public static function create($id = null) {
$fileEntry = new FileEntry($id);
return $fileEntry;
}
/**
* Construct a new FileEntry Control
*
* @param string $id (optional) Control Id
*/
public function __construct($id = null) {
parent::__construct($id);
$this->tagName = 'fileentry';
}
/**
* Set Folder
*
* @param string $folder Base Folder
* @return \FML\Controls\FileEntry
*/
public function setFolder($folder) {
$this->folder = (string) $folder;
return $this;
}
/**
*
* @see \FML\Entry::render()
*/
public function render(\DOMDocument $domDocument) {
$xmlElement = parent::render($domDocument);
if ($this->folder) {
$xmlElement->setAttribute('folder', $this->folder);
}
return $xmlElement;
}
}