--- arctic/tpl_functions.php 2010-10-29 21:40:27.000000000 +0200 +++ arctic-mbo/tpl_functions.php 2011-01-09 14:31:01.000000000 +0100 @@ -86,6 +86,16 @@ case 'main': if(tpl_getConf('closedwiki') && !isset($_SERVER['REMOTE_USER'])) return; $main_sb = $pname; + +//translating the main sidebar + $translation = &plugin_load('helper','translation'); + if ($translation) { + $curlc = $translation->getLangPart($ID); + list($lc,$idpart) = $translation->getTransParts($main_sb); + list($main_sb,$name) = $translation->buildTransID($curlc,$idpart); + if(substr($main_sb,0,1)==":") $main_sb=substr($main_sb,1); + } + if(@page_exists($main_sb) && auth_quickaclcheck($main_sb) >= AUTH_READ) { $always = tpl_getConf('main_sidebar_always'); if($always or (!$always && !getNS($ID))) { @@ -346,8 +356,17 @@ $ns_sb = ''; $path = explode(':', $id); $found = false; + array_pop($path); //remove the page from the path + $min_path_depth=0; +//load translation plugin + $translation = &plugin_load('helper','translation'); + if ($translation) { +//if it's a translated page, we need to increase depth to exlude the namespace sidebar + $curlc = $translation->getLangPart($id); + if ($curlc) $min_path_depth=1; + } - while(count($path) > 0) { + while(count($path) > $min_path_depth) { $ns_sb = implode(':', $path).':'.$pname; if(@page_exists($ns_sb)) return $ns_sb; array_pop($path);