Exemple #1
0
function nglistpath($ngwc, $path)
{
    global $host, $bw_path;
    $count = 0;
    $linkpath = nglink($path);
    $bw_list = $ngwc->bw_getlist($path);
    if (count($bw_list['directories']) > 0) {
        for ($j = 0; $j < count($bw_list['directories']); $j++) {
            ngwriteident($ident + 1);
            $newpath = "{$path}\\" . $bw_list['directories'][$j];
            $newlinkpath = nglink($newpath);
            echo "<A CLASS=\"bold italic link\" HREF=\"?host={$host}&action=browse&bw_op=list&bw_path={$newlinkpath}\">{$newpath}</A> - [<A CLASS=\"bold italic link\" HREF=\"?host={$host}&action=browse&bw_op=add&bw_addfile={$newpath}&bw_path={$newpath}\">add</A>]<BR>\n";
            $count++;
        }
        echo "<BR>\n";
        $bw_list['directories'] = array();
    }
    if (count($bw_list['files']) > 0) {
        for ($j = 0; $j < count($bw_list['files']); $j++) {
            ngwriteident($ident + 3);
            $linkfile = nglink($path . "\\" . $bw_list['files'][$j]);
            $curpath = nglink($bw_path);
            echo "<A CLASS=\"bold italic link\" HREF=\"?host={$host}&action=browse&bw_op=add&bw_addfile={$linkfile}&bw_path={$curpath}\">{$bw_list['files'][$j]}</A><BR>\n";
            $count++;
        }
        echo "<BR>\n";
        $bw_list['files'] = array();
    }
    echo "<BR>\n";
    return $count;
}
Exemple #2
0
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";
}