dirroot.'/course/lib.php'); $id = required_param('id',PARAM_INT); // course id if (!$course = get_record('course', 'id', $id)) { error('Course id is incorrect.'); } require_login($course); $context = get_context_instance(CONTEXT_COURSE, $course->id); require_capability('coursereport/outline:view', $context); add_to_log($course->id, 'course', 'report outline', "report/outline/index.php?id=$course->id", $course->id); $showlastaccess = true; $hiddenfields = explode(',', $CFG->hiddenuserfields); if (array_search('lastaccess', $hiddenfields) and !has_capability('moodle/user:viewhiddendetails', $coursecontext)) { $showlastaccess = false; } $stractivityreport = get_string('activityreport'); $stractivity = get_string('activity'); $strlast = get_string('lastaccess'); $strreports = get_string('reports'); $strviews = get_string('views'); $navlinks = array(); $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc'); $navlinks[] = array('name' => $stractivityreport, 'link' => null, 'type' => 'misc'); $navigation = build_navigation($navlinks); print_header("$course->shortname: $stractivityreport", $course->fullname, $navigation); print_heading(format_string($course->fullname)); if (!$logstart = get_field_sql("SELECT MIN(time) FROM {$CFG->prefix}log")) { error('Logs not available'); } echo '
'.$stractivity.' | '; echo ''.$strviews.' | '; if ($showlastaccess) { echo ''.$strlast.' | '; } echo '
---|---|---|
'; switch ($course->format) { case 'weeks': print_string('week'); break; case 'topics': print_string('topic'); break; default: print_string('section'); break; } echo ' '.$sectionnum.' | ||
modpixpath/$cm->modname/icon.gif\" class=\"icon\" alt=\"$modulename\" />"; echo "wwwroot/mod/$cm->modname/view.php?id=$cm->id\">".format_string($cm->name)." | "; echo ""; if (!empty($views[$cm->id]->numviews)) { echo $views[$cm->id]->numviews; } else { echo '-'; } echo " | "; if ($showlastaccess) { echo ""; if (isset($views[$cm->id]->lasttime)) { $timeago = format_time(time() - $views[$cm->id]->lasttime); echo userdate($views[$cm->id]->lasttime)." ($timeago)"; } echo " | "; } echo '