bug #546011 (Navigation tooltips)

This commit is contained in:
Alexander M. Turek
2002-05-09 22:11:43 +00:00
parent a1e5592bbb
commit f00d5856d8
3 changed files with 33 additions and 4 deletions

View File

@@ -821,6 +821,31 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
<!--
window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>');
//-->
</script>
<?php
}
// Corrects the tooltip text via JS if required
else if (isset($GLOBALS['table']) && $GLOBALS['cfg']['ShowTooltip'] && PMA_MYSQL_INT_VERSION >= 32303) {
$result = mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($GLOBALS['db']));
while ($tmp = mysql_fetch_array($result, MYSQL_ASSOC)) {
if ($tmp['Name'] == $GLOBALS['table']) {
if (empty($tmp['Comment'])) {
$tooltip = '';
} else {
$tooltip = $tmp['Comment'] . ' ';
}
$tooltip .= '(' . $tmp['Rows'] . ' ' . $GLOBALS['strRows'] . ')';
unset($tmp);
break;
}
}
?>
<script type="text/javascript" language="javascript1.2">
<!--
if (typeof(document.getElementById) != 'undefined') {
window.parent.frames['nav'].document.getElementById('a_tbl_<?php echo htmlspecialchars($GLOBALS['table']); ?>').title = '<?php echo $tooltip; ?>';
}
//-->
</script>
<?php
}