]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed notice() so that you can pass a course if you want
authormoodler <moodler>
Sun, 24 Sep 2006 06:21:15 +0000 (06:21 +0000)
committermoodler <moodler>
Sun, 24 Sep 2006 06:21:15 +0000 (06:21 +0000)
admin/index.php
lib/weblib.php

index 8a90157252471bd58b463e129c82a8bd98ffcf46..03733186159c5d76b336c7ab50dd1e61f7c02345 100644 (file)
         if (!set_config("release", $release)) {
             notify("ERROR: Could not update release version in database!!");
         }
-        notice(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'index.php');
-        exit;
+        notice(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'index.php', 'none');
     }
 
 /// Send $CFG->unicodedb to DB to have it available for next requests
index 3e2cbb7423bf1131ade9ba70231ef5b358c5f618..61e59058e7ce7a769ad98f2c7eb093f52aca2c5d 100644 (file)
@@ -4584,8 +4584,8 @@ function emoticonhelpbutton($form, $field) {
  * @param string $link ?
  * @todo Finish documenting this function
  */
-function notice ($message, $link='') {
-    global $CFG;
+function notice ($message, $link='', $course=NULL) {
+    global $CFG, $SITE;
 
     $message = clean_text($message);
     $link    = clean_text($link);
@@ -4601,8 +4601,12 @@ function notice ($message, $link='') {
     echo '<br />';
     print_simple_box($message, 'center', '50%', '', '20', 'generalbox', 'notice');
     print_continue($link);
-    print_footer(get_site());
-    die;
+    if (empty($course)) {
+        print_footer($SITE);
+    } else {
+        print_footer($course);
+    }
+    exit;
 }
 
 /**