diff options
author | mistic100 <mistic@piwigo.org> | 2012-07-25 20:26:52 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2012-07-25 20:26:52 +0000 |
commit | af345e210032524215564348986ae1f4fb1a5877 (patch) | |
tree | 8662b1ac68f707a16bdbb8c3b43d01592b689dd5 /plugins/language_switch | |
parent | 273f066dafc967ec5ff75d4a7664f65959e19a90 (diff) |
Merged revision(s) r17064 from trunk:
works with Additional Pages
git-svn-id: http://piwigo.org/svn/branches/2.4@17069 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/language_switch')
-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', |