-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENHANCEMENT Indicate which file extensions are allowed to be uploaded #78
ENHANCEMENT Indicate which file extensions are allowed to be uploaded #78
Conversation
… when choosing a file to upload.
Seems reasonable to me; does the UI look okay, though? |
There's quite a few extensions in the text, what do you think? http://postimage.org/image/87cw9ns6b/ |
Hmm, can we order them by most common, and provide a "..." after the first ~10 exensions? That'd be the icing on the cake though... At the least they should be ordered alphabetically though, otherwise the list is actually quite useless hehe. |
'getEditForm', | ||
new FieldList( | ||
$uploadField, | ||
new LiteralField('AllowedExtensions', sprintf('<p>Allowed extensions: %s</p>', implode('</em>, <em>', $uploadField->getValidator()->getAllowedExtensions()))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the HTML out of the _t() call? I know we tend to do that in core, but its not a great habit as it leaves too much room for error for translators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chillu Woops, that's a good point. I'll update the commit.
On Tue, Mar 27, 2012 at 12:14 PM, Ingo Schommer <
reply@reply.github.com
wrote:
@@ -73,9 +73,13 @@ public function getEditForm($id = null, $fields =
null) {
}$form = new Form(
$this,
'getEditForm',
new FieldList($uploadField, new HiddenField('ID')),
$this,
'getEditForm',
new FieldList(
$uploadField,
sprintf('new LiteralField('AllowedExtensions',
Allowed extensions: %s
', implode(', ',
$uploadField->getValidator()->getAllowedExtensions()))),Can we move the HTML out of the _t() call? I know we tend to do that in
core, but its not a great habit as it leaves too much room for error for
translators.
Reply to this email directly or view it on GitHub:
https://github.com/silverstripe/silverstripe-cms/pull/78/files#r606365
…ontroller::getEditForm() ENHANCEMENT Ensure _t() used for "Allowed extensions" english text.
I've added the correct _t() call to this now, and sorted the extensions alphabetically. The text "Allowed extensions" is now translatable independent of the formatting of the extension list. |
ENHANCEMENT Indicate which file extensions are allowed to be uploaded
When uploading a file to a folder, show which file extensions are permitted to be uploaded through
UploadField->getValidator()->getAllowedExtensions()
This is for http://open.silverstripe.org/ticket/6905