You are here

function i18nmenu_menu_edit_menu_submit in Internationalization 6

Submit handler for the menu_edit_item form.

On menu item insert or update, save a translation record.

1 string reference to 'i18nmenu_menu_edit_menu_submit'
i18nmenu_form_menu_edit_menu_alter in i18nmenu/i18nmenu.module
Implementation of hook_form_form_id_alter().

File

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

Code

function i18nmenu_menu_edit_menu_submit($form, &$form_state) {

  // Ensure we have a menu to work with.
  if (isset($form_state['values']['menu_name']) && isset($form_state['values']['title'])) {
    if ($form['#insert']) {
      $context = 'menu:menu:menu-' . $form_state['values']['menu_name'] . ':title';
    }
    else {
      $context = 'menu:menu:' . $form_state['values']['menu_name'] . ':title';
    }
    i18nstrings_update_string($context, $form_state['values']['title']);
  }
}