aboutsummaryrefslogtreecommitdiffstats
path: root/langs.php
diff options
context:
space:
mode:
authorManuel Hiebel <leuhmanu@mageia.org>2017-07-05 08:55:22 +0200
committerManuel Hiebel <leuhmanu@mageia.org>2017-07-05 09:19:05 +0200
commit47d6171b94ad6ba36386869633540f2c8f2d06fe (patch)
tree3177f52c0c670f9a2619565c8b977d819d3019e3 /langs.php
parent614e3c0e980463513e6186d2e33934c8317d5e00 (diff)
downloadwww-47d6171b94ad6ba36386869633540f2c8f2d06fe.tar
www-47d6171b94ad6ba36386869633540f2c8f2d06fe.tar.gz
www-47d6171b94ad6ba36386869633540f2c8f2d06fe.tar.bz2
www-47d6171b94ad6ba36386869633540f2c8f2d06fe.tar.xz
www-47d6171b94ad6ba36386869633540f2c8f2d06fe.zip
Adapt to bootstrap, add common_header for css & js script in common_footer
Use modal for langs switch Don't inject anymore nav css in html
Diffstat (limited to 'langs.php')
-rw-r--r--langs.php44
1 files changed, 36 insertions, 8 deletions
diff --git a/langs.php b/langs.php
index ce48933fa..37cbf8944 100644
--- a/langs.php
+++ b/langs.php
@@ -68,25 +68,50 @@ foreach ($langs as $k => $v) {
$k,
$k == $locale ? ' selected="selected"' : '',
$v);
+ $k == $locale ? $fulllang = $v: '';
}
$options = implode($options);
$langsForm = <<<H
-<form id="lang_form" dir="ltr" method="get" action="/">
- <input type="hidden" name="furl" value="{$_SERVER['REQUEST_URI']}" />
- <select id="flang" name="flang" dir="ltr" onchange="this.form.submit()">
- {$options}
- </select>
- <noscript><div><input type="submit" id="lang_submit" value="Hop!" /></div></noscript>
-</form>
+</ul><ul class="navbar-nav"><li class="nav-item"><a class="nav-link globe-icon" href="#langsModal" data-toggle="modal" data-target="#langsModal">{$fulllang}</a></li>
H;
-$hsnav = _mgnav_style() . _mgnav_html(true, $locale, $langsForm, $_SERVER['HTTP_HOST']);
+$langsmodal = <<<H
+<div class="modal fade" id="langsModal">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ </div>
+ <div class="modal-body">
+ <form class="form-group" id="lang_form" dir="ltr" method="get" action="/">
+ <input class="form-control" type="hidden" name="furl" value="{$_SERVER['REQUEST_URI']}" />
+ <select class="form-control custom-select" id="flang" name="flang" dir="ltr" onchange="this.form.submit()">
+ {$options}
+ </select>
+ <noscript><div><input type="submit" id="lang_submit" value="Hop!" /></div></noscript>
+ </form>
+ </div>
+ </div>
+ </div>
+</div> <!--end modal -->
+H;
+
+// _mgnav_style() no more needed
+$hsnav = _mgnav_html(true, $locale, $langsForm, $_SERVER['HTTP_HOST']). $langsmodal;
$hsfoot = '';
if (!defined('HLANG'))
echo $hsnav;
+function common_header(){
+ $common_header = '<meta name="viewport" content="width=device-width, initial-scale=1.0">' . PHP_EOL;
+ $common_header .= ' <link rel="stylesheet" href="/g/style/bootstrap.min.css">' . PHP_EOL;
+ $common_header .= ' <link rel="stylesheet" href="/g/style/bootstrap_theme.css">' . PHP_EOL;
+ $common_header .= ' <link rel="stylesheet" href="/g/style/common_footer.css">' . PHP_EOL;
+ return $common_header;
+}
+
/**
* Output common footer in passed language
*
@@ -121,6 +146,9 @@ function common_footer($locale = 'en')
$common_footer .= ' </p>' . PHP_EOL;
$common_footer .= ' </div>' . PHP_EOL;
$common_footer .= '</div>' . PHP_EOL;
+ $common_footer .= '<script src="/g/js/jquery-3.2.1.min.js"></script>' . PHP_EOL;
+ $common_footer .= '<script src="/g/js/tether.min.js"></script>' . PHP_EOL;
+ $common_footer .= '<script src="/g/js/bootstrap.min.js"></script>' . PHP_EOL;
return $common_footer;
}