- Timestamp:
- 2006/11/21 17:29:58 (20 years ago)
- File:
-
- 1 edited
-
temp/trunk/html/test/uehara/test.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/html/test/uehara/test.php
r8769 r8770 19 19 $cnt = 0; 20 20 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); 21 sfGetFileTreeSub($default_dir, $default_rank, $arrTree, $cnt); 22 } 23 24 function sfGetFileTreeSub($dir, $default_rank, $arrTree, $cnt) { 25 26 if(file_exists($dir)) { 27 if ($handle = opendir("$dir")) { 28 while (false !== ($item = readdir($handle))) { 29 if ($item != "." && $item != "..") { 30 // ʸËö¤Î/¤ò¼è¤ê½ü¤¯ 31 $dir = ereg_replace("/$", "", $dir); 32 $path = $dir."/".$item; 33 // ¥Ç¥£¥ì¥¯¥È¥ê¤Î¤ß¼èÆÀ 34 if (is_dir($path)) { 35 $path; 36 if(sfDirChildExists($path)) { 37 $file_type = "_parent"; 38 } else { 39 $file_type = "_child"; 49 40 } 41 42 // ³¬Áؤò³ä¤ê½Ð¤¹ 43 $arrCnt = split('/', $path); 44 $rank = count($arrCnt); 45 $rank = $rank - $default_rank; 46 47 // javascript¤Î¥Ä¥ê¡¼À¸À®ÍѤÎÇÛÎó¤òºîÀ® 48 $arrTree[$cnt] = array($cnt, $file_type, $path, $rank); 49 $cnt++; 50 // ²¼Áإǥ£¥ì¥¯¥È¥ê¼èÆÀ¤Î°Ù¡¢ºÆµ¢Åª¤Ë¸Æ¤Ó½Ð¤¹ 51 sfGetFileTreeSub($path, $default_rank, $arrTree, $cnt); 50 52 } 51 53 } 52 54 } 53 closedir($handle);54 55 } 56 closedir($handle); 55 57 } 56 sfGetFileTreeSub($default_dir);57 58 } 59 60 61 58 62 59 63 /*
Note: See TracChangeset
for help on using the changeset viewer.
