Merged from branches/2.3

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@80875 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-07-02 07:23:29 +00:00
parent cabf044700
commit 00c8fd25d9
2 changed files with 37 additions and 33 deletions

View File

@ -120,6 +120,9 @@ JS
if(isset($data['ID']) && $data['ID'] != 'root') $folder = DataObject::get_by_id("Folder", $data['ID']); if(isset($data['ID']) && $data['ID'] != 'root') $folder = DataObject::get_by_id("Folder", $data['ID']);
else $folder = singleton('Folder'); else $folder = singleton('Folder');
// Don't modify the output of the template, or it will become invalid
ContentNegotiator::disable();
return array( 'CanUpload' => $folder->canEdit()); return array( 'CanUpload' => $folder->canEdit());
} }
@ -135,16 +138,11 @@ JS
new HiddenField("action_doUpload", "", "1"), new HiddenField("action_doUpload", "", "1"),
new FileField("Files[0]" , _t('AssetAdmin.CHOOSEFILE','Choose file: ')), new FileField("Files[0]" , _t('AssetAdmin.CHOOSEFILE','Choose file: ')),
new LiteralField('UploadButton'," new LiteralField('UploadButton',"
<input type='submit' value='". _t('AssetAdmin.UPLOAD', 'Upload Files Listed Below'). "' name='action_upload' id='Form_UploadForm_action_upload' class='action' /> <input type=\"submit\" value=\"". _t('AssetAdmin.UPLOAD', 'Upload Files Listed Below'). "\" name=\"action_upload\" id=\"Form_UploadForm_action_upload\" class=\"action\" />
"), "),
new LiteralField('MultifileCode'," new LiteralField('MultifileCode',"
<p>" . _t('AssetAdmin.FILESREADY','Files ready to upload:') ."</p> <p>" . _t('AssetAdmin.FILESREADY','Files ready to upload:') ."</p>
<div id='Form_UploadForm_FilesList'></div> <div id=\"Form_UploadForm_FilesList\"></div>
<script>
var multi_selector = new MultiSelector($('Form_UploadForm_FilesList'), null, $('Form_UploadForm_action_upload'));
multi_selector.addElement($('Form_UploadForm_Files-0'));
//new window.top.document.CMSMain_upload();
</script>
") ")
), new FieldSet( ), new FieldSet(
)); ));

View File

@ -1,7 +1,11 @@
<html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head> <head>
<% base_tag %>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><% _t('TITLE', 'Image Uploading Iframe') %></title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<style> <style type="text/css">
body { body {
padding: 0; padding: 0;
margin: 0; margin: 0;
@ -13,14 +17,16 @@ fieldset {
border-style: none; border-style: none;
} }
</style> </style>
<% base_tag %>
</head> </head>
<body> <body>
<% if CanUpload %> <% if CanUpload %>
$UploadForm $UploadForm
<% else %> <% else %>
<% _t('PERMFAILED','You do not have permission to upload files into this folder.') %> <% _t('PERMFAILED','You do not have permission to upload files into this folder.') %>
<% end_if %> <% end_if %>
<script type="text/javascript">
var multi_selector = new MultiSelector($('Form_UploadForm_FilesList'), null, $('Form_UploadForm_action_upload'));
multi_selector.addElement($('Form_UploadForm_Files-0'));
</script>
</body> </body>
</html>