1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2<!-- 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 4 * Copyright (C) 2003-2009 Frederico Caldeira Knabben 5 * 6 * == BEGIN LICENSE == 7 * 8 * Licensed under the terms of any of the following licenses at your 9 * choice: 10 * 11 * - GNU General Public License Version 2 or later (the "GPL") 12 * http://www.gnu.org/licenses/gpl.html 13 * 14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 15 * http://www.gnu.org/licenses/lgpl.html 16 * 17 * - Mozilla Public License Version 1.1 or later (the "MPL") 18 * http://www.mozilla.org/MPL/MPL-1.1.html 19 * 20 * == END LICENSE == 21 * 22 * Page used to create new folders in the current folder. 23--> 24<html> 25 <head> 26 <title>Create Folder</title> 27 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 28 <link href="browser.css" type="text/css" rel="stylesheet"> 29 <script type="text/javascript" src="js/common.js"></script> 30 <script type="text/javascript" src="js/language.js"></script> 31 <script type="text/javascript" src="js/safeFN_class.js"></script> 32 <script type="text/javascript"> 33 34var CurrentDWikiUser = parent.CurrentDWikiUser; 35var isLocalDwikiBrowser = parent.isLocalDwikiBrowser; 36var CreateDwikiFolder = parent.CreateDwikiFolder; 37var DwikiFNencode = parent.DwikiFNencode; 38 39function SetCurrentFolder( resourceType, folderPath ) 40{ 41 oConnector.ResourceType = resourceType ; 42 oConnector.CurrentFolder = folderPath ; 43} 44 45function CreateFolder() 46{ 47 var sFolderName ; 48 49 while ( true ) 50 { 51 sFolderName = prompt(translateItem('DlgFileBrowserFolderPrompt', 'Type the name of the new folder:'), '' ) ; 52 53 if ( sFolderName == null ) 54 return ; 55 else if ( sFolderName.length == 0 ) 56 alert(translateItem('DlgFileBrowserFolderWarning', 'Please type the folder name' ) ) ; 57 else 58 break ; 59 } 60 61/* requires safe_ascii */ 62if(DwikiFNencode == 'safe') { 63 sFolderName=sFolderName.toLowerCase(); 64 sFolderName=sFolderName.replace(/\s/g, '_'); 65} 66oConnector.SendCommand( 'CreateFolder', 'NewFolderName=' + dwikiUTF8_encodeFN(sFolderName,DwikiFNencode) , CreateFolderCallBack ) ; 67} 68 69function CreateFolderCallBack( fckXml ) 70{ 71 if ( oConnector.CheckError( fckXml ) == 0 ) 72 window.parent.frames['frmResourcesList'].Refresh() ; 73 74 /* 75 // Get the current folder path. 76 var oNode = fckXml.SelectSingleNode( 'Connector/Error' ) ; 77 var iErrorNumber = parseInt( oNode.attributes.getNamedItem('number').value ) ; 78 79 switch ( iErrorNumber ) 80 { 81 case 0 : 82 window.parent.frames['frmResourcesList'].Refresh() ; 83 break ; 84 case 101 : 85 alert( 'Folder already exists' ) ; 86 break ; 87 case 102 : 88 alert( 'Invalid folder name' ) ; 89 break ; 90 case 103 : 91 alert( 'You have no permissions to create the folder' ) ; 92 break ; 93 case 110 : 94 alert( 'Unknown error creating folder' ) ; 95 break ; 96 default : 97 alert( 'Error creating folder. Error number: ' + iErrorNumber ) ; 98 break ; 99 } 100 */ 101} 102 103window.onload = function() 104{ 105 window.top.IsLoadedCreateFolder = true ; 106 setupLanguage(); 107 108 if(CurrentDWikiUser == 'visitor' || isLocalDwikiBrowser || !CurrentDWikiUser) { 109 document.getElementById("btn__create_folder").disabled = true; 110 document.getElementById("create_folder").innerHTML = ""; 111 } 112// alert(CreateDwikiFolder); 113 if(CreateDwikiFolder == 'n') { 114 document.getElementById('create_folder').style.display = 'none'; 115 } 116 else { 117 document.getElementById('folder_hint_icons').style.display = 'none'; 118 119 } 120 if(navigator.userAgent.match(/macintosh/i)) { 121 document.getElementById('is_mac').innerHTML = 'Cmd'; 122 } 123} 124 </script> 125 </head> 126 <body> 127 128 129 <div id="create_folder"> 130 <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0"> 131 <tr> 132 <td> 133 <button id = "btn__create_folder" type="button" style="WIDTH: 100%" onclick="CreateFolder();"> 134 <table cellSpacing="0" cellPadding="0" border="0"> 135 <tr id="create_folder_img"> 136 <td><img height="15" alt="" src="images/Folder.gif" width="15"></td> 137 <td> </td> 138 <td nowrap><span fckLang="DlgFileBrowserNewFolder">Create Folder</span></td> 139 </tr> 140 </table> 141 </button> 142 </td> 143 </tr> 144 </table> 145 </div> 146<div id="folder_hint_icons"> 147<table cellspace='2'> 148<tr><td> 149<span fckLang="DlgFileBrowserMoveLabel">move </span><span id='is_mac'>Ctrl</span>+<img alt="trash" src="images/trash.png"><br /> 150</td></tr> 151<tr><td> 152<img height="16" alt="" src="images/FolderOpenedRO.gif" width="15"> <span fckLang="DlgFileBrowserRead">read-only</span><br> 153<img height="16" alt="" src="images/FolderOpened.gif" width="16"> <span fckLang="DlgFileBrowserWrite">uploadable</span> 154</td></tr> 155</table> 156</div> 157 158 </body> 159</html> 160