table_coords
This commit is contained in:
@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$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>
|
2002-05-23 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||||
* Documentation.html: The Mozilla textarea bug also appears in
|
* Documentation.html: The Mozilla textarea bug also appears in
|
||||||
Mozilla 1.0-RC2 and Netscape 7.0-PR1.
|
Mozilla 1.0-RC2 and Netscape 7.0-PR1.
|
||||||
|
@@ -607,7 +607,8 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
the FAQ, section "Using phpMyAdmin");
|
the FAQ, section "Using phpMyAdmin");
|
||||||
</li>
|
</li>
|
||||||
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br />
|
<br />
|
||||||
@@ -658,13 +659,46 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
Since release 2.3.0 you can describe, in a special 'table_info'
|
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>
|
<ul>
|
||||||
<li>the coordinates where each table will be placed on a PDF schema
|
<li>
|
||||||
output</li>
|
create in the same database a table (for example
|
||||||
<li>which field is to be displayed as a tooltip when moving the
|
'PMA_table_info') following this scheme:<br />
|
||||||
cursor over the corresponding key</li>
|
<tt>
|
||||||
</ul>
|
CREATE TABLE `PMA_table_info` (<br />
|
||||||
|
`table_name` varchar(64) NOT NULL default '',<br />
|
||||||
|
`display_field` varchar(64) NOT NULL default '',<br />
|
||||||
|
PRIMARY KEY (`table_name`)<br />
|
||||||
|
) 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 />
|
<br />
|
||||||
This configuration variable will hold the name of this special
|
This configuration variable will hold the name of this special
|
||||||
table.
|
table.
|
||||||
@@ -677,28 +711,27 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
create in the same database a table (for example
|
create in the same database a table (for example
|
||||||
'PMA_table_info') following this scheme:<br />
|
'PMA_table_coords') following this scheme:<br />
|
||||||
<tt>
|
<tt>
|
||||||
CREATE TABLE `PMA_table_info` (<br />
|
CREATE TABLE `PMA_table_coords` (<br />
|
||||||
`table_name` varchar(64) NOT NULL default '',<br />
|
`table_name` varchar(64) NOT NULL default '',<br />
|
||||||
|
`pdf_page_number` int NOT NULL default '0',<br />
|
||||||
`x` float unsigned NOT NULL default '0',<br />
|
`x` float unsigned NOT NULL default '0',<br />
|
||||||
`y` float unsigned NOT NULL default '0',<br />
|
`y` float unsigned NOT NULL default '0',<br />
|
||||||
`display_field` varchar(64) NOT NULL default '',<br />
|
PRIMARY KEY (`table_name`, `pdf_page_number`)<br />
|
||||||
PRIMARY KEY (`table_name`)<br />
|
) TYPE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output';<br />
|
||||||
) TYPE=MyISAM COMMENT='Table information for phpMyAdmin';<br />
|
|
||||||
</tt>
|
</tt>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
put the table name in
|
put the table name in
|
||||||
<tt>$cfg['Servers'][$i]['table_info']</tt>
|
<tt>$cfg['Servers'][$i]['table_coords']</tt>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
then manually fill this table with information about the table
|
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>
|
</li>
|
||||||
</ul><br />
|
</ul><br />
|
||||||
Usage tips: <a class="navigation" href="#faqpdf">PDF output</a> and
|
Usage tips: <a class="navigation" href="#faqpdf">PDF output</a>.
|
||||||
<a class="navigation" href="#faqdisplay">display field</a>.
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
@@ -1786,19 +1819,22 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
<p>
|
<p>
|
||||||
<b>How can I produce a PDF schema of my database?</b>
|
<b>How can I produce a PDF schema of my database?</b>
|
||||||
<br />
|
<br />
|
||||||
First you have to fill the 'relation' and 'table_info'
|
First you have to fill the 'relation' and 'table_coords'
|
||||||
configuration variables.
|
configuration variables.
|
||||||
<br /><br />
|
<br /><br />
|
||||||
Then, think about your schema layout: which tables will go on which pages.
|
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
|
You have to fill in the 'relation' table the page number for each
|
||||||
master-foreign link.
|
master-foreign link.
|
||||||
<br /><br />
|
<br /><br />
|
||||||
Then manually fill the table_info table with the coordinates,
|
A table may be displayed on more that one page, depending on how many
|
||||||
x being the width and y the height, and (0,0) at the upper left corner.
|
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
|
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.
|
and 100 mm right from the upper left corner.
|
||||||
<br /><br />
|
<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.
|
and 'Display PDF schema', and enter the page number.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@@ -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)
|
$cfg['Servers'][$i]['relation'] = ''; // table to describe the relation between links (see doc)
|
||||||
// - leave blank for no relation-links support
|
// - leave blank for no relation-links support
|
||||||
$cfg['Servers'][$i]['table_info']
|
$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
|
= ''; // table to describe the
|
||||||
// tables position for the
|
// tables position for the
|
||||||
// PDF schema - leave blank
|
// PDF schema - leave blank
|
||||||
@@ -76,8 +82,8 @@ $cfg['Servers'][$i]['verbose'] = '';
|
|||||||
$cfg['Servers'][$i]['bookmarkdb'] = '';
|
$cfg['Servers'][$i]['bookmarkdb'] = '';
|
||||||
$cfg['Servers'][$i]['bookmarktable'] = '';
|
$cfg['Servers'][$i]['bookmarktable'] = '';
|
||||||
$cfg['Servers'][$i]['relation'] = '';
|
$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']['order']
|
||||||
= '';
|
= '';
|
||||||
$cfg['Servers'][$i]['AllowDeny']['rules']
|
$cfg['Servers'][$i]['AllowDeny']['rules']
|
||||||
@@ -98,8 +104,8 @@ $cfg['Servers'][$i]['verbose'] = '';
|
|||||||
$cfg['Servers'][$i]['bookmarkdb'] = '';
|
$cfg['Servers'][$i]['bookmarkdb'] = '';
|
||||||
$cfg['Servers'][$i]['bookmarktable'] = '';
|
$cfg['Servers'][$i]['bookmarktable'] = '';
|
||||||
$cfg['Servers'][$i]['relation'] = '';
|
$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']['order']
|
||||||
= '';
|
= '';
|
||||||
$cfg['Servers'][$i]['AllowDeny']['rules']
|
$cfg['Servers'][$i]['AllowDeny']['rules']
|
||||||
|
@@ -438,7 +438,7 @@ echo ' ' . ' <input type="submit" value="' . $strGo . '" />' . "\n";
|
|||||||
<?php
|
<?php
|
||||||
// is this OK to check for 'class' support?
|
// is this OK to check for 'class' support?
|
||||||
if (PMA_PHP_INT_VERSION >= 40000
|
if (PMA_PHP_INT_VERSION >= 40000
|
||||||
&& (!empty($cfg['Server']['table_info']))
|
&& (!empty($cfg['Server']['table_coords']))
|
||||||
&& $num_tables > 0) {
|
&& $num_tables > 0) {
|
||||||
?>
|
?>
|
||||||
<!-- PDF schema -->
|
<!-- PDF schema -->
|
||||||
|
@@ -361,7 +361,7 @@ class PMA_RT_Table
|
|||||||
|
|
||||||
function PMA_RT_Table($table_name, $ff)
|
function PMA_RT_Table($table_name, $ff)
|
||||||
{
|
{
|
||||||
global $pdf;
|
global $pdf, $pdf_page_number;
|
||||||
|
|
||||||
$this->table_name = $table_name;
|
$this->table_name = $table_name;
|
||||||
$sql = 'DESCRIBE ' . PMA_backquote($table_name);
|
$sql = 'DESCRIBE ' . PMA_backquote($table_name);
|
||||||
@@ -380,8 +380,9 @@ class PMA_RT_Table
|
|||||||
|
|
||||||
//x and y
|
//x and y
|
||||||
$sql = 'SELECT x, y FROM '
|
$sql = 'SELECT x, y FROM '
|
||||||
. PMA_backquote($GLOBALS['cfg']['Server']['table_info'])
|
. PMA_backquote($GLOBALS['cfg']['Server']['table_coords'])
|
||||||
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table_name) . '\'';
|
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table_name) . '\''
|
||||||
|
. ' AND pdf_page_number = ' . $pdf_page_number;
|
||||||
$result = mysql_query($sql);
|
$result = mysql_query($sql);
|
||||||
if (!$result || !mysql_num_rows($result)) {
|
if (!$result || !mysql_num_rows($result)) {
|
||||||
$pdf->PMA_PDF_die(sprintf($GLOBALS['strConfigureTableCoord'], $table_name));
|
$pdf->PMA_PDF_die(sprintf($GLOBALS['strConfigureTableCoord'], $table_name));
|
||||||
|
Reference in New Issue
Block a user