function ctools_ajax_sample_configure_sheep in Chaos Tool Suite (ctools) 7
Same name and namespace in other branches
- 6 ctools_ajax_sample/ctools_ajax_sample.module \ctools_ajax_sample_configure_sheep()
Wizard form to configure your sheep.
1 string reference to 'ctools_ajax_sample_configure_sheep'
- ctools_ajax_sample_animals in ctools_ajax_sample/
ctools_ajax_sample.module - Get a list of our animals and associated forms.
File
- ctools_ajax_sample/
ctools_ajax_sample.module, line 580 - Sample AJAX functionality so people can see some of the CTools AJAX features in use.
Code
function ctools_ajax_sample_configure_sheep($form, &$form_state) {
$form_state['title'] = t('Configure sheep');
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name your sheep'),
'#default_value' => $form_state['object']->name,
'#required' => TRUE,
);
$form['sheep'] = array(
'#title' => t('What kind of sheep'),
'#type' => 'radios',
'#options' => array(
t('Wensleydale') => t('Wensleydale'),
t('Merino') => t('Merino'),
t('Corriedale') => t('Coriedale'),
),
'#default_value' => !empty($form_state['object']->sheep) ? $form_state['object']->sheep : '',
'#required' => TRUE,
);
return $form;
}