22define(
'NOTOKENRENEWAL', 1);
25require
'../../../../main.inc.php';
33<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
35 * FCKeditor - The text editor
for Internet - http:
36 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
40 * Licensed under the terms of any of the following licenses at your
43 * - GNU General Public License Version 2 or later (the
"GPL")
46 * - GNU Lesser General Public License Version 2.1 or later (the
"LGPL")
49 * - Mozilla Public License Version 1.1 or later (the
"MPL")
54 * This page shows the list of folders available in the parent folder
55 * of the current folder.
63 <title>Folders</title>
64 <link href=
"browser.css" type=
"text/css" rel=
"stylesheet">
65 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
67print
'<!-- Includes CSS for Dolibarr theme -->'.
"\n";
71if (!empty(
$conf->modules_parts[
'theme'])) {
72 foreach (
$conf->modules_parts[
'theme'] as $reldir) {
75 $themesubdir = $reldir;
82print
'<link rel="stylesheet" type="text/css" href="'.$themepath.
'">'.
"\n";
84 <script
type=
"text/javascript" src=
"js/common.js"></script>
85 <script
type=
"text/javascript">
89var bIsLoaded = false ;
92var oListManager =
new Object();
94oListManager.Init =
function()
96 this.Table = document.getElementById(
'tableFiles');
97 this.UpRow = document.getElementById(
'trUp');
99 this.TableRows =
new Object();
102oListManager.Clear =
function()
105 while ( this.Table.rows.length > 1 )
106 this.Table.deleteRow(1);
109 this.TableRows =
new Object();
112oListManager.AddItem =
function( folderName, folderPath )
115 var oRow = this.Table.insertRow(-1);
116 oRow.className =
'FolderListFolder' ;
119 var sLink =
'<a href="#" onclick="OpenFolder(\'' + folderPath +
'\');
return false;
">' ;
121 // Add the folder icon cell.
122 var oCell = oRow.insertCell(-1);
124 oCell.innerHTML = sLink + ' <\/a>' ;
126 // Add the folder name cell.
127 oCell = oRow.insertCell(-1);
128 oCell.noWrap = true ;
129 oCell.innerHTML = ' ' + sLink + folderName + '<\/a>' ;
131 this.TableRows[ folderPath ] = oRow ;
134oListManager.ShowUpFolder = function( upFolderPath )
136 this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' );
138 if ( upFolderPath != null )
140 document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
142 LoadFolders( upFolderPath );
148function CheckLoaded()
150 if ( window.top.IsLoadedActualFolder
151 && window.top.IsLoadedCreateFolder
152 && window.top.IsLoadedUpload
153 && window.top.IsLoadedResourcesList )
155 window.clearInterval( iIntervalId );
157 OpenFolder( sActiveFolder );
161function OpenFolder( folderPath )
163 sActiveFolder = folderPath ;
168 iIntervalId = window.setInterval( CheckLoaded, 100 );
172 // Change the style for the select row (to show the opened folder).
173 for ( var sFolderPath in oListManager.TableRows )
175 oListManager.TableRows[ sFolderPath ].className =
176 ( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' );
179 // Set the current folder in all frames.
180 window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath );
181 window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath );
182 window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath );
184 // Load the resources list for this folder.
185 window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath );
188function LoadFolders( folderPath )
190 console.log("LoadFolders folderPath=
"+folderPath);
192 // Clear the folders list.
193 oListManager.Clear();
195 // Get the parent folder path.
196 var sParentFolderPath ;
197 if ( folderPath != '/' )
198 sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 );
200 // Show/Hide the Up Folder.
201 oListManager.ShowUpFolder( sParentFolderPath );
203 if ( folderPath != '/' )
205 sActiveFolder = folderPath ;
206 oConnector.CurrentFolder = sParentFolderPath ;
207 oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack );
213function GetFoldersCallBack( fckXml )
215 if ( oConnector.CheckError( fckXml ) != 0 )
218 // Get the current folder path.
219 var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' );
220 var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
222 var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' );
224 for ( var i = 0 ; i < oNodes.length ; i++ )
226 var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
227 oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + '/' );
230 OpenFolder( sActiveFolder );
233function SetResourceType( type )
235 oConnector.ResourceType = type ;
239window.onload = function()
246 <body class="FileArea
">
247 <table id="tableFiles
" cellSpacing="0
" cellPadding="0
" width="100%
" border="0
">
248 <tr id="trUp
" style="DISPLAY: none
">
249 <td width="16
"><a id="linkUpIcon
" href="#
"><img alt="" src="images/FolderUp.gif
" width="16
" height="16
" border="0
"></a></td>
250 <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(!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...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type