You are here

function ctools_ajax_sample_start in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 ctools_ajax_sample/ctools_ajax_sample.module \ctools_ajax_sample_start()

Wizard start form. Choose an animal.

1 string reference to 'ctools_ajax_sample_start'
ctools_ajax_sample_animal in ctools_ajax_sample/ctools_ajax_sample.module
A modal login callback.

File

ctools_ajax_sample/ctools_ajax_sample.module, line 549
Sample AJAX functionality so people can see some of the CTools AJAX features in use.

Code

function ctools_ajax_sample_start($form, &$form_state) {
  $form_state['title'] = t('Choose animal');
  $animals = ctools_ajax_sample_animals();
  foreach ($animals as $id => $animal) {
    $options[$id] = $animal['title'];
  }
  $form['type'] = array(
    '#title' => t('Choose your animal'),
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => $form_state['object']->type,
    '#required' => TRUE,
  );
  return $form;
}