Added optional authentication method.
[viewgit.git] / templates / header.php
blobf4f3f357267d95893ff47726c4a990cd2157c43a
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 <link rel="icon" type="image/png" href="favicon.png" />
10 <?php
11 if (isset($page['project'])) {
12 echo "\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"". htmlentities($page['project']) ." log\" href=\"". makelink(array('a' => 'rss-log', 'p' => $page['project'])) ."\" />\n";
15 <meta name="generator" content="ViewGit" />
16 </head>
17 <body>
19 <div class="nav">
20 <a href=".">Index</a>
21 <?php
22 if (isset($page['project'])) {
23 echo " &raquo; <a href=\"". makelink(array('a' => 'summary', 'p' => $page['project'])) ."\">$page[project]</a>";
25 // TODO: move this out of here
26 if ($page['action'] === 'summary') {
27 echo " : Summary";
29 elseif ($page['action'] === 'commit') {
30 echo " : Commit ". substr($page['commit_id'], 0, 6);
32 elseif ($page['action'] === 'commitdiff') {
33 echo " : Commitdiff ". substr($page['commit_id'], 0, 6);
35 elseif ($page['action'] === 'shortlog') {
36 echo " : Shortlog";
38 elseif ($page['action'] === 'tree') {
39 echo " : Tree ". substr($page['tree_id'], 0, 6);
41 elseif ($page['action'] === 'viewblob') {
42 echo " : Blob ". substr($page['hash'], 0, 6);
45 if (isset($page['path'])) {
46 if (isset($page['pathinfo'])) {
47 echo ' ';
48 $f = '';
49 foreach ($page['pathinfo'] as $p) {
50 if (strlen($f) > 0) { $f .= '/'; }
51 $f .= "$p[name]";
52 echo "/ <a href=\"". makelink(array('a' => ($p['type'] === 'tree' ? 'tree' : 'viewblob'), 'p' => $page['project'], 'h' => $p['hash'], 'hb' => $page['commit_id'], 'f' => $f)) ."\">$p[name]</a> ";
57 </div>
59 <?php if (isset($page['project'])) { ?>
60 <div class="pagenav">
61 <?php
62 $links = array(
63 'summary' => array(),
64 'shortlog' => array(),
65 'commit' => array('h' => $page['commit_id']),
66 'commitdiff' => array('h' => $page['commit_id']),
67 'tree' => array('h' => $page['tree_id'], 'hb' => $page['commit_id']),
69 $first = true;
70 foreach ($links as $link => $params) {
71 if (!$first) { echo " | "; }
72 if ($page['action'] === $link) { echo '<span class="cur">'; }
73 echo "<a href=\"". makelink(array_merge(array('a' => $link, 'p' => $page['project']), $params)) ."\">". ucfirst($link) . "</a>";
74 if ($page['action'] === $link) { echo '</span>'; }
75 $first = false;
79 <form action="?" type="get" class="search">
80 <input type="hidden" name="a" value="search" />
81 <input type="hidden" name="p" value="<?php echo $page['project']; ?>" />
82 <select name="st">
83 <?php
84 $opts = array('commit', 'change', 'author', 'committer');
85 foreach ($opts as $opt) {
86 echo "\t<option";
87 if (isset($page['search_t']) && $opt == $page['search_t']) {
88 echo ' selected="selected"';
90 echo ">$opt</option>\n";
93 </select>
94 <input type="text" name="s"<?php if (isset($page['search_s'])) { echo ' value="'. htmlentities($page['search_s']) .'"'; } ?> />
95 </form>
96 </div>
97 <?php } ?>