[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_2-3421-gca6f3b0
Michal Čihař
nijel at users.sourceforge.net
Mon Jun 13 14:50:24 CEST 2011
The branch, master has been updated
via ca6f3b0ac27ab2124c196dda8484397d99656e0b (commit)
via fedefef85c1af91e7f60bae52c409db7dca623ef (commit)
from d0974bd61f2b228338e5a2af7f5967bcc7037d08 (commit)
- Log -----------------------------------------------------------------
commit ca6f3b0ac27ab2124c196dda8484397d99656e0b
Author: Michal Čihař <mcihar at novell.com>
Date: Mon Jun 13 14:50:07 2011 +0200
Display tabs for chart based on currently selected database/table
commit fedefef85c1af91e7f60bae52c409db7dca623ef
Author: Michal Čihař <mcihar at novell.com>
Date: Mon Jun 13 14:49:45 2011 +0200
Properly handle case when there is no database selected
-----------------------------------------------------------------------
Summary of changes:
libraries/display_tbl.lib.php | 6 +++++-
tbl_chart.php | 27 +++++++++++++++++----------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 5b06b3e..26d362d 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -2358,8 +2358,12 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
* first table of this database, so that tbl_export.php and
* the script it calls do not fail
*/
- if (empty($_url_params['table'])) {
+ if (empty($_url_params['table']) && !empty($_url_params['db'])) {
$_url_params['table'] = PMA_DBI_fetch_value("SHOW TABLES");
+ /* No result (probably no database selected) */
+ if ($_url_params['table'] === FALSE) {
+ unset($_url_params['table']);
+ }
}
echo PMA_linkOrButton(
diff --git a/tbl_chart.php b/tbl_chart.php
index f4b8bd3..5853c45 100644
--- a/tbl_chart.php
+++ b/tbl_chart.php
@@ -24,9 +24,23 @@ $GLOBALS['js_include'][] = 'pMap.js';
/**
* Runs common work
*/
-require './libraries/db_common.inc.php';
-$url_params['goto'] = $cfg['DefaultTabDatabase'];
-$url_params['back'] = 'sql.php';
+if (strlen($GLOBALS['table'])) {
+ $url_params['goto'] = $cfg['DefaultTabTable'];
+ $url_params['back'] = 'tbl_sql.php';
+ require './libraries/tbl_common.php';
+ require './libraries/tbl_info.inc.php';
+ require './libraries/tbl_links.inc.php';
+} elseif (strlen($GLOBALS['db'])) {
+ $url_params['goto'] = $cfg['DefaultTabDatabase'];
+ $url_params['back'] = 'sql.php';
+ require './libraries/db_common.inc.php';
+ require './libraries/db_info.inc.php';
+} else {
+ $url_params['goto'] = $cfg['DefaultTabServer'];
+ $url_params['back'] = 'sql.php';
+ require './libraries/server_common.inc.php';
+ require './libraries/server_links.inc.php';
+}
/*
* Import chart functions
@@ -59,13 +73,6 @@ else {
$message = PMA_Message::error(__('The result of this query can\'t be used for a chart. See [a at ./Documentation.html#faq6_29 at Documentation]FAQ 6.29[/a]'));
}
-/**
- * Displays top menu links
- * We use db links because a chart is not necessarily on a single table
- */
-$num_tables = 0;
-require_once './libraries/db_links.inc.php';
-
$url_params['db'] = $GLOBALS['db'];
$url_params['reload'] = 1;
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list