Skip to content
This repository
Browse code

ENHANCEMENT Sort extension names by alphabetical order in CMSFileAddC…

…ontroller::getEditForm()

ENHANCEMENT Ensure _t() used for "Allowed extensions" english text.
  • Loading branch information...
commit 7c9a1304a527785eaac58217464070a144ae64e6 1 parent 9e54124
Sean Harvey authored March 27, 2012
12  code/controllers/CMSFileAddController.php
@@ -72,12 +72,22 @@ public function getEditForm($id = null, $fields = null) {
72 72
 			$uploadField->setFolderName(ASSETS_DIR);
73 73
 		}
74 74
 
  75
+		$exts = $uploadField->getValidator()->getAllowedExtensions();
  76
+		asort($exts);
  77
+
75 78
 		$form = new Form(
76 79
 			$this,
77 80
 			'getEditForm',
78 81
 			new FieldList(
79 82
 				$uploadField,
80  
-				new LiteralField('AllowedExtensions', sprintf('<p>Allowed extensions: %s</p>', implode('</em>, <em>', $uploadField->getValidator()->getAllowedExtensions()))),
  83
+				new LiteralField(
  84
+					'AllowedExtensions',
  85
+					sprintf(
  86
+						'<p>%s: %s</p>',
  87
+						_t('AssetAdmin.ALLOWEDEXTS', 'Allowed extensions'),
  88
+						implode('<em>, </em>', $exts)
  89
+					)
  90
+				),
81 91
 				new HiddenField('ID')
82 92
 			),
83 93
 			new FieldList()

0 notes on commit 7c9a130

Please sign in to comment.
Something went wrong with that request. Please try again.