forked from SFML/SFML-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
95 lines (90 loc) · 4.56 KB
/
header.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
<?php
// Define access functions for the website's most common directories
function root() {return '//' . $_SERVER['SERVER_NAME'];}
function home() {return root() . '/index.php';}
function page($name) {return root() . '/' . $name;}
function image($name) {return root() . '/images/' . $name;}
function style($name) {return root() . '/styles/' . $name;}
function script($name) {return root() . '/scripts/' . $name;}
// Build the page title
$keys = array_keys($breadcrumbs);
if (empty($keys))
{
$page_title = 'SFML';
}
else
{
$last = end($keys);
reset($keys);
$page_title = $last . ' (SFML';
for ($i = 0; $i < count($keys) - 1; $i++)
$page_title .= ' / ' . $keys[$i];
$page_title .= ')';
}
// Build the translated URL of the current page
if (!isset($doxygen))
$translated_page = str_replace(".php", "-fr.php", $_SERVER['SCRIPT_NAME']);
else
$translated_page = str_replace("documentation/" . $version, "documentation/" . $version . "-fr", $_SERVER['SCRIPT_NAME']);
function h2($title)
{
$id = trim(str_replace(' ', '-', preg_replace('/[^a-z0-9 -]+/', '', strtolower($title))), '-');
echo '<h2 id="' . $id . '"><a class="h2-link" href="#' . $id . '">' . $title . '</a><a class="back-to-top" href="#top" title="Top of the page"></a></h2>';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $page_title ?></title>
<meta http-equiv="Content-Type" content="text/html"/>
<meta charset="utf-8"/>
<link rel="icon" type="image/ico" href="<?php echo image('favicon.ico') ?>"/>
<link rel='stylesheet' type='text/css' href="//fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>
<link rel="stylesheet" type="text/css" href="<?php echo style('style.css') ?>?2017-09-15-0000" title="default" media="screen,print"/>
<link rel="stylesheet" type="text/css" href="<?php echo script('highlight/styles/github.css') ?>"/>
<?php if (isset($redirect))
{
echo '<link rel="canonical" href="' . $redirect .'"/>' . "\n";
} ?>
<?php if (isset($doxygen))
{
echo '<link rel="stylesheet" type="text/css" href="' . root() . '/' . $docpath . 'doxygen.css" title="default" media="screen,print" />' . "\n" .
'<script type="text/javascript" src="jquery.js"></script>' . "\n" .
'<script type="text/javascript" src="dynsections.js"></script>' . "\n";
} ?>
<!--[if (gte IE 9)|!(IE)]>
<!-->
<script type="text/javascript" src="<?php echo script('highlight/highlight.pack.js') ?>"></script>
<script type="text/javascript">hljs.initHighlightingOnLoad();</script>
<!--<![endif]-->
</head>
<body id="top">
<?php include_once("analytics.php") ?>
<div id="page">
<div id="banner-container">
<div id="banner">
<a href="<?php echo home(); ?>"><img id="logo" src="<?php echo image('logo.png') ?>" alt="SFML logo"/></a>
<ul id="menu">
<li><a href="<?php echo page('learn.php') ?>">Learn</a></li>
<li><a href="<?php echo page('download.php') ?>">Download</a></li>
<li><a href="<?php echo page('community.php') ?>">Community</a></li>
<li><a href="<?php echo page('development.php') ?>">Development</a></li>
</ul>
</div>
</div>
<div id="navigation-container">
<div id="navigation">
<ul id="breadcrumbs">
<?php
echo '<li><a href="' . home() . '">Home</a></li>';
foreach ($breadcrumbs as $name => $link)
echo '<li>»<a href="' . root() . '/' . $link . '">' . $name .'</a></li>';
?>
</ul>
<ul id="buttons">
<li><a id="language-fr" href="<?php echo $translated_page ?>" title="Site en français">Français</a></li>
<li><a id="donate" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2C8CG2AGYSBT4&lc=US" title="Make a donation">Donate</a></li>
</ul>
</div>
</div>
<div id="content" <?php if (isset($doxygen)) echo 'class="doxygen"' ?>>