22 define(
'NOTOKENRENEWAL', 1);
24 require
'../../../../main.inc.php';
26 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
28 * FCKeditor - The text editor
for Internet - http:
29 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
33 * Licensed under the terms of any of the following licenses at your
36 * - GNU General Public License Version 2 or later (the
"GPL")
39 * - GNU Lesser General Public License Version 2.1 or later (the
"LGPL")
42 * - Mozilla Public License Version 1.1 or later (the
"MPL")
47 * This page shows the list of folders available in the parent folder
48 * of the current folder.
56 <title>Folders</title>
57 <link href=
"browser.css" type=
"text/css" rel=
"stylesheet">
58 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
59 <script
type=
"text/javascript" src=
"js/common.js"></script>
60 <script
type=
"text/javascript">
64 var bIsLoaded = false ;
67 var oListManager =
new Object();
69 oListManager.Init =
function()
71 this.Table = document.getElementById(
'tableFiles');
72 this.UpRow = document.getElementById(
'trUp');
74 this.TableRows =
new Object();
77 oListManager.Clear =
function()
80 while ( this.Table.rows.length > 1 )
81 this.Table.deleteRow(1);
84 this.TableRows =
new Object();
87 oListManager.AddItem =
function( folderName, folderPath )
90 var oRow = this.Table.insertRow(-1);
91 oRow.className =
'FolderListFolder' ;
94 var sLink =
'<a href="#" onclick="OpenFolder(\'' + folderPath +
'\');
return false;
">' ;
96 // Add the folder icon cell.
97 var oCell = oRow.insertCell(-1);
99 oCell.innerHTML = sLink + '<img alt="" src="spacer.gif
" width="16
" height="16
" border="0
"><\/a>' ;
101 // Add the folder name cell.
102 oCell = oRow.insertCell(-1);
103 oCell.noWrap = true ;
104 oCell.innerHTML = ' ' + sLink + folderName + '<\/a>' ;
106 this.TableRows[ folderPath ] = oRow ;
109 oListManager.ShowUpFolder = function( upFolderPath )
111 this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' );
113 if ( upFolderPath != null )
115 document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
117 LoadFolders( upFolderPath );
123 function CheckLoaded()
125 if ( window.top.IsLoadedActualFolder
126 && window.top.IsLoadedCreateFolder
127 && window.top.IsLoadedUpload
128 && window.top.IsLoadedResourcesList )
130 window.clearInterval( iIntervalId );
132 OpenFolder( sActiveFolder );
136 function OpenFolder( folderPath )
138 sActiveFolder = folderPath ;
143 iIntervalId = window.setInterval( CheckLoaded, 100 );
147 // Change the style for the select row (to show the opened folder).
148 for ( var sFolderPath in oListManager.TableRows )
150 oListManager.TableRows[ sFolderPath ].className =
151 ( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' );
154 // Set the current folder in all frames.
155 window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath );
156 window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath );
157 window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath );
159 // Load the resources list for this folder.
160 window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath );
163 function LoadFolders( folderPath )
165 // Clear the folders list.
166 oListManager.Clear();
168 // Get the parent folder path.
169 var sParentFolderPath ;
170 if ( folderPath != '/' )
171 sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 );
173 // Show/Hide the Up Folder.
174 oListManager.ShowUpFolder( sParentFolderPath );
176 if ( folderPath != '/' )
178 sActiveFolder = folderPath ;
179 oConnector.CurrentFolder = sParentFolderPath ;
180 oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack );
186 function GetFoldersCallBack( fckXml )
188 if ( oConnector.CheckError( fckXml ) != 0 )
191 // Get the current folder path.
192 var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' );
193 var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
195 var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' );
197 for ( var i = 0 ; i < oNodes.length ; i++ )
199 var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
200 oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + '/' );
203 OpenFolder( sActiveFolder );
206 function SetResourceType( type )
208 oConnector.ResourceType = type ;
212 window.onload = function()
219 <body class="FileArea
">
220 <table id="tableFiles
" cellSpacing="0
" cellPadding="0
" width="100%
" border="0
">
221 <tr id="trUp
" style="DISPLAY: none
">
222 <td width="16
"><a id="linkUpIcon
" href="#
"><img alt="" src="images/FolderUp.gif
" width="16
" height="16
" border="0
"></a></td>
223 <td class="nowrap
" width="100%
"> <a id="linkUp
" href="#
">..</a></td>
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type