Handle the OnBeforeUnload events to call OnFormCancel handlers when needed so that the plug-ins have a chance to perform some cleanup.

SVN:trunk[1328]
This commit is contained in:
Denis Flaven
2011-07-05 08:46:31 +00:00
parent 8a547bf104
commit 52fb63c0ee
5 changed files with 44 additions and 7 deletions

View File

@@ -485,7 +485,19 @@ try
// Can be useful in case a user got some corrupted prefs...
appUserPreferences::ClearPreferences();
break;
case 'on_form_cancel':
// Called when a creation/modification form is cancelled by the end-user
// Let's take this opportunity to inform the plug-ins so that they can perform some cleanup
$iTransactionId = utils::ReadParam('transaction_id', 0);
$sTempId = session_id().'_'.$iTransactionId;
foreach (MetaModel::EnumPlugins('iApplicationObjectExtension') as $oExtensionInstance)
{
$oExtensionInstance->OnFormCancel($sTempId);
}
break;
default:
$oPage->p("Invalid query.");
}