mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 20:50:21 +01:00
MDL-22290 stadnardised the cancel button on lesson password page
This commit is contained in:
parent
ea7a9614e7
commit
510f8b0e5c
@ -114,8 +114,8 @@ class mod_lesson_renderer extends plugin_renderer_base {
|
|||||||
}
|
}
|
||||||
$output .= get_string('passwordprotectedlesson', 'lesson', format_string($lesson->name)).'<br /><br />';
|
$output .= get_string('passwordprotectedlesson', 'lesson', format_string($lesson->name)).'<br /><br />';
|
||||||
$output .= get_string('enterpassword', 'lesson')." <input type=\"password\" name=\"userpassword\" /><br /><br />";
|
$output .= get_string('enterpassword', 'lesson')." <input type=\"password\" name=\"userpassword\" /><br /><br />";
|
||||||
$output .= '<div class="lessonbutton standardbutton"><a href="'.$CFG->wwwroot.'/course/view.php?id='. $this->page->course->id .'">'. get_string('cancel', 'lesson') .'</a></div> ';
|
|
||||||
$output .= "<div class='lessonbutton standardbutton submitbutton'><input type='submit' value='".get_string('continue', 'lesson')."' /></div>";
|
$output .= "<div class='lessonbutton standardbutton submitbutton'><input type='submit' value='".get_string('continue', 'lesson')."' /></div>";
|
||||||
|
$output .= " <div class='lessonbutton standardbutton submitbutton'><input type='submit' name='backtocourse' value='".get_string('cancel', 'lesson')."' /></div>";
|
||||||
$output .= '</fieldset></form>';
|
$output .= '</fieldset></form>';
|
||||||
$output .= $this->output->box_end();
|
$output .= $this->output->box_end();
|
||||||
$output .= $this->output->box_end();
|
$output .= $this->output->box_end();
|
||||||
|
@ -33,6 +33,7 @@ $id = required_param('id', PARAM_INT); // Course Module ID
|
|||||||
$pageid = optional_param('pageid', NULL, PARAM_INT); // Lesson Page ID
|
$pageid = optional_param('pageid', NULL, PARAM_INT); // Lesson Page ID
|
||||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||||
$userpassword = optional_param('userpassword','',PARAM_RAW);
|
$userpassword = optional_param('userpassword','',PARAM_RAW);
|
||||||
|
$backtocourse = optional_param('backtocourse', false, PARAM_RAW);
|
||||||
|
|
||||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||||
@ -40,6 +41,10 @@ $lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*'
|
|||||||
|
|
||||||
require_login($course, false, $cm);
|
require_login($course, false, $cm);
|
||||||
|
|
||||||
|
if ($backtocourse) {
|
||||||
|
redirect(new moodle_url('/course/view.php', array('id'=>$course->id)));
|
||||||
|
}
|
||||||
|
|
||||||
$url = new moodle_url('/mod/lesson/view.php', array('id'=>$id));
|
$url = new moodle_url('/mod/lesson/view.php', array('id'=>$id));
|
||||||
if ($pageid !== null) {
|
if ($pageid !== null) {
|
||||||
$url->param('pageid', $pageid);
|
$url->param('pageid', $pageid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user