diff options
| author | oweissbarth | 2014-03-27 01:48:34 +0100 |
|---|---|---|
| committer | oweissbarth | 2014-03-27 01:48:34 +0100 |
| commit | 9469e30334580ada1a8c5761301fc2b1481e4355 (patch) | |
| tree | 14a98ad151809b7cb41f34de9da98e61bce9e01e | |
| parent | 84f44351d1f9e11d6b1421aa2de77c3414058159 (diff) | |
| download | files.iamfabulous.de-9469e30334580ada1a8c5761301fc2b1481e4355.tar.gz | |
Added upload ui
| -rw-r--r-- | www/browse.php | 47 | ||||
| -rw-r--r-- | www/static/browser.css | 59 |
2 files changed, 92 insertions, 14 deletions
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){ <script> function showNewFolder(){ document.getElementById("new-folder-bg").style.visibility = "visible"; + return; } function hideNewFolder(){ - if(document.getElementById("new-folder-name").value!=""){ - document.getElementById("new-folder-bg").style.visibility = "hidden"; - } + document.getElementById("new-folder-bg").style.visibility = "hidden"; + return; + } + + function showUpload(){ + document.getElementById("upload-bg").style.visibility = "visible"; + return; + } + function hideUpload(){ + document.getElementById("upload-bg").style.visibility = "hidden"; return; } </script> <div id="new-folder-bg"> <div id="new-folder-area"> - <h1 class="new-folder-"> New Folder </h1> + <h1 class="new-folder"> New Folder </h1> <form id="new-folder-form" method="post" action="/'.$_GET["name"]."/".$_GET["folder"].'"> <input class="new-folder-input" id="new-folder-name" type="text" placeholder="name" name="foldername" required> <input type="hidden" value="'.$_GET["folder"].'" name="path"> - <label style="display:inline">Public</label><input style="display:inline; margin-left: 5px;" class="new-folder-input" type="checkbox" name="public"> - <input style="display:block" onclick="hideNewFolder()" type="submit" id="button-input" class="new-folder-input" value="create"> + <input type="hidden" value="new-folder" name="task"> + <label>Public</label><input style="display:inline; margin-left: 5px;" class="new-folder-input" type="checkbox" name="public"> + <input onclick="hide-new-folder()" type="submit" id="button-input" class="new-folder-input" value="create"> + </form> + </div> + </div> + + <div id="upload-bg"> + <div id="upload-area"> + <h1 class="upload"> Upload </h1> + <form id="upload-form" method="post" action="/'.$_GET["name"]."/".$_GET["folder"].'" enctype="multipart/form-data"> + <input class="upload-input" id="upload-file" type="file" placeholder="file" name="userfile" size=" 500000000" maxlength="100000000000000" required> + <input type="hidden" value="'.$_GET["folder"].'" name="path"> + <input type="hidden" value="upload" name="task"> + <label>Public</label><input class="upload-input" type="checkbox" name="share"> + <input onclick="hide-upload()" type="submit" id="button-input" class="upload-input" value="upload"> </form> </div> </div> @@ -79,7 +104,7 @@ function get_item($file){ function print_menu(){ echo '<div id="menu"> - <div class="menu-item" id="new-item" onclick="showNewFolder()" ><img src="/static/img/icon_new.svg" width="45px" onclick="toggleNewFolder()"></div> - <div class="menu-item" id="upload-item"><img src="/static/img/icon_upload.svg" width="45px"></div> + <div class="menu-item" id="new-item" onclick="showNewFolder()" ><img src="/static/img/icon_new.svg" width="45px" onclick="showNewFolder()"></div> + <div class="menu-item" id="upload-item" onclick="showUpload()" ><img src="/static/img/icon_upload.svg" width="45px" onclick="showUpload()" ></div> </div><!-- div menu-->'; } diff --git a/www/static/browser.css b/www/static/browser.css index a6031dc..c040695 100644 --- a/www/static/browser.css +++ b/www/static/browser.css @@ -86,7 +86,7 @@ td{ } -input.new-folder-input[type=text], input.new-folder-input[type=checkbox]{ +input.new-folder-input[type=text]{ border: none; box-shadow: inset 0px 0px 1px 1px #1F3D4C; border-radius: 0; @@ -94,21 +94,74 @@ input.new-folder-input[type=text], input.new-folder-input[type=checkbox]{ font-size: 25px; margin-top: 15px; width: 395px; - display:block; padding-left: 5px; } +/*input.new-folder-input[type=checkbox]*/ + +input[type=checkbox]{ + display:inline; + margin-left: 5px; + width: 10px; +} + + input.new-folder-input:focus{ background: #D6E0E5 } + +#upload-bg{ + width: 100%; + height: 100%; + background: white; + position: fixed; + z-index: 99; + top: 0px; + opacity: 0.75; + visibility: hidden; +} + +#upload-form{ + +} + +#upload-area{ + height: 190px; + width: 400px; + position: fixed; + top: 50%; + margin-top: -100px; + + padding: 10px; + + left: 50%; + margin-left: -200px; + + border: 1px solid black; +} + + + +input.upload-input[type=file]{ + border: none; + margin-top: 15px; + margin-bottom: 15px; + display:block; + padding-left: 5px; +} + #button-input{ height: 40px; width: 120px; - display:inline; border: none; box-shadow: inset 0px 0px 1px 1px #1F3D4C; border-radius: 0; font-size: 25px; margin-top: 15px; + display:block; +} +label{ + display: inline; } +dis
\ No newline at end of file |
