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

69 lines
1.3 KiB
PHP
Raw Normal View History

<?php
namespace FML\Controls;
/**
2014-01-19 19:30:21 +01:00
* FileEntry Control
* (CMlFileEntry)
*
2014-05-20 15:44:45 +02:00
* @author steeffeen <mail@steeffeen.com>
2014-04-13 18:21:40 +02:00
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
2014-05-16 22:44:22 +02:00
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
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-05-16 22:44:22 +02:00
/**
* Construct a new FileEntry Control
*
* @param string $id (optional) Control Id
*/
public function __construct($id = null) {
parent::__construct($id);
$this->tagName = 'fileentry';
}
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;
}
/**
2014-05-16 22:44:22 +02:00
* @see \FML\Controls\Control::getManiaScriptClass()
*/
2014-05-16 22:44:22 +02:00
public function getManiaScriptClass() {
return 'CMlFileEntry';
}
/**
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-05-16 22:44:22 +02: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;
}
}