You are here

function lingotek_delete_menu_links in Lingotek Translation 7.7

1 call to lingotek_delete_menu_links()
lingotek_entity_delete_form_submit in ./lingotek.bulk_grid.inc
Submit handler for the lingotek_entity_delete form.

File

./lingotek.util.inc, line 2974
Utility functions.

Code

function lingotek_delete_menu_links($mlids) {
  foreach ($mlids as $mlid) {
    $menu_link = menu_link_load($mlid);
    $tsid = $menu_link['i18n_tsid'];
    $translation_set = i18n_translation_set_load($tsid, 'menu_link');
    if ($translation_set) {
      $translations = $translation_set
        ->get_translations();
      foreach ($translations as $langcode => $menu_link) {
        $translation_mlid = $menu_link['mlid'];
        menu_link_delete($translation_mlid);
      }
    }
    else {
      menu_link_delete($mlid);
    }
  }
}