diff --git a/_config/routes.yml b/_config/routes.yml new file mode 100644 index 0000000..700c1be --- /dev/null +++ b/_config/routes.yml @@ -0,0 +1,7 @@ +--- +Name: userformsroutes +After: framework/routes#coreroutes +--- +Director: + rules: + 'UserDefinedForm_Controller//$Action' : 'UserDefinedForm_Controller' \ No newline at end of file diff --git a/code/model/editableformfields/EditableFileField.php b/code/model/editableformfields/EditableFileField.php index 68ab1de..83bb1cc 100755 --- a/code/model/editableformfields/EditableFileField.php +++ b/code/model/editableformfields/EditableFileField.php @@ -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(