You are here

function _i18nmenu_update_item in Internationalization 6

Update the translation data for a menu item that has been inserted or updated.

See also

i18nmenu_menu_item_update()

i18nmenu_nodeapi()

2 calls to _i18nmenu_update_item()
i18nmenu_menu_item_update in i18nmenu/i18nmenu.module
Submit handler for the menu_edit_item form.
i18nmenu_nodeapi in i18nmenu/i18nmenu.module
Implementation of hook_nodeapi().

File

i18nmenu/i18nmenu.module, line 335
Internationalization (i18n) submodule: Menu translation.

Code

function _i18nmenu_update_item($item) {
  list($item['menu_name'], $item['plid']) = explode(':', $item['parent']);

  // If this was an insert, determine the ID that was set.
  if (!isset($item['mlid'])) {
    $item['mlid'] = db_result(db_query("SELECT MAX(mlid) FROM {menu_links} WHERE link_path = '%s' AND menu_name = '%s' AND module = 'menu' AND plid = %d AND link_title = '%s'", $item['link_path'], $item['menu_name'], $item['plid'], $item['link_title']));
  }
  if (!empty($item['mlid'])) {
    _i18nmenu_get_item_title($item, TRUE);
    _i18nmenu_get_item_description($item, TRUE);
  }
}