|
By moodler:
redirect MDL-20546 Set page type to embedded to avoid ever printing header/blocks/footer on redirects
|
| 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); |
| 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; |