MDL-14460, fix get_context_instance, see tracker

This commit is contained in:
dongsheng
2008-04-23 08:11:31 +00:00
parent 117e675602
commit 82b04884f3
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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)) {
error("You need do not have the required permissions to import activities to this course");
+1 -1
View File
@@ -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)) {
+2 -2
View File
@@ -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.
+1 -1
View File
@@ -21,7 +21,7 @@
$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');
}
+1 -1
View File
@@ -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 .= "<a href=\"$CFG->wwwroot/filter/algebra/algebradebug.php\">";
} else {
$output .= "<a target=\"popup\" title=\"TeX\" href=";
+1 -1
View File
@@ -68,7 +68,7 @@ function string_file_picture_tex($imagefile, $tex= "", $height="", $width="", $a
}
$style .= '"';
if ($imagefile) {
if (!file_exists("$CFG->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 .= "<a href=\"$CFG->wwwroot/filter/tex/texdebug.php\">";
} else {
$output .= "<a target=\"popup\" title=\"TeX\" href=";