You are here

function privatemsg_devel_batch_generate_threads in Privatemsg 7.2

Same name and namespace in other branches
  1. 6.2 privatemsg.devel_generate.inc \privatemsg_devel_batch_generate_threads()
1 call to privatemsg_devel_batch_generate_threads()
privatemsg_devel_generate_form_submit in ./privatemsg.devel_generate.inc
Submit; Integrates with Devel Generate.

File

./privatemsg.devel_generate.inc, line 224

Code

function privatemsg_devel_batch_generate_threads($form_state) {
  $operations = array();

  // add the kill operation
  if ($form_state['values']['kill_content']) {
    $operations[] = array(
      'privatemsg_devel_generate_batch_kill_threads',
      array(),
    );
  }

  // add the operations to create the nodes
  for ($num = 0; $num < $form_state['values']['num_threads']; $num++) {
    $operations[] = array(
      'privatemsg_devel_generate_batch_new_thread',
      array(
        $form_state['values'],
      ),
    );
  }

  // start the batch
  $batch = array(
    'title' => t('Generating private messages'),
    'operations' => $operations,
    'finished' => 'privatemsg_devel_generate_batch_finished',
    'file' => drupal_get_path('module', 'privatemsg') . '/privatemsg.devel_generate.inc',
  );
  batch_set($batch);
}