function entity_translation_taxonomy_term_menu_alter in Entity Translation 7
Taxonomy-term-specific menu alterations.
File
- ./
entity_translation.taxonomy.inc, line 22 - The taxonomy specific translation functions and hook implementations.
Code
function entity_translation_taxonomy_term_menu_alter(&$items, $backup) {
if (isset($backup['taxonomy_term'])) {
$item = $backup['taxonomy_term'];
// 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(
2,
$item['access callback'],
), $item['access arguments']);
$page_arguments = array_merge(array(
'taxonomy_term',
2,
$callback,
), $item['page arguments']);
}
else {
$access_arguments = array(
2,
);
$page_arguments = array(
'taxonomy_term',
2,
);
}
$items['taxonomy/term/%taxonomy_term/translate']['page callback'] = 'entity_translation_overview';
$items['taxonomy/term/%taxonomy_term/translate']['page arguments'] = $page_arguments;
$items['taxonomy/term/%taxonomy_term/translate']['access arguments'] = $access_arguments;
$items['taxonomy/term/%taxonomy_term/translate']['access callback'] = 'entity_translation_taxonomy_term_tab_access';
$items['taxonomy/term/%taxonomy_term/translate']['file'] = 'entity_translation.admin.inc';
$items['taxonomy/term/%taxonomy_term/translate']['module'] = 'entity_translation';
// Delete translation callback.
$items['taxonomy/term/%taxonomy_term/translate/delete/%entity_translation_language']['access arguments'] = $access_arguments;
}