}
function get_content() {
- global $CFG, $course;
-
- if (!isset($course)) {
- $course = SITEID;
- }
+ global $CFG, $USER, $COURSE;
if (empty($CFG->bloglevel)) {
$this->content->text = '';
$userBlog ->userid = 0;
}
- global $CFG, $USER, $course;
if (!empty($USER->id)) {
$userBlog->userid = $USER->id;
} //what is $userBlog anyway
$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;
if ( (isloggedin() && !isguest()) && $incoursecontext
&& $CFG->bloglevel >= BLOG_COURSE_LEVEL && $canviewblogs) {
- $coursearg = '&courseid='.$course->id;
+ $coursearg = '&courseid='.$COURSE->id;
// a course is specified
- $courseviewlink = '<li><a href="'. $CFG->wwwroot .'/blog/index.php?filtertype=course&filterselect='. $course->id .'">';
+ $courseviewlink = '<li><a href="'. $CFG->wwwroot .'/blog/index.php?filtertype=course&filterselect='. $COURSE->id .'">';
$courseviewlink .= get_string('viewcourseentries', 'blog') ."</a></li>\n";
}
*/
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 = '';
}
}
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);
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)) {
$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));
}
echo '</fieldset>';
echo "</form>";
print_simple_box_end();
- print_footer($course);
+ print_footer($COURSE);
exit;
}
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);
$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));
}
$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");
echo '</fieldset>';
echo "</form>";
print_simple_box_end();
- print_footer($course);
+ print_footer($COURSE);
exit;
}
//