You are here

function i18nprofile_field_delete_submit in Internationalization 6

Delte field profile related strings

1 string reference to 'i18nprofile_field_delete_submit'
i18nprofile_form_alter in i18nprofile/i18nprofile.module
Implementation of hook_form_alter().

File

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

Code

function i18nprofile_field_delete_submit($form, $form_state) {
  $field = $form_state['values']['field'];
  foreach (array(
    'title',
    'explanation',
    'options',
  ) as $property) {
    i18nstrings_remove_string("profile:field:{$field->name}:{$property}");
  }

  // Delete category too if no more fields in the same category
  if (!db_result(db_query("SELECT COUNT(*) FROM {profile_fields} WHERE category = '%s'", $field->category))) {
    i18nstrings_remove_string("profile:category", $values->category);
  }
}