Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT Indicate which file extensions are allowed to be uploaded…

… when choosing a file to upload.
  • Loading branch information...
commit 9e541241454e8c19834a0423311d1c3be9b7540c 1 parent 8166c26
@halkyon halkyon authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 code/controllers/CMSFileAddController.php
View
12 code/controllers/CMSFileAddController.php
@@ -73,9 +73,13 @@ public function getEditForm($id = null, $fields = null) {
}
$form = new Form(
- $this,
- 'getEditForm',
- new FieldList($uploadField, new HiddenField('ID')),
+ $this,
+ 'getEditForm',
+ new FieldList(
+ $uploadField,
+ new LiteralField('AllowedExtensions', sprintf('<p>Allowed extensions: %s</p>', implode('</em>, <em>', $uploadField->getValidator()->getAllowedExtensions()))),
+ new HiddenField('ID')
+ ),
new FieldList()
);
$form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses());
@@ -121,4 +125,4 @@ public function Breadcrumbs($unlinked = false) {
return $items;
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.