forked from sunny/pouce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·71 lines (60 loc) · 1.7 KB
/
index.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
require dirname(__FILE__).'/lib/pouce.php';
$page = new Pouce(urldecode($_SERVER['REQUEST_URI']));
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php echo h($page->name()) ?></title>
<link rel="shortcut icon" href="/_pouce/images/<?= POUCE_IMG_SET ?>/favicon.png" />
<link rel="stylesheet" href="/_pouce/css/global.css" media="all">
<!-- GeSHi -->
<style><?php echo $page->style(); ?></style>
</head>
<body>
<h1><?php echo $page->fancy_path() ?></h1>
<?php if ($page->not_found() or $page->text()) : ?>
<div class="text">
<?php if ($page->not_found()) : ?>
<p>Fichier inconnu.</p>
<?php endif; ?>
<?php echo $page->text(); ?>
</div>
<? endif; ?>
<?php if ($page->is_dir()) : ?>
<table>
<thead>
<tr>
<th class="type">Type</th>
<th class="name">Name</th>
<th class="size">Size</th>
<th class="source">Source</th>
</tr>
</thead>
<tbody>
<?php foreach ($page->files() as $file) : ?>
<tr>
<td class="type">
<img src="<?php echo h($file->icon()) ?>" alt="<?php echo h($file->type()) ?>" />
</td>
<td class="name">
<a href="<?php echo h($file->uri()) ?>"><?php echo h($file->name()) ?></a>
</td>
<td class="size">
<?php echo h($file->size()) ?>
</td>
<td class="source">
<?php if ($file->is_file() and $file->is_text()) : ?>
<a class="viewsource" title="View source" href="?<?php echo h($file->uri()) ?>">
<img src="/_pouce/images/<?= POUCE_IMG_SET ?>/viewsource.png" alt="">
</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</body>
</html>