function certificate_admin_clear_form_submit in Certificate 3.x
Same name and namespace in other branches
- 8.3 certificate.admin.inc \certificate_admin_clear_form_submit()
- 6.2 certificate.admin.inc \certificate_admin_clear_form_submit()
- 6 certificate.admin.inc \certificate_admin_clear_form_submit()
- 7.2 certificate.admin.inc \certificate_admin_clear_form_submit()
- 4.x certificate.admin.inc \certificate_admin_clear_form_submit()
Delete selected certificate snapshots.
File
- ./
certificate.admin.inc, line 482 - Administrative pages for Certificate module.
Code
function certificate_admin_clear_form_submit(&$form, &$form_state) {
$nids = array();
foreach ($form_state['values']['nids'] as $nid => $delete) {
if ($delete) {
$nids[] = $nid;
}
}
if (count($nids)) {
db_delete('certificate_snapshots')
->condition('nid', $nids, 'IN')
->execute();
drupal_set_message(t('Cleared certificate snapshots.'));
}
else {
drupal_set_message(t('No items selected.'), 'error');
}
}