From dfa924cc99f45b1553ec6c5643d46a79e515df85 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 31 Oct 2006 11:59:54 +0000 Subject: [PATCH] Make the close_window function better. Merged 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 2410252cc2..34896171aa 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -1047,6 +1047,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 7bc2efd220..01a50b53bf 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -690,15 +690,20 @@ function close_window_button($name='closewindow', $return=false) { * Try and close the current window immediately using Javascript */ function close_window($delay=0) { - echo ''."\n"; - exit; + setTimeout("close_this_window()", ); +--> + + +