Index: branches/5.2.x/core/kernel/managers/url_manager.php =================================================================== diff -u -N -r14628 -r14653 --- branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 14628) +++ branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 14653) @@ -1,6 +1,6 @@ Application->recallObject('Session'); /* @var $session Session */ - + $ssl = isset($params['__SSL__']) ? $params['__SSL__'] : 0; $sid = $session->NeedQueryString() && !$this->Application->RewriteURLs($ssl) ? $this->Application->GetSID() : ''; // if (getArrayValue($params,'admin') == 1) $sid = $this->Application->GetSID(); @@ -536,7 +536,7 @@ if ( $this->Application->getUnitOption($prefix, 'PortalStyleEnv') == true ) { $ret = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/', '\\1\\2-\\3', $ret); } - + return $ret; } @@ -624,12 +624,31 @@ return trim(preg_replace('/'.preg_quote($cut_prefix, '/').'(.*)/', '\\1', $_SERVER['PHP_SELF']), '/'); } - function getPhysicalTemplate($template) + /** + * Returns theme template filename and it's corresponding page_id based on given seo template + * + * @param string $seo_template + * @return string + * @access public + */ + public function getPhysicalTemplate($seo_template) { - return array_search($template, $this->structureTemplateMapping); + return array_search($seo_template, $this->structureTemplateMapping); } /** + * Returns template name, that corresponds with given virtual (not physical) page id + * + * @param int $page_id + * @return string|bool + * @access public + */ + public function getVirtualPageTemplate($page_id) + { + return isset($this->structureTemplateMapping['id:' . $page_id]) ? $this->structureTemplateMapping['id:' . $page_id] : false; + } + + /** * Loads template mapping for Front-End * */