allow direct language switching on all lib2 pages
This commit is contained in:
@@ -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'])
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user