summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/protected/pages/FeatureList.php
blob: 8f28f6dee2123d7cdfc94bd218656f69bacb08c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
	}
}

?>