Index: branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php =================================================================== diff -u -r6862 -r6864 --- branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php (.../session.php) (revision 6862) +++ branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php (.../session.php) (revision 6864) @@ -778,7 +778,7 @@ $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']); + $this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink $this->StoreVar('last_env', substr($last_env, strlen(ENV_VAR_NAME)+1)); } Index: branches/unlabeled/unlabeled-1.9.2/kernel/units/relationship/relationship_event_handler.php =================================================================== diff -u -r6628 -r6864 --- branches/unlabeled/unlabeled-1.9.2/kernel/units/relationship/relationship_event_handler.php (.../relationship_event_handler.php) (revision 6628) +++ branches/unlabeled/unlabeled-1.9.2/kernel/units/relationship/relationship_event_handler.php (.../relationship_event_handler.php) (revision 6864) @@ -82,7 +82,8 @@ // place correct template in opener stack $source_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); $template = $this->Application->getUnitOption($source_prefix, 'AdminTemplatePath').'/relations_edit'; - $redirect_params = Array($event->Prefix.'_event' => 'OnNew', 'target_id' => $target_id, 'target_type' => $target_type); + + $redirect_params = Array($event->Prefix.'_event' => 'OnNew', 'target_id' => $target_id, 'm_opener' => 's', 'target_type' => $target_type); $this->Application->EventManager->openerStackPush($template, $redirect_params, 'all,'.$event->Prefix); } } Index: branches/unlabeled/unlabeled-1.9.2/core/units/relationship/relationship_event_handler.php =================================================================== diff -u -r6628 -r6864 --- branches/unlabeled/unlabeled-1.9.2/core/units/relationship/relationship_event_handler.php (.../relationship_event_handler.php) (revision 6628) +++ branches/unlabeled/unlabeled-1.9.2/core/units/relationship/relationship_event_handler.php (.../relationship_event_handler.php) (revision 6864) @@ -82,7 +82,8 @@ // place correct template in opener stack $source_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); $template = $this->Application->getUnitOption($source_prefix, 'AdminTemplatePath').'/relations_edit'; - $redirect_params = Array($event->Prefix.'_event' => 'OnNew', 'target_id' => $target_id, 'target_type' => $target_type); + + $redirect_params = Array($event->Prefix.'_event' => 'OnNew', 'target_id' => $target_id, 'm_opener' => 's', 'target_type' => $target_type); $this->Application->EventManager->openerStackPush($template, $redirect_params, 'all,'.$event->Prefix); } } Index: branches/unlabeled/unlabeled-1.39.8/core/kernel/event_manager.php =================================================================== diff -u -r6863 -r6864 --- branches/unlabeled/unlabeled-1.39.8/core/kernel/event_manager.php (.../event_manager.php) (revision 6863) +++ branches/unlabeled/unlabeled-1.39.8/core/kernel/event_manager.php (.../event_manager.php) (revision 6864) @@ -357,16 +357,25 @@ $this->Application->StoreVar(rtrim('opener_stack_'.$wid, '_'), serialize($opener_stack)); } - + /** + * Used from relationship event handler + * + * @param string $t + * @param Array $params + * @param string $pass + */ function openerStackPush($t, $params, $pass = 'all') { - $opener_stack = $this->Application->RecallVar('opener_stack'); + $wid = $this->Application->GetVar('m_wid'); + $stack_name = rtrim('opener_stack_'.$wid, '_'); + + $opener_stack = $this->Application->RecallVar($stack_name); $opener_stack = $opener_stack ? unserialize($opener_stack) : Array(); $redirect_params = array_merge_recursive2(Array('m_opener' => 'u', '__URLENCODE__' => 1), $params); $new_level = $this->Application->BuildEnv($t, $redirect_params, $pass, true); array_push($opener_stack, 'index.php|'.ltrim($new_level, ENV_VAR_NAME.'=') ); - $this->Application->StoreVar('opener_stack', serialize($opener_stack)); + $this->Application->StoreVar($stack_name, serialize($opener_stack)); } function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional) Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/incs/close_popup.tpl =================================================================== diff -u -r6863 -r6864 --- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/incs/close_popup.tpl (.../close_popup.tpl) (revision 6863) +++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/incs/close_popup.tpl (.../close_popup.tpl) (revision 6864) @@ -2,11 +2,28 @@