MDL-29030 fix remaining report linking hacks

Please note all plugin references from core should use callbacks, it is not ok to use capabilities or links to plugins because they may not be present in customised installs.
This commit is contained in:
Petr Skoda
2011-11-06 12:22:50 +01:00
parent ffd8bb207e
commit ba50bd3d63
8 changed files with 39 additions and 34 deletions
+2 -2
View File
@@ -1350,13 +1350,13 @@ function stats_get_report_options($courseid,$mode) {
case STATS_MODE_DETAILED:
$reportoptions[STATS_REPORT_USER_ACTIVITY] = get_string('statsreport'.STATS_REPORT_USER_ACTIVITY);
$reportoptions[STATS_REPORT_USER_ALLACTIVITY] = get_string('statsreport'.STATS_REPORT_USER_ALLACTIVITY);
if (has_capability('coursereport/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
if (has_capability('report/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
$site = get_site();
$reportoptions[STATS_REPORT_USER_LOGINS] = get_string('statsreport'.STATS_REPORT_USER_LOGINS);
}
break;
case STATS_MODE_RANKED:
if (has_capability('coursereport/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
if (has_capability('report/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
$reportoptions[STATS_REPORT_ACTIVE_COURSES] = get_string('statsreport'.STATS_REPORT_ACTIVE_COURSES);
$reportoptions[STATS_REPORT_ACTIVE_COURSES_WEIGHTED] = get_string('statsreport'.STATS_REPORT_ACTIVE_COURSES_WEIGHTED);
$reportoptions[STATS_REPORT_PARTICIPATORY_COURSES] = get_string('statsreport'.STATS_REPORT_PARTICIPATORY_COURSES);