]> git.mjollnir.org Git - moodle.git/commitdiff
Added a little static variable to print_header to prevent it being called twice
authormoodler <moodler>
Mon, 10 Apr 2006 14:40:39 +0000 (14:40 +0000)
committermoodler <moodler>
Mon, 10 Apr 2006 14:40:39 +0000 (14:40 +0000)
lib/weblib.php

index d0a07f37cdd6bf07906059790720a79663b0e332..33712659c8a959267b6ee067b8adadb2b77e50cc 100644 (file)
@@ -1849,6 +1849,15 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta=
 
     global $USER, $CFG, $THEME, $SESSION, $ME, $SITE, $HTTPSPAGEREQUIRED;
 
+/// This makes sure that the header is never repeated twice on a page
+    static $headerprinted = false;
+
+    if ($headerprinted) {
+        return;
+    } else {
+        $headerprinted = true;
+    }
+
 /// This is an ugly hack to be replaced later by a proper global $COURSE
     global $course;
     if (!empty($course->lang)) {