- Timestamp:
- 2006/11/21 17:26:05 (20 years ago)
- File:
-
- 1 edited
-
temp/trunk/html/test/uehara/test.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/html/test/uehara/test.php
r8767 r8768 1 1 <?php 2 2 3 $default_dir = "/home/web/test.ec-cube.net/html/user_data/";4 $arrCnt = split('/', $default_dir);5 $default_rank = count($arrCnt);6 3 7 $arrTree = array();8 $cnt = 0;9 4 10 5 sfGetFileTree($default_dir); … … 17 12 */ 18 13 function sfGetFileTree($dir) { 19 global $arrTree; 20 global $cnt; 21 global $default_rank; 14 $default_dir = "/home/web/test.ec-cube.net/html/user_data/"; 15 $arrCnt = split('/', $default_dir); 16 $default_rank = count($arrCnt); 17 18 $arrTree = array(); 19 $cnt = 0; 22 20 23 if(file_exists($dir)) { 24 if ($handle = opendir("$dir")) { 25 while (false !== ($item = readdir($handle))) { 26 if ($item != "." && $item != "..") { 27 // ʸËö¤Î/¤ò¼è¤ê½ü¤¯ 28 $dir = ereg_replace("/$", "", $dir); 29 $path = $dir."/".$item; 30 // ¥Ç¥£¥ì¥¯¥È¥ê¤Î¤ß¼èÆÀ 31 if (is_dir($path)) { 32 $path; 33 if(sfDirChildExists($path)) { 34 $file_type = "_parent"; 35 } else { 36 $file_type = "_child"; 21 function sfGetFileTreeSub($dir) { 22 23 if(file_exists($dir)) { 24 if ($handle = opendir("$dir")) { 25 while (false !== ($item = readdir($handle))) { 26 if ($item != "." && $item != "..") { 27 // ʸËö¤Î/¤ò¼è¤ê½ü¤¯ 28 $dir = ereg_replace("/$", "", $dir); 29 $path = $dir."/".$item; 30 // ¥Ç¥£¥ì¥¯¥È¥ê¤Î¤ß¼èÆÀ 31 if (is_dir($path)) { 32 $path; 33 if(sfDirChildExists($path)) { 34 $file_type = "_parent"; 35 } else { 36 $file_type = "_child"; 37 } 38 39 // ³¬Áؤò³ä¤ê½Ð¤¹ 40 $arrCnt = split('/', $path); 41 $rank = count($arrCnt); 42 $rank = $rank - $default_rank; 43 44 // javascript¤Î¥Ä¥ê¡¼À¸À®ÍѤÎÇÛÎó¤òºîÀ® 45 $arrTree[$cnt] = array($cnt, $file_type, $path, $rank); 46 $cnt++; 47 // ²¼Áإǥ£¥ì¥¯¥È¥ê¼èÆÀ¤Î°Ù¡¢ºÆµ¢Åª¤Ë¸Æ¤Ó½Ð¤¹ 48 sfGetFileTreeSub($path); 37 49 } 38 39 // ³¬Áؤò³ä¤ê½Ð¤¹40 $arrCnt = split('/', $path);41 $rank = count($arrCnt);42 $rank = $rank - $default_rank;43 44 // javascript¤Î¥Ä¥ê¡¼À¸À®ÍѤÎÇÛÎó¤òºîÀ®45 $arrTree[$cnt] = array($cnt, $file_type, $path, $rank);46 $cnt++;47 // ²¼Áإǥ£¥ì¥¯¥È¥ê¼èÆÀ¤Î°Ù¡¢ºÆµ¢Åª¤Ë¸Æ¤Ó½Ð¤¹48 sfGetFileTree($path);49 50 } 50 51 } 51 52 } 53 closedir($handle); 52 54 } 53 closedir($handle);54 55 } 55 56 }
Note: See TracChangeset
for help on using the changeset viewer.
