diff --git a/pdf_pages.php b/pdf_pages.php index c9759e33f..4d7376ac3 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']) { - - - +' + . '(' . $strAutomaticLayout . ' / FOREIGN KEY)'; + } +?>