From: skodak Date: Thu, 27 Sep 2007 08:18:28 +0000 (+0000) Subject: MDL-11442 removed last instances of global $course X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=42626376f3be7130657ead2125dd5c5535af361b;p=moodle.git MDL-11442 removed last instances of global $course --- diff --git a/blocks/blog_menu/block_blog_menu.php b/blocks/blog_menu/block_blog_menu.php index 1ce8274f61..463d73425e 100755 --- a/blocks/blog_menu/block_blog_menu.php +++ b/blocks/blog_menu/block_blog_menu.php @@ -11,11 +11,7 @@ class block_blog_menu extends block_base { } function get_content() { - global $CFG, $course; - - if (!isset($course)) { - $course = SITEID; - } + global $CFG, $USER, $COURSE; if (empty($CFG->bloglevel)) { $this->content->text = ''; @@ -32,7 +28,6 @@ class block_blog_menu extends block_base { $userBlog ->userid = 0; } - global $CFG, $USER, $course; if (!empty($USER->id)) { $userBlog->userid = $USER->id; } //what is $userBlog anyway @@ -58,11 +53,10 @@ class block_blog_menu extends block_base { $sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID); - if (isset($course) && isset($course->id) - && $course->id != 0 && $course->id != SITEID) { + if ($COURSE->id != SITEID) { $incoursecontext = true; - $curcontext = get_context_instance(CONTEXT_COURSE, $course->id); + $curcontext = get_context_instance(CONTEXT_COURSE, $COURSE->id); } else { $incoursecontext = false; $curcontext = $sitecontext; @@ -75,10 +69,10 @@ class block_blog_menu extends block_base { if ( (isloggedin() && !isguest()) && $incoursecontext && $CFG->bloglevel >= BLOG_COURSE_LEVEL && $canviewblogs) { - $coursearg = '&courseid='.$course->id; + $coursearg = '&courseid='.$COURSE->id; // a course is specified - $courseviewlink = '
  • '; + $courseviewlink = '
  • '; $courseviewlink .= get_string('viewcourseentries', 'blog') ."
  • \n"; } diff --git a/files/index.php b/files/index.php index 7997e3d93f..daa54763f0 100644 --- a/files/index.php +++ b/files/index.php @@ -39,11 +39,11 @@ require_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $course->id)); function html_footer() { - global $course, $choose; + global $COURSE, $choose; echo ''; - print_footer($course); + print_footer($COURSE); } function html_header($course, $wdir, $formfield=""){ diff --git a/lib/weblib.php b/lib/weblib.php index 657fa51144..46dc072553 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -5360,11 +5360,11 @@ function editorhelpbutton(){ */ function helpbutton ($page, $title='', $module='moodle', $image=true, $linktext=false, $text='', $return=false, $imagetext='') { - global $CFG, $course; + global $CFG, $COURSE; // fix for MDL-7734 - if (!empty($course->lang)) { - $forcelang = $course->lang; + if (!empty($COURSE->lang)) { + $forcelang = $COURSE->lang; } else { $forcelang = ''; } diff --git a/question/format/coursetestmanager/format.php b/question/format/coursetestmanager/format.php index e8de1dc8e5..295db1a4d8 100755 --- a/question/format/coursetestmanager/format.php +++ b/question/format/coursetestmanager/format.php @@ -25,7 +25,7 @@ class qformat_coursetestmanager extends qformat_default { } function importprocess($filename) { - global $CFG, $USER, $strimportquestions,$form,$question_category,$category,$course, + global $CFG, $USER, $strimportquestions,$form,$question_category,$category,$COURSE, $hostname, $mdapath, $mdbpath; if ((PHP_OS == "Linux") and isset($hostname)) { $hostname = trim($hostname); @@ -42,7 +42,7 @@ class qformat_coursetestmanager extends qformat_default { if ((PHP_OS == "Linux") and !isset($hostname)) { // copy the file to a semi-permanent location - if (! $basedir = make_upload_directory("$course->id")) { + if (! $basedir = make_upload_directory("$COURSE->id")) { error("The site administrator needs to fix the file permissions for the data directory"); } if (!isset($hostname_access_error)) { @@ -52,7 +52,7 @@ class qformat_coursetestmanager extends qformat_default { $newfile = "$basedir/$cleanfilename"; if (move_uploaded_file($filename, $newfile)) { chmod($newfile, 0666); - clam_log_upload($newfile,$course); + clam_log_upload($newfile,$COURSE); } else { notify(get_string("uploadproblem", "", $filename)); } @@ -88,7 +88,7 @@ class qformat_coursetestmanager extends qformat_default { echo ''; echo ""; print_simple_box_end(); - print_footer($course); + print_footer($COURSE); exit; } @@ -100,7 +100,7 @@ class qformat_coursetestmanager extends qformat_default { if (PHP_OS == "WINNT") { // copy the file to a semi-permanent location - if (! $basedir = make_upload_directory("$course->id")) { + if (! $basedir = make_upload_directory("$COURSE->id")) { error("The site administrator needs to fix the file permissions for the data directory"); } $bname=basename($filename); @@ -109,7 +109,7 @@ class qformat_coursetestmanager extends qformat_default { $newfile = "$basedir/$cleanfilename"; if (move_uploaded_file($filename, $newfile)) { chmod($newfile, 0666); - clam_log_upload($newfile,$course); + clam_log_upload($newfile,$COURSE); } else { notify(get_string("uploadproblem", "", $filename)); } @@ -123,7 +123,7 @@ class qformat_coursetestmanager extends qformat_default { $question_categories = $this->getquestioncategories($filename); } // print the intermediary form - if (!$categories = question_category_options($course->id, true)) { + if (!$categories = question_category_options($COURSE->id, true)) { error("No categories!"); } print_heading_with_help($strimportquestions, "import", "quiz"); @@ -151,7 +151,7 @@ class qformat_coursetestmanager extends qformat_default { echo ''; echo ""; print_simple_box_end(); - print_footer($course); + print_footer($COURSE); exit; } // diff --git a/theme/custom_corners/footer.html b/theme/custom_corners/footer.html index 0dbb6ae7bb..2d06b566dd 100644 --- a/theme/custom_corners/footer.html +++ b/theme/custom_corners/footer.html @@ -2,7 +2,7 @@ - +