dolibarr  7.0.0-beta
frmcreatefolder.php
1 <?php
2 /* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2003-2010 Frederico Caldeira Knabben
4  *
5  * Source modified from part of fckeditor (http://www.fckeditor.net)
6  * retreived as GPL v2 or later
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 define('NOTOKENRENEWAL',1); // Disables token renewal
23 
24 require '../../../../main.inc.php';
25 ?>
26 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
27 <!--
28  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
29  * Copyright (C) 2003-2010 Frederico Caldeira Knabben
30  *
31  * == BEGIN LICENSE ==
32  *
33  * Licensed under the terms of any of the following licenses at your
34  * choice:
35  *
36  * - GNU General Public License Version 2 or later (the "GPL")
37  * http://www.gnu.org/licenses/gpl.html
38  *
39  * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
40  * http://www.gnu.org/licenses/lgpl.html
41  *
42  * - Mozilla Public License Version 1.1 or later (the "MPL")
43  * http://www.mozilla.org/MPL/MPL-1.1.html
44  *
45  * == END LICENSE ==
46  *
47  * Page used to create new folders in the current folder.
48 -->
49 <html>
50  <head>
51  <title>Create Folder</title>
52  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
53  <link href="browser.css" type="text/css" rel="stylesheet">
54  <script type="text/javascript" src="js/common.js"></script>
55  <script type="text/javascript">
56 
57 function SetCurrentFolder( resourceType, folderPath )
58 {
59  oConnector.ResourceType = resourceType ;
60  oConnector.CurrentFolder = folderPath ;
61 }
62 
63 function CreateFolder()
64 {
65  var sFolderName ;
66 
67  while ( true )
68  {
69  sFolderName = prompt( 'Type the name of the new folder:', '' );
70 
71  if ( sFolderName == null )
72  return ;
73  else if ( sFolderName.length == 0 )
74  alert( 'Please type the folder name' );
75  else
76  break ;
77  }
78 
79  oConnector.SendCommand( 'CreateFolder', 'NewFolderName=' + encodeURIComponent( sFolderName) , CreateFolderCallBack );
80 }
81 
82 function CreateFolderCallBack( fckXml )
83 {
84  if ( oConnector.CheckError( fckXml ) == 0 )
85  window.parent.frames['frmResourcesList'].Refresh();
86 
87  /*
88  // Get the current folder path.
89  var oNode = fckXml.SelectSingleNode( 'Connector/Error' );
90  var iErrorNumber = parseInt( oNode.attributes.getNamedItem('number').value );
91 
92  switch ( iErrorNumber )
93  {
94  case 0:
95  window.parent.frames['frmResourcesList'].Refresh();
96  break;
97  case 101:
98  alert( 'Folder already exists' );
99  break;
100  case 102:
101  alert( 'Invalid folder name' );
102  break;
103  case 103:
104  alert( 'You have no permissions to create the folder' );
105  break;
106  case 110:
107  alert( 'Unknown error creating folder' );
108  break;
109  default:
110  alert( 'Error creating folder. Error number: ' + iErrorNumber );
111  break;
112  }
113  */
114 }
115 
116 window.onload = function()
117 {
118  window.top.IsLoadedCreateFolder = true ;
119 }
120  </script>
121  </head>
122  <body>
123  <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
124  <tr>
125  <td>
126  <button type="button" style="WIDTH: 100%" onclick="CreateFolder();">
127  <table cellSpacing="0" cellPadding="0" border="0">
128  <tr>
129  <td><?php echo img_picto_common('','treemenu/folder.gif','width="16" height="16"'); ?></td>
130  <td>&nbsp;</td>
131  <td class="nowrap">Create New Folder</td>
132  </tr>
133  </table>
134  </button>
135  </td>
136  </tr>
137  </table>
138  </body>
139 </html>
img_picto_common($titlealt, $picto, $moreatt= '', $pictoisfullpath=0)
Show picto (generic function)
type
Definition: viewcat.php:283