This commit was generated by cvs2svn to compensate for changes in r6252,
[freeside.git] / httemplate / elements / fckeditor / editor / filemanager / browser / default / frmupload.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\r
2 <!--\r
3  * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
4  * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r
5  *\r
6  * == BEGIN LICENSE ==\r
7  *\r
8  * Licensed under the terms of any of the following licenses at your\r
9  * choice:\r
10  *\r
11  *  - GNU General Public License Version 2 or later (the "GPL")\r
12  *    http://www.gnu.org/licenses/gpl.html\r
13  *\r
14  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
15  *    http://www.gnu.org/licenses/lgpl.html\r
16  *\r
17  *  - Mozilla Public License Version 1.1 or later (the "MPL")\r
18  *    http://www.mozilla.org/MPL/MPL-1.1.html\r
19  *\r
20  * == END LICENSE ==\r
21  *\r
22  * Page used to upload new files in the current folder.\r
23 -->\r
24 <html xmlns="http://www.w3.org/1999/xhtml">\r
25         <head>\r
26                 <link href="browser.css" type="text/css" rel="stylesheet" />\r
27                 <script type="text/javascript" src="js/common.js"></script>\r
28                 <script type="text/javascript">\r
29 \r
30 function SetCurrentFolder( resourceType, folderPath )\r
31 {\r
32         var sUrl = oConnector.ConnectorUrl + 'Command=FileUpload' ;\r
33         sUrl += '&Type=' + resourceType ;\r
34         sUrl += '&CurrentFolder=' + encodeURIComponent( folderPath ) ;\r
35 \r
36         document.getElementById('frmUpload').action = sUrl ;\r
37 }\r
38 \r
39 function OnSubmit()\r
40 {\r
41         if ( document.getElementById('NewFile').value.length == 0 )\r
42         {\r
43                 alert( 'Please select a file from your computer' ) ;\r
44                 return false ;\r
45         }\r
46 \r
47         // Set the interface elements.\r
48         document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder (Upload in progress, please wait...)' ;\r
49         document.getElementById('btnUpload').disabled = true ;\r
50 \r
51         return true ;\r
52 }\r
53 \r
54 function OnUploadCompleted( errorNumber, data )\r
55 {\r
56         // Reset the Upload Worker Frame.\r
57         window.parent.frames['frmUploadWorker'].location = 'javascript:void(0)' ;\r
58 \r
59         // Reset the upload form (On IE we must do a little trick to avout problems).\r
60         if ( document.all )\r
61                 document.getElementById('NewFile').outerHTML = '<input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file">' ;\r
62         else\r
63                 document.getElementById('frmUpload').reset() ;\r
64 \r
65         // Reset the interface elements.\r
66         document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder' ;\r
67         document.getElementById('btnUpload').disabled = false ;\r
68 \r
69         switch ( errorNumber )\r
70         {\r
71                 case 0 :\r
72                         window.parent.frames['frmResourcesList'].Refresh() ;\r
73                         break ;\r
74                 case 1 :        // Custom error.\r
75                         alert( data ) ;\r
76                         break ;\r
77                 case 201 :\r
78                         window.parent.frames['frmResourcesList'].Refresh() ;\r
79                         alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + data + '"' ) ;\r
80                         break ;\r
81                 case 202 :\r
82                         alert( 'Invalid file' ) ;\r
83                         break ;\r
84                 default :\r
85                         alert( 'Error on file upload. Error number: ' + errorNumber ) ;\r
86                         break ;\r
87         }\r
88 }\r
89 \r
90 window.onload = function()\r
91 {\r
92         window.top.IsLoadedUpload = true ;\r
93 }\r
94                 </script>\r
95         </head>\r
96         <body bottommargin="0" topmargin="0">\r
97                 <form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">\r
98                         <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">\r
99                                 <tr>\r
100                                         <td nowrap="nowrap">\r
101                                                 <span id="eUploadMessage">Upload a new file in this folder</span><br>\r
102                                                 <table cellspacing="0" cellpadding="0" width="100%" border="0">\r
103                                                         <tr>\r
104                                                                 <td width="100%"><input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file"></td>\r
105                                                                 <td nowrap="nowrap">&nbsp;<input id="btnUpload" type="submit" value="Upload"></td>\r
106                                                         </tr>\r
107                                                 </table>\r
108                                         </td>\r
109                                 </tr>\r
110                         </table>\r
111                 </form>\r
112         </body>\r
113 </html>\r