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 14:53:29 +08:00
parent 440085ecf8
commit 502a403b43
3 changed files with 6 additions and 6 deletions
+5 -2
View File
@@ -777,8 +777,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)) {
+1 -3
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);
}
-1
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;