]> git.mjollnir.org Git - moodle.git/commitdiff
Integrated the default redirect message delay from Greg B
authormoodler <moodler>
Wed, 12 Mar 2003 07:44:29 +0000 (07:44 +0000)
committermoodler <moodler>
Wed, 12 Mar 2003 07:44:29 +0000 (07:44 +0000)
lib/weblib.php

index c193533f077a26c03e38e5182e32d170e8923aa9..f12cbfa46d26e5bca7dfaeecf8c085e3bae7d3ff 100644 (file)
@@ -1124,22 +1124,16 @@ function notice_yesno ($message, $linkyes, $linkno) {
     print_simple_box_end();
 }
 
-/* This is an alternate beginning to the redirect function
-function redirect($url, $message="", $delay=false) {
-// Uses META tags to redirect the user, after printing a notice
-    if(!empty($message) && $delay == false):
-        $delay = 10;
-    else:
-        $delay = 0;
-    endif;
-*/
-
 function redirect($url, $message="", $delay=0) {
 // Uses META tags to redirect the user, after printing a notice
 
-    echo "<META HTTP-EQUIV='Refresh' CONTENT='$delay; URL=$url'>";
-
-    if (!empty($message)) {
+    if (empty($message)) {
+        echo "<META HTTP-EQUIV='Refresh' CONTENT='$delay; URL=$url'>";
+    } else {
+        if (! $delay) {  
+            $delay = 3;  // There's no point having a message with no delay
+        }
+        echo "<META HTTP-EQUIV='Refresh' CONTENT='$delay; URL=$url'>";
         print_header();
         echo "<CENTER>";
         echo "<P>$message</P>";