mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #458 from dnadesign/master
Added routing for UserDefinedForm_Controller
This commit is contained in:
commit
32ae99112c
7
_config/routes.yml
Normal file
7
_config/routes.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
Name: userformsroutes
|
||||
After: framework/routes#coreroutes
|
||||
---
|
||||
Director:
|
||||
rules:
|
||||
'UserDefinedForm_Controller//$Action' : 'UserDefinedForm_Controller'
|
@ -49,9 +49,14 @@ class EditableFileField extends EditableFormField {
|
||||
}
|
||||
|
||||
public function getFormField() {
|
||||
$field = FileField::create($this->Name, $this->EscapedTitle)
|
||||
->setFieldHolderTemplate('UserFormsField_holder')
|
||||
->setTemplate('UserFormsFileField');
|
||||
if(isset(Config::inst()->get('EditableFileField', 'use_uploadfield')) && Config::inst()->get('EditableFileField', 'use_uploadfield')) {
|
||||
$field = Upload::create($this->Name, $this->EscapedTitle)
|
||||
} else {
|
||||
$field = FileField::create($this->Name, $this->EscapedTitle)
|
||||
}
|
||||
|
||||
$field->setFieldHolderTemplate('UserFormsField_holder')
|
||||
->setTemplate('UserFormsFileField');
|
||||
|
||||
$field->getValidator()->setAllowedExtensions(
|
||||
array_diff(
|
||||
|
Loading…
Reference in New Issue
Block a user