Skip to content

Commit

Permalink
in multy disk, only json can visit root, other will jump to first disk
Browse files Browse the repository at this point in the history
  • Loading branch information
qkqpttgf committed Aug 4, 2020
1 parent 9b88ee1 commit 5e0626e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions common.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,16 @@ function main($path)
// echo 'count$disk:'.count($disktags);
if (count($disktags)>1) {
if ($path=='/'||$path=='') {
$files['folder']['childCount'] = count($disktags);
foreach ($disktags as $disktag) {
$files['children'][$disktag]['folder'] = 1;
$files['children'][$disktag]['name'] = $disktag;
}
if ($_GET['json']) {
// return a json
$files['folder']['childCount'] = count($disktags);
foreach ($disktags as $disktag) {
$files['children'][$disktag]['folder'] = 1;
$files['children'][$disktag]['name'] = $disktag;
}
return files_json($files);
}
return render_list($path, $files);
//return output('', 302, [ 'Location' => path_format($_SERVER['base_path'].'/'.$disktags[0].'/') ]);
} // else return render_list($path, $files);
return output('', 302, [ 'Location' => path_format($_SERVER['base_path'].'/'.$disktags[0].'/') ]);
}
$_SERVER['disktag'] = splitfirst( substr(path_format($path), 1), '/' )[0];
//$pos = strpos($path, '/');
Expand Down

0 comments on commit 5e0626e

Please sign in to comment.