forked from codeforamerica/codeforamerica.org-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogram.php
68 lines (50 loc) · 1.51 KB
/
program.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
<!DOCTYPE html>
<?php
require_once 'lib.php';
$context = new Context('data.db');
$program_name = $context->path_info();
if($program_name) {
$title = "Library Items In {$program_name} Program";
} else {
$title = "Library Programs";
}
?>
<html lang="en-us">
<? include 'includes/head.php' ?>
<body>
<div class="js-container">
<? include 'includes/header.php' ?>
<main role="main">
<div class="layout-semibreve">
<nav class="nav-breadcrumbs" role="navigation">
<ul>
<li><a href="/">Home</a></li>
<li><a href="<?= $context->base() ?>/">Library</a></li>
</ul>
</nav>
<? if($program_name) { ?>
<header>
<h2>Items In <?= html($program_name) ?> Program</h2>
</header>
<ul>
<? foreach(get_program_items($context, $program_name) as $item) { ?>
<li><a href="<?= $context->base() ?>/item/<?= enc($item['id']) ?>"><?= html($item['title']) ?></a></li>
<? } ?>
</ul>
<? } else { ?>
<header>
<h2>Programs</h2>
</header>
<ul>
<? foreach(get_programs($context) as $program) { ?>
<li><a href="<?= program_href($context, $program) ?>"><?= html($program) ?></a></li>
<? } ?>
</ul>
<? } ?>
</div>
<? include 'includes/footer.php' ?>
</main>
</div><!-- /.js-container -->
<script src="http://style.codeforamerica.org/script/global.js"></script>
</body>
</html>