From fa4c975c89105377d3c37f766a31a3dbbf1edc2f Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 5 Jan 2007 08:18:26 +0000 Subject: [PATCH] Some extensions to print_error to make it more useful for admin pages --- lib/weblib.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index a0adbdf803..cd21ca38f3 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4530,7 +4530,7 @@ function print_scale_menu_helpbutton($courseid, $scale, $return=false) { * @param string $message The message to display to the user about the error. * @param string $link The url where the user will be prompted to continue. If no url is provided the user will be directed to the site index page. */ -function error ($message, $link='', $adminroot='') { +function error ($message, $link='', $adminroot=false) { global $CFG, $SESSION; $message = clean_text($message); // In case nasties are in here @@ -4563,17 +4563,21 @@ function error ($message, $link='', $adminroot='') { $link = $CFG->wwwroot .'/'; } } - print_continue($link); if ($adminroot) { admin_externalpage_print_footer($adminroot); } else { + print_continue($link); print_footer(); } for ($i=0;$i<512;$i++) { // Padding to help IE work with 404 echo ' '; } + if ($continue) { + return true; + } + die; } @@ -4585,8 +4589,9 @@ function error ($message, $link='', $adminroot='') { * @param string $errorcode The name of the string from error.php to print * @param string $link The url where the user will be prompted to continue. If no url is provided the user will be directed to the site index page. * @param object $a Extra words and phrases that might be required in the error string + * @param boolean $adminroot Is the page an admin settings page? */ -function print_error ($errorcode, $module='', $link='', $a=NULL) { +function print_error ($errorcode, $module='', $link='', $a=NULL, $adminroot=false) { global $CFG; @@ -4609,7 +4614,7 @@ function print_error ($errorcode, $module='', $link='', $a=NULL) { '

'. ''. get_string('moreinformation').'

'; - error($message, $link); + error($message, $link, $adminroot); } /** * Returns a string of html with an image of a help icon linked to a help page on a number of help topics. -- 2.39.5