diff options
author | xue <> | 2006-07-02 18:05:42 +0000 |
---|---|---|
committer | xue <> | 2006-07-02 18:05:42 +0000 |
commit | 7e002c23edc5fb5db70935591aa6adeda25fc7fb (patch) | |
tree | 846feb337405448cc1559c2e7b4ed6f85798e0c7 /tests/FunctionalTests/validators/protected/pages/Home.php | |
parent | 618293517861b69334cd470068199394120cd20a (diff) |
Merge from 3.0 branch till 1224.
Diffstat (limited to 'tests/FunctionalTests/validators/protected/pages/Home.php')
-rwxr-xr-x | tests/FunctionalTests/validators/protected/pages/Home.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/FunctionalTests/validators/protected/pages/Home.php b/tests/FunctionalTests/validators/protected/pages/Home.php new file mode 100755 index 00000000..37804419 --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/Home.php @@ -0,0 +1,34 @@ +<?php + +class Home 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 |