DL-13337 - Add confirmation before deleting outcomes (and POST for action..)

merged from MOODLE_19_STABLE
This commit is contained in:
poltawski 2008-02-12 21:14:44 +00:00
parent 87518137bf
commit f3f2468cf5
2 changed files with 18 additions and 2 deletions

View File

@ -100,8 +100,22 @@ switch ($action) {
break;
}
//TODO: add confirmation
$deleteconfirmed = optional_param('deleteconfirmed', 0, PARAM_BOOL);
if(!$deleteconfirmed){
print_header(get_string('outcomedelete', 'grades'));
notice_yesno(get_string('outcomeconfirmdelete', 'grades', $outcome->fullname),
"index.php?id={$courseid}", "index.php?id={$courseid}",
array('outcomeid' => $outcome->id,
'action'=> 'delete',
'sesskey' => $USER->sesskey,
'deleteconfirmed'=> 1)
);
print_footer();
die;
}else{
$outcome->delete();
}
break;
}

View File

@ -342,7 +342,9 @@ $string['options'] = 'Options';
$string['outcome'] = 'Outcome';
$string['outcomecategory'] = 'Create outcomes in category';
$string['outcomecategorynew'] = 'New category';
$string['outcomeconfirmdelete'] = 'Are you sure you wish to delete the outcome \"$a\"?';
$string['outcomecreate'] = 'Add a new outcome';
$string['outcomedelete'] = 'Delete Outcome';
$string['outcomeidhelp'] = 'The outcome this grade item represents.';
$string['outcomeitem'] = 'Outcome item';
$string['outcomeitemsedit'] = 'Edit outcome item';