From 9469e30334580ada1a8c5761301fc2b1481e4355 Mon Sep 17 00:00:00 2001 From: oweissbarth Date: Thu, 27 Mar 2014 01:48:34 +0100 Subject: Added upload ui --- www/browse.php | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'www/browse.php') diff --git a/www/browse.php b/www/browse.php index d01df6e..a4b9e84 100644 --- a/www/browse.php +++ b/www/browse.php @@ -7,8 +7,11 @@ function print_browser($content){ if($_SERVER['REQUEST_METHOD'] == 'POST'){ //echo "created_folder : ". $_POST["foldername"] . " in ". $_GET["folder"]; - - create_folder($_POST["path"], $_POST["foldername"], /*$_POST["public"]?*/"PUBLIC"/*:"PRIVATE"*/); + if($_POST["task"]=="new-folder"){ + create_folder($_POST["path"], $_POST["foldername"], /*$_POST["public"]?*/"PUBLIC"/*:"PRIVATE"*/); + }elseif($_POST["task"]=="upload"){ + upload($_POST["path"]); + } browse(collect_content($GLOBALS["db"], $_SESSION["username"] , $_POST["path"])); }else{ browse(collect_content($GLOBALS["db"], $_GET["name"] , $_GET["folder"])); @@ -24,7 +27,7 @@ function browse($content){ $file_list = ""; - if($content){ + if($content != EMPTY_FOLDER){ foreach($content as $file){ $file_list .= get_item($file); } @@ -34,23 +37,45 @@ function browse($content){