1 search_embedded_form.module search_embedded_form_form($form, &$form_state)

Builds a form for embedding in search results for testing.

See also

search_embedded_form_form_submit().

File

core/modules/search/tests/search_embedded_form/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 = config_get('search.settings', 'search_embedded_form_submitted');

  $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;
}