function example_form_alter

8.0.x example.profile example_form_alter(&$form, $form_state, $form_id)
6.x example.profile example_form_alter(&$form, $form_state, $form_id)
7.x example.profile example_form_alter(&$form, $form_state, $form_id)
5.x example.profile example_form_alter(&$form, $form_state, $form_id)
master example.profile example_form_alter(&$form, $form_state, $form_id)

File

tests/resources/example.profile, line 14

Code

function example_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'install_configure') {
    $form['my_options'] = array(
      '#type' => 'fieldset',
      '#title' => t('Example options'),
    );
    $form['my_options']['myopt1'] = array(
      '#type' => 'textfield',
      '#title' => 'Example option 1',
    );
    $form['my_options']['myopt2'] = array(
      '#type' => 'select',
      '#title' => t('Example option 2'),
      '#options' => array(
        0 => t('Something'),
        1 => t('Something else'),
        2 => t('Something completely different'),
      ),
    );

    // Make sure we don't clobber the original auto-detected submit func
    $form['#submit'] = array('install_configure_form_submit', 'example_install_configure_form_submit');
  }
}