aboutsummaryrefslogtreecommitdiffstats
path: root/lib.php
diff options
context:
space:
mode:
authorManuel Hiebel <leuhmanu@mageia.org>2017-07-05 08:24:42 +0200
committerManuel Hiebel <leuhmanu@mageia.org>2017-07-05 08:24:42 +0200
commit2a2be4fadbfcb612060fbaa5acb9671beece11a2 (patch)
treef9385524ff5c010a760d9dbc900ef4be4905e6ec /lib.php
parent61462bcad215f878e9340136ab29713dd96856a3 (diff)
downloadnav-2a2be4fadbfcb612060fbaa5acb9671beece11a2.tar
nav-2a2be4fadbfcb612060fbaa5acb9671beece11a2.tar.gz
nav-2a2be4fadbfcb612060fbaa5acb9671beece11a2.tar.bz2
nav-2a2be4fadbfcb612060fbaa5acb9671beece11a2.tar.xz
nav-2a2be4fadbfcb612060fbaa5acb9671beece11a2.zip
Adapt nav to bootstrap
don't show anymore map (it's already in the footer) add class sticky-top for nav to be always on the top modify inject, so we can use class on <li>
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib.php b/lib.php
index 9824405..563561d 100644
--- a/lib.php
+++ b/lib.php
@@ -291,7 +291,7 @@ function _mgnav_html($wrap = false, $lang = 'en', $inject = null, $vhost = 'www.
l10n::load($lang, $cache);
$tn = array(
- array('mageia', '//$S/$L/map/', 'Mageia', l10n::_t('Go to mageia.org site map.')),
+ //array('mageia', '//$S/$L/map/', 'Mageia', l10n::_t('Go to mageia.org site map.')),
array('about', '//$S/$L/about/', l10n::_t('About&nbsp;us'), l10n::_t('Learn more about Mageia.')),
array('downloads', '//$S/$L/downloads/', l10n::_t('Downloads'), l10n::_t('Download Mageia ISO and updates.')),
array('support', '//$S/$L/support/', l10n::_t('Support'), l10n::_t('Get support from Mageia community.')),
@@ -307,7 +307,7 @@ function _mgnav_html($wrap = false, $lang = 'en', $inject = null, $vhost = 'www.
$s = array();
foreach ($tn as $i) {
- $s[] = sprintf('<li><a href="%s" class="%s" title="%s">%s</a></li>',
+ $s[] = sprintf('<li class="nav-item"><a href="%s" class="%s nav-link" title="%s">%s</a></li>',
str_replace(
array('$L', '$S'),
array($lang, $vhost),
@@ -320,14 +320,24 @@ function _mgnav_html($wrap = false, $lang = 'en', $inject = null, $vhost = 'www.
}
if (!is_null($inject))
- $s[] = sprintf('<li>%s</li>', $inject);
+ $s[] = sprintf('%s', $inject);
$s = implode($s);
- $h = sprintf('<!--googleoff: all--><nav id="mgnav"><ul id="nav">%s</ul></nav><!--googleon: all-->', $s);
+ $h = sprintf('<!--googleoff: all-->
+ <div class="mganav">
+ <nav id="mgnav" class="container navbar navbar-toggleable-md navbar-light">
+ <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+ <a class="navbar-brand text-hide" href="//'. $vhost .'/'. $lang. '">Mageia</a>
+ <div class="collapse navbar-collapse" id="navbarNav">
+ <ul class="navbar-nav mr-auto">%s</ul>
+ </div>
+ </nav>
+ </div><!--googleon: all-->', $s);
if ($wrap)
- $h = sprintf('<header id="hmgn">%s
-<link rel="icon" type="image/png" href="/g/favicon.png" />
+ $h = sprintf('<header id="hmgn" class="sticky-top">%s
</header>', $h);
if (!is_null($cache))