You are here

function onepageprofile_form_user_profile_form_alter in One page profile 7

Same name and namespace in other branches
  1. 6 onepageprofile.module \onepageprofile_form_user_profile_form_alter()

Implements hook_form_user_profile_form_alter().

File

./onepageprofile.module, line 48

Code

function onepageprofile_form_user_profile_form_alter(&$form, &$form_state) {

  // Find each of the subpages implemented by profile2
  // Pull their forms into this form
  // Order the form elements
  if ($weights = variable_get('onepageprofile_weights', '')) {
    foreach (element_children($form) as $field) {
      if (!empty($weights[$field])) {
        $form[$field]['#weight'] = $weights[$field];
      }
    }
    uasort($form, 'element_sort');
  }
}