<script language="JavaScript1.2" type="text/javascript">
tb = parent.AfianHandler['allTabs']['<?echo $_GET['tabid'];?>'];
<?
$sys['fullPath'] = gluePath($permissions['path'],"/",$sys['path']);

$zip = new PclZip($sys['fullPath']);

if (($contents = $zip->listContent()) == 0) {
?>
<?iframeAlert($lang->get("Archive error: ").$str->safeJS($zip->errorInfo(false))."");?>
if (tb != undefined) {
tb.countSelected = 0;
tb.browsed = true;
tb.hideHourGlass();
parent.cancelTimeOut(tb.id);
}
</script>
<?
exit();
}

$sys['innerpath'] = $str->fromHTML($_GET['innerpath']);

//debug($contents);

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

for ($i = 0 ; $i < sizeof($contents) ; $i++) {
if (!$contents[$i]['folder']) {

	$data['name'] = $fm->basename($contents[$i]['filename']);
	$data['lcname'] = strtolower($data['name']);
		/*
		$data['isdir'] = true;
		$data['size'] = 0;
		$data['ext'] = "";
		$data['filetypedescription'] = $fm->dirname($contents[$i]['filename']);
		$icon = "folder.gif";
		$data['icon_img'] = gluePath("images/icons/filetypes/big/", $icon);
		$data['thumb_img'] = gluePath("images/icons/filetypes/big/", $icon);
		$data['list_img'] = gluePath("images/icons/filetypes/small/", $icon);
		$data['filetype'] = "folder";
		$data['ondblclick'] = "";
		
	} else {
	*/
		$data['isdir'] = false;
		$data['size'] = $contents[$i]['size'];
		$extension = $fm->getExtension($data['lcname']);
		$data['ext'] = $extension;
		$data['filetypedescription'] = $fm->dirname($contents[$i]['filename']);
		$fileinfo = $fm->fileTypeInfo($extension);
		$data['icon_img'] = gluePath("images/icons/filetypes/big/",$fileinfo['icon']);
		$iconfolder = "images/icons/filetypes/big/";
		$data['thumb_img'] =  gluePath("images/icons/filetypes/big/",$fileinfo['icon']);
		$data['list_img'] = gluePath("images/icons/filetypes/small/",$fileinfo['icon']);
		$data['filetype'] = $img_prefix.$fileinfo['type'];
		$data['ondblclick'] = "";
		$data['extra'] = $contents[$i]['compressed_size'];
		$list->setIcon($data);
	}
}

?>
if (tb != undefined) {
parent.cancelTimeOut(tb.id);
tb.removeAll();
}

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

if (tb != undefined) {
tb.sortItems('name', 'desc');
tb.buildItems();
if (tb.active) {
tb.showItems();
}
}
<?}?>
if (tb != undefined) {
tb.countSelected = 0;
tb.hideHourGlass();
tb.browsed = true;
}
</script>
