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

@ -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('<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 @@ class CMSFileAddController extends LeftAndMain {
return $items;
}
}
}