* @return bool
*/
function report_outline_myprofile_navigation(core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course) {
- if (!empty($course) && report_outline_can_access_user_report($user, $course)) {
+ if (empty($course)) {
+ // We want to display these reports under the site context.
+ $course = get_fast_modinfo(SITEID)->get_course();
+ }
+ if (report_outline_can_access_user_report($user, $course)) {
$url = new moodle_url('/report/outline/user.php',
array('id' => $user->id, 'course' => $course->id, 'mode' => 'outline'));
$node = new core_user\output\myprofile\node('reports', 'outline', get_string('outlinereport'), null, $url);