The branch, master has been updated via 723e51dfdba31eabb1417e7dd5731680748df414 (commit) via ede177c577668a712e0d89a8c895c1d0c200f42f (commit) via 238ceb8f98861482d153b1c38a8e46ca07f2993c (commit) via c5d1aae6f6565a69b65546ceab6113ede41c61da (commit) via 24a257ffcea338546613bc60c6c0b6f98c99389e (commit) via 21b84f5c882cc1ac267d380f042218f184ce1781 (commit) via 6e65d3d7fc04653be59e133acfe5f10f5eb6cbc5 (commit) via 7e5fddf4ae2893cc08428b3c3f37241ff85d2457 (commit) from 103aed54d932caf536fcb5f2a782fb754706a997 (commit)
- Log ----------------------------------------------------------------- commit 723e51dfdba31eabb1417e7dd5731680748df414 Merge: 103aed54d932caf536fcb5f2a782fb754706a997 ede177c577668a712e0d89a8c895c1d0c200f42f Author: Marc Delisle marc@infomarc.info Date: Tue Jun 21 08:13:41 2011 -0400
Merge commit 'ede177c577668a712e0d89a8c895c1d0c200f42f'
commit ede177c577668a712e0d89a8c895c1d0c200f42f Merge: 238ceb8f98861482d153b1c38a8e46ca07f2993c 21b84f5c882cc1ac267d380f042218f184ce1781 Author: Aris Feryanto aris_feryanto@yahoo.com Date: Tue Jun 21 12:37:59 2011 +0700
Merge branch 'recent' into aris
commit 238ceb8f98861482d153b1c38a8e46ca07f2993c Merge: 6e65d3d7fc04653be59e133acfe5f10f5eb6cbc5 c5d1aae6f6565a69b65546ceab6113ede41c61da Author: Aris Feryanto aris_feryanto@yahoo.com Date: Tue Jun 21 12:37:55 2011 +0700
Merge branch 'colresize' into aris
commit c5d1aae6f6565a69b65546ceab6113ede41c61da Author: Aris Feryanto aris_feryanto@yahoo.com Date: Tue Jun 21 12:37:20 2011 +0700
Column reordering: better placement of code for displaying remembered column order
commit 24a257ffcea338546613bc60c6c0b6f98c99389e Author: Aris Feryanto aris_feryanto@yahoo.com Date: Tue Jun 21 12:25:31 2011 +0700
Column reordering: add checking for different server
commit 21b84f5c882cc1ac267d380f042218f184ce1781 Author: Aris Feryanto aris_feryanto@yahoo.com Date: Tue Jun 21 11:43:32 2011 +0700
Recent tables: better checking of different server
commit 6e65d3d7fc04653be59e133acfe5f10f5eb6cbc5 Author: Aris Feryanto aris_feryanto@yahoo.com Date: Tue Jun 21 10:54:48 2011 +0700
Fix bug: Recent tables list doesn't honor current server
commit 7e5fddf4ae2893cc08428b3c3f37241ff85d2457 Author: Aris Feryanto aris_feryanto@yahoo.com Date: Mon Jun 20 13:21:07 2011 +0700
Recent table: Add support for browser without javascript
-----------------------------------------------------------------------
Summary of changes: index.php | 2 +- js/makegrid.js | 1 + libraries/RecentTable.class.php | 11 ++++++----- libraries/Table.class.php | 7 ++++--- libraries/common.inc.php | 19 +++++++++++++++---- libraries/display_tbl.lib.php | 16 ++++++++-------- navigation.php | 12 +++++++++--- 7 files changed, 44 insertions(+), 24 deletions(-)
diff --git a/index.php b/index.php index 36a6118..070099b 100644 --- a/index.php +++ b/index.php @@ -73,7 +73,7 @@ if (! strlen($GLOBALS['db'])) { } else { $_GET['db'] = $GLOBALS['db']; $_GET['table'] = $GLOBALS['table']; - $main_target = $GLOBALS['cfg']['DefaultTabTable']; + $main_target = isset($GLOBALS['goto']) ? $GLOBALS['goto'] : $GLOBALS['cfg']['DefaultTabTable']; }
$url_query = PMA_generate_common_url($_GET); diff --git a/js/makegrid.js b/js/makegrid.js index 80a62ad..6e16db9 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -314,6 +314,7 @@ db: window.parent.db, table: window.parent.table, token: window.parent.token, + server: window.parent.server, set_col_order: true, col_order: this.colOrder.toString(), table_create_time: this.tableCreateTime diff --git a/libraries/RecentTable.class.php b/libraries/RecentTable.class.php index b42a0aa..4e5bd27 100644 --- a/libraries/RecentTable.class.php +++ b/libraries/RecentTable.class.php @@ -46,11 +46,12 @@ class PMA_RecentTable $this->pma_table = PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) .".". PMA_backquote($GLOBALS['cfg']['Server']['recent']); } - if (! isset($_SESSION['tmp_user_values']['recent_tables'])) { - $_SESSION['tmp_user_values']['recent_tables'] = + $server_id = $GLOBALS['server']; + if (! isset($_SESSION['tmp_user_values']['recent_tables'][$server_id])) { + $_SESSION['tmp_user_values']['recent_tables'][$server_id] = isset($this->pma_table) ? $this->getFromDb() : array(); } - $this->tables =& $_SESSION['tmp_user_values']['recent_tables']; + $this->tables =& $_SESSION['tmp_user_values']['recent_tables'][$server_id]; }
/** @@ -163,9 +164,9 @@ class PMA_RecentTable */ public function getHtmlSelect() { - $html = '<input type="hidden" id="LeftDefaultTabTable" value="' . + $html = '<input type="hidden" name="goto" id="LeftDefaultTabTable" value="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '" />'; - $html .= '<select id="recentTable">'; + $html .= '<select name="table" id="recentTable">'; $html .= $this->getHtmlSelectOption(); $html .= '</select>';
diff --git a/libraries/Table.class.php b/libraries/Table.class.php index cfc28d6..cec5b66 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -1286,15 +1286,16 @@ class PMA_Table */ protected function loadUiPrefs() { + $server_id = $GLOBALS['server']; // set session variable if it's still undefined - if (! isset($_SESSION['tmp_user_values']['table_uiprefs'][$this->db_name][$this->name])) { - $_SESSION['tmp_user_values']['table_uiprefs'][$this->db_name][$this->name] = + if (! isset($_SESSION['tmp_user_values']['table_uiprefs'][$server_id][$this->db_name][$this->name])) { + $_SESSION['tmp_user_values']['table_uiprefs'][$server_id][$this->db_name][$this->name] = // check whether we can get from pmadb (strlen($GLOBALS['cfg']['Server']['pmadb']) && strlen($GLOBALS['cfg']['Server']['table_uiprefs'])) ? $this->getUiPrefsFromDb() : array(); } - $this->uiprefs =& $_SESSION['tmp_user_values']['table_uiprefs'][$this->db_name][$this->name]; + $this->uiprefs =& $_SESSION['tmp_user_values']['table_uiprefs'][$server_id][$this->db_name][$this->name]; }
/** diff --git a/libraries/common.inc.php b/libraries/common.inc.php index a0b8628..0887db8 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -509,10 +509,21 @@ if (PMA_isValid($_REQUEST['db'])) { */ $GLOBALS['table'] = ''; if (PMA_isValid($_REQUEST['table'])) { - // can we strip tags from this? - // only \ and / is not allowed in table names for MySQL - $GLOBALS['table'] = $_REQUEST['table']; - $GLOBALS['url_params']['table'] = $GLOBALS['table']; + // check if specified table contain db name + if (strpos($_REQUEST['table'], '.')) { + $splitted = explode('.', $_REQUEST['table']); + if (count($splitted) == 2) { // make sure the format is "db.table" + $GLOBALS['db'] = $splitted[0]; + $GLOBALS['url_params']['db'] = $GLOBALS['db']; + $GLOBALS['table'] = $splitted[1]; + $GLOBALS['url_params']['table'] = $GLOBALS['table']; + } + } else { + // can we strip tags from this? + // only \ and / is not allowed in table names for MySQL + $GLOBALS['table'] = $_REQUEST['table']; + $GLOBALS['url_params']['table'] = $GLOBALS['table']; + } }
/** diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index d41e245..85eac32 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -1193,6 +1193,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { // name of the class added to all inline editable elements $inline_edit_class = 'inline_edit';
+ // prepare to get the column order, if available + if (PMA_isSelect()) { + $pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']); + $col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER); + } else { + $col_order = false; + } + // Correction University of Virginia 19991216 in the while below // Previous code assumed that all tables have keys, specifically that // the phpMyAdmin GUI should support row delete/edit only for such @@ -1354,14 +1362,6 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// 2. Displays the rows' values
- if (PMA_isSelect()) { - // prepare to get the column order, if available - $pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']); - $col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER); - } else { - $col_order = false; - } - for ($j = 0; $j < $fields_cnt; ++$j) { // assign $i with appropriate column order $i = $col_order ? $col_order[$j] : $j; diff --git a/navigation.php b/navigation.php index af3f138..b63f775 100644 --- a/navigation.php +++ b/navigation.php @@ -194,9 +194,15 @@ require './libraries/navigation_header.inc.php';
// display recently used tables if ($GLOBALS['cfg']['LeftRecentTable'] > 0) { - echo '<div id="recentTableList">'; - echo PMA_RecentTable::getInstance()->getHtmlSelect(); - echo '</div>'; + echo '<div id="recentTableList">' . "\n" + .'<form method="post" action="index.php" target="_parent">' . "\n" + .PMA_generate_common_hidden_inputs() . "\n" + .PMA_RecentTable::getInstance()->getHtmlSelect() + .'<noscript>' . "\n" + .'<input type="submit" name="Go" value="' . __('Go') . '" />' . "\n" + .'</noscript>' . "\n" + .'</form>' . "\n" + .'</div>' . "\n"; }
if (! $GLOBALS['server']) {
hooks/post-receive