make the database list more magic:

load/fetch only if really required
use SPL ArrayObject to behave like an array
This commit is contained in:
Sebastian Mendel
2008-05-09 10:41:16 +00:00
parent 91007aa3d6
commit fa21fe3ea5
13 changed files with 183 additions and 138 deletions

View File

@@ -258,14 +258,14 @@ unset($columns);
<input type="hidden" name="what" value="data" />
<fieldset id="fieldset_table_rename">
<legend><?php echo $strMoveTable; ?></legend>
<?php if ($GLOBALS['PMA_List_Database']->count() > $GLOBALS['cfg']['MaxDbList']) {
<?php if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {
?>
<input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/>
<?php
} else {
?>
<select name="target_db">
<?php echo $GLOBALS['PMA_List_Database']->getHtmlOptions(true, false); ?>
<?php echo $GLOBALS['pma']->databases->getHtmlOptions(true, false); ?>
</select>
<?php
} // end if
@@ -462,14 +462,14 @@ if (isset($possible_row_formats[$tbl_type])) {
<input type="hidden" name="reload" value="1" />
<fieldset>
<legend><?php echo $strCopyTable; ?></legend>
<?php if ($GLOBALS['PMA_List_Database']->count() > $GLOBALS['cfg']['MaxDbList']) {
<?php if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {
?>
<input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/>
<?php
} else {
?>
<select name="target_db">
<?php echo $GLOBALS['PMA_List_Database']->getHtmlOptions(true, false); ?>
<?php echo $GLOBALS['pma']->databases->getHtmlOptions(true, false); ?>
</select>
<?php
} // end if