Index: trunk/kernel/units/categories/cache_updater.php =================================================================== diff -u -N -r5206 -r5212 --- trunk/kernel/units/categories/cache_updater.php (.../cache_updater.php) (revision 5206) +++ trunk/kernel/units/categories/cache_updater.php (.../cache_updater.php) (revision 5212) @@ -137,10 +137,15 @@ var $table; var $root_prefixes = Array(); + var $TitleField = ''; function Init($prefix, $special, $event_params = null) { parent::Init($prefix, $special, $event_params); + + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $this->TitleField = $ml_formatter->LangFieldName('Name'); + $continuing = $event_params['continue']; foreach ($this->Application->ModuleInfo as $module_name => $module_info) { @@ -281,14 +286,13 @@ function QueryTitle(&$data) { $category_id = $data['current_id']; - - $sql = 'SELECT Name, Filename, CategoryTemplate, ItemTemplate + $sql = 'SELECT '.$this->TitleField.', Filename, CategoryTemplate, ItemTemplate FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$category_id; $record = $this->Conn->GetRow($sql); if ($record) { - $data['title'][] = $record['Name']; + $data['title'][] = $record[$this->TitleField]; $data['named_path'][] = $record['Filename']; // it is one of the modules root category Index: trunk/kernel/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r5210 -r5212 --- trunk/kernel/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 5210) +++ trunk/kernel/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 5212) @@ -138,9 +138,9 @@ { $block_params['name'] = $this->SelectParam($params,'render_as,block'); - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField'); // $cat_object = &$this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' ); - $sql = 'SELECT CategoryId, ParentId, '.$ml_formatter->LangFieldName('Name').' AS Name + $sql = 'SELECT CategoryId, ParentId, '.$title_field.' AS Name FROM '.$this->Application->getUnitOption($this->Prefix, 'TableName').' WHERE CategoryId = '.$params['cat_id']; $res = $this->Conn->GetRow($sql); @@ -176,8 +176,7 @@ function CurrentCategoryName($params) { $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List'); - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); - $sql = 'SELECT '.$ml_formatter->LangFieldName('Name').' + $sql = 'SELECT '.$this->Application->getUnitOption($this->Prefix, 'TitleField').' FROM '.$cat_object->TableName.' WHERE CategoryId = '.$this->Application->GetVar('m_cat_id'); return $this->Conn->GetOne($sql); Index: trunk/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r5210 -r5212 --- trunk/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 5210) +++ trunk/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 5212) @@ -138,9 +138,9 @@ { $block_params['name'] = $this->SelectParam($params,'render_as,block'); - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField'); // $cat_object = &$this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' ); - $sql = 'SELECT CategoryId, ParentId, '.$ml_formatter->LangFieldName('Name').' AS Name + $sql = 'SELECT CategoryId, ParentId, '.$title_field.' AS Name FROM '.$this->Application->getUnitOption($this->Prefix, 'TableName').' WHERE CategoryId = '.$params['cat_id']; $res = $this->Conn->GetRow($sql); @@ -176,8 +176,7 @@ function CurrentCategoryName($params) { $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List'); - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); - $sql = 'SELECT '.$ml_formatter->LangFieldName('Name').' + $sql = 'SELECT '.$this->Application->getUnitOption($this->Prefix, 'TitleField').' FROM '.$cat_object->TableName.' WHERE CategoryId = '.$this->Application->GetVar('m_cat_id'); return $this->Conn->GetOne($sql); Index: trunk/core/units/categories/cache_updater.php =================================================================== diff -u -N -r5206 -r5212 --- trunk/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 5206) +++ trunk/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 5212) @@ -137,10 +137,15 @@ var $table; var $root_prefixes = Array(); + var $TitleField = ''; function Init($prefix, $special, $event_params = null) { parent::Init($prefix, $special, $event_params); + + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + $this->TitleField = $ml_formatter->LangFieldName('Name'); + $continuing = $event_params['continue']; foreach ($this->Application->ModuleInfo as $module_name => $module_info) { @@ -281,14 +286,13 @@ function QueryTitle(&$data) { $category_id = $data['current_id']; - - $sql = 'SELECT Name, Filename, CategoryTemplate, ItemTemplate + $sql = 'SELECT '.$this->TitleField.', Filename, CategoryTemplate, ItemTemplate FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$category_id; $record = $this->Conn->GetRow($sql); if ($record) { - $data['title'][] = $record['Name']; + $data['title'][] = $record[$this->TitleField]; $data['named_path'][] = $record['Filename']; // it is one of the modules root category