Index: branches/5.1.x/core/units/helpers/category_helper.php =================================================================== diff -u -r12657 -r13086 --- branches/5.1.x/core/units/helpers/category_helper.php (.../category_helper.php) (revision 12657) +++ branches/5.1.x/core/units/helpers/category_helper.php (.../category_helper.php) (revision 13086) @@ -1,6 +1,6 @@ Application->GetVar('t'); $show_category = getArrayValue($params, 'show_category'); + $current_template = $this->Application->GetVar('t'); + $physical_template = array_search($current_template, $this->Application->structureTemplateMapping); + + if ($physical_template !== false) { + // replace menu template name with it's actual template name on disk + list ($current_template) = explode(':', $physical_template, 2); + } + foreach ($navigation_parts as $template => $title) { $block_params['template'] = $template; @@ -344,7 +358,8 @@ return Array (); } - $ret = Array($parent_category_id => str_repeat('-', $level).' '.$data['l'.$language_id.'_Name']); + $category_language = $data['l' . $language_id . '_Name'] ? $language_id : $this->_primaryLanguageId; + $ret = Array($parent_category_id => str_repeat('-', $level).' '.$data['l' . $category_language . '_Name']); if ($data['children']) { $level++; @@ -459,6 +474,7 @@ $theme_id = (int)$themes_helper->getCurrentThemeId(); $root_category = $this->Application->findModule('Name', 'Core', 'RootCat'); + $this->_primaryLanguageId = $this->Application->GetDefaultLanguageId(); $this->_structureTree = $this->_printChildren($data, $root_category, $this->Application->GetVar('m_lang'), $theme_id); return $this->_structureTree; @@ -491,10 +507,11 @@ $url_params = Array ('m_cat_id' => $page_id, 'pass' => 'm'); $page_url = $this->Application->HREF(strtolower($templates[$page_id]), '', $url_params); - /*if ($this->Application->IsAdmin()) { + /*if ($this->Application->isAdmin) { $page_url = preg_replace('/&(admin|editing_mode)=[\d]/', '', $page_url); }*/ - $text = preg_replace('/@@' . $page_id . '@@/', $page_url, $text); + + $text = str_replace('@@' . $page_id . '@@', $page_url, $text); } return $text;