summaryrefslogtreecommitdiff
path: root/www/browse.php
diff options
context:
space:
mode:
authoroweissbarth2014-03-17 00:38:42 +0100
committeroweissbarth2014-03-17 00:38:42 +0100
commitac384ab0feee6fc6761d0030273c665264dd33e1 (patch)
tree23e03a17bbcd560c8c0ee150b81123073379b9cb /www/browse.php
parentd5bd89e1d64d00f0d10926c470bc850646f4a969 (diff)
downloadfiles.iamfabulous.de-ac384ab0feee6fc6761d0030273c665264dd33e1.tar.gz
added basic browsing functionality
Diffstat (limited to 'www/browse.php')
-rw-r--r--www/browse.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/www/browse.php b/www/browse.php
new file mode 100644
index 0000000..9c37f41
--- /dev/null
+++ b/www/browse.php
@@ -0,0 +1,32 @@
+<?php
+
+function print_browser($content){
+
+ include("static/header.html");
+
+ $file_list = "";
+ foreach($content as $file){
+ $file_list .= get_item($file);
+ }
+
+ echo '<link rel="stylesheet" type="text/css" href="/static/browser.css">
+ <table>'.$file_list.'</table>';
+
+ include("static/footer.html");
+}
+
+function get_icon($file){
+ if($file[4]=="DIRECTORY"){
+ return '<td id="icon">'.get_link($file).'<img src="/static/img/icon_folder.svg" width="30px"></a></td>';
+ }else{
+ return '<td id="icon">'.get_link($file).'<img src="/static/img/icon_file.svg" width="30px"></a></td>';
+ }
+}
+
+function get_link($file){
+ return '<a href="/'.$_GET["name"].$_GET["folder"].$file[3].'">';
+}
+
+function get_item($file){
+ return '<tr>'.get_icon($file).'<td>'.get_link($file).$file[3].'</a></td></tr>';
+}