Index: trunk/core/units/general/inp1_parser.php =================================================================== diff -u -N -r1848 -r2127 --- trunk/core/units/general/inp1_parser.php (.../inp1_parser.php) (revision 1848) +++ trunk/core/units/general/inp1_parser.php (.../inp1_parser.php) (revision 2127) @@ -6,14 +6,22 @@ function Parse($tname, $template_body) { + global $objTemplate, $var_list, $var_list_update; if ( !$this->InportalInited) { + //$save_t = $this->Application->GetVar('t'); $this->InitInPortal(); + $var_list['t'] = $this->cutTPL($var_list['t']); + if($var_list['t'] != $this->Application->GetVar('t')) + { + $get = $_GET; + unset($get['env']); + $this->Application->StoreVar('K4_Template_Referer', $this->Application->GetVar('t') ); + + $this->Application->Redirect($var_list['t'], $get); + } } - global $objTemplate, $var_list, $var_list_update; - if( substr($var_list['t'],-4) == '.tpl' ) - { - $var_list['t'] = substr($var_list['t'], 0, strlen($var_list['t'])-4 ); - } + + $var_list['t'] = $this->cutTPL($var_list['t']); if ($var_list['t'] != $this->Application->GetVar('t')) { //$var_list['t'] = rtrim($var_list['t'],'.tpl'); @@ -28,6 +36,14 @@ return $template_body; } + function cutTPL($tname) + { + if( substr($tname,-4) == '.tpl' ) + { + return substr($tname, 0, strlen($tname)-4 ); + } + return $tname; + } function InitInPortal() { @@ -123,7 +139,12 @@ if(is_object($objSession)) { - + $k4_referer = $objSession->GetVariable('K4_Template_Referer'); + if($k4_referer) + { + $_local_t = $k4_referer; + $this->Application->RemoveVar('K4_Template_Referer'); + } $objSession->SetVariable("Template_Referer", $_local_t); } if($objTemplate->ErrorNo == -1)