From 11bcc210e18e4615d0959fe33808f1ad02d27210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20M=C3=BCller?= Date: Sat, 29 Jun 2002 08:13:01 +0000 Subject: [PATCH] default tab selection stuff: * Documentation.html: docs about $cfg['DefaultTabDatabase'] and $cfg['DefaultTabTable'] * config.inc.php3, index.php3, left.php3, libraries/common.lib.php3: default tab selection is now customizable from config.inc.php3. --- ChangeLog | 6 ++++++ Documentation.html | 16 ++++++++++++++++ config.inc.php3 | 15 ++++++++++++--- index.php3 | 2 +- left.php3 | 22 +++++++++++----------- libraries/common.lib.php3 | 20 ++++++++++++++------ 6 files changed, 60 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index a100ebbc2..1935d798e 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-06-29 Olivier L. Müller + * Documentation.html: docs about $cfg['DefaultTabDatabase'] + and $cfg['DefaultTabTable'] + * config.inc.php3, index.php3, left.php3, libraries/common.lib.php3: + default tab selection is now customizable from config.inc.php3. + 2002-06-28 Olivier L. Müller * ANNOUNCE.txt: preparing 2.3.0 announcement... Feel free to improve and check diff --git a/Documentation.html b/Documentation.html index fd4bef62c..c52979aad 100755 --- a/Documentation.html +++ b/Documentation.html @@ -1058,6 +1058,22 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'

+
$cfg['DefaultTabDatabase'] string
+
+ Defines the Tab displayed by default on database view. Possible + values: 'db_details_structure.php3', 'db_details.php3', or + 'db_search.php3'. +

+
+ +
$cfg['DefaultTabTable'] string
+
+ Defines the Tab displayed by default on table view. Possible + values: 'tbl_properties_structure.php3', 'tbl_properties.php3', + 'tbl_select.php3', 'tbl_change.php3'. +

+
+
$cfg['ManualBaseShort'] string
If set to an URL which points to the MySQL documentation (on short diff --git a/config.inc.php3 b/config.inc.php3 index cac05e7d9..a864ebf25 100755 --- a/config.inc.php3 +++ b/config.inc.php3 @@ -184,11 +184,20 @@ $cfg['GZipDump'] = TRUE; // compression for $cfg['BZipDump'] = TRUE; // dump files -// Default Tabs settings +// Default Tabs display settings -$cfg['DefaultTabTable'] = 'Structure'; // not active yet -$cfg['DefaultTabDatabase'] = 'Structure'; // not active yet +//$cfg['DefaultTabDatabase'] = 'db_details_structure.php3'; + // Possible values: + // 'db_details_structure.php3' = tables list + // 'db_details.php3' = sql form + // 'db_search.php3' = search query +//$cfg['DefaultTabTable'] = 'tbl_properties_structure.php3'; + // Possible values: + // 'tbl_properties_structure.php3' = fields list + // 'tbl_properties.php3' = sql form + // 'tbl_select.php3 = select page + // 'tbl_change.php3 = insert row page /** * Link to the official MySQL documentation diff --git a/index.php3 b/index.php3 index ba7b41c21..cbbd5e15e 100755 --- a/index.php3 +++ b/index.php3 @@ -59,7 +59,7 @@ body {font-family: ; font-size: ,*" rows="*"> - + <body bgcolor="#FFFFFF"> diff --git a/left.php3 b/left.php3 index e0e1a46a7..31446b098 100755 --- a/left.php3 +++ b/left.php3 @@ -242,7 +242,7 @@ if ($num_dbs > 1) { if (!empty($num_tables)) { echo "\n"; ?> - <nobr><a class="item" href="db_details_structure.php3?<?php echo $common_url_query; ?>" onclick="if (capable) {expandBase('el<?php echo $j; ?>', true); return false} else {return true}"> + <nobr><a class="item" href="<?php echo $cfg['DefaultTabDatabase']; ?>?<?php echo $common_url_query; ?>" onclick="if (capable) {expandBase('el<?php echo $j; ?>', true); return false} else {return true}"> <img name="imEx" id="el<?php echo $j; ?>Img" src="images/plus.gif" border="0" width="9" height="9" alt="+" /></a> <?php } else { @@ -253,7 +253,7 @@ if ($num_dbs > 1) { } echo "\n"; ?> - <a class="item" href="db_details_structure.php3?<?php echo $common_url_query; ?>" onclick="if (capable) {expandBase('el<?php echo $j; ?>', false)}"> + <a class="item" href="<?php echo $cfg['DefaultTabDatabase']; ?>?<?php echo $common_url_query; ?>" onclick="if (capable) {expandBase('el<?php echo $j; ?>', false)}"> <span class="heada"><?php echo $db; ?><bdo dir="<?php echo($text_dir); ?>">&nbsp;&nbsp;</bdo></span><span class="headaCnt">(<?php echo $num_tables_disp; ?>)</span></a></nobr> </div> @@ -269,9 +269,9 @@ if ($num_dbs > 1) { echo "\n"; ?> <nobr><img src="images/spacer.gif" border="0" width="9" height="9" alt="" /> - <a target="phpmain" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table)); ?>&amp;pos=0&amp;goto=tbl_properties_structure.php3"> + <a target="phpmain" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table)); ?>&amp;pos=0&amp;goto=<?php echo $cfg['DefaultTabTable']; ?>"> <img src="images/browse.gif" width="8" height="8" border="0" alt="<?php echo "$strBrowse: $table"; ?>" title="<?php echo "$strBrowse: $table"; ?>" /></a><bdo dir="<?php echo $text_dir; ?>">&nbsp;</bdo> - <a class="tblItem" id="<?php echo md5($table); ?>" title="<?php echo $url_title; ?>" target="phpmain" href="tbl_properties_structure.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>"> + <a class="tblItem" id="<?php echo md5($table); ?>" title="<?php echo $url_title; ?>" target="phpmain" href="<?php echo $cfg['DefaultTabTable']; ?>?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>"> <?php echo $table; ?></a></nobr><br /> <?php } // end for $t (tables list) @@ -296,12 +296,12 @@ if ($num_dbs > 1) { $url_title = (!empty($tooltip) && isset($tooltip[$table])) ? str_replace('"', '&quot;', $tooltip[$table]) : ''; - $table_list .= ' <nobr><a target="phpmain" href="sql.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '&amp;sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($table)) . '&amp;pos=0&amp;goto=tbl_properties_structure.php3">' . "\n"; + $table_list .= ' <nobr><a target="phpmain" href="sql.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '&amp;sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($table)) . '&amp;pos=0&amp;goto=' . $cfg['DefaultTabTable'] . '">' . "\n"; $table_list .= ' <img src="images/browse.gif" width="8" height="8" border="0" alt="' . $strBrowse . ': ' . $table . '" title="' . $strBrowse . ': ' . $table . '" /></a><bdo dir="' . $text_dir . '">&nbsp;</bdo>' . "\n"; if (PMA_USR_BROWSER_AGENT == 'IE') { - $table_list .= ' <span class="tblItem"><a class="tblItem" id="' . md5($table) . '" title="' . $url_title . '" target="phpmain" href="tbl_properties_structure.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . $table . '</a></span></nobr><br />' . "\n"; + $table_list .= ' <span class="tblItem"><a class="tblItem" id="' . md5($table) . '" title="' . $url_title . '" target="phpmain" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . $table . '</a></span></nobr><br />' . "\n"; } else { - $table_list .= ' <a class="tblItem" id="' . md5($table) . '" title="' . $url_title . '" target="phpmain" href="tbl_properties_structure.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . $table . '</a></nobr><br />' . "\n"; + $table_list .= ' <a class="tblItem" id="' . md5($table) . '" title="' . $url_title . '" target="phpmain" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . $table . '</a></nobr><br />' . "\n"; } } // end for $t (tables list) @@ -311,7 +311,7 @@ if ($num_dbs > 1) { } $selected = ' selected="selected"'; - $table_list_header .= ' <a class="item" target="phpmain" href="db_details_structure.php3?' . $common_url_query . '">' . "\n"; + $table_list_header .= ' <a class="item" target="phpmain" href="' . $cfg['DefaultTabDatabase'] . '?' . $common_url_query . '">' . "\n"; $table_list_header .= ' <span class="heada"><b>' . $db . '</b><bdo dir="' . $text_dir . '">&nbsp;&nbsp;</bdo></span></a><br />' . "\n\n"; } else { $selected = ''; @@ -400,7 +400,7 @@ else if ($num_dbs == 1) { echo "\n"; ?> <div id="el2Parent" class="parent"> - <nobr><a class="item" href="db_details_structure.php3?<?php echo $common_url_query; ?>"> + <nobr><a class="item" href="<?php echo $cfg['DefaultTabDatabase']; ?>?<?php echo $common_url_query; ?>"> <span class="heada"><?php echo $db; ?><bdo dir="<?php echo($text_dir); ?>">&nbsp;&nbsp;</bdo></span><span class="headaCnt">(<?php echo $num_tables_disp; ?>)</span></a></nobr> </div> <div id="el2Child" class="child" style="margin-bottom: 5px"> @@ -413,9 +413,9 @@ else if ($num_dbs == 1) { : ''; echo "\n"; ?> - <nobr><a target="phpmain" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table)); ?>&amp;pos=0&amp;goto=tbl_properties_structure.php3"> + <nobr><a target="phpmain" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table)); ?>&amp;pos=0&amp;goto=<?php echo $cfg['DefaultTabTable']; ?>"> <img src="images/browse.gif" width="8" height="8" border="0" alt="<?php echo "$strBrowse: $table"; ?>" title="<?php echo "$strBrowse: $table"; ?>" /></a><bdo dir="<?php echo $text_dir; ?>">&nbsp;</bdo> - <a class="tblItem" id="<?php echo md5($table); ?>" title="<?php echo $url_title; ?>" target="phpmain" href="tbl_properties_structure.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>"> + <a class="tblItem" id="<?php echo md5($table); ?>" title="<?php echo $url_title; ?>" target="phpmain" href="<?php echo $cfg['DefaultTabTable']; ?>?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>"> <?php echo $table; ?></a></nobr><br /> <?php } // end for $j (tables list) diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index 1126be71e..95735a68c 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -493,12 +493,6 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} $DisplayPmaAbsoluteUriWarning = 0; if (empty($cfg['PmaAbsoluteUri'])) { - // if (empty($GLOBALS['is_header_sent'])) { - // include('./header.inc.php3'); - // } - // echo '<p class="warning">'. $strPmaUriError . '</p>' . "\n"; - // include('./footer.inc.php3'); - // exit(); $DisplayPmaAbsoluteUriWarning = 1; @@ -518,6 +512,20 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold} } + /** + * Make sure $cfg['DefaultTabDatabase'] and $cfg['DefaultTabTable'] are set. + * Todo: check if it is set to a *valid* value. + */ + + if (empty($cfg['DefaultTabDatabase'])) { + $cfg['DefaultTabDatabase'] = 'db_details_structure.php3'; + } + + if (empty($cfg['DefaultTabTable'])) { + $cfg['DefaultTabTable'] = 'tbl_properties_structure.php3'; + } + + /** * Use mysql_connect() or mysql_pconnect()? */