MDL-46238 enrol:add a simple way to go back to course page

This commit is contained in:
shashi
2015-02-19 16:56:53 +05:30
parent 95751e81ac
commit bbc3b07965
6 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ if ($editform->is_cancelled()) {
if ($plugin = enrol_get_plugin($instance->enrol)) {
if ($plugin->get_manual_enrol_link($instance)) {
// We know that the ajax enrol UI will have an option to enrol.
$courseurl = new moodle_url('/enrol/users.php', array('id' => $course->id));
$courseurl = new moodle_url('/enrol/users.php', array('id' => $course->id, 'newcourse' => 1));
break;
}
}
+1 -1
View File
@@ -45,7 +45,7 @@ class core_enrol_renderer extends plugin_renderer_base {
$buttons = $table->get_manual_enrol_buttons();
$buttonhtml = '';
if (count($buttons) > 0) {
$buttonhtml .= html_writer::start_tag('div', array('class' => 'enrol_user_buttons'));
$buttonhtml .= html_writer::start_tag('div', array('class' => 'enrol_user_buttons enrol-users-page-action'));
foreach ($buttons as $button) {
$buttonhtml .= $this->render($button);
}
+6 -1
View File
@@ -35,6 +35,7 @@ $search = optional_param('search', '', PARAM_RAW);
$role = optional_param('role', 0, PARAM_INT);
$fgroup = optional_param('filtergroup', 0, PARAM_INT);
$status = optional_param('status', -1, PARAM_INT);
$newcourse = optional_param('newcourse', false, PARAM_BOOL);
// When users reset the form, redirect back to first page without other params.
if (optional_param('resetbutton', '', PARAM_RAW) !== '') {
@@ -54,7 +55,7 @@ $PAGE->set_pagelayout('admin');
$manager = new course_enrolment_manager($PAGE, $course, $filter, $role, $search, $fgroup, $status);
$table = new course_enrolment_users_table($manager, $PAGE);
$PAGE->set_url('/enrol/users.php', $manager->get_url_params()+$table->get_url_params());
$PAGE->set_url('/enrol/users.php', $manager->get_url_params()+$table->get_url_params()+array('newcourse' => $newcourse));
navigation_node::override_active_url(new moodle_url('/enrol/users.php', array('id' => $id)));
// Check if there is an action to take
@@ -240,4 +241,8 @@ $PAGE->set_heading($PAGE->title);
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('enrolledusers', 'enrol'));
echo $renderer->render_course_enrolment_users_table($table, $filterform);
if ($newcourse == 1) {
echo $OUTPUT->single_button(new moodle_url('/course/view.php', array('id' => $id)),
get_string('proceedtocourse', 'enrol'), 'GET', array('class' => 'enrol-users-page-action'));
}
echo $OUTPUT->footer();
+1
View File
@@ -104,6 +104,7 @@ $string['periodend'] = 'until {$a}';
$string['periodnone'] = 'enrolled {$a}';
$string['periodstart'] = 'from {$a}';
$string['periodstartend'] = 'from {$a->start} until {$a->end}';
$string['proceedtocourse'] = 'Proceed to course content';
$string['recovergrades'] = 'Recover user\'s old grades if possible';
$string['rolefromthiscourse'] = '{$a->role} (Assigned in this course)';
$string['rolefrommetacourse'] = '{$a->role} (Inherited from parent course)';
+4
View File
@@ -75,3 +75,7 @@ body {
@import "moodle/debug";
@import "moodle/expendable";
.enrol-users-page-action {
margin-left:-5px;
}
File diff suppressed because one or more lines are too long