Skip to content

Commit

Permalink
statistics MDL-25822 Fix broken navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Dec 30, 2010
1 parent f9c2702 commit 9e202d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions course/report/stats/index.php
Expand Up @@ -37,9 +37,14 @@


require_login($course); require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id); $context = get_context_instance(CONTEXT_COURSE, $course->id);

require_capability('coursereport/stats:view', $context); require_capability('coursereport/stats:view', $context);


$PAGE->set_url(new moodle_url('/course/report/stats/index.php', array('course' => $course->id,
'report' => $report,
'time' => $time,
'mode' => $mode,
'userid' => $userid)));

add_to_log($course->id, "course", "report stats", "report/stats/index.php?course=$course->id", $course->id); add_to_log($course->id, "course", "report stats", "report/stats/index.php?course=$course->id", $course->id);
stats_check_uptodate($course->id); stats_check_uptodate($course->id);


Expand All @@ -52,10 +57,8 @@


$PAGE->set_title("$course->shortname: $strstats"); $PAGE->set_title("$course->shortname: $strstats");
$PAGE->set_heading($course->fullname); $PAGE->set_heading($course->fullname);
//$PAGE->set_headingmenu(); $PAGE->set_pagelayout('report');
$PAGE->navbar->add($strreports, new moodle_url('/course/report.php', array('id'=>$course->id))); $PAGE->set_headingmenu(report_stats_mode_menu($course, $mode, $time, "$CFG->wwwroot/course/report/stats/index.php"));
$PAGE->navbar->add($strstats);
$PAGE->headingmenu(report_stats_mode_menu($course, $mode, $time, "$CFG->wwwroot/course/report/stats/index.php"));
echo $OUTPUT->header(); echo $OUTPUT->header();
} }


Expand Down
4 changes: 2 additions & 2 deletions course/report/stats/lib.php
Expand Up @@ -46,7 +46,7 @@ function report_stats_mode_menu($course, $mode, $time, $url) {
$popupurl = $url."?course=$course->id&time=$time"; $popupurl = $url."?course=$course->id&time=$time";
$select = new single_select(new moodle_url($popupurl), 'mode', $options, $mode, null); $select = new single_select(new moodle_url($popupurl), 'mode', $options, $mode, null);
$select->formid = 'switchmode'; $select->formid = 'switchmode';
echo $OUTPUT->render($select); return $OUTPUT->render($select);
} }




Expand Down Expand Up @@ -86,7 +86,7 @@ function stats_report_extend_navigation($navigation, $course, $context) {
global $CFG, $OUTPUT; global $CFG, $OUTPUT;
if (has_capability('coursereport/stats:view', $context)) { if (has_capability('coursereport/stats:view', $context)) {
if (!empty($CFG->enablestats)) { if (!empty($CFG->enablestats)) {
$url = new moodle_url('/course/report/stats/index.php', array('id'=>$course->id)); $url = new moodle_url('/course/report/stats/index.php', array('course'=>$course->id));
$navigation->add(get_string('stats'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', '')); $navigation->add(get_string('stats'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
} }
} }
Expand Down

0 comments on commit 9e202d3

Please sign in to comment.