| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2 <!-- 3 * FCKeditor - The text editor for internet 4 * Copyright (C) 2003-2006 Frederico Caldeira Knabben 5 * 6 * Licensed under the terms of the GNU Lesser General Public License: 7 * http://www.opensource.org/licenses/lgpl-license.php 8 * 9 * For further information visit: 10 * http://www.fckeditor.net/ 11 * 12 * "Support Open Source software. What about a donation today?" 13 * 14 * File Name: frmresourceslist.html 15 * This page shows all resources available in a folder in the File Browser. 16 * 17 * File Authors: 18 * Frederico Caldeira Knabben (fredck@fckeditor.net) 19 --> 20 <html xmlns="http://www.w3.org/1999/xhtml"> 21 <head> 22 <link href="browser.css" type="text/css" rel="stylesheet" /> 23 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 24 <script type="text/javascript" src="/fckeditor/common.js"></script> 25 <script type="text/javascript"> 26 <!-- 27 var oListManager = new Object() ; 28 29 oListManager.Clear = function() 30 { 31 document.body.innerHTML = '' ; 32 } 33 34 oListManager.GetFolderRowHtml = function( folderName, folderPath ) 35 { 36 // Build the link to view the folder. 37 var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath.replace( /'/g, '\\\'') + '\');return false;">' ; 38 39 return '<tr>' + 40 '<td width="16">' + 41 sLink + 42 '<img alt="" src="/fckeditor/images/Folder.gif" width="16" height="16" border="0"></a>' + 43 '</td><td nowrap colspan="2"> ' + 44 sLink + 45 folderName + 46 '</a>' + 47 '</td></tr>' ; 48 } 49 50 oListManager.GetFileRowHtml = function( id, fileName, fileUrl, fileSize ) 51 { 52 // Build the link to view the folder. 53 var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\', ' + id + ', \'' + fileName + '\');return false;">' ; 54 55 // Get the file icon. 56 var sIcon = oIcons.GetIcon( fileName ) ; 57 58 return '<tr>' + 59 '<td width="16">' + 60 sLink + 61 '<img alt="" src="/fckeditor/images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' + 62 '</td><td> ' + 63 sLink + 64 fileName + 65 '</a>' + 66 '</td><td align="right" nowrap> ' + 67 fileSize + 68 ' KB' + 69 '</td></tr>' ; 70 } 71 72 oListManager.GetImageRowHtml = function( id, fileName, iconUrl, thumbnailUrl, originalUrl ) 73 { 74 // Build the link to view the folder. 75 var sIconLink = '<a href="#" onclick="OpenFile(\'' + iconUrl.replace( /'/g, '\\\'') + '\', ' + id + ');return false;">' ; 76 var sThumbnailLink = '<a href="#" onclick="OpenFile(\'' + thumbnailUrl.replace( /'/g, '\\\'') + '\', ' + id + ');return false;">' ; 77 var sOriginalLink = '<a href="#" onclick="OpenFile(\'' + originalUrl.replace( /'/g, '\\\'') + '\', ' + id + ');return false;">' ; 78 79 return '<tr>' + 80 '<td width="16">' + 81 '<img alt="" src="' + iconUrl + '" width="16" height="16" border="0">' + 82 '</td><td> ' + 83 fileName + 84 ' ' + 85 sOriginalLink + 86 'Original</a>' + 87 ' | ' + 88 sThumbnailLink + 89 'Thumbnail</a>' + 90 ' | ' + 91 sIconLink + 92 'Icon</a>' + 93 '</td><td align="right" nowrap> ' + 94 '</td></tr>' ; 95 } 96 97 98 function OpenFolder( folderPath ) 99 { 100 // Load the resources list for this folder. 101 window.parent.frames['frmFolders'].LoadFolders( folderPath ) ; 102 } 103 104 function OpenFile( fileUrl, id, fileName ) 105 { 106 window.top.opener.SetUrl( fileUrl, id, fileName ) ; 107 window.top.close() ; 108 window.top.opener.focus() ; 109 } 110 111 function LoadResources( resourceType, folderPath ) 112 { 113 oListManager.Clear() ; 114 oConnector.ResourceType = resourceType ; 115 oConnector.CurrentFolder = folderPath 116 oConnector.SendCommand( 'GetFoldersAndFiles', null, GetFoldersAndFilesCallBack ) ; 117 } 118 119 function Refresh() 120 { 121 LoadResources( oConnector.ResourceType, oConnector.CurrentFolder ) ; 122 } 123 124 function GetFoldersAndFilesCallBack( fckXml ) 125 { 126 if ( oConnector.CheckError( fckXml ) != 0 ) 127 return ; 128 129 // var dTimer = new Date() ; 130 131 // Get the current folder path. 132 var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ; 133 var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ; 134 var sCurrentFolderUrl = oNode.attributes.getNamedItem('url').value ; 135 136 var sHTML = '<table id="tableFiles" cellspacing="1" cellpadding="0" width="100%" border="0">' ; 137 138 139 // Add the Folders. 140 var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ; 141 for ( var i = 0 ; i < oNodes.length ; i++ ) 142 { 143 var sFolderName = oNodes[i].attributes.getNamedItem('name').value ; 144 var folderId = oNodes[i].attributes.getNamedItem('id').value ; 145 sHTML += oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + folderId + "/" ) ; 146 } 147 148 // Add the Files. 149 var oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ; 150 for ( var i = 0 ; i < oNodes.length ; i++ ) 151 { 152 if(oConnector.ResourceType == 'Image') 153 { 154 var iconUrl = oNodes[i].attributes.getNamedItem('icon_url').value ; 155 var thumbnailUrl = oNodes[i].attributes.getNamedItem('thumbnail_url').value ; 156 var originalUrl = oNodes[i].attributes.getNamedItem('original_url').value ; 157 var sFileName = oNodes[i].attributes.getNamedItem('name').value ; 158 var id = oNodes[i].attributes.getNamedItem('id').value ; 159 sHTML += oListManager.GetImageRowHtml( id, sFileName, iconUrl, thumbnailUrl, originalUrl ) ; 160 } 161 else 162 { 163 var fileUrl = oNodes[i].attributes.getNamedItem('url').value ; 164 var sFileName = oNodes[i].attributes.getNamedItem('name').value ; 165 var sFileSize = oNodes[i].attributes.getNamedItem('size').value ; 166 var id = oNodes[i].attributes.getNamedItem('id').value ; 167 sHTML += oListManager.GetFileRowHtml( id, sFileName, fileUrl, sFileSize ) ; 168 } 169 170 } 171 172 sHTML += '</table>' ; 173 174 document.body.innerHTML = sHTML ; 175 176 // window.top.document.title = 'Finished processing in ' + ( ( ( new Date() ) - dTimer ) / 1000 ) + ' seconds' ; 177 } 178 179 window.onload = function() 180 { 181 window.top.IsLoadedResourcesList = true ; 182 } 183 --> 184 </script> 185 </head> 186 <body class="FileArea" bottommargin="10" leftmargin="10" topmargin="10" rightmargin="10"> 187 </body> 188 </html>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Fri Dec 5 04:05:07 2008 | Cross-referenced by PHPXref 0.7 |