Index: branches/unlabeled/unlabeled-1.56.2/kernel/include/category.php =================================================================== diff -u -r5651 -r5656 --- branches/unlabeled/unlabeled-1.56.2/kernel/include/category.php (.../category.php) (revision 5651) +++ branches/unlabeled/unlabeled-1.56.2/kernel/include/category.php (.../category.php) (revision 5656) @@ -1383,8 +1383,9 @@ return $this->Get("ParentId"); break; case "cat_fullpath": - return $this->Get("CachedNavbar"); + return $this->GetNavbar(); break; + case "cat_name": return $this->Get($this->TitleField); break; @@ -1495,7 +1496,7 @@ } } - function ParentNames() + /*function ParentNames() { global $objCatList; @@ -1523,9 +1524,9 @@ $this->Set("CachedNavbar",$nav); $this->Update(); } - $res = explode(">",$this->Get("CachedNavbar")); + $res = explode("&|&",$this->Get("CachedNavbar")); return $res; - } + }*/ // not used anywhere /* function UpdateCacheCounts() @@ -2440,7 +2441,9 @@ $rs->MoveNext(); } - $rs = $this->adodbConnection->Execute("SELECT * FROM ".$this->SourceTable." WHERE CachedNavbar IS NULL or CachedNavBar=''"); + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $navbar_field = $ml_formatter->LangFieldName('CachedNavbar'); + $rs = $this->adodbConnection->Execute('SELECT * FROM '.$this->SourceTable.' WHERE '.$navbar_field.' IS NULL OR '.$navbar_field.' = ""'); while($rs && !$rs->EOF) { $c = new clsCategory(NULL); Index: branches/unlabeled/unlabeled-1.7.20/kernel/admin/include/parser.php =================================================================== diff -u -r5651 -r5656 --- branches/unlabeled/unlabeled-1.7.20/kernel/admin/include/parser.php (.../parser.php) (revision 5651) +++ branches/unlabeled/unlabeled-1.7.20/kernel/admin/include/parser.php (.../parser.php) (revision 5656) @@ -136,11 +136,7 @@ { $o .= "Get("RelationshipId")."\">"; $cat = $objCatList->GetByResource($catrel->Get("TargetId")); - $path = $cat->ParentNames(); - if(strlen($path)) - { - $o .= implode(">",$path); - } + $o .= $cat->GetCachedNavBar(); $o .="
\n"; } } @@ -166,11 +162,7 @@ $o .= "".$data["SourceTable"].""; $cat =& $objCatList->GetCategory($data["CategoryId"]); $o .= ""; - $path = $cat->ParentNames(); - if(strlen($path)) - { - $o .= implode(">",$path); - } + $o .= $cat->GetCachedNavBar(); $o .= ""; } } Index: branches/unlabeled/unlabeled-1.89.2/kernel/include/parseditem.php =================================================================== diff -u -r4448 -r5656 --- branches/unlabeled/unlabeled-1.89.2/kernel/include/parseditem.php (.../parseditem.php) (revision 4448) +++ branches/unlabeled/unlabeled-1.89.2/kernel/include/parseditem.php (.../parseditem.php) (revision 5656) @@ -85,9 +85,13 @@ case 'primarycategory': $db =& GetADODBConnection(); - $sql = 'SELECT CachedNavbar FROM '.$objCatList->SourceTable.' WHERE CategoryId = '.(int)$this->GetPrimaryCategory(); + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + + $sql = 'SELECT '.$ml_formatter->LangFieldName('CachedNavbar').' FROM '.$objCatList->SourceTable.' WHERE CategoryId = '.(int)$this->GetPrimaryCategory(); $ret = prompt_language($objConfig->Get("Root_Name")); - if( $this->GetPrimaryCategory() ) $ret .= '>'.$db->GetOne($sql); + if ($this->GetPrimaryCategory()) { + $ret .= ' > '.str_replace('&|&', ' > ', $db->GetOne($sql)); + } break; case "id": @@ -132,7 +136,7 @@ { $c = $objCatList->GetItem($this->Get("CategoryId")); if(is_object($c)) - $ret = $c->Get("CachedNavbar"); + $ret = $c->GetNavBar(); } else { @@ -141,7 +145,7 @@ $cat = $this->GetPrimaryCategory(); $c = $objCatList->GetItem($cat); if(is_object($c)) - $ret = $c->Get("CachedNavbar"); + $ret = $c->GetNavBar(); } } } @@ -2327,6 +2331,13 @@ return $sql; } + /** + * Not used in php files directly [comment by Alex] + * + * @param unknown_type $attribs + * @return unknown + * + */ function CountFavorites($attribs) { if($attribs["_today"]) @@ -2345,7 +2356,8 @@ $where .= " AND $favtable.Modified >= $today AND ItemTypeId=".$this->ItemType; $p = $this->BasePermission.".VIEW"; - $sql = "SELECT $ltable.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $favtable INNER JOIN $ltable ON ($favtable.ResourceId=$ltable.ResourceId) "; + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $sql = "SELECT $ltable.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavBar')." AS CachedNavBar FROM $favtable INNER JOIN $ltable ON ($favtable.ResourceId=$ltable.ResourceId) "; $sql .= $this->GetJoinedSQL($p,NULL,$where); $ret = QueryCount($sql); } @@ -2469,7 +2481,8 @@ } $p = $this->BasePermission.".VIEW"; - $sql = "SELECT $ltable.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $favtable INNER JOIN $ltable ON ($favtable.ResourceId=$ltable.ResourceId) "; + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $sql = "SELECT $ltable.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavBar')." AS CachedNavBar FROM $favtable INNER JOIN $ltable ON ($favtable.ResourceId=$ltable.ResourceId) "; $sql .= $this->GetJoinedSQL($p,NULL,$where); @@ -2538,7 +2551,8 @@ $where .= " AND ($TableName.CreatedOn>=$today)"; } $CategoryTable = GetTablePrefix()."Category"; - $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName "; $p = $this->BasePermission.".VIEW"; $sql .= $this->GetJoinedSQL($p,$catid,$where); @@ -2593,8 +2607,9 @@ $today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y")); $where .= " AND ($TableName.CreatedOn>=$today)"; } - $CategoryTable = GetTablePrefix()."Category"; - $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $CategoryTable = GetTablePrefix()."Category"; + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName "; $p = $this->BasePermission.".VIEW"; $sql .= $this->GetJoinedSQL($p,null,$where); // maybe null should be replaced by some CategoryId @@ -2686,7 +2701,8 @@ } $CategoryTable = GetTablePrefix()."Category"; - $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName "; $p = $this->BasePermission.".VIEW"; $sql .= $this->GetJoinedSQL($p,$catid,$where); @@ -2759,7 +2775,8 @@ $where .= " AND ($TableName.CreatedOn>=$today)"; } $CategoryTable = GetTablePrefix()."Category"; - $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName "; $p = $this->BasePermission.".VIEW"; $sql .= $this->GetJoinedSQL($p,$catid,$where); @@ -2832,7 +2849,8 @@ $where .= " AND ($TableName.CreatedOn>=$today)"; } $CategoryTable = GetTablePrefix()."Category"; - $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName "; $p = $this->BasePermission.".VIEW"; $CatId = !$scope? NULL : $catid; $sql .= $this->GetJoinedSQL($p,$CatId,$where); @@ -2890,7 +2908,8 @@ $p = $this->BasePermission.".VIEW"; $i = new $this->classname(); - $sql = "SELECT $cattable.CategoryId,$cattable.CachedNavbar,$ltable.*, Relevance FROM $stable "; + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $sql = "SELECT $cattable.CategoryId,$cattable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavbar,$ltable.*, Relevance FROM $stable "; $sql .= "INNER JOIN $ltable ON ($stable.ItemId=$ltable.".$i->id_field.") "; $where = "ItemType=".$this->ItemType." AND $ltable.Status=1";