<?
header("Pragma: no-cache");


$list = new iconlist($_GET['tabid']);

	$sys['fullPath'] = $permissions['path'];
	$rs = $db->query("SELECT * FROM ".$settings->config['trash_tablename']." WHERE uid='".$auth->currentUserInfo['id']."'");


	while (!$rs->EOF) {

		$objectInfo = $rs->fields;
		$file = gluePath((($settings->config['trashpath'])?$settings->config['trashpath']:gluePath($sys['root'], "/system/data/trash/")), $auth->currentUserInfo['username'], $objectInfo['id']);
		$extension = $fm->getExtension(basename($objectInfo['path']));
		$fileinfo = $fm->fileTypeInfo($extension);




			$data['name'] = basename($objectInfo['path']);
			$data['input_value'] = $objectInfo['id'];
			$data['lcname'] = strtolower(basename($objectInfo['path']));
			$data['extra'] = date("d-M-Y G:i",$objectInfo['date']);

			//deleted from
			$data['filetypedescription'] = $fm->dirname($objectInfo['path']);
			
		if (is_dir($file)) {
			$data['isdir'] = "1";
			$data['size'] = $settings->config['compute_folder_size']?$fm->getDirSize($fullpath):0;
			$data['ext'] = "";

			$data['icon_img'] = "images/icons/filetypes/big/folder.gif";
			$data['thumb_img'] = "images/icons/filetypes/big/folder.gif";
			$data['list_img'] = "images/icons/filetypes/small/folder.gif";
			$data['filetype'] = "folder";
			$data['ondblclick'] = "";
		} else {
			$data['isdir'] = "0";
			$data['size'] = filesize($file);
			$extension = $fm->getExtension($data['name']);
			$data['ext'] = $extension;
			$fileinfo = $fm->fileTypeInfo($extension);
			//$data['filetypedescription'] = $fileinfo['description'];

			$data['icon_img'] = gluePath("images/icons/filetypes/big/",$fileinfo['icon']);
			$iconfolder = "images/icons/filetypes/big/";
			$data['thumb_img'] =  $img->icon($file, 1, 1, $fm->dirname($objectInfo['path']));
			$data['list_img'] = gluePath("images/icons/filetypes/small/",$fileinfo['icon']);

			$data['filetype'] = $img_prefix.$fileinfo['type'];
			$data['ondblclick'] = "";
		}
		
		if (!file_exists($file)) {
			$data['list_img'] = "images/icons/filetypes/small/trasherror.gif";
			$data['thumb_img'] = $data['list_img'];
			$data['icon_img'] = $data['list_img'];
		}
		$list->setIcon($data);
		$rs->MoveNext();
}

?>
<script>
tb = parent.AfianHandler['allTabs']['<?echo $_GET['tabid'];?>'];
if (tb != undefined) {
tb.removeAll();
}


<?
for ($i = 0 ; $i < sizeof($list->icons) ; $i++) {
	$list->drawIcon($list->icons[$i]);
}
?>



if (tb != undefined) {
	parent.cancelTimeOut(tb.id);
	tb.sortItems('name', 'desc');
	tb.buildItems();
	tb.showHG = false;
	tb.browsed = true;
	if (tb.active) {
		tb.showItems();
		parent.toggleTreeByPath('trash@afian');
		parent.TrashStatusBar();
		tb.hideHourGlass();
	}
}


</script>