Allow browsing of tags/branches.
[viewgit.git] / templates / header.php
blobefdb9bc4b0458c6894f65e427b32410d19fbb76e
1 <?php
2 echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
3 ?>
4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <head>
7 <title><?php echo $page['title']; ?></title>
8 <link rel="stylesheet" href="default.css" type="text/css" />
9 </head>
10 <body>
12 <div class="nav">
13 <a href=".">Index</a>
14 <?php
15 if (isset($page['project'])) {
16 echo " &raquo; <a href=\"". makelink(array('a' => 'summary', 'p' => $page['project'])) ."\">$page[project]</a>";
18 // TODO: move this out of here
19 if ($page['action'] === 'summary') {
20 echo " : Summary";
22 elseif ($page['action'] === 'commit') {
23 echo " : Commit $page[commit_id]";
25 elseif ($page['action'] === 'shortlog') {
26 echo " : Shortlog";
28 elseif ($page['action'] === 'tree') {
29 echo " : Tree $page[tree_id]";
31 elseif ($page['action'] === 'viewblob') {
32 echo " : Blob $page[hash]";
35 if (isset($page['path'])) {
36 echo ' / ';
37 echo htmlentities(join(' / ', explode('/', $page['path'])));
40 </div>
42 <?php if (isset($page['project'])) { ?>
43 <div class="pagenav">
44 <?php
45 $links = array(
46 'summary' => array(),
47 'shortlog' => array(),
48 'commit' => array('h' => $page['commit_id']),
49 'commitdiff' => array('h' => $page['commit_id']),
50 'tree' => array('h' => $page['tree_id'], 'hb' => $page['commit_id']),
52 $first = true;
53 foreach ($links as $link => $params) {
54 if (!$first) { echo " | "; }
55 if ($page['action'] === $link) { echo '<span class="cur">'; }
56 echo "<a href=\"". makelink(array_merge(array('a' => $link, 'p' => $page['project']), $params)) ."\">". ucfirst($link) . "</a>";
57 if ($page['action'] === $link) { echo '</span>'; }
58 $first = false;
61 </div>
62 <? } ?>