]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7861, adding third param to error() function to print correct admin footer
authortoyomoyo <toyomoyo>
Tue, 19 Dec 2006 06:58:20 +0000 (06:58 +0000)
committertoyomoyo <toyomoyo>
Tue, 19 Dec 2006 06:58:20 +0000 (06:58 +0000)
admin/langdoc.php
lib/weblib.php

index d08476c2f91ae377bfbb595c95260232b9c11ae2..25ff92dcdf83239a2146c263ebc7e34004c65bb2 100755 (executable)
@@ -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.
index 23dc0b1dacad858cee13c1f6629862badc55a822..6d8e41446fae96961711bd43095681d3e41b5c8d 100644 (file)
@@ -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 ' ';
     }