Index: kernel/managers/url_manager.php =================================================================== --- kernel/managers/url_manager.php (revision 15226) +++ kernel/managers/url_manager.php (working copy) @@ -41,7 +41,7 @@ protected $rewriteReady = false; /** - * Physical template name mapping to their template names based on structure + * Physical template name mapping to their template names based in "Structure & Data" section * * @var Array */ @@ -366,7 +366,16 @@ */ public function getPhysicalTemplate($seo_template) { - return array_search($seo_template, $this->structureTemplateMapping); + $physical_template = array_search($seo_template, $this->structureTemplateMapping); + + if ( $physical_template === false || substr($physical_template, 0, 3) == 'id:' ) { + // physical template from ".smsignore" file OR virtual template + return $seo_template; + } + + list ($physical_template,) = explode(':', $physical_template, 2); // template_path:theme_id => seo_template + + return $physical_template; } /** Index: kernel/processors/main_processor.php =================================================================== --- kernel/processors/main_processor.php (revision 15226) +++ kernel/processors/main_processor.php (working copy) @@ -616,24 +616,19 @@ // for tabs function is_active($params) { - $test_templ = $this->SelectParam($params, 'templ,template,t'); - if ( !getArrayValue($params,'allow_empty') ) - { - $if_true=getArrayValue($params,'true') ? $params['true'] : 1; - $if_false=getArrayValue($params,'false') ? $params['false'] : 0; + $test_templ = $this->SelectParam($params, 'templ,template,t'); + if ( !getArrayValue($params, 'allow_empty') ) { + $if_true = getArrayValue($params, 'true') ? $params['true'] : 1; + $if_false = getArrayValue($params, 'false') ? $params['false'] : 0; } - else - { - $if_true=$params['true']; - $if_false=$params['false']; - } - - if ( preg_match("/^".str_replace('/', '\/', $test_templ)."/i", $this->Application->GetVar('t'))) { - return $if_true; - } else { - return $if_false; + $if_true = $params['true']; + $if_false = $params['false']; } + + $physical_template = $this->Application->getPhysicalTemplate($this->Application->GetVar('t')); + + return preg_match('/^' . str_replace('/', '\/', $test_templ) . '/i', $physical_template) ? $if_true : $if_false; } function IsNotActive($params) Index: units/helpers/navigation_bar.php =================================================================== --- units/helpers/navigation_bar.php (revision 15277) +++ units/helpers/navigation_bar.php (working copy) @@ -106,15 +106,7 @@ */ protected function _getCurrentTemplate() { - $current_template = $this->Application->GetVar('t'); - $physical_template = $this->Application->getPhysicalTemplate($current_template); - - if ( $physical_template !== false ) { - // replace menu template name with it's actual template name on disk - list ($current_template) = explode(':', $physical_template, 2); - } - - return $current_template; + return $this->Application->getPhysicalTemplate($this->Application->GetVar('t')); } /** Index: units/helpers/themes_helper.php =================================================================== --- units/helpers/themes_helper.php (revision 15165) +++ units/helpers/themes_helper.php (working copy) @@ -241,13 +241,8 @@ */ public function getTemplateId($template_path, $theme_id) { - $physical_template = $this->Application->getPhysicalTemplate($template_path); + $template_path = $this->Application->getPhysicalTemplate($template_path); - if ( ($physical_template !== false) && (substr($physical_template, 0, 3) != 'id:') ) { - // replace menu template name with it's actual template name on disk - list ($template_path) = explode(':', $physical_template, 2); - } - $sql = 'SELECT FileId FROM ' . TABLE_PREFIX . 'ThemeFiles WHERE ' . $this->getTemplateWhereClause($template_path, $theme_id);