Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Delisle <marc@infomarc.info>2008-06-08 02:56:03 +0400
committerMarc Delisle <marc@infomarc.info>2008-06-08 02:56:03 +0400
commitcc02f9b79d9a251ab33623bddf8bcde60f8b299b (patch)
tree8bc6f9c816edb4341016f9a613d82850f6595e60 /pdf_pages.php
parent00f893361f4c62e70506b9070b27d70ff2f6e59a (diff)
PBXT and Edit PDF pages
Diffstat (limited to 'pdf_pages.php')
-rw-r--r--pdf_pages.php36
1 files changed, 21 insertions, 15 deletions
diff --git a/pdf_pages.php b/pdf_pages.php
index c9759e33f5..4d7376ac3b 100644
--- a/pdf_pages.php
+++ b/pdf_pages.php
@@ -10,7 +10,7 @@
*/
require_once './libraries/common.inc.php';
require_once './libraries/db_common.inc.php';
-
+require './libraries/StorageEngine.class.php';
/**
* Settings for relation stuff
@@ -85,26 +85,29 @@ if ($cfgRelation['pdfwork']) {
// A u t o m a t i c l a y o u t
// ================================
- if (isset($auto_layout_internal) || isset($auto_layout_innodb)) {
+ if (isset($auto_layout_internal) || isset($auto_layout_foreign)) {
$all_tables = array();
}
- if (isset($auto_layout_innodb)) {
+ if (isset($auto_layout_foreign)) {
// get the tables list
$tables = PMA_DBI_get_tables_full($db);
- // find the InnoDB ones
- $innodb_tables = array();
+ // find the ones who support FOREIGN KEY; it's not
+ // important that we group together InnoDB tables
+ // and PBXT tables, as this logic is just to put
+ // the tables on the layout, not to determine relations
+ $foreignkey_tables = array();
foreach($tables as $table_name => $table_properties) {
- if ($table_properties['ENGINE'] == 'InnoDB') {
- $innodb_tables[] = $table_name;
+ if (PMA_foreignkey_supported($table_properties['ENGINE'])) {
+ $foreignkey_tables[] = $table_name;
}
}
- $all_tables = $innodb_tables;
+ $all_tables = $foreignkey_tables;
// could be improved by finding the tables which have the
- // most references keys and place them at the beginning
+ // most references keys and placing them at the beginning
// of the array (so that they are all center of schema)
- unset($tables, $innodb_tables);
- } // endif auto_layout_innodb
+ unset($tables, $foreignkey_tables);
+ } // endif auto_layout_foreign
if (isset($auto_layout_internal)) {
// get the tables that have relations, by descending
@@ -147,7 +150,7 @@ if ($cfgRelation['pdfwork']) {
} // endif there are master tables
} // endif auto_layout_internal
- if (isset($auto_layout_internal) || isset($auto_layout_innodb)) {
+ if (isset($auto_layout_internal) || isset($auto_layout_foreign)) {
// now generate the coordinates for the schema,
// in a clockwise spiral
@@ -303,9 +306,12 @@ if ($cfgRelation['pdfwork']) {
<input type="hidden" name="do" value="createpage" />
<input type="text" name="newpage" size="20" maxlength="50" />
<input type="checkbox" name="auto_layout_internal" />
- <?php echo '(' . $strAutomaticLayout . ' / ' . $strInternalRelations . ')' . "\n"; ?>
- <input type="checkbox" name="auto_layout_innodb" />
- <?php echo '(' . $strAutomaticLayout . ' / InnoDB)' . "\n"; ?>
+<?php echo '(' . $strAutomaticLayout . ' / ' . $strInternalRelations . ')';
+ if (PMA_StorageEngine::isValid('InnoDB') || PMA_StorageEngine::isValid('PBXT')) {
+ echo '<input type="checkbox" name="auto_layout_foreign" />'
+ . '(' . $strAutomaticLayout . ' / FOREIGN KEY)';
+ }
+?>
<input type="submit" value="<?php echo $strGo; ?>" />
</fieldset>
</form>