-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint.php
62 lines (61 loc) · 1.93 KB
/
print.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
<?php
function output_slide($item, $index) {
echo '<div class="slide">';
echo '<h1>' . get_html_for_text($item['title']);
if (strpos($_SERVER['REQUEST_URI'], 'nonum')===false)
echo ' <abbr>' . $index . '</abbr>';
echo '</h1>';
if (isset($item['menu']))
output_bullets($item);
else if (isset($item['image']))
echo '<div><img src="/images/' . $item['image'] . '"></div>';
echo '</div>';
}
function output_bullets($item) {
echo '<ul>';
foreach ($item['menu'] as $bullet) {
echo '<li>';
if (is_string($bullet))
echo get_html_for_text($bullet);
else {
echo get_html_for_text($bullet['title']);
if (isset($bullet['language']))
echo '<pre>' . htmlentities($bullet['code']) . '</pre>';
else if (isset($bullet['description']))
echo '<ul><li>' . get_html_for_text($bullet['description']) . '</li></ul>';
else if (isset($bullet['table']))
echo get_html_for_table($bullet['table']);
else if (isset($bullet['html']))
echo $bullet['html'];
else if (isset($bullet['menu']))
output_bullets($bullet);
else if (isset($bullet['image']))
echo '<div><img src="/images/' . $bullet['image'] . '"></div>';
}
echo '</li>';
}
echo '</ul>';
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?= $page_heading ?></title>
<link rel="stylesheet" href="/print.css" />
</head>
<body>
<?php
echo '<div class="slide">';
echo '<h1>' . $page_heading;
if (strpos($_SERVER['REQUEST_URI'], 'nonum')===false)
echo ' <abbr>1</abbr>';
echo '</h1>';
echo '</div>';
$index = 2;
foreach ($page['menu'] as $slide) {
output_slide($slide, $index);
$index += 1;
}
?>
</body>
</html>