2013-11-25 00:02:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FML\Controls;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class representing CMlFileEntry
|
|
|
|
*
|
|
|
|
* @author steeffeen
|
|
|
|
*/
|
|
|
|
class FileEntry extends Entry {
|
|
|
|
/**
|
2013-12-31 02:55:19 +01:00
|
|
|
* Protected Properties
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
protected $folder = '';
|
|
|
|
|
|
|
|
/**
|
2013-12-31 02:55:19 +01:00
|
|
|
* Construct a new FileEntry Control
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
2014-01-12 00:51:46 +01:00
|
|
|
* @param string $id (optional) Control Id
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
public function __construct($id = null) {
|
|
|
|
parent::__construct($id);
|
|
|
|
$this->tagName = 'fileentry';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-12-31 02:55:19 +01:00
|
|
|
* Set Folder
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
2014-01-12 00:51:46 +01:00
|
|
|
* @param string $folder Base Folder
|
2013-11-25 00:02:07 +01:00
|
|
|
* @return \FML\Controls\FileEntry
|
|
|
|
*/
|
|
|
|
public function setFolder($folder) {
|
2014-01-12 00:51:46 +01:00
|
|
|
$this->folder = (string) $folder;
|
2013-11-25 00:02:07 +01:00
|
|
|
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;
|
2013-11-25 00:02:07 +01:00
|
|
|
}
|
|
|
|
}
|