Commit eaf07c67 authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

Added delete confirmation, and generic pieform confirmation code

parent 897d1a12
......@@ -67,9 +67,10 @@ $form = new Pieform(array(
'value' => get_string('exportuserprofiles', 'admin')
),
'delete' => array(
'type' => 'submit',
'name' => 'delete',
'value' => get_string('deleteusers', 'admin')
'type' => 'submit',
'confirm' => get_string('confirmdeleteusers', 'admin'),
'name' => 'delete',
'value' => get_string('deleteusers', 'admin')
)
)
));
......
......@@ -178,6 +178,7 @@ $string['staffusersupdated'] = 'Staff users updated';
// Suspended Users
$string['deleteusers'] = 'Delete Users';
$string['confirmdeleteusers'] = 'Are you sure you want to delete the selected users?';
$string['exportingnotsupportedyet'] = 'Exporting user profiles is not supported yet';
$string['exportuserprofiles'] = 'Export User Profiles';
$string['nousersselected'] = 'No users selected';
......
......@@ -32,6 +32,10 @@
* @return string The HTML for the element
*/
function pieform_element_submit(Pieform $form, $element) {
if (isset($element['confirm'])) {
$element['onclick'] = 'return confirm(' . json_encode($element['confirm']) . ');';
}
return '<input type="submit"'
. $form->element_attributes($element)
. ' value="' . Pieform::hsc($form->get_value($element)) . '">';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment