t("nid"), field=> 'node.title'),
array('data' => t("Title"), field=> 'node.title', 'sort' => asc),
array('data' => t("Language"), field=> 'language'),
array('data' => t("Status"), field=> 'status'),
);
$rows = array();
$tablesort = tablesort_sql($header);
$result = pager_query($sql . $tablesort, $rowlimit);
while ($row = mysql_fetch_array($result)) {
$rows[] = array(
$row['nid'],
"".
$row['title']."",
$row['language'],
$row['status']
);
}
print "Back to overview
";
}else {
//Show it all
$sql = "
SELECT node.type as type, count(node.type) as number,
(SELECT count(i18n.language)
FROM i18n_node as i18n
JOIN node as nd on i18n.nid = nd.nid
WHERE nd.type = node.type
AND i18n.status = 4
) as SourceUpdated,
(SELECT count(i18n.language)
FROM i18n_node as i18n
JOIN node as nd on i18n.nid = nd.nid
WHERE nd.type = node.type
AND i18n.status = 3
) as Translated_Content,
(SELECT count(i18n.language)
FROM i18n_node as i18n
JOIN node as nd on i18n.nid = nd.nid
WHERE nd.type = node.type
AND i18n.status = 2
) as Translation_in_progress,
(SELECT count(i18n.language)
FROM i18n_node as i18n
JOIN node as nd on i18n.nid = nd.nid
WHERE nd.type = node.type
AND i18n.status = 1
) as Source_Content,
(SELECT count(i18n.language)
FROM i18n_node as i18n
JOIN node as nd on i18n.nid = nd.nid
WHERE nd.type = node.type
AND i18n.status = 0
) as None
FROM i18n_node
JOIN node on i18n_node.nid = node.nid
GROUP BY node.type
";
//lets throw the data into a table
$header=array(
array('data' => t("Type"), field=> 'node.type', 'sort' => asc),
array('data' => t("# of Nodes"), field=> 'number'),
array('data' => t("Source Updated"), field=> 'SourceUpdated'),
array('data' => t("Translated Content"), field=> 'Translated_Content'),
array('data' => t("Translation in Progress"), field=> 'Translation_in_progress'),
array('data' => t("Source Content"), field=> 'Source_Content'),
array('data' => t("None"), field=> 'None')
);
$tablesort = tablesort_sql($header);
$result = pager_query($sql . $tablesort, $rowlimit);
$rows = array();
while ($row = mysql_fetch_array($result)) {
$rows[] = array(
"".$row['type']."",
"".$row['number']."",
"".$row['SourceUpdated']."",
"".$row['Translated_Content']."",
"".$row['Translation_in_progress']."",
"".$row['Source_Content']."",
"".$row['None']."",
);
}
}
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, $limit, 0);
//$table = theme_table($header,$rows);
print $output;
?>