[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/wysiwyg/shared/tiny_mce/plugins/ibrowser/scripts/ -> rdirs.php (source)

   1  <?php
   2      // ================================================

   3      // PHP image browser - iBrowser 

   4      // ================================================

   5      // iBrowser dialog - dir functions

   6      // ================================================

   7      // Developed: net4visions.com

   8      // Copyright: net4visions.com

   9      // License: GPL - see license.txt

  10      // (c)2005 All rights reserved.

  11      // ================================================

  12      // Revision: 1.0                   Date: 12/12/2005

  13      // ================================================

  14      
  15      $files = array();    
  16      foreach ($cfg['ilibs_dir'] as $dir) {        
  17          if ($cfg['ilibs_dir_show'] == true) {
  18              $files[] = array('value' => absPath(str_replace($cfg['root_dir'],'',$dir)), 'text' => ucfirst(basename($dir)));                
  19          }        
  20          if(dirlist($files, str_replace('//','/',$cfg['root_dir'] . $dir))) { // get dirlist
  21              $cfg['ilibs'] = $files;            
  22          } else {
  23              echo 'directory error';
  24              return false;
  25          }    
  26      }    
  27  	function dirlist(&$files,$dir) {        
  28          global $cfg;
  29          if ($handle = opendir($dir)) {            
  30              while ($file = readdir($handle)) {                
  31                  if ($file == '.' || $file == '..') {
  32                      continue;                    
  33                  }                
  34                  $fullpath = str_replace('//','/',$dir . '/' . $file);    
  35                  if (is_dir($fullpath)) {                        
  36                      $indent = str_repeat('&nbsp;', count(explode('/', trim(str_replace($cfg['root_dir'],'',$dir), '/')))*2);
  37                      $files[] = array('value' => absPath(str_replace( $cfg['root_dir'],'',$fullpath ) . '/'), 'text' => $indent . ucfirst(basename($fullpath)));    
  38                      dirlist($files,$fullpath);                                                               
  39                  }
  40                 }
  41              closedir($handle);
  42              asort($files);    
  43                 return true;        
  44          }
  45          return false;         
  46      }
  47  ?>


Generated: Thu Aug 28 04:51:15 2008 Cross-referenced by PHPXref 0.7