<?
header("Pragma: no-cache");
?>
<script>
d = new Array;
<?
$list = $db->GetAll("SELECT * FROM ".$settings->config['flags_tablename'].",".$settings->config['share_info_tablename']." WHERE ".$settings->config['share_info_tablename'].".to_uid='".$auth->currentUserInfo['id']."' AND ".$settings->config['flags_tablename'].".id=".$settings->config['share_info_tablename'].".fid and ".$settings->config['flags_tablename'].".shared='1' AND ".$settings->config['flags_tablename'].".uid='".$sys['uid']."'");

$userinfo = $auth->getUserInfoById($sys['uid']);

foreach ($list as $key => $row) {
    $as[$key]  = $row['as'];
}
array_multisort($as, SORT_ASC, SORT_STRING, $list);
$i = 0;
	foreach ($list as $item) {
		?>
d[<?echo $i;?>] = new Array;
d[<?echo $i;?>]['text'] = '<?echo $str->safeJS($item['as']);?>';
d[<?echo $i;?>]['uid'] = '<?echo $str->safeJS($item['uid']);?>';
d[<?echo $i;?>]['user'] = '<?echo $str->safeJS($item['username']);?>';
		<?
		$i++;
	}


/* sort here the new items */
?>
treeitem = parent.AfianTreeHandler.all['<?echo $_GET['id'];?>'];
parent.AfianTreeDataLoaded(d, treeitem, parent.ListSharedFolder);
</script>
