Skip to content
This repository
Browse code

ENHANCEMENT Indicate which file extensions are allowed to be uploaded…

… when choosing a file to upload.
  • Loading branch information...
commit 9e541241454e8c19834a0423311d1c3be9b7540c 1 parent 8166c26
Sean Harvey authored March 27, 2012
12  code/controllers/CMSFileAddController.php
@@ -73,9 +73,13 @@ public function getEditForm($id = null, $fields = null) {
73 73
 		}
74 74
 
75 75
 		$form = new Form(
76  
-			$this, 
77  
-			'getEditForm', 
78  
-			new FieldList($uploadField, new HiddenField('ID')), 
  76
+			$this,
  77
+			'getEditForm',
  78
+			new FieldList(
  79
+				$uploadField,
  80
+				new LiteralField('AllowedExtensions', sprintf('<p>Allowed extensions: %s</p>', implode('</em>, <em>', $uploadField->getValidator()->getAllowedExtensions()))),
  81
+				new HiddenField('ID')
  82
+			),
79 83
 			new FieldList()
80 84
 		);
81 85
 		$form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses());
@@ -121,4 +125,4 @@ public function Breadcrumbs($unlinked = false) {
121 125
 		return $items;
122 126
 	}
123 127
 
124  
-}
  128
+}

0 notes on commit 9e54124

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