mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-14460, fix get_context_instance, see tracker
This commit is contained in:
parent
fd968fb1b5
commit
09ee7b0d9e
6 changed files with 8 additions and 8 deletions
|
@ -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");
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
$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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue