You are here

function location_generate_form in Location 5.3

1 string reference to 'location_generate_form'
location_generate_menu in contrib/location_generate/location_generate.module
Implementation of hook_menu().

File

contrib/location_generate/location_generate.module, line 26
Generate random locations.

Code

function location_generate_form() {
  if (!db_result(db_query('SELECT COUNT(*) FROM {node}'))) {
    drupal_set_message(t('No nodes found.  Create some nodes first.'));
    return array();
  }
  $form['nodes'] = array(
    '#type' => 'checkbox',
    '#title' => t('Generate locations for nodes'),
    '#default_value' => TRUE,
  );
  $form['users'] = array(
    '#type' => 'checkbox',
    '#title' => t('Generate locations for users'),
    '#default_value' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Do it!'),
  );
  return $form;
}