-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.php
More file actions
97 lines (78 loc) · 1.8 KB
/
index.php
File metadata and controls
97 lines (78 loc) · 1.8 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
// Public root path.
define("R", str_replace("index.php", "", $_SERVER['PHP_SELF']));
include("core/init.php");
?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<title>Delivery</title>
<style>
@import "<?=R; ?>assets/css/main.css";
</style>
</head>
<body>
<div class="wrapper">
<nav>
<ul>
<?
$count = 0;
foreach ($p_files as $preview) {
$count++;
$has_tooltip = false;
$preview_class = '';
$label = str_replace($prefix, "", $preview['filename']);
if(strlen($label) > 21)
{
$has_tooltip = true;
$preview_class .= "has-tooltip ";
}
if($cur_preview == false)
$cur_preview = $preview['slug'];
if($preview['slug'] == $cur_preview)
{
$current_preview = $preview;
$preview_class .= 'active ';
}
?><li class="<?=$preview_class; ?>"><a href="<?=R.$cur_project."_/".$preview['slug']; ?>"><?=$label ?></a><? if($has_tooltip) { ?> <b class="tooltip"><?=htmlentities($label); ?><i></i></b><? } ?></li><?
}
?>
</ul>
<?
$info_glob = glob($cur_project . "info.txt");
if(count($info_glob) > 0)
{
?>
<div class="info has-tooltip">
<a href="#">More information ...</a>
<div class="tooltip">
<?=htmlentities(file_get_contents($info_glob[0])); ?>
<i></i>
</div>
</div>
<? } ?>
</nav>
<?
if($current_preview)
{
$imagesize = getimagesize($current_preview['full']);
$height = $imagesize[1];
$width = $imagesize[0];
?>
<style type="text/css">
.preview {
background: url("<?=R.$current_preview['full']; ?>") no-repeat 50% 36px;
height: <?=$height+36; ?>px;
}
</style>
<?
} else {
?>
<p class="notice informative">Please select a preview</p>
<?
}
?>
<div class="preview"></div>
</div>
</body>
</html>