[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/cms/template/admin_tree/ -> folders.html (source)

   1  <!--
   2   * FCKeditor - The text editor for internet
   3   * Copyright (C) 2003-2006 Frederico Caldeira Knabben
   4   *
   5   * Licensed under the terms of the GNU Lesser General Public License:
   6   *         http://www.opensource.org/licenses/lgpl-license.php
   7   *
   8   * For further information visit:
   9   *         http://www.fckeditor.net/
  10   *
  11   * "Support Open Source software. What about a donation today?"
  12   *
  13   * File Name: frmfolders.html
  14   *     This page shows the list of folders available in the parent folder
  15   *     of the current folder.
  16   *
  17   * File Authors:
  18   *         Frederico Caldeira Knabben (fredck@fckeditor.net)
  19  -->
  20  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  21  <html>
  22    <head>
  23      <link href="browser.css" type="text/css" rel="stylesheet" />
  24      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  25      <script type="text/javascript" src="/fckeditor/common.js"></script>
  26      <script language="javascript">
  27      <!--
  28  var sActiveFolder ;
  29  
  30  var bIsLoaded = false ;
  31  var iIntervalId ;
  32  
  33  var oListManager = new Object() ;
  34  
  35  oListManager.Init = function()
  36  {
  37    this.Table = document.getElementById('tableFiles') ;
  38    this.UpRow = document.getElementById('trUp') ;
  39  
  40    this.TableRows = new Object() ;
  41  }
  42  
  43  oListManager.Clear = function()
  44  {
  45    // Remove all other rows available.

  46    while ( this.Table.rows.length > 1 )
  47      this.Table.deleteRow(1) ;
  48  
  49    // Reset the TableRows collection.

  50    this.TableRows = new Object() ;
  51  }
  52  
  53  oListManager.AddItem = function( folderName, folderPath )
  54  {
  55    // Create the new row.

  56    var oRow = this.Table.insertRow(-1) ;
  57    oRow.className = 'FolderListFolder' ;
  58  
  59    // Build the link to view the folder.

  60    var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath + '\');return false;">' ;
  61  
  62    // Add the folder icon cell.

  63    var oCell = oRow.insertCell(-1) ;
  64    oCell.width = 16 ;
  65    oCell.innerHTML = sLink + '<img alt="" src="/fckeditor/images/Folder.gif" width="16" height="16" border="0"></a>' ;
  66  
  67    // Add the folder name cell.

  68    oCell = oRow.insertCell(-1) ;
  69    oCell.noWrap = true ;
  70    oCell.innerHTML = '&nbsp;' + sLink + folderName + '</a>' ;
  71  
  72    this.TableRows[ folderPath ] = oRow ;
  73  }
  74  
  75  oListManager.ShowUpFolder = function( upFolderPath )
  76  {
  77    this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' ) ;
  78  
  79    if ( upFolderPath != null )
  80    {
  81      document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
  82      {
  83        LoadFolders( upFolderPath ) ;
  84        return false ;
  85      }
  86    }
  87  }
  88  
  89  function CheckLoaded()
  90  {
  91    if ( window.top.IsLoadedResourcesList )
  92    {
  93      window.clearInterval( iIntervalId ) ;
  94      bIsLoaded = true ;
  95      OpenFolder( sActiveFolder ) ;
  96    }
  97  }
  98  
  99  function OpenFolder( folderPath )
 100  {
 101    sActiveFolder = folderPath ;
 102  
 103    if ( ! bIsLoaded )
 104    {
 105      if ( ! iIntervalId )
 106        iIntervalId = window.setInterval( CheckLoaded, 100 ) ;
 107      return ;
 108    }
 109  
 110    // Change the style for the select row (to show the opened folder).

 111    for ( var sFolderPath in oListManager.TableRows )
 112    {
 113      oListManager.TableRows[ sFolderPath ].className =
 114        ( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' ) ;
 115    }
 116  
 117    // Load the resources list for this folder.

 118    window.parent.frames['frmResourcesList'].LoadResources( folderPath ) ;
 119  }
 120  
 121  function LoadFolders( folderPath )
 122  {
 123    // Clear the folders list.

 124    oListManager.Clear() ;
 125  
 126    // Get the parent folder path.

 127    var sParentFolderPath ;
 128    if ( folderPath != '/' )
 129      sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 ) ;
 130  
 131    // Show/Hide the Up Folder.

 132    oListManager.ShowUpFolder( sParentFolderPath ) ;
 133  
 134    if ( folderPath != '/' )
 135    {
 136      sActiveFolder = folderPath ;
 137      oConnector.CurrentFolder = sParentFolderPath;
 138      oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack ) ;
 139    }
 140    else
 141      OpenFolder( '/' ) ;
 142  }
 143  
 144  function GetFoldersCallBack( fckXml )
 145  {
 146    if ( oConnector.CheckError( fckXml ) != 0 )
 147      return ;
 148  
 149    // Get the current folder path.

 150    var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
 151    var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
 152  
 153    var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
 154  
 155    for ( var i = 0 ; i < oNodes.length ; i++ )
 156    {
 157      var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
 158      var folderId = oNodes[i].attributes.getNamedItem('id').value ;
 159      oListManager.AddItem( sFolderName, sCurrentFolderPath + folderId + "/" ) ;
 160    }
 161  
 162    OpenFolder( sActiveFolder ) ;
 163  }
 164  
 165  window.onload = function()
 166  {
 167    oListManager.Init() ;
 168    LoadFolders( '/' ) ;
 169  }
 170      -->
 171      </script>
 172    </head>
 173    <body class="FileArea" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10">
 174      <table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0">
 175        <tr id="trUp" style="DISPLAY: none">
 176          <td width="16"><a id="linkUpIcon" href="#"><img alt="" src="/fckeditor/images/FolderUp.gif" width="16" height="16" border="0" /></a></td>
 177          <td nowrap width="100%">&nbsp;<a id="linkUp" href="#">..</a></td>
 178        </tr>
 179      </table>
 180    </body>
 181  </html>


Generated: Fri Dec 5 04:05:07 2008 Cross-referenced by PHPXref 0.7