22 define(
'NOTOKENRENEWAL', 1);
25 require
'../../../../main.inc.php';
30 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
32 * FCKeditor - The text editor
for Internet - http:
33 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
37 * Licensed under the terms of any of the following licenses at your
40 * - GNU General Public License Version 2 or later (the
"GPL")
43 * - GNU Lesser General Public License Version 2.1 or later (the
"LGPL")
46 * - Mozilla Public License Version 1.1 or later (the
"MPL")
51 * This page shows the list of folders available in the parent folder
52 * of the current folder.
60 <title>Folders</title>
61 <link href=
"browser.css" type=
"text/css" rel=
"stylesheet">
62 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
64 print
'<!-- Includes CSS for Dolibarr theme -->'.
"\n";
68 if (!empty($conf->modules_parts[
'theme'])) {
69 foreach ($conf->modules_parts[
'theme'] as $reldir) {
72 $themesubdir = $reldir;
79 print
'<link rel="stylesheet" type="text/css" href="'.$themepath.
'">'.
"\n";
81 <script
type=
"text/javascript" src=
"js/common.js"></script>
82 <script
type=
"text/javascript">
86 var bIsLoaded = false ;
89 var oListManager =
new Object();
91 oListManager.Init =
function()
93 this.Table = document.getElementById(
'tableFiles');
94 this.UpRow = document.getElementById(
'trUp');
96 this.TableRows =
new Object();
99 oListManager.Clear =
function()
102 while ( this.Table.rows.length > 1 )
103 this.Table.deleteRow(1);
106 this.TableRows =
new Object();
109 oListManager.AddItem =
function( folderName, folderPath )
112 var oRow = this.Table.insertRow(-1);
113 oRow.className =
'FolderListFolder' ;
116 var sLink =
'<a href="#" onclick="OpenFolder(\'' + folderPath +
'\');
return false;
">' ;
118 // Add the folder icon cell.
119 var oCell = oRow.insertCell(-1);
121 oCell.innerHTML = sLink + ' <\/a>' ;
123 // Add the folder name cell.
124 oCell = oRow.insertCell(-1);
125 oCell.noWrap = true ;
126 oCell.innerHTML = ' ' + sLink + folderName + '<\/a>' ;
128 this.TableRows[ folderPath ] = oRow ;
131 oListManager.ShowUpFolder = function( upFolderPath )
133 this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' );
135 if ( upFolderPath != null )
137 document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
139 LoadFolders( upFolderPath );
145 function CheckLoaded()
147 if ( window.top.IsLoadedActualFolder
148 && window.top.IsLoadedCreateFolder
149 && window.top.IsLoadedUpload
150 && window.top.IsLoadedResourcesList )
152 window.clearInterval( iIntervalId );
154 OpenFolder( sActiveFolder );
158 function OpenFolder( folderPath )
160 sActiveFolder = folderPath ;
165 iIntervalId = window.setInterval( CheckLoaded, 100 );
169 // Change the style for the select row (to show the opened folder).
170 for ( var sFolderPath in oListManager.TableRows )
172 oListManager.TableRows[ sFolderPath ].className =
173 ( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' );
176 // Set the current folder in all frames.
177 window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath );
178 window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath );
179 window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath );
181 // Load the resources list for this folder.
182 window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath );
185 function LoadFolders( folderPath )
187 // Clear the folders list.
188 oListManager.Clear();
190 // Get the parent folder path.
191 var sParentFolderPath ;
192 if ( folderPath != '/' )
193 sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 );
195 // Show/Hide the Up Folder.
196 oListManager.ShowUpFolder( sParentFolderPath );
198 if ( folderPath != '/' )
200 sActiveFolder = folderPath ;
201 oConnector.CurrentFolder = sParentFolderPath ;
202 oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack );
208 function GetFoldersCallBack( fckXml )
210 if ( oConnector.CheckError( fckXml ) != 0 )
213 // Get the current folder path.
214 var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' );
215 var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
217 var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' );
219 for ( var i = 0 ; i < oNodes.length ; i++ )
221 var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
222 oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + '/' );
225 OpenFolder( sActiveFolder );
228 function SetResourceType( type )
230 oConnector.ResourceType = type ;
234 window.onload = function()
241 <body class="FileArea
">
242 <table id="tableFiles
" cellSpacing="0
" cellPadding="0
" width="100%
" border="0
">
243 <tr id="trUp
" style="DISPLAY: none
">
244 <td width="16
"><a id="linkUpIcon
" href="#
"><img alt="" src="images/FolderUp.gif
" width="16
" height="16
" border="0
"></a></td>
245 <td class="nowrap
" width="100%
"> <a id="linkUp
" href="#
">..</a></td>
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type