Index: branches/unlabeled/unlabeled-1.56.2/kernel/include/category.php =================================================================== diff -u -r5444 -r5651 --- branches/unlabeled/unlabeled-1.56.2/kernel/include/category.php (.../category.php) (revision 5444) +++ branches/unlabeled/unlabeled-1.56.2/kernel/include/category.php (.../category.php) (revision 5651) @@ -327,11 +327,20 @@ $cateogry_template = ''; $item_template = ''; + $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); + $language_count = $ml_helper->getLanguageCount(); + $primary_lang_id = $this->Application->GetDefaultLanguageId(); + do { - $rs = $this->adodbConnection->Execute('SELECT ParentId, '.$this->TitleField.', Filename, CachedCategoryTemplate, CachedItemTemplate FROM '.$this->tablename.' WHERE CategoryId = '.$Id2); + $rs = $this->adodbConnection->Execute('SELECT * FROM '.$this->tablename.' WHERE CategoryId = '.$Id2); $path_parts[] = $Id2; - $nav_parts[] = $rs->fields[$this->TitleField]; $named_parts[] = $rs->fields['Filename']; + + $i = 1; + while ($i <= $language_count) { + $nav_parts[$i][] = $rs->fields['l'.$i.'_Name'] ? $rs->fields['l'.$i.'_Name'] : $rs->fields['l'.$primary_lang_id.'_Name']; + $i++; + } if (!$cateogry_template && $rs->fields['CachedCategoryTemplate']) { $cateogry_template = $rs->fields['CachedCategoryTemplate']; @@ -346,27 +355,32 @@ } while ($Id2 != '0'); $parent_path = '|'.implode('|', array_reverse($path_parts) ).'|'; - $nav_bar = implode('>', array_reverse($nav_parts) ); $named_path = implode('/', array_reverse($named_parts) ); + + $i = 1; + while ($i <= $language_count) { + $this->Set('l'.$i.'_CachedNavbar', implode('&|&', array_reverse($nav_parts[$i]) )); + $i++; + } $this->Set('ParentPath', $parent_path); - $this->Set('CachedNavbar', $nav_bar); $this->Set('NamedParentPath', $named_path); $this->Set('CachedCategoryTemplate', $cateogry_template); $this->Set('CachedItemTemplate', $item_template); $this->Update(); } - function GetCachedNavBar() - { - $res = $this->Get("CachedNavbar"); - if(!strlen($res)) - { - $this->UpdateCachedPath(); - $res = $this->Get("CachedNavbar"); - } - return $res; + function GetCachedNavBar() + { + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $navbar_field = $ml_formatter->LangFieldName('CachedNavbar'); + $res = $this->Get($navbar_field); + if (!strlen($res)) { + $this->UpdateCachedPath(); + $res = $this->Get($navbar_field); + } + return str_replace('&|&', ' > ', $res); } function Increment_Count() { @@ -828,6 +842,12 @@ return $res; } + function GetNavbar() + { + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + return str_replace('&|&', ' > ', $this->Get($ml_formatter->LangFieldName('CachedNavbar'))); + } + function ParseObject($element) { global $objConfig, $objCatList, $rootURL, $var_list, $var_list_update, $m_var_list_update, $objItemTypes,$objCountCache, $objUsers; @@ -890,6 +910,9 @@ @field:cat.cachednavbar @description: Category cached navbar */ + + $this->Set('CachedNavbar', $this->GetNavbar()); + $ret = $this->HighlightField("CachedNavbar"); if(!strlen($ret)) {