I need a custom user_profile_form in a page of my drupal site containing a subset of fields provided by the form. I created it and rendered it this way:
function mymodule_join_experiment_contr_strict_mode($exp_node, &$form, &$form_state) {
module_load_include('inc', 'user', 'user.pages');
global $user;
$user = user_load($user->uid);
$form = drupal_get_form('user_profile_form', $user, 'account', 'strict_mode');
return $form;
}
Now in my custom function mymodule_form_user_profile_form_alter(&$form, &$form_state, $form_id) i'm doing
$form['picture']['#access']=FALSE;
in order to hide the field 'picture' and any other field i need to hide. In the form i have two collapsible named 'location' and 'timezone', provided, i think, by 'location' or 'gmap' module. (I didn't realized all this site so i don't really know everything about it.) Now, even looking at $form i can't see the equivalent for timezone and location. I expected to find something that allowed me to do
$form['timezone']['#access']=FALSE;
but i cannot find timezone and location... What i am doing wrong?
EDIT: i'm trying to get what is the right way to do it in drupal, before to surrender and use a 'display:none' on css