]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11442 removed last instances of global $course
authorskodak <skodak>
Thu, 27 Sep 2007 08:18:28 +0000 (08:18 +0000)
committerskodak <skodak>
Thu, 27 Sep 2007 08:18:28 +0000 (08:18 +0000)
blocks/blog_menu/block_blog_menu.php
files/index.php
lib/weblib.php
question/format/coursetestmanager/format.php
theme/custom_corners/footer.html

index 1ce8274f6110573949f78e18931afafe5ddba32f..463d73425ed2f4b2c67f34f479ffc960ba197d68 100755 (executable)
@@ -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 = '&amp;courseid='.$course->id;
+                $coursearg = '&amp;courseid='.$COURSE->id;
                 // a course is specified
 
-                $courseviewlink = '<li><a href="'. $CFG->wwwroot .'/blog/index.php?filtertype=course&amp;filterselect='. $course->id .'">';
+                $courseviewlink = '<li><a href="'. $CFG->wwwroot .'/blog/index.php?filtertype=course&amp;filterselect='. $COURSE->id .'">';
                 $courseviewlink .= get_string('viewcourseentries', 'blog') ."</a></li>\n";
             }
 
index 7997e3d93f1eb7e68095031ecabd9af139ae377f..daa54763f0a4ee3dad0974d15514d00b894c91df 100644 (file)
     require_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $course->id));
 
     function html_footer() {
-        global $course, $choose;
+        global $COURSE, $choose;
 
         echo '</td></tr></table>';
 
-        print_footer($course);
+        print_footer($COURSE);
     }
 
     function html_header($course, $wdir, $formfield=""){
index 657fa51144988189e22db7380f1c854fcc766f8b..46dc072553c240f6e1808df930494c72c4bbcbb8 100644 (file)
@@ -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 = '';
     }
index e8de1dc8e51384603266c82ef5892a37678e4ca4..295db1a4d88a3a32bf940714e6b7f70eb18fcd62 100755 (executable)
@@ -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 '</fieldset>';
             echo "</form>";
             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 '</fieldset>';
             echo "</form>";
             print_simple_box_end();
-            print_footer($course);
+            print_footer($COURSE);
             exit;
         }
 //
index 0dbb6ae7bb17e0b4947e82dc56fea9d6569a1a62..2d06b566dd802afbdb9acf20b21008c36f74b4ff 100644 (file)
@@ -2,7 +2,7 @@
 <?php print_custom_corners_end(false, 'content'); ?>
 </div> <!-- end div containerContent -->
 <!-- START OF FOOTER -->
-<?php global $CFG, $course; ?>
+<?php global $CFG, $COURSE; ?>
 <div id="footer">
     <?php print_custom_corners_start(); ?>
 <?php