You are here

function shrinktheweb_admin_log_submit in ShrinkTheWeb 6

Same name and namespace in other branches
  1. 7 shrinktheweb.admin.inc \shrinktheweb_admin_log_submit()

File

./shrinktheweb.admin.inc, line 102

Code

function shrinktheweb_admin_log_submit($form, &$form_state) {
  if (!isset($form_state['storage']['confirm'])) {
    $form_state['storage']['confirm'] = TRUE;
    $form_state['storage']['log_records'] = array_filter($form_state['values']['log_records']);
    $form_state['rebuild'] = TRUE;
  }
  else {
    if (!empty($form_state['storage']['log_records'])) {
      foreach ($form_state['storage']['log_records'] as $key => $value) {
        $num_deleted = db_query("DELETE FROM `shrinktheweb_log` WHERE `siteid` = " . $value);
      }
      drupal_set_message(t('Deletion successful.'));
    }
  }
}