dolibarr 21.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 * retrieved 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 <https://www.gnu.org/licenses/>.
20 */
21
22define('NOTOKENRENEWAL', 1); // Disables token renewal
23
24// Load Dolibarr environment
25require '../../../../main.inc.php';
31$langs->load("ecm");
32
34
35?>
36<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
37<!--
38 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
39 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
40 *
41 * == BEGIN LICENSE ==
42 *
43 * Licensed under the terms of any of the following licenses at your
44 * choice:
45 *
46 * - GNU General Public License Version 2 or later (the "GPL")
47 * https://www.gnu.org/licenses/gpl.html
48 *
49 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
50 * https://www.gnu.org/licenses/lgpl.html
51 *
52 * - Mozilla Public License Version 1.1 or later (the "MPL")
53 * http://www.mozilla.org/MPL/MPL-1.1.html
54 *
55 * == END LICENSE ==
56 *
57 * Page used to create new folders in the current folder.
58-->
59<html>
60 <head>
61 <title>Create Folder</title>
62 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
63<?php
64print '<!-- Includes CSS for Dolibarr theme -->'."\n";
65// Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php'
66$themepath = dol_buildpath($conf->css, 1);
67$themesubdir = '';
68if (!empty($conf->modules_parts['theme'])) { // This slow down
69 foreach ($conf->modules_parts['theme'] as $reldir) {
70 if (file_exists(dol_buildpath($reldir.$conf->css, 0))) {
71 $themepath = dol_buildpath($reldir.$conf->css, 1);
72 $themesubdir = $reldir;
73 break;
74 }
75 }
76}
77
78//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
79print '<link rel="stylesheet" type="text/css" href="'.$themepath.'">'."\n";
80?>
81 <link href="browser.css" type="text/css" rel="stylesheet">
82 <script type="text/javascript" src="js/common.js"></script>
83 <script type="text/javascript">
84
85function SetCurrentFolder( resourceType, folderPath )
86{
87 oConnector.ResourceType = resourceType ;
88 oConnector.CurrentFolder = folderPath ;
89}
90
91function CreateFolder()
92{
93 var sFolderName ;
94
95 while ( true )
96 {
97 sFolderName = prompt( 'Type the name of the new folder:', '' );
98
99 if ( sFolderName == null )
100 return ;
101 else if ( sFolderName.length == 0 )
102 alert( 'Please type the folder name' );
103 else
104 break ;
105 }
106
107 oConnector.SendCommand( 'CreateFolder', 'NewFolderName=' + encodeURIComponent( sFolderName) , CreateFolderCallBack );
108}
109
110function CreateFolderCallBack( fckXml )
111{
112 if ( oConnector.CheckError( fckXml ) == 0 )
113 window.parent.frames['frmResourcesList'].Refresh();
114
115 /*
116 // Get the current folder path.
117 var oNode = fckXml.SelectSingleNode( 'Connector/Error' );
118 var iErrorNumber = parseInt( oNode.attributes.getNamedItem('number').value );
119
120 switch ( iErrorNumber )
121 {
122 case 0:
123 window.parent.frames['frmResourcesList'].Refresh();
124 break;
125 case 101:
126 alert( 'Folder already exists' );
127 break;
128 case 102:
129 alert( 'Invalid folder name' );
130 break;
131 case 103:
132 alert( 'You have no permissions to create the folder' );
133 break;
134 case 110:
135 alert( 'Unknown error creating folder' );
136 break;
137 default:
138 alert( 'Error creating folder. Error number: ' + iErrorNumber );
139 break;
140 }
141 */
142}
143
144window.onload = function()
145{
146 window.top.IsLoadedCreateFolder = true ;
147}
148 </script>
149 </head>
150 <body>
151 <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
152 <tr>
153 <td>
154 <button type="button" class="butAction" onclick="CreateFolder();"><?php echo $langs->trans("ECMNewSection"); ?></button>
155 </td>
156 </tr>
157 </table>
158 </body>
159</html>
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
treeview li table
No Email.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:149