Wrap notices using htmlentities_wrapper().
[viewgit.git] / templates / header.php
blobcccb53e3abca0cd0a503b19dcc94541a6fd3d7ca
1 <?php
2 echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
3 ?>
4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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="<?php echo $conf['style']; ?>.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_wrapper($page['project']) ." log\" href=\"". makelink(array('a' => 'rss-log', 'p' => $page['project'])) ."\" />\n";
15 <meta name="generator" content="ViewGit" />
16 <?php VGPlugin::call_hooks('header'); ?>
17 </head>
18 <body>
20 <?php
21 VGPlugin::call_hooks('page_start');
22 if (isset($page['notices'])) {
23 echo '<div class="notices">';
24 foreach ($page['notices'] as $n) {
25 echo "<p class=\"$n[class]\">". htmlentities_wrapper($n['message']) ."</p>";
27 echo '</div>';
31 <div class="nav">
32 <a href=".">Index</a>
33 <?php
34 if (isset($page['project'])) {
35 echo " &raquo; <a href=\"". makelink(array('a' => 'summary', 'p' => $page['project'])) ."\">$page[project]</a>";
36 $projconf = $conf['projects'][$page['project']];
37 if ($projconf['www']) {
38 tpl_extlink($projconf['www']);
41 if (isset($page['subtitle'])) {
42 echo " : $page[subtitle]";
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>
58 <div id="page_body">
60 <?php if (isset($page['project'])) { ?>
61 <div class="pagenav">
62 <?php
63 $page['links'] = array(
64 'summary' => array(),
65 'shortlog' => array(),
66 'commit' => array('h' => $page['commit_id']),
67 'commitdiff' => array('h' => $page['commit_id']),
68 'tree' => array('h' => $page['tree_id'], 'hb' => $page['commit_id']),
70 VGPlugin::call_hooks('pagenav');
71 $first = true;
72 foreach ($page['links'] as $link => $params) {
73 if (!$first) { echo " | "; }
74 if ($page['action'] === $link) { echo '<span class="cur">'; }
75 echo "<a href=\"". makelink(array_merge(array('a' => $link, 'p' => $page['project']), $params)) ."\">". ucfirst($link) . "</a>";
76 if ($page['action'] === $link) { echo '</span>'; }
77 $first = false;
81 <form action="?" method="get" class="search">
82 <input type="hidden" name="a" value="search" />
83 <input type="hidden" name="p" value="<?php echo $page['project']; ?>" />
84 <input type="hidden" name="h" value="<?php echo $page['commit_id']; ?>" />
85 <select name="st">
86 <?php
87 $opts = array('commit', 'change', 'author', 'committer');
88 foreach ($opts as $opt) {
89 echo "\t<option";
90 if (isset($page['search_t']) && $opt == $page['search_t']) {
91 echo ' selected="selected"';
93 echo ">$opt</option>\n";
96 </select>
97 <input type="text" name="s"<?php if (isset($page['search_s'])) { echo ' value="'. htmlentities_wrapper($page['search_s']) .'"'; } ?> />
98 </form>
99 </div>
100 <?php } ?>