Index: branches/5.2.x/core/kernel/managers/url_manager.php =================================================================== diff -u -N -r15528 -r15543 --- branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 15528) +++ branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 15543) @@ -1,6 +1,6 @@ Application->GetVar('m_theme'); - } - if ( !$t ) { // when template not specified, use current $t = $this->Application->GetVar('t'); @@ -114,12 +108,9 @@ unset($params['use_section']); } - $theme_id = isset($params['m_theme']) ? $params['m_theme'] : $current_theme_id; - - if ( isset($use_section) && $use_section && array_key_exists($t . ':' . $theme_id, $this->structureTemplateMapping) ) { - // structure template corresponding to given physical template - $t = $this->structureTemplateMapping[$t . ':' . $theme_id]; - unset($params['use_section']); + if ( isset($use_section) && $use_section ) { + $theme_id = isset($params['m_theme']) ? $params['m_theme'] : null; + $t = $this->getSectionTemplate($t, $theme_id); } if ( preg_match('/external:(.*)/', $t, $regs) ) { @@ -402,6 +393,34 @@ } /** + * Returns section template for given physical/virtual template + * + * @param string $template + * @param int $theme_id + * @return string + * @access public + */ + public function getSectionTemplate($template, $theme_id = null) + { + static $current_theme_id = null; + + if ( !isset($current_theme_id) ) { + $current_theme_id = $this->Application->GetVar('m_theme'); + } + + if ( !isset($theme_id) ) { + $theme_id = $current_theme_id; + } + + if ( array_key_exists($template . ':' . $theme_id, $this->structureTemplateMapping) ) { + // structure template corresponding to given physical template + return $this->structureTemplateMapping[$template . ':' . $theme_id]; + } + + return $template; + } + + /** * Loads template mapping for Front-End * * @return void Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -N -r15532 -r15543 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15532) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15543) @@ -1,6 +1,6 @@ UrlManager->getSectionTemplate($template, $theme_id); + } + + /** * Returns variables with values that should be passed through with this link + variable list * * @param Array $params