2013-11-25 00:02:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FML\Controls;
|
|
|
|
|
|
|
|
/**
|
2014-01-19 19:30:21 +01:00
|
|
|
* FileEntry Control
|
|
|
|
* (CMlFileEntry)
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
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
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
class FileEntry extends Entry {
|
2014-01-21 20:30:40 +01:00
|
|
|
/*
|
2014-06-21 03:18:21 +02:00
|
|
|
* Protected properties
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
2014-06-21 03:18:21 +02:00
|
|
|
protected $tagName = 'fileentry';
|
|
|
|
protected $folder = null;
|
2014-01-19 19:30:21 +01:00
|
|
|
|
2013-11-25 00:02:07 +01:00
|
|
|
/**
|
2014-05-16 22:44:22 +02:00
|
|
|
* @see \FML\Controls\Control::getManiaScriptClass()
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
2014-05-16 22:44:22 +02:00
|
|
|
public function getManiaScriptClass() {
|
|
|
|
return 'CMlFileEntry';
|
2013-11-25 00:02:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-06-21 03:18:21 +02:00
|
|
|
* Set the base folder
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
2014-06-21 03:18:21 +02:00
|
|
|
* @param string $folder Base folder
|
2014-07-03 22:34:47 +02:00
|
|
|
* @return static
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
public function setFolder($folder) {
|
2014-05-16 22:44:22 +02:00
|
|
|
$this->folder = (string)$folder;
|
2013-11-25 00:02:07 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-03 22:34:47 +02:00
|
|
|
* @see \FML\Types\Renderable::render()
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
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;
|
2013-11-25 00:02:07 +01:00
|
|
|
}
|
|
|
|
}
|