config.func.php
Upload User: feiyaoda
Upload Date: 2016-11-21
Package Size: 9556k
Code Size: 1k
Category:

WEB Mail

Development Platform:

PHP

  1. <?php
  2. function theme_list()
  3. {
  4.     $path = './themes/';
  5.     return get_list_folder($path);    
  6. }
  7. function language_list()
  8. {
  9.     $path = './lang/';
  10.     return get_list_folder($path);
  11. }
  12. function get_list_folder($path)
  13. {
  14.     $dp = opendir($path);
  15.     
  16.     if (!$dp)
  17.     {
  18.         trigger_error('Impossible to read language folder');
  19.         return false;
  20.     }
  21.     
  22.     while ($file = readdir($dp))
  23.     {
  24.         if ('.' == $file) continue;
  25.         if ('..' == $file) continue;
  26.         
  27.         if (is_dir($path.$file)) $folders[] = $file;
  28.     }
  29.     closedir($dp);
  30.     
  31.     $str = implode('|',$folders);
  32.     
  33.     // removing last char
  34.     unset($str[strlen($str)-1]);
  35.     
  36.     return $str;
  37. }