You are here

function example_form_alter in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_upgrade/tests/old/samples/example.module \example_form_alter()

Implemenatation of hook_form_alter().

http://drupal.org/node/224333#node_form

File

coder_upgrade/tests/old/samples/example.module, line 1568

Code

function example_form_alter(&$form, &$form_state, $form_id) {
  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) {

    // Alter node form.
  }
  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id && $form['type']['#value'] == 'page') {

    // Alter page node form.
  }

  // Try to make it harder to detect.
  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) {

    // Alter node form.
  }

  // Change the condition order (not handled by routine).
  if (isset($form['#node']) && isset($form['type']) && $form['type']['#value'] . '_node_form' == $form_id) {

    // Alter node form.
  }
}