You are here

function i18nprofile_form_alter in Internationalization 6

Same name and namespace in other branches
  1. 5.3 i18nprofile/i18nprofile.module \i18nprofile_form_alter()
  2. 5 i18nprofile/i18nprofile.module \i18nprofile_form_alter()
  3. 5.2 i18nprofile/i18nprofile.module \i18nprofile_form_alter()

Implementation of hook_form_alter().

File

i18nprofile/i18nprofile.module, line 119
Internationalization (i18n) submodule: Profile translation.

Code

function i18nprofile_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'profile_field_form':
      $form['#submit'][] = 'i18nprofile_field_form_submit';
      break;
    case 'user_profile_form':
      if (($category = $form['_category']['#value']) && $category != 'account') {
        i18nprofile_form_translate_category($form, $category);
      }
      break;
    case 'user_register':
      i18nprofile_form_translate_all($form_id, $form);
      break;
    case 'profile_field_delete':

      // Store all field info for further reference
      $form['field'] = array(
        '#type' => 'value',
        '#value' => db_fetch_object(db_query("SELECT * FROM {profile_fields} WHERE fid = %d", $form['fid']['#value'])),
      );
      $form['#submit'][] = 'i18nprofile_field_delete_submit';
  }
}