summaryrefslogtreecommitdiff
path: root/www/browse.php
diff options
context:
space:
mode:
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>';
+}