undid config.inc.php3 changes (shame on me)

and see ChangeLog
This commit is contained in:
Garvin Hicking
2003-07-24 18:02:37 +00:00
parent dc4f147dac
commit b89b4f117b
5 changed files with 199 additions and 105 deletions

View File

@@ -9,6 +9,11 @@ $Source$
* libraries/sqlparser.lib.php3 - Confirmation is also needed on
TRUNCATE statements!
* libraries/common.lib.php3 - RFE #758051 (simpler PHPcode generation)
* config.inc.php3, db_details_structure.php3, libraries/common.lib.php3,
libraries/config_import.lib.php3: *EXPERIMENTAL* - implemented buttons
for the database properties page and implemented RFE #752062: multi-
column display for many tables.
(thanks to Kawika Ohumukini [boogie33]).
2003-07-24 Marc Delisle <lem9@users.sourceforge.net>
* libraries/sqlparser.lib.php3 /relation.lib.php3 /get_foreign.lib.php3:

View File

@@ -36,7 +36,7 @@ if (!isset($old_error_reporting)) {
* If the auto-detection code does work properly, you can set to TRUE the
* $cfg['PmaAbsoluteUri_DisableWarning'] variable below.
*/
$cfg['PmaAbsoluteUri'] = 'http://www.garvinhicking.de/cvs/phpMyAdmin/';
$cfg['PmaAbsoluteUri'] = '';
/**
@@ -76,12 +76,9 @@ $cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settin
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
// and "mysql/db" tables)
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['blowfish_secret'] = 'hammer'; // Secret key used by
// blowfish encryption
// (if auth_type='cookie')
$cfg['Servers'][$i]['user'] = 'superdbl'; // MySQL user
$cfg['Servers'][$i]['password'] = 'geheim00'; // MySQL password (only needed
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
// with 'config' auth_type)
$cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
// this db is displayed
@@ -231,7 +228,7 @@ $cfg['SuggestDBName'] = TRUE; // suggest a new DB name if possible (fa
// In browse mode...
$cfg['ShowBlob'] = FALSE; // display blob field contents
$cfg['NavigationBarIconic'] = TRUE; // do not display text inside navigation bar buttons
$cfg['ShowAll'] = TRUE; // allows to display all the rows
$cfg['ShowAll'] = FALSE; // allows to display all the rows
$cfg['MaxRows'] = 30; // maximum number of rows to display
$cfg['Order'] = 'ASC'; // default for 'ORDER BY' clause (valid
// values are 'ASC', 'DESC' or 'SMART' -ie
@@ -258,6 +255,10 @@ $cfg['BZipDump'] = TRUE; // dump files
// Tabs display settings
$cfg['LightTabs'] = FALSE; // use graphically less intense menu tabs
$cfg['PropertiesIconic'] = TRUE; // Use icons instead of text for the table display of a database
$cfg['PropertiesNumColumns'] = 1; // How many columns should be used for table display of a database?
// (a value larger than 1 results in some information being hidden)
$cfg['DefaultTabServer'] = 'main.php3';
// Possible values:
// 'main.php3' = the welcome page

View File

@@ -39,6 +39,32 @@ if (empty($is_info)) {
}
}
// Display function
function pma_TableHeader() {
?>
<table border="<?php echo $GLOBALS['cfg']['Border']; ?>">
<tr>
<td></td>
<th>&nbsp;<?php echo $GLOBALS['strTable']; ?>&nbsp;</th>
<th colspan="6"><?php echo $GLOBALS['strAction']; ?></th>
<th><?php echo $GLOBALS['strRecords']; ?></th>
<?php
if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
?>
<th><?php echo $GLOBALS['strType']; ?></th>
<?php
}
?>
<?php
if ($GLOBALS['cfg']['ShowStats']) {
echo '<th>' . $GLOBALS['strSize'] . '</th>';
}
echo "\n";
?>
</tr>
<?php
}
/**
* Settings for relations stuff
@@ -112,24 +138,22 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
<form method="post" action="db_details_structure.php3" name="tablesForm">
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<table border="<?php echo $cfg['Border']; ?>">
<tr>
<td></td>
<th>&nbsp;<?php echo $strTable; ?>&nbsp;</th>
<th colspan="6"><?php echo $strAction; ?></th>
<th><?php echo $strRecords; ?></th>
<th><?php echo $strType; ?></th>
<?php
if ($cfg['ShowStats']) {
echo '<th>' . $strSize . '</th>';
<?php
if ($cfg['PropertiesNumColumns'] > 1) {
?>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<?php
}
echo "\n";
?>
</tr>
<?php
pma_TableHeader();
$i = $sum_entries = 0;
(double) $sum_size = 0;
$checked = (!empty($checkall) ? ' checked="checked"' : '');
$num_columns = ($cfg['PropertiesNumColumns'] > 1 ? (ceil($num_tables / $cfg['PropertiesNumColumns']) + 1) : 0);
$row_count = 0;
while (list($keyname, $sts_data) = each($tables)) {
$table = $sts_data['Name'];
$table_encoded = urlencode($table);
@@ -146,52 +170,90 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
$tbl_url_query = $url_query . '&amp;table=' . $table_encoded;
$bgcolor = ($i++ % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
echo "\n";
$row_count++;
if($num_columns > 0 && $num_tables > $num_columns && (($row_count % ($num_columns)) == 0)) {
$bgcolor = $cfg['BgcolorTwo'];
$row_count = 1;
?>
<tr>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<input type="checkbox" name="selected_tbl[]" value="<?php echo $table_encoded; ?>" id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> />
</tr>
</table>
</td>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
&nbsp;<b><label for="checkbox_tbl_<?php echo $i; ?>" title="<?php echo $alias; ?>"><?php echo $truename; ?></label>&nbsp;</b>&nbsp;
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<td><img src="./images/spacer.gif" border="0" width="10" height="1" alt="" /></td>
<td valign="top">
<?php
pma_TableHeader();
}
?>
<tr>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<input type="checkbox" name="selected_tbl[]" value="<?php echo $table_encoded; ?>" id="checkbox_tbl_<?php echo $i; ?>"<?php echo $checked; ?> />
</td>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
&nbsp;<b><label for="checkbox_tbl_<?php echo $i; ?>" title="<?php echo $alias; ?>"><?php echo $truename; ?></label>&nbsp;</b>&nbsp;
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php
include('./libraries/bookmark.lib.php3');
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
$titles = array();
if ($cfg['PropertiesIconic'] == true) {
$titles['Browse'] = '<img width="12" height="12" src="images/button_browse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
$titles['Select'] = '<img width="14" height="12" src="images/button_select.png" alt="' . $strSelect . '" title="' . $strSelect . '" border="0" />';
$titles['NoBrowse'] = '<img width="12" height="12" src="images/button_nobrowse.png" alt="' . $strBrowse . '" title="' . $strBrowse . '" border="0" />';
$titles['NoSelect'] = '<img width="14" height="12" src="images/button_noselect.png" alt="' . $strSelect . '" title="' . $strSelect . '" border="0" />';
$titles['Insert'] = '<img width="13" height="12" src="images/button_insert.png" alt="' . $strInsert . '" title="' . $strInsert . '" border="0" />';
$titles['Properties'] = '<img width="18" height="12" src="images/button_properties.png" alt="' . $strProperties . '" title="' . $strProperties . '" border="0" />';
$titles['Drop'] = '<img width="11" height="12" src="images/button_drop.png" alt="' . $strDrop . '" title="' . $strDrop . '" border="0" />';
$titles['Empty'] = '<img width="11" height="12" src="images/button_empty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
$titles['NoEmpty'] = '<img width="11" height="12" src="images/button_noempty.png" alt="' . $strEmpty . '" title="' . $strEmpty . '" border="0" />';
} else {
$titles['Browse'] = $strBrowse;
$titles['Select'] = $strSelect;
$titles['NoBrowse'] = $strBrowse;
$titles['NoSelect'] = $strSelect;
$titles['Insert'] = $strInsert;
$titles['Properties'] = $strProperties;
$titles['Drop'] = $strDrop;
$titles['Empty'] = $strEmpty;
$titles['NoEmpty'] = $strEmpty;
}
if (!empty($sts_data['Rows'])) {
echo '<a href="sql.php3?' . $tbl_url_query . '&amp;sql_query='
. (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
. '&amp;pos=0">' . $strBrowse . '</a>';
. '&amp;pos=0">' . $titles['Browse'] . '</a>';
} else {
echo $strBrowse;
echo $titles['NoBrowse'];
}
?>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php
if (!empty($sts_data['Rows'])) {
echo '<a href="tbl_select.php3?' . $tbl_url_query . '">'
. $strSelect . '</a>';
. $titles['Select'] . '</a>';
} else {
echo $strSelect;
echo $titles['NoSelect'];
}
?>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_change.php3?<?php echo $tbl_url_query; ?>">
<?php echo $strInsert; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $titles['Insert']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="tbl_properties_structure.php3?<?php echo $tbl_url_query; ?>">
<?php echo $strProperties; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $titles['Properties']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<a href="sql.php3?<?php echo $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
onclick="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
<?php echo $strDrop; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $titles['Drop']; ?></a>
</td>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php
if (!empty($sts_data['Rows'])) {
echo '<a href="sql.php3?' . $tbl_url_query
@@ -207,12 +269,12 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)))
. '" onclick="return confirmLink(this, \'DELETE FROM ';
}
echo PMA_jsFormat($table) . '\')">' . $strEmpty . '</a>';
echo PMA_jsFormat($table) . '\')">' . $titles['Empty'] . '</a>';
} else {
echo $strEmpty;
echo $titles['NoEmpty'];
}
?>
</td>
</td>
<?php
echo "\n";
@@ -275,35 +337,40 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
$display_rows = 'unknown';
}
?>
<td align="right" bgcolor="<?php echo $bgcolor; ?>">
<td align="right" bgcolor="<?php echo $bgcolor; ?>">
<?php
echo "\n" . ' ' . $display_rows . "\n";
?>
</td>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
&nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp;
</td>
</td>
<?php
if (!($cfg['PropertiesNumColumns'] > 1)) {
?>
<td bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
&nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp;
</td>
<?php
}
if ($cfg['ShowStats']) {
echo "\n";
?>
<td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
&nbsp;&nbsp;
<a href="tbl_properties_structure.php3?<?php echo $tbl_url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
</td>
<td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
&nbsp;&nbsp;
<a href="tbl_properties_structure.php3?<?php echo $tbl_url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
</td>
<?php
echo "\n";
} // end if
} else {
?>
<td colspan="3" align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php echo $strInUse . "\n"; ?>
</td>
<td colspan="3" align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php echo $strInUse . "\n"; ?>
</td>
<?php
}
echo "\n";
?>
</tr>
</tr>
<?php
}
// Show Summary
@@ -312,50 +379,55 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
}
echo "\n";
?>
<tr>
<td></td>
<th align="center" nowrap="nowrap">
&nbsp;<b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?></b>&nbsp;
</th>
<th colspan="6" align="center">
<b><?php echo $strSum; ?></b>
</th>
<th align="right" nowrap="nowrap">
<b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?></b>
</th>
<th align="center">
<b>--</b>
</th>
<tr>
<td></td>
<th align="center" nowrap="nowrap">
&nbsp;<b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?></b>&nbsp;
</th>
<th colspan="6" align="center">
<b><?php echo $strSum; ?></b>
</th>
<th align="right" nowrap="nowrap">
<b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?></b>
</th>
<?php
if (!($cfg['PropertiesNumColumns'] > 1)) {
?>
<th align="center">
<b>--</b>
</th>
<?php
}
if ($cfg['ShowStats']) {
echo "\n";
?>
<th align="right" nowrap="nowrap">
&nbsp;
<b><?php echo $sum_formated . ' ' . $unit; ?></b>
</th>
<th align="right" nowrap="nowrap">
&nbsp;
<b><?php echo $sum_formated . ' ' . $unit; ?></b>
</th>
<?php
}
echo "\n";
?>
</tr>
</tr>
<?php
// Check all tables url
$checkall_url = 'db_details_structure.php3?' . PMA_generate_common_url($db);
echo "\n";
?>
<tr>
<td colspan="<?php echo (($cfg['ShowStats']) ? '11' : '10'); ?>" valign="bottom">
<img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
<a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('tablesForm', true); return false;">
<?php echo $strCheckAll; ?></a>
&nbsp;/&nbsp;
<a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('tablesForm', false); return false;">
<?php echo $strUncheckAll; ?></a>
&nbsp;&nbsp;&nbsp;
<img src="./images/spacer.gif" border="0" width="38" height="1" alt="" />
<select name="submit_mult" dir="ltr" onchange="this.form.submit();">
<tr>
<td colspan="<?php echo (($cfg['ShowStats']) ? '11' : '10'); ?>" valign="bottom">
<img src="./images/arrow_<?php echo $text_dir; ?>.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
<a href="<?php echo $checkall_url; ?>&amp;checkall=1" onclick="setCheckboxes('tablesForm', true); return false;">
<?php echo $strCheckAll; ?></a>
&nbsp;/&nbsp;
<a href="<?php echo $checkall_url; ?>" onclick="setCheckboxes('tablesForm', false); return false;">
<?php echo $strUncheckAll; ?></a>
&nbsp;&nbsp;&nbsp;
<img src="./images/spacer.gif" border="0" width="38" height="1" alt="" />
<select name="submit_mult" dir="ltr" onchange="this.form.submit();">
<?php
echo "\n";
echo ' <option value="' . $strWithChecked . '" selected="selected">'
@@ -375,19 +447,27 @@ else if (PMA_MYSQL_INT_VERSION >= 32303) {
echo ' <option value="' . $strAnalyzeTable . '" >'
. $strAnalyzeTable . '</option>' . "\n";
?>
</select>
<script type="text/javascript" language="javascript">
<!--
// Fake js to allow the use of the <noscript> tag
//-->
</script>
<noscript>
<input type="submit" value="<?php echo $strGo; ?>" />
</noscript>
</td>
</tr>
</select>
<script type="text/javascript" language="javascript">
<!--
// Fake js to allow the use of the <noscript> tag
//-->
</script>
<noscript>
<input type="submit" value="<?php echo $strGo; ?>" />
</noscript>
</td>
</tr>
</table>
<?php
if ($cfg['PropertiesNumColumns'] > 1) {
?>
</td>
</tr>
</table>
<?php
}
?>
</form>
<?php
} // end case mysql >= 3.23.03

View File

@@ -135,7 +135,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* Includes compatibility code for older config.inc.php3 revisions
* if necessary
*/
if (!isset($cfg['FileRevision']) || (int) substr($cfg['FileRevision'], 13, 3) < 190) {
if (!isset($cfg['FileRevision']) || (int) substr($cfg['FileRevision'], 13, 3) < 195) {
include('./libraries/config_import.lib.php3');
}

View File

@@ -298,6 +298,14 @@ if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) {
$cfg['LightTabs'] = FALSE;
}
if (!isset($cfg['PropertiesIconic'])) {
$cfg['PropertiesIconic'] = TRUE;
}
if (!isset($cfg['PropertiesNumColumns'])) {
$cfg['PropertiesNumColumns'] = 1;
}
if (!isset($cfg['ShowTooltip'])) {
if (isset($cfgShowTooltip)) {
$cfg['ShowTooltip'] = $cfgShowTooltip;