PBXT and Edit PDF pages
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user