MDL-39103 lesson: Fix lesson administration block

Credit to Joseph Rézeau for the fix
This commit is contained in:
John Okely 2015-01-06 11:36:42 +08:00
parent fefd49f70e
commit 02ff22e925
3 changed files with 6 additions and 6 deletions

View File

@ -805,8 +805,11 @@ function lesson_extend_settings_navigation($settings, $lessonnode) {
$lessonnode->add(get_string('preview', 'lesson'), $url);
if (has_capability('mod/lesson:edit', $PAGE->cm->context)) {
$url = new moodle_url('/mod/lesson/edit.php', array('id'=>$PAGE->cm->id));
$lessonnode->add(get_string('edit', 'lesson'), $url);
$editnode = $lessonnode->add(get_string('edit', 'lesson'));
$url = new moodle_url('/mod/lesson/edit.php', array('id' => $PAGE->cm->id, 'mode' => 'collapsed'));
$editnode->add(get_string('collapsed', 'lesson'), $url);
$url = new moodle_url('/mod/lesson/edit.php', array('id' => $PAGE->cm->id, 'mode' => 'full'));
$editnode->add(get_string('full', 'lesson'), $url);
}
if (has_capability('mod/lesson:manage', $PAGE->cm->context)) {

View File

@ -69,9 +69,7 @@ if (! $students = $DB->get_records_sql($sql, $params)) {
}
$url = new moodle_url('/mod/lesson/report.php', array('id'=>$id));
if ($action !== 'reportoverview') {
$url->param('action', $action);
}
$url->param('action', $action);
if ($pageid !== null) {
$url->param('pageid', $pageid);
}

View File

@ -353,7 +353,6 @@ if ($pageid != LESSON_EOL) {
}
}
$PAGE->set_url('/mod/lesson/view.php', array('id' => $cm->id, 'pageid' => $page->id));
$PAGE->set_subpage($page->id);
$currenttab = 'view';
$extraeditbuttons = true;