mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-29108: support for returnurl in rubriceditor
This commit is contained in:
parent
5060997ba5
commit
ed709412c2
@ -47,14 +47,17 @@ $PAGE->requires->js('/grade/grading/form/rubric/js/rubriceditor.js');
|
||||
|
||||
//TODO freeze rubric editor if needed
|
||||
$mform = new gradingform_rubric_editrubric(null, array('areaid' => $areaid, 'context' => $context, 'freezerubric' => optional_param('freeze', 0, PARAM_INT)));
|
||||
$mform->set_data($controller->get_definition_for_editing());
|
||||
$data = $controller->get_definition_for_editing();
|
||||
$returnurl = optional_param('returnurl', $manager->get_management_url(), PARAM_LOCALURL);
|
||||
$data->returnurl = $returnurl;
|
||||
$mform->set_data($data);
|
||||
if ($mform->is_cancelled()) {
|
||||
// todo process editing cancel in a better way
|
||||
redirect($manager->get_management_url());
|
||||
|
||||
} else if ($data = $mform->get_data()) {
|
||||
redirect($returnurl);
|
||||
} else if ($mform->is_submitted() && $mform->is_validated()) {
|
||||
$data = $mform->get_data();
|
||||
$controller->update_definition($data);
|
||||
redirect($PAGE->url);
|
||||
redirect($returnurl);
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
@ -44,6 +44,8 @@ class gradingform_rubric_editrubric extends moodleform {
|
||||
$form->addElement('hidden', 'areaid');
|
||||
$form->setType('areaid', PARAM_INT);
|
||||
|
||||
$form->addElement('hidden', 'returnurl');
|
||||
|
||||
// name
|
||||
$form->addElement('text', 'name', get_string('name', 'gradingform_rubric'), array('size'=>52));
|
||||
$form->addRule('name', get_string('required'), 'required');
|
||||
|
Loading…
x
Reference in New Issue
Block a user