diff options
author | Romain d'Alverny <rda@mageia.org> | 2010-10-11 19:12:46 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2010-10-11 19:12:46 +0000 |
commit | 5682e3de7041b833087c6b4269f278f4b6fd877e (patch) | |
tree | 887c2bab2d3803ca97ed839ffb93990efe0fccfa /langs.php | |
parent | 57992b2f7f179d28b07d72d548303d3b21d1a606 (diff) | |
download | www-5682e3de7041b833087c6b4269f278f4b6fd877e.tar www-5682e3de7041b833087c6b4269f278f4b6fd877e.tar.gz www-5682e3de7041b833087c6b4269f278f4b6fd877e.tar.bz2 www-5682e3de7041b833087c6b4269f278f4b6fd877e.tar.xz www-5682e3de7041b833087c6b4269f278f4b6fd877e.zip |
fixes incorrect locale alternative links in menu
Diffstat (limited to 'langs.php')
-rw-r--r-- | langs.php | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -24,12 +24,13 @@ $langs = array( $sru = trim($_SERVER['REQUEST_URI']); $sel = explode('/', $sru); -$locale = $sel[1]; -$page = isset($sel[2]) ? $sel[2] : null; +array_shift($sel); +$locale = array_shift($sel); +$page = count($sel) > 0 ? implode('/', $sel) : null; $list_langs = array(); foreach ($langs as $k => $v) - $list_langs[] = sprintf('<a href="/%s/"%s>%s</a>', + $list_langs[] = sprintf('<a href="/%s"%s>%s</a>', $page != null ? implode('/', array($k, $page)) : $k, $k == $locale ? ' class="sel"' : '', $v); |