PBXT and Edit PDF pages

This commit is contained in:
Marc Delisle
2008-06-07 22:56:03 +00:00
parent 00f893361f
commit cc02f9b79d

View File

@@ -10,7 +10,7 @@
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
require_once './libraries/db_common.inc.php'; require_once './libraries/db_common.inc.php';
require './libraries/StorageEngine.class.php';
/** /**
* Settings for relation stuff * 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 // 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(); $all_tables = array();
} }
if (isset($auto_layout_innodb)) { if (isset($auto_layout_foreign)) {
// get the tables list // get the tables list
$tables = PMA_DBI_get_tables_full($db); $tables = PMA_DBI_get_tables_full($db);
// find the InnoDB ones // find the ones who support FOREIGN KEY; it's not
$innodb_tables = array(); // 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) { foreach($tables as $table_name => $table_properties) {
if ($table_properties['ENGINE'] == 'InnoDB') { if (PMA_foreignkey_supported($table_properties['ENGINE'])) {
$innodb_tables[] = $table_name; $foreignkey_tables[] = $table_name;
} }
} }
$all_tables = $innodb_tables; $all_tables = $foreignkey_tables;
// could be improved by finding the tables which have the // 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) // of the array (so that they are all center of schema)
unset($tables, $innodb_tables); unset($tables, $foreignkey_tables);
} // endif auto_layout_innodb } // endif auto_layout_foreign
if (isset($auto_layout_internal)) { if (isset($auto_layout_internal)) {
// get the tables that have relations, by descending // get the tables that have relations, by descending
@@ -147,7 +150,7 @@ if ($cfgRelation['pdfwork']) {
} // endif there are master tables } // endif there are master tables
} // endif auto_layout_internal } // 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, // now generate the coordinates for the schema,
// in a clockwise spiral // in a clockwise spiral
@@ -303,9 +306,12 @@ if ($cfgRelation['pdfwork']) {
<input type="hidden" name="do" value="createpage" /> <input type="hidden" name="do" value="createpage" />
<input type="text" name="newpage" size="20" maxlength="50" /> <input type="text" name="newpage" size="20" maxlength="50" />
<input type="checkbox" name="auto_layout_internal" /> <input type="checkbox" name="auto_layout_internal" />
<?php echo '(' . $strAutomaticLayout . ' / ' . $strInternalRelations . ')' . "\n"; ?> <?php echo '(' . $strAutomaticLayout . ' / ' . $strInternalRelations . ')';
<input type="checkbox" name="auto_layout_innodb" /> if (PMA_StorageEngine::isValid('InnoDB') || PMA_StorageEngine::isValid('PBXT')) {
<?php echo '(' . $strAutomaticLayout . ' / InnoDB)' . "\n"; ?> echo '<input type="checkbox" name="auto_layout_foreign" />'
. '(' . $strAutomaticLayout . ' / FOREIGN KEY)';
}
?>
<input type="submit" value="<?php echo $strGo; ?>" /> <input type="submit" value="<?php echo $strGo; ?>" />
</fieldset> </fieldset>
</form> </form>