Location: PHPKode > projects > Wexplorer > weXplorer/weXplorer_treeview.php
<?php

/*
 * Created on 18 août 2005
 * @author Matthias Cullmann
 */
error_reporting(E_ALL ^ E_NOTICE);
require_once ('session.php');
?>

<html>
<head>
	<title></title> 
</head>

<body >
<?php require_once ('treeview.php'); ?>
<table width="100%" border="0" cellpadding="2">
  <tr valign="top">
    <td><span id='tcontainer'/></td>
  </tr>
</table>

<script type="text/javascript">
function reget(){
	var url = document.lastget;
	document.lastget=null;
	document.cache[url]=null;
  	get(url);	
}


function setContent(cont){
	parent.folder.document.getElementsByTagName("body")[0].innerHTML = cont;
	parent.folder.sortables_init();
}

document.cache = new Object();

function resetLastFolder(){
	setContent(document.cache[document.lastget]);	
}

function get(a) {
		if(document.lastget == a) return;
		document.lastget = a;
		if(document.cache[a]!=null){
			 setContent(document.cache[a]);
			 return;
		}
		try {
			var url = "<?php echo ROOT_URL; ?>/"+ a;
			
			if(url.indexOf('?')<0){
				url += '?PHPSESSID=<?php echo session_id(); ?>&nocache='+new Date().getTime();
			}else{
				url += '&PHPSESSID=<?php echo session_id(); ?>&nocache='+new Date().getTime();
			}
			parent.folder.location.href = url;
			var bood = parent.folder.document.getElementsByTagName("body")[0];
			 bood.innerHTML=bood.innerHTML+ '<span style="font-family:	Verdana, Helvetica, Arial, Sans-Serif; font-size:11px;">Loading page contents ...</span>';		  
		}catch (ignored) {
			get(a);
		}
}





function folderSelected(url){
	get("info.php?folder="+url);
	mytreeview.selectedNode.expand();
}
function leafSelected(url){
	get("info.php?folder="+url);
}



var treecontainer = document.getElementById('tcontainer');
var treeRootService = 'tree.root.php';
document.mytreeview = newtreeview (treecontainer,treeRootService);
<?php

if (isset ($_GET['path'])) {
	if (substr($_GET['path'], 0, 2) == './')
		$_GET['path'] = substr($_GET['path'], 2);
	if (substr($_GET['path'], -1) == '/')
		$_GET['path'] = substr($_GET['path'], 0, -1);
	echo "selectPath('".urldecode($_GET['path'])."');\n";
}
?>
</script>
</body>
</html>

Return current item: Wexplorer