allow direct language switching on all lib2 pages

This commit is contained in:
following
2013-07-27 00:33:24 +02:00
parent 1466f3f402
commit 25fda9c4fc
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -225,6 +225,21 @@ class OcSmarty extends Smarty
if ($this->title == '')
$optn['template']['title'] = $menu->GetMenuTitle();
// build address for switching locales
$locale_pageadr = $_SERVER['REQUEST_URI'];
$lpos = strpos($locale_pageadr,"locale=");
if ($lpos)
$locale_pageadr = substr($locale_pageadr,0,$lpos);
else
{
$urx = explode('#', $locale_pageadr);
$locale_pageadr = $urx[0];
if (strpos($locale_pageadr,'?') == 0)
$locale_pageadr .= '?';
else
$locale_pageadr .= '&';
}
$this->assign('locale_pageadr', $locale_pageadr);
if ($opt['logic']['license']['disclaimer'])
{
+1 -1
View File
@@ -125,7 +125,7 @@
<td>
{foreach from=$opt.template.locales key=localeKey item=localeItem}
{if $localeItem.show}
<a style="text-decoration: none;" href="index.php?locale={$localeKey}"><img src="{$localeItem.flag}" alt="{$localeItem.name|escape}" width="24px" height="18px" /></a>
<a style="text-decoration: none;" href="{$locale_pageadr}locale={$localeKey}"><img src="{$localeItem.flag}" alt="{$localeItem.name|escape}" width="24px" height="18px" /></a>
{/if}
{/foreach}
</td>