RFE #700307 - Display DB comments / MIME-types where appropriate.

This commit is contained in:
Garvin Hicking
2003-03-12 19:13:37 +00:00
parent 22c8c1dd58
commit 2a3bd1cc7a
5 changed files with 84 additions and 7 deletions

View File

@@ -6,6 +6,8 @@ $Id$
$Source$
2003-03-12 Garvin Hicking <me@supergarv.de>
* db_printview.php3, tbl_printview.php3, db_datadict.php3, pdf_schema.php3:
Display DB comments and MIME types, where appropriate.
* header.inc.php3, querywindow.php3, libraries/common.lib.php3: Fixed some bugs for
the querywindow which didn't show the latest querys always.
* Documentation.html, db_details.php3, read_dump.php3, tbl_query_box.php3:

View File

@@ -15,6 +15,9 @@ if (!isset($selected_tbl)) {
* Gets the relations settings
*/
require('./libraries/relation.lib.php3');
require('./libraries/transformations.lib.php3');
$cfgRelation = PMA_getRelationsParam();
/**
@@ -26,6 +29,21 @@ if (isset($table)) {
$err_url = 'db_details.php3?' . PMA_generate_common_url($db);
}
if ($cfgRelation['commwork']) {
$comment = PMA_getComments($db);
/**
* Displays DB comment
*/
if (is_array($comment)) {
?>
<!-- DB comment -->
<p><?php echo $strDBComment; ?> <i>
<?php echo htmlspecialchars(implode(' ', $comment)) . "\n"; ?>
</i></p>
<?php
} // end if
}
/**
* Selects the database and gets tables names
@@ -42,7 +60,6 @@ while ($row = mysql_fetch_array($rowset)) {
$myfieldname = 'Tables in ' . htmlspecialchars($db);
}
$table = $row[$myfieldname];
$cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['commwork']) {
$comments = PMA_getComments($db, $table);
}
@@ -170,6 +187,9 @@ while ($row = mysql_fetch_array($rowset)) {
if ($cfgRelation['commwork']) {
echo ' <th>' . $strComments . '</th>' . "\n";
}
if ($cfgRelation['mimework']) {
echo ' <th>MIME</th>' . "\n";
}
?>
</tr>
@@ -254,6 +274,15 @@ while ($row = mysql_fetch_array($rowset)) {
}
echo '&nbsp;</td>' . "\n";
}
if ($cfgRelation['mimework']) {
$mime_map = PMA_getMIME($db, $table, true);
echo ' <td class="print">';
if (isset($mime_map[$field_name])) {
echo htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype']));
}
echo '&nbsp;</td>' . "\n";
}
?>
</tr>
<?php

View File

@@ -15,6 +15,11 @@ require('./header.inc.php3');
*/
$err_url = 'db_details.php3?' . PMA_generate_common_url($db);
/**
* Settings for relations stuff
*/
require('./libraries/relation.lib.php3');
$cfgRelation = PMA_getRelationsParam();
/**
* Gets the list of the table in the current db and informations about these
@@ -77,6 +82,21 @@ else {
mysql_free_result($result);
}
if ($cfgRelation['commwork']) {
$comment = PMA_getComments($db);
/**
* Displays DB comment
*/
if (is_array($comment)) {
?>
<!-- DB comment -->
<p><i>
<?php echo htmlspecialchars(implode(' ', $comment)) . "\n"; ?>
</i></p>
<?php
} // end if
}
/**
* If there is at least one table, displays the printer friendly view, else
@@ -102,6 +122,7 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
}
echo "\n";
?>
<th><?php echo $strComments; ?></th>
</tr>
<?php
$i = $sum_entries = $sum_size = 0;
@@ -184,6 +205,9 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
}
echo "\n";
?>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $sts_data['Comment']; ?>
</td>
</tr>
<?php
}
@@ -214,6 +238,7 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
}
echo "\n";
?>
<th>&nbsp;</th>
</tr>
</table>
<?php

View File

@@ -19,6 +19,8 @@ require('./libraries/common.lib.php3');
* Settings for relation stuff
*/
require('./libraries/relation.lib.php3');
require('./libraries/transformations.lib.php3');
$cfgRelation = PMA_getRelationsParam();
@@ -1253,7 +1255,9 @@ function PMA_RT_DOC($alltables ){
if ($cfgRelation['commwork']) {
$comments = PMA_getComments($db, $table);
}
if ($cfgRelation['mimework']) {
$mime_map = PMA_getMIME($db, $table, true);
}
/**
* Gets table informations
@@ -1364,8 +1368,9 @@ function PMA_RT_DOC($alltables ){
$pdf->Cell(20,8,ucfirst($GLOBALS['strDefault']),1,0,'C');
$pdf->Cell(25,8,ucfirst($GLOBALS['strExtra']),1,0,'C');
$pdf->Cell(45,8,ucfirst($GLOBALS['strLinksTo']),1,0,'C');
$pdf->Cell(112,8,ucfirst($GLOBALS['strComments']),1,1,'C');
$pdf->SetWidths(array(25,20,20,10,20,25,45,112));
$pdf->Cell(67,8,ucfirst($GLOBALS['strComments']),1,0,'C');
$pdf->Cell(45,8,'MIME',1,1,'C');
$pdf->SetWidths(array(25,20,20,10,20,25,45,67,45));
} else {
$pdf->Cell(20,8,ucfirst($GLOBALS['strField']),1,0,'C');
$pdf->Cell(20,8,ucfirst($GLOBALS['strType']),1,0,'C');
@@ -1374,8 +1379,9 @@ function PMA_RT_DOC($alltables ){
$pdf->Cell(15,8,ucfirst($GLOBALS['strDefault']),1,0,'C');
$pdf->Cell(15,8,ucfirst($GLOBALS['strExtra']),1,0,'C');
$pdf->Cell(30,8,ucfirst($GLOBALS['strLinksTo']),1,0,'C');
$pdf->Cell(60,8,ucfirst($GLOBALS['strComments']),1,1,'C');
$pdf->SetWidths(array(20,20,20,10,15,15,30,60));
$pdf->Cell(30,8,ucfirst($GLOBALS['strComments']),1,0,'C');
$pdf->Cell(30,8,'MIME',1,1,'C');
$pdf->SetWidths(array(20,20,20,10,15,15,30,30,30));
}
$pdf->SetFont('', '');
@@ -1434,7 +1440,8 @@ function PMA_RT_DOC($alltables ){
((isset($row['Default'])) ? $row['Default'] : ''),
$row['Extra'] ,
((isset($res_rel[$field_name])) ? $res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field'] : ''),
((isset($comments[$field_name])) ? $comments[$field_name] : '' )
((isset($comments[$field_name])) ? $comments[$field_name] : '' ),
((isset($mime_map) && isset($mime_map[$field_name])) ? str_replace('_', '/', $mime_map[$field_name]['mimetype']) : '' )
);
$links[0] = $pdf->PMA_links['RT'][$table][$field_name];
if (isset($res_rel[$field_name]['foreign_table']) AND

View File

@@ -15,6 +15,8 @@ if (!isset($selected_tbl)) {
* Gets the relations settings
*/
require('./libraries/relation.lib.php3');
require('./libraries/transformations.lib.php3');
$cfgRelation = PMA_getRelationsParam();
@@ -188,6 +190,9 @@ while (list($key, $table) = each($the_tables)) {
if ($cfgRelation['commwork']) {
echo ' <th>' . $strComments . '</th>' . "\n";
}
if ($cfgRelation['mimework']) {
echo ' <th>MIME</th>' . "\n";
}
?>
</tr>
@@ -273,6 +278,15 @@ while (list($key, $table) = each($the_tables)) {
}
echo '&nbsp;</td>' . "\n";
}
if ($cfgRelation['mimework']) {
$mime_map = PMA_getMIME($db, $table, true);
echo ' <td class="print">';
if (isset($mime_map[$field_name])) {
echo htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype']));
}
echo '&nbsp;</td>' . "\n";
}
?>
</tr>
<?php