You are here

function devel_generate_users_form in Devel 6

Same name and namespace in other branches
  1. 5 devel_generate.module \devel_generate_users_form()
  2. 7 devel_generate/devel_generate.module \devel_generate_users_form()

Generates users using FormAPI.

1 string reference to 'devel_generate_users_form'
devel_generate_menu in ./devel_generate.module
Implementation of hook_menu().

File

./devel_generate.module, line 51

Code

function devel_generate_users_form() {
  $form['num'] = array(
    '#type' => 'textfield',
    '#title' => t('How many users would you like to generate?'),
    '#default_value' => 50,
    '#size' => 10,
  );
  $form['kill_users'] = array(
    '#type' => 'checkbox',
    '#title' => t('Delete all users (except user id 1) before generating new users.'),
    '#default_value' => FALSE,
  );
  $options = array(
    1 => t('Now'),
  );
  foreach (array(
    3600,
    86400,
    604800,
    2592000,
    31536000,
  ) as $interval) {
    $options[$interval] = format_interval($interval, 1) . ' ' . t('ago');
  }
  $form['time_range'] = array(
    '#type' => 'select',
    '#title' => t('How old should user accounts be?'),
    '#description' => t('User ages will be distributed randomly from the current time, back to the selected time.'),
    '#options' => $options,
    '#default_value' => 604800,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Do it!'),
  );
  return $form;
}