-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
54 lines (47 loc) · 2.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<!--<link rel="icon" href="../../favicon.ico">-->
<!-- Custom styles for this template -->
<link href="css/jumbotron-narrow.css" rel="stylesheet">
<title>MFF Game</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Bootstrap needs jquery -->
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="header clearfix">
<nav>
<ul class="nav nav-pills pull-right">
<li role="presentation" <?php echo isCurrent('index.php') ? 'class="active"' : null; ?>><a href="index.php">Home</a></li>
<li role="presentation" <?php echo isCurrent('oldGame.php') ? 'class="active"' : null; ?>><a href="game.php">Old game</a></li>
<li role="presentation" <?php echo isCurrent('game.php') ? 'class="active"' : null; ?>><a href="game.php">Game</a></li>
<li role="presentation"><a href="plain-game.html">Game without PHP</a></li>
</ul>
</nav>
<h3 class="text-muted">MFF Game</h3>
</div>
<?php
function isCurrent($page) {
return endsWith($_SERVER['PHP_SELF'], $page);
}
function endsWith($haystack, $needle) {
return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);
}
?>