Location: PHPKode > projects > Wexplorer > weXplorer/tree.root.php
<?php
require_once('config.inc.php');
header('Connection: keep-alive');
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>';
echo "\n<tree>";
$mappings = split(',',$ini_array['general']['FOLDERS']);
$folders = array();
foreach ($mappings as $mapping) {
	$mapping = split('->', $mapping);
	$folders[] = $mapping[0];
}
foreach( $folders as $folder){
	$expand = false;
	if(substr($folder,0,1)=="*"){
		$folder = substr($folder,1);
		$expand = true;
	}
	echo'
	<tree 
		label="'.$folder.'"
		icon="tree/folder.gif"
		iconopen="tree/folderopen.gif"
		src="'.ROOT_URL.'/tree.php?folder=./'.$folder.'/" 
		href="javascript:folderSelected(\'./'.$folder.'\');"';
	if($expand)
		echo '
		onloadevent="selectPath(\''.$folder.'\')" ';
	echo '
		/>';
}
echo "\n</tree>";
/*
OUTPUT EXAMPLE:
<tree>
	<tree 
		label="delivery"
		icon="/tree/folder.gif"
		iconopen="/tree/folderopen.gif"
		src="/tree.php?folder=./delivery/" 
		href="javascript:folderSelected('./delivery');"
		onloadevent="folderSelected('./delivery')" 
		/>
	<tree 
		label="documentation"
		icon="/tree/folder.gif"
		iconopen="/tree/folderopen.gif"
		src="/tree.php?folder=./documentation" 
		href="javascript:folderSelected('./documentation');"
		/>
</tree>
*/
?>
Return current item: Wexplorer