Creating the Dialog plugin with the creation of methods to execute code
during the opening and closing events of the dialogs