You are here

function _delete_all_normal in Delete all 5

Same name and namespace in other branches
  1. 6 delete_all.module \_delete_all_normal()
  2. 7 delete_all.module \_delete_all_normal()
1 call to _delete_all_normal()
delete_all_content_submit in ./delete_all.module

File

./delete_all.module, line 321

Code

function _delete_all_normal($all, $types) {
  if ($form['all']) {
    $result = db_query('SELECT nid FROM {node}' . $where);
  }
  else {
    $placeholders = implode(',', array_fill(0, count($types), "'%s'"));
    $result = db_query('SELECT nid FROM {node} WHERE type IN (' . $placeholders . ')', $types);
  }
  $deleted = 0;
  while ($data = db_fetch_object($result)) {
    set_time_limit(30);
    node_delete($data->nid);
    $deleted++;
  }
  return $deleted;
}