TrackManiaControl/application/core/Libs/FML/Controls/FileEntry.php

61 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace FML\Controls;
/**
2014-01-19 19:30:21 +01:00
* FileEntry Control
* (CMlFileEntry)
*
* @author steeffeen
*/
class FileEntry extends Entry {
2014-01-21 20:30:40 +01:00
/*
2013-12-31 02:55:19 +01:00
* Protected Properties
*/
protected $folder = '';
2014-01-19 19:30:21 +01:00
/**
* 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;
}
/**
2013-12-31 02:55:19 +01:00
* Construct a new FileEntry 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 = 'fileentry';
}
/**
2013-12-31 02:55:19 +01:00
* Set Folder
*
2014-01-12 00:51:46 +01:00
* @param string $folder Base Folder
* @return \FML\Controls\FileEntry
*/
public function setFolder($folder) {
2014-01-12 00:51:46 +01:00
$this->folder = (string) $folder;
return $this;
}
/**
*
* @see \FML\Entry::render()
*/
public function render(\DOMDocument $domDocument) {
2014-01-12 00:51:46 +01:00
$xmlElement = parent::render($domDocument);
if ($this->folder) {
$xmlElement->setAttribute('folder', $this->folder);
}
return $xmlElement;
}
}