mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-29030 fix whitespace
This commit is contained in:
parent
275cbac71a
commit
3f5389b129
1 changed files with 128 additions and 128 deletions
|
@ -23,74 +23,74 @@
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require('../../config.php');
|
require('../../config.php');
|
||||||
require_once($CFG->dirroot.'/course/lib.php');
|
require_once($CFG->dirroot.'/course/lib.php');
|
||||||
|
|
||||||
$id = required_param('id',PARAM_INT); // course id
|
$id = required_param('id',PARAM_INT); // course id
|
||||||
|
|
||||||
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
|
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
|
||||||
|
|
||||||
$PAGE->set_url('/report/outline/index.php', array('id'=>$id));
|
$PAGE->set_url('/report/outline/index.php', array('id'=>$id));
|
||||||
$PAGE->set_pagelayout('report');
|
$PAGE->set_pagelayout('report');
|
||||||
|
|
||||||
require_login($course);
|
require_login($course);
|
||||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||||
require_capability('report/outline:view', $context);
|
require_capability('report/outline:view', $context);
|
||||||
|
|
||||||
add_to_log($course->id, 'course', 'report outline', "report/outline/index.php?id=$course->id", $course->id);
|
add_to_log($course->id, 'course', 'report outline', "report/outline/index.php?id=$course->id", $course->id);
|
||||||
|
|
||||||
$showlastaccess = true;
|
$showlastaccess = true;
|
||||||
$hiddenfields = explode(',', $CFG->hiddenuserfields);
|
$hiddenfields = explode(',', $CFG->hiddenuserfields);
|
||||||
|
|
||||||
if (array_search('lastaccess', $hiddenfields) and !has_capability('moodle/user:viewhiddendetails', $coursecontext)) {
|
if (array_search('lastaccess', $hiddenfields) and !has_capability('moodle/user:viewhiddendetails', $coursecontext)) {
|
||||||
$showlastaccess = false;
|
$showlastaccess = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$stractivityreport = get_string('pluginname', 'report_outline');
|
$stractivityreport = get_string('pluginname', 'report_outline');
|
||||||
$stractivity = get_string('activity');
|
$stractivity = get_string('activity');
|
||||||
$strlast = get_string('lastaccess');
|
$strlast = get_string('lastaccess');
|
||||||
$strreports = get_string('reports');
|
$strreports = get_string('reports');
|
||||||
$strviews = get_string('views');
|
$strviews = get_string('views');
|
||||||
$strrelatedblogentries = get_string('relatedblogentries', 'blog');
|
$strrelatedblogentries = get_string('relatedblogentries', 'blog');
|
||||||
|
|
||||||
$PAGE->set_title($course->shortname .': '. $stractivityreport);
|
$PAGE->set_title($course->shortname .': '. $stractivityreport);
|
||||||
$PAGE->set_heading($course->fullname);
|
$PAGE->set_heading($course->fullname);
|
||||||
echo $OUTPUT->header();
|
echo $OUTPUT->header();
|
||||||
echo $OUTPUT->heading(format_string($course->fullname));
|
echo $OUTPUT->heading(format_string($course->fullname));
|
||||||
|
|
||||||
if (!$logstart = $DB->get_field_sql("SELECT MIN(time) FROM {log}")) {
|
if (!$logstart = $DB->get_field_sql("SELECT MIN(time) FROM {log}")) {
|
||||||
print_error('logfilenotavailable');
|
print_error('logfilenotavailable');
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $OUTPUT->container(get_string('computedfromlogs', 'admin', userdate($logstart)), 'loginfo');
|
echo $OUTPUT->container(get_string('computedfromlogs', 'admin', userdate($logstart)), 'loginfo');
|
||||||
|
|
||||||
$outlinetable = new html_table();
|
$outlinetable = new html_table();
|
||||||
$outlinetable->attributes['class'] = 'generaltable boxaligncenter';
|
$outlinetable->attributes['class'] = 'generaltable boxaligncenter';
|
||||||
$outlinetable->cellpadding = 5;
|
$outlinetable->cellpadding = 5;
|
||||||
$outlinetable->id = 'outlinetable';
|
$outlinetable->id = 'outlinetable';
|
||||||
$outlinetable->head = array($stractivity, $strviews);
|
$outlinetable->head = array($stractivity, $strviews);
|
||||||
|
|
||||||
if ($CFG->useblogassociations) {
|
if ($CFG->useblogassociations) {
|
||||||
$outlinetable->head[] = $strrelatedblogentries;
|
$outlinetable->head[] = $strrelatedblogentries;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($showlastaccess) {
|
if ($showlastaccess) {
|
||||||
$outlinetable->head[] = $strlast;
|
$outlinetable->head[] = $strlast;
|
||||||
}
|
}
|
||||||
|
|
||||||
$modinfo = get_fast_modinfo($course);
|
$modinfo = get_fast_modinfo($course);
|
||||||
$sections = get_all_sections($course->id);
|
$sections = get_all_sections($course->id);
|
||||||
|
|
||||||
$sql = "SELECT cm.id, COUNT('x') AS numviews, MAX(time) AS lasttime
|
$sql = "SELECT cm.id, COUNT('x') AS numviews, MAX(time) AS lasttime
|
||||||
FROM {course_modules} cm
|
FROM {course_modules} cm
|
||||||
JOIN {modules} m ON m.id = cm.module
|
JOIN {modules} m ON m.id = cm.module
|
||||||
JOIN {log} l ON l.cmid = cm.id
|
JOIN {log} l ON l.cmid = cm.id
|
||||||
WHERE cm.course = ? AND l.action LIKE 'view%' AND m.visible = 1
|
WHERE cm.course = ? AND l.action LIKE 'view%' AND m.visible = 1
|
||||||
GROUP BY cm.id";
|
GROUP BY cm.id";
|
||||||
$views = $DB->get_records_sql($sql, array($course->id));
|
$views = $DB->get_records_sql($sql, array($course->id));
|
||||||
|
|
||||||
$prevsecctionnum = 0;
|
$prevsecctionnum = 0;
|
||||||
foreach ($modinfo->sections as $sectionnum=>$section) {
|
foreach ($modinfo->sections as $sectionnum=>$section) {
|
||||||
foreach ($section as $cmid) {
|
foreach ($section as $cmid) {
|
||||||
$cm = $modinfo->cms[$cmid];
|
$cm = $modinfo->cms[$cmid];
|
||||||
if (!$cm->has_view()) {
|
if (!$cm->has_view()) {
|
||||||
|
@ -167,10 +167,10 @@
|
||||||
}
|
}
|
||||||
$outlinetable->data[] = $reportrow;
|
$outlinetable->data[] = $reportrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo html_writer::table($outlinetable);
|
echo html_writer::table($outlinetable);
|
||||||
|
|
||||||
echo $OUTPUT->footer();
|
echo $OUTPUT->footer();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue