You are here

function i18n_menu_menu_link_delete in Internationalization 7

Implements hook_menu_delete()

File

i18n_menu/i18n_menu.module, line 284
Internationalization (i18n) submodule: Menu translation.

Code

function i18n_menu_menu_link_delete($link) {

  // If a translation set exists for this link, remove this link from the set.
  if (!empty($link['i18n_tsid'])) {
    if ($translation_set = i18n_translation_set_load($link['i18n_tsid'])) {
      $translation_set
        ->get_translations();
      $translation_set
        ->remove_language($link['language']);

      // If there are no links left in this translation set, delete the set.
      // Otherwise update the set.
      $translation_set
        ->update_delete();
    }
  }
  i18n_string_object_remove('menu_link', $link);
}