You are here

function _menu_target_drop_link in Menu target 7

Removes the mlid from the menu_target_links table

2 calls to _menu_target_drop_link()
menu_target_menu_link_delete in ./menu_target.module
Implements hook_menu_link_delete(). Removes entry from menu_target_links when menu entry is deleted. This hook is not detected unless present in the .module file
_menu_target_edit_form_extra_elements_submit in ./menu_target.module
Implements hook_form_submit(). This is only needed when the menu_target attribute is updated, since the mlid is not available to this function when the menu item is new.

File

./menu_target.module, line 142
Allows content editors to choose wether or not to open menu items in a new window

Code

function _menu_target_drop_link($mlid) {
  $drop = db_delete('menu_target_links')
    ->condition('mlid', $mlid)
    ->execute();
  if ($drop) {
    drupal_set_message(t('The menu target attribute has been removed.'));
  }
  else {
    drupal_set_message(t('Unable to remove the menu target attribute.'), 'error');
  }
}