[moodle] / moodle / lib / weblib.php Repository:

Diff of /moodle/lib/weblib.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1343, Thu Oct 1 12:16:22 2009 WST revision 1.1344, Tue Oct 13 14:45:38 2009 WST

By moodler:

redirect MDL-20546 Set page type to embedded to avoid ever printing header/blocks/footer on redirects

# Line 2717  Line 2717 
2717   * @return void   * @return void
2718   */   */
2719  function redirect($url, $message='', $delay=-1) {  function redirect($url, $message='', $delay=-1) {
2720      global $OUTPUT, $SESSION, $CFG;      global $OUTPUT, $PAGE, $SESSION, $CFG;
2721    
2722      if ($url instanceof moodle_url) {      if ($url instanceof moodle_url) {
2723          $url = $url->out(false, array(), false);          $url = $url->out(false, array(), false);
# Line 2781  Line 2781 
2781      }      }
2782    
2783      // Include a redirect message, even with a HTTP redirect, because that is recommended practice.      // Include a redirect message, even with a HTTP redirect, because that is recommended practice.
2784        $PAGE->set_generaltype('embedded');  // No header and footer needed
2785      $CFG->docroot = false; // to prevent the link to moodle docs from being displayed on redirect page.      $CFG->docroot = false; // to prevent the link to moodle docs from being displayed on redirect page.
2786      echo $OUTPUT->redirect_message($encodedurl, $message, $delay, $debugdisableredirect);      echo $OUTPUT->redirect_message($encodedurl, $message, $delay, $debugdisableredirect);
2787      exit;      exit;

Legend:
Removed from v.1.1343  
changed lines
  Added in v.1.1344

Moodle CVS Admin
ViewVC Help
Powered by ViewVC 1.0.7