function translation_node_page in Internationalization 5
Same name and namespace in other branches
- 5.3 translation/translation.module \translation_node_page()
- 5.2 translation/translation.module \translation_node_page()
This is the callback for the tab 'translation' for nodes
1 string reference to 'translation_node_page'
- translation_menu in translation/
translation.module - Implementation of hook_menu().
File
- translation/
translation.module, line 412
Code
function translation_node_page() {
$args = func_get_args();
$op = $args[0];
$nid = arg(1);
$node = node_load($nid);
// If node has no language, just warning message. Function returns here
if (!$node->language) {
form_set_error('language', t("You need to set a language before creating a translation."));
drupal_goto("node/{$nid}/edit");
}
drupal_set_title(check_plain($node->title));
$output = '';
switch ($op) {
case 'select':
$output .= translation_node_overview($node);
$output .= translation_node_select($node, $args[1]);
break;
default:
$output .= translation_node_overview($node);
}
return $output;
}