diff options
author | mistic100 <mistic@piwigo.org> | 2012-07-25 20:19:39 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2012-07-25 20:19:39 +0000 |
commit | 0a7878f4e80ba86bf7f67ae0669635a5d0d758ef (patch) | |
tree | 1188b4c9d40d5a9609832bd0282e23d3a9117aac /plugins/language_switch | |
parent | b5f1db107955880e429e1165fdb3491591b58cc7 (diff) |
works with Additional Pages
git-svn-id: http://piwigo.org/svn/trunk@17064 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | plugins/language_switch/language_switch.inc.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/language_switch/language_switch.inc.php b/plugins/language_switch/language_switch.inc.php index 49c1a6c49..7b99f4b06 100644 --- a/plugins/language_switch/language_switch.inc.php +++ b/plugins/language_switch/language_switch.inc.php @@ -87,7 +87,7 @@ UPDATE '.USER_INFOS_TABLE.' function language_controler_flags() { - global $user, $template, $conf; + global $user, $template, $conf, $page; $available_lang = get_languages(); @@ -97,11 +97,21 @@ function language_controler_flags() } $url_starting = get_query_string_diff(array('lang')); - + + if ($page['section'] == 'additional_page' and isset($page['additional_page'])) + { + $base_url = make_index_url(array('section'=>'page')).'/'.(isset($page['additional_page']['permalink']) ? $page['additional_page']['permalink'] : $page['additional_page']['id']); + } + else + { + $base_url = duplicate_index_url(); + } + foreach ($available_lang as $code => $displayname) { + $qlc = array ( - 'url' => add_url_params(duplicate_index_url(), array('lang'=> $code)), + 'url' => add_url_params($base_url, array('lang'=> $code)), 'alt' => ucwords($displayname), 'title' => substr($displayname, 0, -4), // remove [FR] or [RU] 'img' => get_root_url().'language/'.$code.'/'.$code.'.jpg', |