Index: trunk/kernel/units/categories/categories_tag_processor.php =================================================================== diff -u -r4997 -r5024 --- trunk/kernel/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 4997) +++ trunk/kernel/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 5024) @@ -288,6 +288,24 @@ { return false; } + + /** + * Substitutes category in last template base on current category + * + * @param Array $params + */ + function UpdateLastTemplate($params) + { + $category_id = $this->Application->GetVar('m_cat_id'); + + list($index_file, $env) = explode('|', $this->Application->RecallVar('last_template'), 2); + $this->Application->SetVar(ENV_VAR_NAME, $env); + $this->Application->HttpQuery->processQueryString(); + + // update required fields + $this->Application->SetVar('m_cat_id', $category_id); + $this->Application->Session->SaveLastTemplate($params['template']); + } }