diff options
author | wei <> | 2006-06-17 01:55:05 +0000 |
---|---|---|
committer | wei <> | 2006-06-17 01:55:05 +0000 |
commit | b3ceed048bb533a00bbea542f7c12b49c8c83d9b (patch) | |
tree | 97962fc3cb6746ae404c4f1d0095834bbb0e1ac7 /tests/FunctionalTests/active-controls/protected/pages/FeatureList.php | |
parent | 6c0154fb4e292ad22667e618f598a37cc5f9d524 (diff) |
Update changes to active controls, add FT tests for active controls, add comments.
Diffstat (limited to 'tests/FunctionalTests/active-controls/protected/pages/FeatureList.php')
-rwxr-xr-x | tests/FunctionalTests/active-controls/protected/pages/FeatureList.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/FeatureList.php b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.php new file mode 100755 index 00000000..8f28f6de --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.php @@ -0,0 +1,34 @@ +<?php + +class FeatureList extends TPage +{ + public function onLoad($param) + { + parent::onLoad($param); + $list=$this->getPageList(dirname(__FILE__),''); + $this->List->DataSource=$list; + $this->List->dataBind(); + } + + protected function getPageList($directory,$basePath) + { + $list=array(); + $folder=@opendir($directory); + while($entry=@readdir($folder)) + { + if($entry[0]==='.') + continue; + else if(is_file($directory.'/'.$entry)) + { + if(($page=basename($entry,'.page'))!==$entry && strpos($page,'.')===false) + $list['?page='.$basePath.$page]=$basePath.$page; + } + else + $list=array_merge($list,$this->getPageList($directory.'/'.$entry,$basePath.$entry.'.')); + } + closedir($folder); + return $list; + } +} + +?>
\ No newline at end of file |