You are here

function certificate_admin_clear_form_submit in Certificate 6.2

Same name and namespace in other branches
  1. 8.3 certificate.admin.inc \certificate_admin_clear_form_submit()
  2. 6 certificate.admin.inc \certificate_admin_clear_form_submit()
  3. 7.2 certificate.admin.inc \certificate_admin_clear_form_submit()
  4. 4.x certificate.admin.inc \certificate_admin_clear_form_submit()
  5. 3.x certificate.admin.inc \certificate_admin_clear_form_submit()

Delete selected certificate snapshots.

File

./certificate.admin.inc, line 528
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)) {
    $placeholders = db_placeholders($nids);
    db_query("delete from {certificate_snapshots} where nid in ({$placeholders})", $nids);
    drupal_set_message('Cleared certificate snapshots.');
  }
}