diff --git a/course/import/activities/index.php b/course/import/activities/index.php
index f15f467f4d751..5677d865d74ba 100644
--- a/course/import/activities/index.php
+++ b/course/import/activities/index.php
@@ -25,7 +25,7 @@
if ($fromcourse) {
$fromcontext = get_context_instance(CONTEXT_COURSE, $fromcourse);
}
- $syscontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
+ $syscontext = get_context_instance(CONTEXT_SYSTEM);
if (!has_capability('moodle/course:manageactivities', $tocontext)) {
print_error("You need do not have the required permissions to import activities to this course");
diff --git a/course/import/activities/mod.php b/course/import/activities/mod.php
index 9debf7f37dfe8..2cdcab69e0a3a 100644
--- a/course/import/activities/mod.php
+++ b/course/import/activities/mod.php
@@ -7,7 +7,7 @@
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot.'/backup/restorelib.php');
- $syscontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
+ $syscontext = get_context_instance(CONTEXT_SYSTEM);
// if we're not a course creator , we can only import from our own courses.
if (has_capability('moodle/course:create', $syscontext)) {
diff --git a/course/report/log/lib.php b/course/report/log/lib.php
index 4e058dc0fb43e..5a82e73c9316f 100644
--- a/course/report/log/lib.php
+++ b/course/report/log/lib.php
@@ -19,7 +19,7 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select
$showcourses = 1;
}
- $sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
+ $sitecontext = get_context_instance(CONTEXT_SYSTEM);
// Context for remote data is always SITE
// Groups for remote data are always OFF
@@ -286,7 +286,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today'
$showcourses = 1;
}
- $sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
+ $sitecontext = get_context_instance(CONTEXT_SYSTEM);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
/// Setup for group handling.
diff --git a/course/report/stats/lib.php b/course/report/stats/lib.php
index f281d210f1d98..be81872fc4be5 100644
--- a/course/report/stats/lib.php
+++ b/course/report/stats/lib.php
@@ -14,14 +14,14 @@ function report_stats_mode_menu($course, $mode, $time, $url) {
$reportoptions = stats_get_report_options($course->id, $mode);
$timeoptions = report_stats_timeoptions($mode);
if (empty($timeoptions)) {
- error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id);
+ print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
*/
$options = array();
$options[STATS_MODE_GENERAL] = get_string('statsmodegeneral');
$options[STATS_MODE_DETAILED] = get_string('statsmodedetailed');
- if (has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
+ if (has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM))) {
$options[STATS_MODE_RANKED] = get_string('reports');
}
diff --git a/filter/algebra/filter.php b/filter/algebra/filter.php
index eee12c34fd106..bdd6d1d1676ee 100644
--- a/filter/algebra/filter.php
+++ b/filter/algebra/filter.php
@@ -61,7 +61,7 @@ function string_file_picture_algebra($imagefile, $tex= "", $height="", $width=""
}
$style .= '"';
if ($imagefile) {
- if (!file_exists("$CFG->dataroot/filter/algebra/$imagefile") && has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
+ if (!file_exists("$CFG->dataroot/filter/algebra/$imagefile") && has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
$output .= "wwwroot/filter/algebra/algebradebug.php\">";
} else {
$output .= "dataroot/filter/tex/$imagefile") && has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
+ if (!file_exists("$CFG->dataroot/filter/tex/$imagefile") && has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
$output .= "wwwroot/filter/tex/texdebug.php\">";
} else {
$output .= "