Hi,

i would like to know how to move the user location registration form to bio form. I've the form_id of the Bio form so y try to change this :

function location_user_form_alter($form_id, &$form) {
  if ($form_id == 'user_admin_settings') {
    // Add user locations settings.
    _location_user_settings_form_alter($form_id, $form);
  }
}

to this :

function location_user_form_alter($form_id, &$form) {
  if ($form_id == bio_get_type() .'_node_form') {
    // Add user locations settings.
    _location_user_settings_form_alter($form_id, $form);
  }
}

But this function is for admin form...

Thanks in advance !
++

Comments

moksa’s picture

Ok i move location category in a new profile category. Just create a new one called "Location" and change this

    case 'form':
      if ($category == 'account') {
        if ((($user->uid == $account->uid) && user_access('set own user location')) || user_access('administer user locations')) {
          $settings = variable_get('location_settings_user', array());
          $form['locations'] = location_form($settings, $account->locations);
          return $form;
        }
      }
      break;

to this

    case 'form':
      if ($category == 'Localisation') {
        if ((($user->uid == $account->uid) && user_access('set own user location')) || user_access('administer user locations')) {
          $settings = variable_get('location_settings_user', array());
          $form['locations'] = location_form($settings, $account->locations);
          return $form;
        }
      }
      break;

And it's work.

++

ankur’s picture

Status: Active » Closed (fixed)