mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
41 lines
827 B
PHP
Executable File
41 lines
827 B
PHP
Executable File
<?php
|
|
/**
|
|
* Allows a user to add a field that can be used to upload a file
|
|
*
|
|
* @package userforms
|
|
*/
|
|
class EditableFileField extends EditableFormField {
|
|
|
|
// this needs to be moved.
|
|
static $has_one = array(
|
|
"UploadedFile" => "File"
|
|
);
|
|
|
|
/**
|
|
* @see Upload->allowedMaxFileSize
|
|
* @var int
|
|
*/
|
|
public static $allowed_max_file_size;
|
|
|
|
/**
|
|
* @see Upload->allowedExtensions
|
|
* @var array
|
|
*/
|
|
public static $allowed_extensions = array();
|
|
|
|
static $singular_name = 'File field';
|
|
|
|
static $plural_names = 'File fields';
|
|
|
|
function getFormField() {
|
|
if($field = parent::getFormField()) {
|
|
return $field;
|
|
}
|
|
return new FileField($this->Name, $this->Title, $this->getField('Default'));
|
|
}
|
|
|
|
function getSimpleFormField(){
|
|
return new FileField($this->Name, $this->Title, $this->getField('Default'));
|
|
}
|
|
}
|
|
?>
|