You are here

function entity_translation_node_menu_alter in Entity Translation 7

Node-specific menu alterations.

File

./entity_translation.node.inc, line 38
The node specific translation functions and hook implementations.

Code

function entity_translation_node_menu_alter(&$items, $backup) {
  if (isset($backup['node'])) {
    $item = $backup['node'];

    // Preserve the menu router item defined by other modules.
    $callback['page callback'] = $item['page callback'];
    $callback['file'] = $item['file'];
    $callback['module'] = $item['module'];
    $access_arguments = array_merge(array(
      1,
      $item['access callback'],
    ), $item['access arguments']);
    $page_arguments = array_merge(array(
      'node',
      1,
      $callback,
    ), $item['page arguments']);
  }
  else {
    $access_arguments = array(
      1,
    );
    $page_arguments = array(
      'node',
      1,
    );
  }
  $items['node/%node/translate']['page callback'] = 'entity_translation_overview';
  $items['node/%node/translate']['page arguments'] = $page_arguments;
  $items['node/%node/translate']['access arguments'] = $access_arguments;
  $items['node/%node/translate']['access callback'] = 'entity_translation_node_tab_access';
  $items['node/%node/translate']['file'] = 'entity_translation.admin.inc';
  $items['node/%node/translate']['module'] = 'entity_translation';
}