From 9e541241454e8c19834a0423311d1c3be9b7540c Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 27 Mar 2012 10:18:05 +1300 Subject: [PATCH] ENHANCEMENT Indicate which file extensions are allowed to be uploaded when choosing a file to upload. --- code/controllers/CMSFileAddController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/controllers/CMSFileAddController.php b/code/controllers/CMSFileAddController.php index aa8239f6..fc056b0a 100644 --- a/code/controllers/CMSFileAddController.php +++ b/code/controllers/CMSFileAddController.php @@ -73,9 +73,13 @@ class CMSFileAddController extends LeftAndMain { } $form = new Form( - $this, - 'getEditForm', - new FieldList($uploadField, new HiddenField('ID')), + $this, + 'getEditForm', + new FieldList( + $uploadField, + new LiteralField('AllowedExtensions', sprintf('

Allowed extensions: %s

', implode(', ', $uploadField->getValidator()->getAllowedExtensions()))), + new HiddenField('ID') + ), new FieldList() ); $form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses()); @@ -121,4 +125,4 @@ class CMSFileAddController extends LeftAndMain { return $items; } -} \ No newline at end of file +}