ENHANCEMENT Sort extension names by alphabetical order in CMSFileAddController::getEditForm()

ENHANCEMENT Ensure _t() used for "Allowed extensions" english text.
This commit is contained in:
Sean Harvey 2012-03-27 13:40:23 +13:00
parent 9e54124145
commit 7c9a1304a5

View File

@ -72,12 +72,22 @@ class CMSFileAddController extends LeftAndMain {
$uploadField->setFolderName(ASSETS_DIR); $uploadField->setFolderName(ASSETS_DIR);
} }
$exts = $uploadField->getValidator()->getAllowedExtensions();
asort($exts);
$form = new Form( $form = new Form(
$this, $this,
'getEditForm', 'getEditForm',
new FieldList( new FieldList(
$uploadField, $uploadField,
new LiteralField('AllowedExtensions', sprintf('<p>Allowed extensions: %s</p>', implode('</em>, <em>', $uploadField->getValidator()->getAllowedExtensions()))), new LiteralField(
'AllowedExtensions',
sprintf(
'<p>%s: %s</p>',
_t('AssetAdmin.ALLOWEDEXTS', 'Allowed extensions'),
implode('<em>, </em>', $exts)
)
),
new HiddenField('ID') new HiddenField('ID')
), ),
new FieldList() new FieldList()