Index: branches/RC/kernel/units/config_search/config_search_event_handler.php =================================================================== diff -u -N -r9363 -r10838 --- branches/RC/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 9363) +++ branches/RC/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 10838) @@ -51,6 +51,11 @@ } $event->SetRedirectParam('opener', 's'); + + // keeps module and section in REQUEST to ensure, that last admin template will work + $event->SetRedirectParam('module', $this->Application->GetVar('module')); + $event->SetRedirectParam('module_key', $this->Application->GetVar('module_key')); + $event->SetRedirectParam('section', $this->Application->GetVar('section')); } function OnCancel(&$event) Index: branches/RC/core/units/config_search/config_search_event_handler.php =================================================================== diff -u -N -r9363 -r10838 --- branches/RC/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 9363) +++ branches/RC/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 10838) @@ -51,6 +51,11 @@ } $event->SetRedirectParam('opener', 's'); + + // keeps module and section in REQUEST to ensure, that last admin template will work + $event->SetRedirectParam('module', $this->Application->GetVar('module')); + $event->SetRedirectParam('module_key', $this->Application->GetVar('module_key')); + $event->SetRedirectParam('section', $this->Application->GetVar('section')); } function OnCancel(&$event) Index: branches/RC/core/units/configuration/configuration_event_handler.php =================================================================== diff -u -N -r10832 -r10838 --- branches/RC/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 10832) +++ branches/RC/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 10838) @@ -154,6 +154,10 @@ $this->Application->removeObject($event->getPrefixSpecial()); $event->redirect = false; } + + // keeps module and section in REQUEST to ensure, that last admin template will work + $event->SetRedirectParam('module', $this->Application->GetVar('module')); + $event->SetRedirectParam('section', $this->Application->GetVar('section')); } /** @@ -187,7 +191,8 @@ { $selected_ids = $this->Application->GetVar('selected_ids'); $this->Application->StoreVar('ModuleRootCategory', $selected_ids['c']); - $this->finalizePopup($event); + + $event->SetRedirectParam('opener', 'u'); } } Index: branches/RC/core/kernel/session/session.php =================================================================== diff -u -N -r10780 -r10838 --- branches/RC/core/kernel/session/session.php (.../session.php) (revision 10780) +++ branches/RC/core/kernel/session/session.php (.../session.php) (revision 10838) @@ -397,7 +397,7 @@ var $Expiration; var $SID; - + var $SessionSet = false; /** @@ -415,7 +415,7 @@ * @var Params */ var $Data; - + /** * Names of optional session keys (which does not need to be always stored * @@ -493,7 +493,7 @@ if (!is_null($this->OriginalMode)) $this->SetMode($this->OriginalMode); } - + function ValidateExpired() { if( !(defined('IS_INSTALL') && IS_INSTALL) ) { @@ -502,7 +502,7 @@ $this->RemoveSessionCookie(); // true was here to force new session creation, but I used RemoveCookie a line above, to avoid redirect loop with expired sid not being removed // setSession with true was used before, to set NEW session cookie - $this->SetSession(); + $this->SetSession(); $this->Application->HandleEvent($event, 'u:OnSessionExpire'); return ; } @@ -628,7 +628,7 @@ $result = $this->LoadSession($sid); $this->SessionSet = $result; - + return $result; } @@ -734,7 +734,7 @@ $this->SID=$new_sid; $this->Application->SetVar($this->GETName,$new_sid); } - + function NeedSession() { $data = $this->Data->GetParams(); @@ -751,7 +751,7 @@ $this->GenerateSID(); return false; } - + if (!$this->SID || $force) $this->GenerateSID(); $this->Expiration = adodb_mktime() + $this->SessionTimeout; switch ($this->Mode) { @@ -820,7 +820,7 @@ $this->SetCookie($this->CookieName.'_live', $this->SID); $_COOKIE[$this->CookieName] = $this->SID; // for compatibility with in-portal } - + function RemoveSessionCookie() { $this->SetCookie($this->CookieName, ''); @@ -933,15 +933,10 @@ $last_template = basename($_SERVER['PHP_SELF']).'|'.mb_substr($last_env, mb_strlen(ENV_VAR_NAME) + 1); $this->StoreVar(rtrim('last_template_'.$wid, '_'), $last_template); + // prepare last_template for opener stack, module & session could be added later $last_env = $this->getLastTemplateENV($t, null, false); - $last_template = basename($_SERVER['PHP_SELF']).'|'.mb_substr($last_env, mb_strlen(ENV_VAR_NAME) + 1); - $this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template); - // save other last... variables for mistical purposes (customizations may be) - $this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink - $this->StoreVar('last_env', mb_substr($last_env, mb_strlen(ENV_VAR_NAME)+1)); - // save last_template in persistant session if (!$wid) { if ($this->Application->IsAdmin()) { @@ -971,6 +966,13 @@ $admin_session->StorePersistentVar('last_template_popup', '../'.$last_template); } } + + // save other last... variables for mistical purposes (customizations may be) + $this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink + $this->StoreVar('last_env', mb_substr($last_env, mb_strlen(ENV_VAR_NAME)+1)); + + // save last template here, becase section & module could be added before + $this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template); } function getLastTemplateENV($t, $params = null, $encode = true) Index: branches/RC/core/kernel/application.php =================================================================== diff -u -N -r10780 -r10838 --- branches/RC/core/kernel/application.php (.../application.php) (revision 10780) +++ branches/RC/core/kernel/application.php (.../application.php) (revision 10838) @@ -326,7 +326,7 @@ } $this->HttpQuery->AfterInit(); - + $this->Session->ValidateExpired(); if( defined('DEBUG_MODE') && $this->isDebugMode() ) { @@ -787,6 +787,7 @@ if ($this->IsAdmin()) { // for permission checking in events & templates $this->LinkVar('module'); // for common configuration templates + $this->LinkVar('module_key'); // for common search templates $this->LinkVar('section'); // for common configuration templates if ($this->GetVar('m_opener') == 'p') {