00001 <?php
00002
00003
00015 function translation_node_overview($node) {
00016 if ($node->tnid) {
00017
00018 $tnid = $node->tnid;
00019 $translations = translation_node_get_translations($node->tnid);
00020 }
00021 else {
00022
00023 $tnid = $node->nid;
00024 $translations = array($node->language => $node);
00025 }
00026
00027 $header = array(t('Language'), t('Title'), t('Status'), t('Operations'));
00028
00029 foreach (language_list() as $language) {
00030 $options = array();
00031 $language_name = $language->name;
00032 if (isset($translations[$language->language])) {
00033
00034
00035 $translation_node = node_load($translations[$language->language]->nid);
00036 $title = l($translation_node->title, 'node/' . $translation_node->nid);
00037 if (node_access('update', $translation_node)) {
00038 $options[] = l(t('edit'), "node/$translation_node->nid/edit");
00039 }
00040 $status = $translation_node->status ? t('Published') : t('Not published');
00041 $status .= $translation_node->translate ? ' - <span class="marker">' . t('outdated') . '</span>' : '';
00042 if ($translation_node->nid == $tnid) {
00043 $language_name = '<strong>' . $language_name . '</strong> (source)';
00044 }
00045 }
00046 else {
00047
00048 $title = t('n/a');
00049 if (node_access('create', $node)) {
00050 $options[] = l(t('add translation'), 'node/add/' . str_replace('_', '-', $node->type), array('query' => "translation=$node->nid&language=$language->language"));
00051 }
00052 $status = t('Not translated');
00053 }
00054 $rows[] = array($language_name, $title, $status, implode(" | ", $options));
00055 }
00056
00057 drupal_set_title(t('Translations of %title', array('%title' => $node->title)));
00058 return theme('table', $header, $rows);
00059 }