table_coords

This commit is contained in:
Marc Delisle
2002-05-23 17:01:19 +00:00
parent c86e72902b
commit 01ad473048
5 changed files with 76 additions and 28 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$
$Source$
2002-05-23 Marc Delisle <lem9@users.sourceforge.net>
* Documentation.html, config.inc.php3, db_details_structure.php3,
pdf_schema.php3: new 'table_coords' because a table can appear
on more than one PDF page
2002-05-23 Alexander M. Turek <rabus@users.sourceforge.net>
* Documentation.html: The Mozilla textarea bug also appears in
Mozilla 1.0-RC2 and Netscape 7.0-PR1.

View File

@@ -607,7 +607,8 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
the FAQ, section &quot;Using phpMyAdmin&quot;);
</li>
<li>
enable you to get a PDF schema of your database.
enable you to get a PDF schema of your database (also uses the
table_coords table).
</li>
</ul>
<br />
@@ -658,13 +659,46 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
</dt>
<dd>
Since release 2.3.0 you can describe, in a special 'table_info'
table
table, which field is to be displayed as a tooltip when moving the
cursor over the corresponding key.
<br />
This configuration variable will hold the name of this special
table.
<br /><br />
To use this functionality you have to:
<ul>
<li>the coordinates where each table will be placed on a PDF schema
output</li>
<li>which field is to be displayed as a tooltip when moving the
cursor over the corresponding key</li>
</ul>
<li>
create in the same database a table (for example
'PMA_table_info') following this scheme:<br />
<tt>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CREATE TABLE `PMA_table_info` (<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`table_name` varchar(64) NOT NULL default '',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`display_field` varchar(64) NOT NULL default '',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PRIMARY KEY (`table_name`)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;) TYPE=MyISAM COMMENT='Table information for phpMyAdmin';<br />
</tt>
</li>
<li>
put the table name in
<tt>$cfg['Servers'][$i]['table_info']</tt>
</li>
<li>
then manually fill this table with information about the
display fields.
</li>
</ul><br />
Usage tips:
<a class="navigation" href="#faqdisplay">display field</a>.
<br /><br />
</dd>
<dt>
<b>$cfg['Servers'][$i]['table_coords']</b> string
</dt>
<dd>
Since release 2.3.0 you can describe, in a special 'table_coords'
table, the coordinates where each table will be placed on a PDF schema
output.
<br />
This configuration variable will hold the name of this special
table.
@@ -677,28 +711,27 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
<ul>
<li>
create in the same database a table (for example
'PMA_table_info') following this scheme:<br />
'PMA_table_coords') following this scheme:<br />
<tt>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CREATE TABLE `PMA_table_info` (<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CREATE TABLE `PMA_table_coords` (<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`table_name` varchar(64) NOT NULL default '',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`pdf_page_number` int NOT NULL default '0',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`x` float unsigned NOT NULL default '0',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`y` float unsigned NOT NULL default '0',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`display_field` varchar(64) NOT NULL default '',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PRIMARY KEY (`table_name`)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;) TYPE=MyISAM COMMENT='Table information for phpMyAdmin';<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PRIMARY KEY (`table_name`, `pdf_page_number`)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;) TYPE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output';<br />
</tt>
</li>
<li>
put the table name in
<tt>$cfg['Servers'][$i]['table_info']</tt>
<tt>$cfg['Servers'][$i]['table_coords']</tt>
</li>
<li>
then manually fill this table with information about the table
positions on the PDF schema, and/or the display fields.
positions on the PDF schema.
</li>
</ul><br />
Usage tips: <a class="navigation" href="#faqpdf">PDF output</a> and
<a class="navigation" href="#faqdisplay">display field</a>.
Usage tips: <a class="navigation" href="#faqpdf">PDF output</a>.
<br /><br />
</dd>
@@ -1786,19 +1819,22 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
<p>
<b>How can I produce a PDF schema of my database?</b>
<br />
First you have to fill the 'relation' and 'table_info'
First you have to fill the 'relation' and 'table_coords'
configuration variables.
<br /><br />
Then, think about your schema layout: which tables will go on which pages.
You have to fill in the 'relation' table the page number for each
master-foreign link.
<br /><br />
Then manually fill the table_info table with the coordinates,
x being the width and y the height, and (0,0) at the upper left corner.
A table may be displayed on more that one page, depending on how many
links it has to other tables.
<br /><br />
Then manually fill the table_coords table with the page number and
the coordinates, x being the width and y the height, and (0,0) at the upper left corner.
For example, x=100 and y=200 means that the table will be at 200 mm down
and 100 mm right from the upper left corner.
<br /><br />
To produce the output, click on your database name, then choose 'Structure'
To generate the output, click on your database name, then choose 'Structure'
and 'Display PDF schema', and enter the page number.
</p>

View File

@@ -51,6 +51,12 @@ $cfg['Servers'][$i]['bookmarktable'] = ''; // Bookmark table - leave bl
$cfg['Servers'][$i]['relation'] = ''; // table to describe the relation between links (see doc)
// - leave blank for no relation-links support
$cfg['Servers'][$i]['table_info']
= ''; // table to describe the
// display fields
// - leave blank
// for no display fields
// support
$cfg['Servers'][$i]['table_coords']
= ''; // table to describe the
// tables position for the
// PDF schema - leave blank
@@ -76,8 +82,8 @@ $cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['bookmarkdb'] = '';
$cfg['Servers'][$i]['bookmarktable'] = '';
$cfg['Servers'][$i]['relation'] = '';
$cfg['Servers'][$i]['table_info']
= '';
$cfg['Servers'][$i]['table_info'] = '';
$cfg['Servers'][$i]['table_coords'] = '';
$cfg['Servers'][$i]['AllowDeny']['order']
= '';
$cfg['Servers'][$i]['AllowDeny']['rules']
@@ -98,8 +104,8 @@ $cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['bookmarkdb'] = '';
$cfg['Servers'][$i]['bookmarktable'] = '';
$cfg['Servers'][$i]['relation'] = '';
$cfg['Servers'][$i]['table_info']
= '';
$cfg['Servers'][$i]['table_info'] = '';
$cfg['Servers'][$i]['table_coords'] = '';
$cfg['Servers'][$i]['AllowDeny']['order']
= '';
$cfg['Servers'][$i]['AllowDeny']['rules']

View File

@@ -438,7 +438,7 @@ echo ' ' . '&nbsp;<input type="submit" value="' . $strGo . '" />' . "\n";
<?php
// is this OK to check for 'class' support?
if (PMA_PHP_INT_VERSION >= 40000
&& (!empty($cfg['Server']['table_info']))
&& (!empty($cfg['Server']['table_coords']))
&& $num_tables > 0) {
?>
<!-- PDF schema -->

View File

@@ -361,7 +361,7 @@ class PMA_RT_Table
function PMA_RT_Table($table_name, $ff)
{
global $pdf;
global $pdf, $pdf_page_number;
$this->table_name = $table_name;
$sql = 'DESCRIBE ' . PMA_backquote($table_name);
@@ -380,8 +380,9 @@ class PMA_RT_Table
//x and y
$sql = 'SELECT x, y FROM '
. PMA_backquote($GLOBALS['cfg']['Server']['table_info'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table_name) . '\'';
. PMA_backquote($GLOBALS['cfg']['Server']['table_coords'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table_name) . '\''
. ' AND pdf_page_number = ' . $pdf_page_number;
$result = mysql_query($sql);
if (!$result || !mysql_num_rows($result)) {
$pdf->PMA_PDF_die(sprintf($GLOBALS['strConfigureTableCoord'], $table_name));