You are here

function prepopulate_form_alter in Prepopulate 6.2

Same name and namespace in other branches
  1. 8.2 prepopulate.module \prepopulate_form_alter()
  2. 5 prepopulate.module \prepopulate_form_alter()
  3. 6 prepopulate.module \prepopulate_form_alter()
  4. 7.2 prepopulate.module \prepopulate_form_alter()

Implementation of hook_form_alter().

File

./prepopulate.module, line 26
Fill form elements with data from GET or POST values.

Code

function prepopulate_form_alter(&$form, $form_state, $form_id) {

  // Provide for accepting base64 encoded fields.
  if (isset($_REQUEST['pp'])) {
    parse_str(base64_decode($_REQUEST['pp']), $_REQUEST);
  }
  if (isset($_REQUEST['edit'])) {
    $form['#after_build'][] = 'prepopulate_after_build';
  }
}