You are here

function taxonomy_menu_group_remove_term_set in Taxonomy menu 6.3

Menu callback to remove Term Set from Menu group

Parameters

$mgid:

$tsid:

3 calls to taxonomy_menu_group_remove_term_set()
taxonomy_menu_ahah_term_set_remove in ./taxonomy_menu.admin.inc
AHAH callback for removing a term set from a menu group
taxonomy_menu_group_remove_term_set_submit in ./taxonomy_menu.admin.inc
Remove a term set from a menu group.
taxonomy_menu_term_set_delete in ./taxonomy_menu.admin.inc
1 string reference to 'taxonomy_menu_group_remove_term_set'
taxonomy_menu_menu in ./taxonomy_menu.module
Implementation of hook_menu().

File

./taxonomy_menu.admin.inc, line 922
admin section for taxonomy menu

Code

function taxonomy_menu_group_remove_term_set($mgid, $tsid) {

  // Get the current menu group
  $menu_group = taxonomy_menu_get_group($mgid);

  // Cycle through the menu group items and remove the items for the term set
  foreach ($menu_group->items as $key => $item) {
    if ($item->tsid == $tsid) {
      unset($menu_group->items[$key]);
    }
  }

  // Update the menu group items
  taxonomy_menu_save_menu_group($menu_group);

  // Delete the record from the menu group table
  db_query('DELETE FROM {taxonomy_menu_group_term_set} WHERE mgid = %d AND tsid = %d', $mgid, $tsid);
  drupal_set_message(t('Term Set Removed'), 'status');
}