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

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

$share->cleanMines();

$rs = $db->query("SELECT * FROM ".$settings->config['flags_tablename']." WHERE uid='".$auth->currentUserInfo['id']."' and shared='1'");

while (!$rs->EOF) {
		$fullPath = gluePath($permissions['path'], $rs->fields['path']);
		$shareInfo = $share->getInfoByFid($rs->fields['id']);
		$tmp = "";
		while (!$shareInfo->EOF) {
			if (strlen($tmp) > 0) {
				$tmp .= ", ";
			}
			$tmp .= $auth->id2username($shareInfo->fields['to_uid']);
			$shareInfo->MoveNext();
		}
			$data['name'] = $fm->basename($rs->fields['path']);
			$data['lcname'] = strtolower($data['name']);
			$data['mdate'] = filemtime($fullPath);
			$data['isdir'] = true;
			$data['size'] = $settings->config['compute_folder_size'] ?$fm->getDirSize($fullPath):0;
			$data['ext'] = "";
			$data['filetypedescription'] = $tmp;
			$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'] = "";
			$data['input_value'] = $rs->fields['id'];
			$data['extra'] = $fm->dirname($rs->fields['path']);
			
			$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();
if (tb.active) {
tb.showItems();
parent.toggleTreeByPath('myshares@afian');
}
tb.countSelected = 0;
tb.onselect();
tb.hideHourGlass();
tb.browsed = true;
tb.onload();
}
</script>