-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.php
113 lines (101 loc) · 3.73 KB
/
template.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
global $site_title, $title, $sidebarentries;
$site_title = "The freeglut Project";
$title = $site_title . " :: The Next Generation of GLUT";
# 1's designate spaces in the sidebar
# Format for an entry:
# array(name=>"Name of Page", page=>"Filename/URL"),
#
$sidebarentries = array(0, # We skip this entry anyway...
array("name"=>"About", "page"=>"/index.php"),
array("name"=>"News", "page"=>"/news.php"),
array("name"=>"Progress", "page"=>"/progress.php"),
array("name"=>"Help Out", "page"=>"/help.php"),
1,
array("name"=>"Download", "page"=>"/index.php#download"),
1,
array("name"=>"Install", "page"=>"/docs/install.php"),
array("name"=>"API", "page"=>"/docs/api.php"),
array("name"=>"OpenGL Wikibook", "page"=>"http://en.wikibooks.org/wiki/OpenGL_Programming"),
1,
array("name"=>"Report a Bug", "page"=>"https://github.com/freeglut/freeglut/issues"),
array("name"=>"Submit a patch", "page"=>"https://github.com/freeglut/freeglut/pulls"),
array("name"=>"Github project", "page"=>"https://github.com/freeglut/freeglut")
);
function generateHeader($self)
{
global $title;
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<?xml-stylesheet href=\"http://freeglut.sourceforge.net/freeglut-style.css\" type=\"text/css\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://freeglut.sourceforge.net/freeglut-style.css" />
<title><? echo $title ?></title>
</head>
<body>
<?php
generateSideBar($self);
}
function generateFooter()
{
?>
</body>
</html>
<?php
}
function printMenuItem($item, $current_page)
{
if ($item == 1)
echo "\t<br/>\n";
else if ($current_page == $item["page"])
echo "\t<div class=\"navbar-item\"><i>$item[name]</i></div>\n";
else
echo "\t<div class=\"navbar-item\"><a class=\"navbar-item\" href=\"$item[page]\">$item[name]</a></div>\n";
}
function generateSideBar($current_page)
{
global $sidebarentries;
# Print out the logo and title
?>
<div class="navbar-left">
<span class="navbar-header"><a href="/"><img src="/images/freeglut_logo.png" alt="freeglut logo" style="border: 0;" /></a></span><br/>
<span class="navbar-smalltext">The Free OpenGL Utility Toolkit</span><br/><br/>
<?php
# Print out each sidebar entry one by one...
reset($sidebarentries);
while (next($sidebarentries))
printMenuItem(current($sidebarentries), $current_page);
# This allows a user to view our PHP source... it's in SVN anyway, and why not spread the love of
# slick web page design? ;)
$svn_location = "https://github.com/freeglut/freeglut_website/blob/master$current_page";
# Print the SourceForge logo button and the "View source" link
?>
<br/>
<span class="navbar-header">
<a href="http://www.opengl.org/">
<img src="/images/opengl.png" alt="OpenGL.org" height="31" width="88" style="border: 0;"/></a>
</span>
<span class="navbar-header">
<a href="http://sourceforge.net/">
<img src="http://sourceforge.net/sflogo.php?group_id=1032" width="88" height="31" alt="SourceForge" style="border: 0;" /></a>
</span>
<span class="navbar-header">
<a href="http://validator.w3.org/check/referer">
<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" style="border: 0;"/></a>
</span>
<br/><br/>
<span class="navbar-smalltext" style="font-style: normal;">
<? echo "\t<a href=\"$svn_location\">View PHP Source</a>"; ?>
</span>
</div>
<?php
}
function setPageTitle($title_inc)
{
global $site_title, $title;
$title = $site_title . " :: " . $title_inc;
}
?>