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
  if (file_exists( "TreeMenuXL.php" ))
    include_once( "TreeMenuXL.php" );

  //$path="../imgs";
  $path="/www";
  //$realpath="/imgs";
  
  $menu00  = new HTML_TreeMenuXL();
  $nodeProperties = array("icon"=>"folder.gif");
  $node0 = new HTML_TreeNodeXL($path, "?path={$path}", $nodeProperties);
  
	//=========================================
	function ParseFolder($path,$nx="") {
		$i=0;
		//print $directory."<br />";
		if ($handle = opendir($path)) {
			while (($files=readdir($handle))!==false) {
				//print "i=".$i."<br />";
				//print "path=".$path."/".$files."<br />\n";
				if (is_dir($path."/".$files) && (($files !=".") && ($files!=".."))) {
					if ($nx=="") { /*$nx = &$node0->addItem(new HTML_TreeNodeXL($files, "?path={$path}/{$files}", $nodeProperties));*/}
					else $nx = &$nx->addItem(new HTML_TreeNodeXL($files, "?path={$path}/{$files}", $nodeProperties));
					$newpath=$path."/".$files;
					ParseFolder($newpath,$nx);
				}
				$i++;
			}
			closedir($handle);
		} else die("Is not possible to read from directory".$path);
	}
	ParseFolder("/www");
	
	$menu00->addItem($node0);