]> git.mjollnir.org Git - moodle.git/commitdiff
redirect MDL-20546 Set page type to embedded to avoid ever printing header/blocks...
authormoodler <moodler>
Tue, 13 Oct 2009 06:45:38 +0000 (06:45 +0000)
committermoodler <moodler>
Tue, 13 Oct 2009 06:45:38 +0000 (06:45 +0000)
lib/weblib.php

index 69a2713bfa6d1ba0f4a5c31c21301c712fcf281a..a5f7fb6453975c7cf772074b16d5ae60022aa096 100644 (file)
@@ -2717,7 +2717,7 @@ function notice ($message, $link='', $course=NULL) {
  * @return void
  */
 function redirect($url, $message='', $delay=-1) {
-    global $OUTPUT, $SESSION, $CFG;
+    global $OUTPUT, $PAGE, $SESSION, $CFG;
 
     if ($url instanceof moodle_url) {
         $url = $url->out(false, array(), false);
@@ -2781,6 +2781,7 @@ function redirect($url, $message='', $delay=-1) {
     }
 
     // Include a redirect message, even with a HTTP redirect, because that is recommended practice.
+    $PAGE->set_generaltype('embedded');  // No header and footer needed
     $CFG->docroot = false; // to prevent the link to moodle docs from being displayed on redirect page.
     echo $OUTPUT->redirect_message($encodedurl, $message, $delay, $debugdisableredirect);
     exit;