function search_embedded_form_form in Drupal 7
Builds a form for embedding in search results for testing.
See also
search_embedded_form_form_submit().
2 string references to 'search_embedded_form_form'
- search_embedded_form_menu in modules/
search/ tests/ search_embedded_form.module - Implements hook_menu().
- search_embedded_form_preprocess_search_result in modules/
search/ tests/ search_embedded_form.module - Adds the test form to search results.
File
- modules/
search/ tests/ search_embedded_form.module, line 32 - Test module implementing a form that can be embedded in search results.
Code
function search_embedded_form_form($form, &$form_state) {
$count = variable_get('search_embedded_form_submitted', 0);
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Your name'),
'#maxlength' => 255,
'#default_value' => '',
'#required' => TRUE,
'#description' => t('Times form has been submitted: %count', array(
'%count' => $count,
)),
);
$form['actions'] = array(
'#type' => 'actions',
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Send away'),
);
$form['#submit'][] = 'search_embedded_form_form_submit';
return $form;
}