summaryrefslogtreecommitdiff
path: root/www/browse.php
blob: 9c37f4180cd002637c0c1d17011c81207a3a7b54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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>';
}