From 64034641cf271294d2b109fc39183cfd16156bc6 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Tue, 19 Dec 2006 06:58:20 +0000 Subject: [PATCH] MDL-7861, adding third param to error() function to print correct admin footer --- admin/langdoc.php | 8 ++++---- lib/weblib.php | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/admin/langdoc.php b/admin/langdoc.php index d08476c2f9..25ff92dcdf 100755 --- a/admin/langdoc.php +++ b/admin/langdoc.php @@ -40,7 +40,7 @@ if (!file_exists($langdir)) { - error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang'); + error ('to edit this language pack, you need to put it in '.$CFG->dataroot.'/lang','',$adminroot); } // Shall I save POSTed data? @@ -49,7 +49,7 @@ if (langdoc_save_file($langdir, $currentfile, $_POST['filedata'])) { notify(get_string("changessaved")." ($langdir/$currentfile)", "green"); } else { - error("Could not save the file '$currentfile'!", "langdoc.php?currentfile=$currentfile&sesskey=$USER->sesskey"); + error("Could not save the file '$currentfile'!", "langdoc.php?currentfile=$currentfile&sesskey=$USER->sesskey", $adminroot); } } } @@ -61,7 +61,7 @@ // Get all files from /docs directory if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/docs", "CVS")) { - error("Could not find English language docs files!"); + error("Could not find English language docs files!",'',$adminroot); } $options = array(); @@ -81,7 +81,7 @@ // Get all files from /help directory if (! $files = get_directory_list("$CFG->dirroot/lang/en_utf8/help", "CVS")) { - error("Could not find English language help files!"); + error("Could not find English language help files!",'',$adminroot); } foreach ($files as $filekey => $file) { // check all the help files. diff --git a/lib/weblib.php b/lib/weblib.php index 23dc0b1dac..6d8e41446f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4481,7 +4481,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='') { +function error ($message, $link='', $adminroot='') { global $CFG, $SESSION; $message = clean_text($message); // In case nasties are in here @@ -4515,7 +4515,12 @@ function error ($message, $link='') { } } print_continue($link); - print_footer(); + + if ($adminroot) { + admin_externalpage_print_footer($adminroot); + } else { + print_footer(); + } for ($i=0;$i<512;$i++) { // Padding to help IE work with 404 echo ' '; } -- 2.39.5