From 4bb30981a024105e699e83ce090661fd9814996d Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 31 Oct 2006 11:58:04 +0000 Subject: [PATCH] Make the close_window function better. Backported from MOODLE_17_STABLE. --- lang/en_utf8/moodle.php | 1 + lib/weblib.php | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index 3c4b914a369..2dfbd9121a2 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -1005,6 +1005,7 @@ $string['periodending'] = 'Period ending ($a)'; $string['personalprofile'] = 'Personal profile'; $string['phone'] = 'Phone'; $string['phpinfo'] = 'PHP info'; +$string['pleaseclose'] = 'Please close this window now.'; $string['pluginsetup'] = 'Setting up plugin tables'; $string['policyagree'] = 'You must agree to this policy to continue using this site. Do you agree?'; $string['policyagreement'] = 'Site Policy Agreement'; diff --git a/lib/weblib.php b/lib/weblib.php index e8eef02291e..22949a0e72a 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -675,15 +675,20 @@ function close_window_button($name='closewindow') { * Try and close the current window immediately using Javascript */ function close_window($delay=0) { - echo ''."\n"; - exit; + setTimeout("close_this_window()", ); +--> + + +