diff options
author | Manuel Hiebel <leuhmanu@mageia.org> | 2017-07-05 08:24:42 +0200 |
---|---|---|
committer | Manuel Hiebel <leuhmanu@mageia.org> | 2017-07-05 08:24:42 +0200 |
commit | 2a2be4fadbfcb612060fbaa5acb9671beece11a2 (patch) | |
tree | f9385524ff5c010a760d9dbc900ef4be4905e6ec | |
parent | 61462bcad215f878e9340136ab29713dd96856a3 (diff) | |
download | nav-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>
-rw-r--r-- | lib.php | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -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 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)) |