You are here

function redhen_contact_user_registration_form_state in RedHen CRM 7

Same name and namespace in other branches
  1. 8 modules/redhen_contact/redhen_contact.module \redhen_contact_user_registration_form_state()

Return form_state that includes the values from the visible form elements.

Parameters

array $form: The RedHen contact form.

array $form_state: The RedHen contact form state.

Return value

array The modified form_state array.

1 call to redhen_contact_user_registration_form_state()
_redhen_contact_user_submission_apply in modules/redhen_contact/redhen_contact.module
Helper function for handling Contact Form values submitted via User forms.

File

modules/redhen_contact/redhen_contact.module, line 1492
Module file for RedHen contacts.

Code

function redhen_contact_user_registration_form_state($form, $form_state) {
  $limited_state = $form_state;
  $limited_state['values'] = array();
  foreach (element_children($form) as $key) {
    $child = $form[$key];

    // Skip un-accessible children.
    if (isset($child['#access']) && !$child['#access']) {
      continue;
    }
    if (isset($form_state['values'][$key])) {
      $limited_state['values'][$key] = $form_state['values'][$key];
    }
  }
  return $limited_state;
}