You are here

function activeedit_set_transfer in Javascript Tools 5

1 call to activeedit_set_transfer()
activeedit_form_alter in activeedit/activeedit.module
Implementation of hook_form_alter().

File

activeedit/activeedit.module, line 115

Code

function activeedit_set_transfer(&$form, $transfer_element, $transfer_value) {
  static $set = FALSE;

  // Don't keep iterating if the field was already found.
  if ($set) {
    return;
  }
  if (array_key_exists($transfer_element, $form)) {
    if ($form[$transfer_element]['#type'] == 'textfield') {
      $form[$transfer_element]['#default_value'] = $transfer_value;
    }
    $set = TRUE;
  }
  else {
    foreach (element_children($form) as $key) {
      activeedit_set_transfer($form[$key], $transfer_element, $transfer_value);
    }
  }
}