echo "</P>\n"; } if (strcmp($bw_op, "list") == 0) { ?> <P> </P> <P CLASS="bold title">BROWSE-LIST</P> <P> <?php $uppath = substr($bw_path, 0, strrpos($bw_path, '\\')); $uplinkpath = nglink($uppath); echo "<SPAN CLASS=\"info\">go up : <A CLASS=\"bold italic link\" HREF=\"?host={$host}&action=browse&bw_op=list&bw_path={$uplinkpath}\">{$uppath}</A></SPAN><BR>\n"; $curlinkpath = nglink($bw_path); $maxcount = $bw_maxcount; $newcount = $maxcount + 50; echo "<SPAN CLASS=\"info\">list from : <A CLASS=\"bold italic link\" HREF=\"?host={$host}&action=browse&bw_op=list&bw_path={$curlinkpath}\">{$bw_path}</A></SPAN><BR><BR>\n"; $c = nglistpath($ngwc, $bw_path); echo "</P><P CLASS=\"italic info\">count : {$c}</P>\n"; } echo "</P>\n"; } // Output commands ?> <P> </P> <P CLASS="bold title">COMMANDS</P> <P> <FORM METHOD="POST"> <INPUT TYPE="hidden" NAME="host" VALUE="<?php echo $host; ?> "> <INPUT TYPE="hidden" NAME="action" VALUE="playlist">
function nglistpath($ngwc, $path, $ident) { global $host, $passwd, $bw_path; global $curcount, $maxcount; $linkpath = nglink($path); $recurse = FALSE; $bw_list = $ngwc->bw_getlist($path); if (count($bw_list['files']) > 0) { $newcount = $maxcount + 50; if ($curcount + count($bw_list['directories']) < $maxcount) { for ($j = 0; $j < count($bw_list['files']); $j++) { if ($curcount + count($bw_list['directories']) < $maxcount) { ngwriteident($ident + 3); $linkfile = nglink($path . "\\" . $bw_list['files'][$j]); $curpath = nglink($bw_path); echo "<A CLASS=\"link\" HREF=\"?host={$host}&passwd={$passwd}&action=browse&bw_op=add&bw_addfile={$linkfile}&bw_path={$curpath}&bw_maxcount={$maxcount}\">{$bw_list['files'][$j]}</A><BR>\n"; $curcount++; } else { ngwriteident($ident + 3); echo "more files ...<BR>\n"; break; } } echo "<BR>\n"; $bw_list['files'] = array(); } else { ngwriteident($ident + 3); echo "more files ...<BR>\n"; } } if ($curcount + count($bw_list['directories']) < $maxcount) { $curcount += count($bw_list['directories']); $recurse = TRUE; } if (count($bw_list['directories']) > 0) { for ($j = 0; $j < count($bw_list['directories']); $j++) { if ($recurse || $curcount < $maxcount) { ngwriteident($ident + 1); $newpath = "{$path}\\" . $bw_list['directories'][$j]; $newlinkpath = nglink($newpath); echo "<A CLASS=\"link\" HREF=\"?host={$host}&passwd={$passwd}&action=browse&bw_op=view&bw_path={$newlinkpath}&bw_maxcount={$maxcount}\">{$newpath}</A><BR>\n"; if ($recurse) { nglistpath($ngwc, $path . "\\" . $bw_list['directories'][$j], $ident + 4); $recurse = TRUE; } else { $curcount++; } } else { ngwriteident($ident + 1); echo "more paths ...<BR>\n"; break; } } echo "<BR>\n"; $bw_list['directories'] = array(); } echo "<BR>\n"; }