-
Notifications
You must be signed in to change notification settings - Fork 1
/
AOSNavBar.php
46 lines (44 loc) · 1.45 KB
/
AOSNavBar.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
<?php
namespace MediaWiki\Extensions\AsteroidOS;
/**
* @var string $title
* @var array $aosNavBar
* @var string $aosHome
* @var array $aosNavBarSelected
* @var string $aosNavBarSelectedDefault
*/
?>
<header class="navbar navbar-inverse docs-nav" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="<?= $aosHome ?>" class="navbar-brand" alt="AsteroidOS">
<img src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" height="50" width="50">
</a>
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav navbar-right">
<?php
foreach ($aosNavBar as $name => $url) {
if (($title == $name && in_array($name, $aosNavBarSelected))
|| (!(in_array($title, $aosNavBarSelected)) && $name == $aosNavBarSelectedDefault)) {
$anbClass = ' class="anb-selected"';
} else {
$anbClass = '';
}
?>
<li <?= $anbClass ?>>
<a href="<?= $url ?>"><?= $name ?></a>
</li>
<?php
}
?>
</ul>
</nav>
</div>
</header>