ENHANCEMENT Indicate which file extensions are allowed to be uploaded when choosing a file to upload.

This commit is contained in:
Sean Harvey 2012-03-27 10:18:05 +13:00
parent 8166c26a8f
commit 9e54124145

View File

@ -75,7 +75,11 @@ class CMSFileAddController extends LeftAndMain {
$form = new Form( $form = new Form(
$this, $this,
'getEditForm', 'getEditForm',
new FieldList($uploadField, new HiddenField('ID')), new FieldList(
$uploadField,
new LiteralField('AllowedExtensions', sprintf('<p>Allowed extensions: %s</p>', implode('</em>, <em>', $uploadField->getValidator()->getAllowedExtensions()))),
new HiddenField('ID')
),
new FieldList() new FieldList()
); );
$form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses()); $form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses());