2008-09-29 05:18:23 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2009-04-17 04:26:40 +02:00
|
|
|
* Allows a user to add a field that can be used to upload a file
|
|
|
|
*
|
|
|
|
* @package userforms
|
2008-09-29 05:18:23 +02:00
|
|
|
*/
|
|
|
|
class EditableFileField extends EditableFormField {
|
|
|
|
|
|
|
|
// this needs to be moved.
|
|
|
|
static $has_one = array(
|
|
|
|
"UploadedFile" => "File"
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2008-10-03 05:43:41 +02:00
|
|
|
* @see Upload->allowedMaxFileSize
|
2008-09-29 05:18:23 +02:00
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
public static $allowed_max_file_size;
|
|
|
|
|
|
|
|
/**
|
2008-10-03 05:43:41 +02:00
|
|
|
* @see Upload->allowedExtensions
|
2008-09-29 05:18:23 +02:00
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
public static $allowed_extensions = array();
|
|
|
|
|
2009-05-06 05:34:40 +02:00
|
|
|
static $singular_name = 'File Upload Field';
|
2009-04-20 01:22:22 +02:00
|
|
|
|
2009-05-06 05:34:40 +02:00
|
|
|
static $plural_names = 'File Fields';
|
2008-09-29 05:18:23 +02:00
|
|
|
|
2009-04-27 06:32:47 +02:00
|
|
|
public function getFormField() {
|
|
|
|
return new FileField($this->Name, $this->Title);
|
2008-09-29 05:18:23 +02:00
|
|
|
}
|
2009-04-28 04:03:13 +02:00
|
|
|
|
2009-07-05 09:29:24 +02:00
|
|
|
/**
|
|
|
|
* Workaround to handle uploads on the UserFormPage
|
|
|
|
*/
|
|
|
|
public function getValueFromData($data) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2008-09-29 05:18:23 +02:00
|
|
|
}
|
|
|
|
?>
|