From b2e1f81c0c58ca645852cb213cbb483bd038a87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 7 Aug 2013 16:52:37 +0200 Subject: [PATCH] Use PMA_URL_getCommon for generating all params --- libraries/ServerStatusData.class.php | 42 ++++++++++++++++++++-------- libraries/insert_edit.lib.php | 11 ++++++-- libraries/sql.lib.php | 13 ++++++--- sql.php | 10 +++++-- 4 files changed, 55 insertions(+), 21 deletions(-) diff --git a/libraries/ServerStatusData.class.php b/libraries/ServerStatusData.class.php index 48fb41eebccb..bcc790fdc220 100644 --- a/libraries/ServerStatusData.class.php +++ b/libraries/ServerStatusData.class.php @@ -209,17 +209,28 @@ public function __construct() // variable or section name => (name => url) $links = array(); - $links['table'][__('Flush (close) all tables')] - = $this->selfUrl . '?flush=TABLES&' . PMA_URL_getCommon(); + $links['table'][__('Flush (close) all tables')] = $this->selfUrl + . PMA_URL_getCommon( + array( + 'flush' => 'TABLES' + ) + ); $links['table'][__('Show open tables')] - = 'sql.php?sql_query=' . urlencode('SHOW OPEN TABLES') . - '&goto=' . $this->selfUrl . '&' . PMA_URL_getCommon(); + = 'sql.php' . PMA_URL_getCommon( + array( + 'sql_query' => 'SHOW OPEN TABLES', + 'goto' => $this->selfUrl, + ) + ); if ($GLOBALS['server_master_status']) { $links['repl'][__('Show slave hosts')] - = 'sql.php?sql_query=' . urlencode('SHOW SLAVE HOSTS') - . '&goto=' . $this->selfUrl . '&' - . PMA_URL_getCommon(); + = 'sql.php' . PMA_URL_getCommon( + array( + 'sql_query' => 'SHOW SLAVE HOSTS', + 'goto' => $this->selfUrl, + ) + ); $links['repl'][__('Show master status')] = '#replication_master'; } if ($GLOBALS['server_slave_status']) { @@ -229,8 +240,12 @@ public function __construct() $links['repl']['doc'] = 'replication'; $links['qcache'][__('Flush query cache')] - = $this->selfUrl . '?flush=' . urlencode('QUERY CACHE') . '&' . - PMA_URL_getCommon(); + = $this->selfUrl + . PMA_URL_getCommon( + array( + 'flush' => 'QUERY CACHE' + ) + ); $links['qcache']['doc'] = 'query_cache'; $links['threads']['doc'] = 'mysql_threads'; @@ -244,8 +259,13 @@ public function __construct() $links['innodb'][__('Variables')] = 'server_engines.php?engine=InnoDB&' . PMA_URL_getCommon(); $links['innodb'][__('InnoDB Status')] - = 'server_engines.php?engine=InnoDB&page=Status&' . - PMA_URL_getCommon(); + = 'server_engines.php' + . PMA_URL_getCommon( + array( + 'engine' => 'InnoDB', + 'page' => 'Status' + ) + ); $links['innodb']['doc'] = 'innodb'; diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 083e78b9a0c3..a2226ea4c4b7 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -733,9 +733,14 @@ function PMA_getForeignLink($column, $backup_field, $column_name_appendix, $html_output .= '' + . 'href="browse_foreigners.php' + . PMA_URL_getCommon( + array( + 'db' => $db, + 'table' => $table, + 'field' => $column['Field'] . $rownumber_param + ) + ) . '">' . str_replace("'", "\'", $titles['Browse']) . ''; return $html_output; } diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index cac8b0b2d62d..82605050a928 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -729,10 +729,15 @@ function PMA_getHtmlForBookmark($disp_mode, $cfgBookmark, $sql_query, $db, $tabl && ! empty($sql_query) ) { $html = "\n"; - $goto = 'sql.php?' - . PMA_URL_getCommon($db, $table) - . '&sql_query=' . urlencode($sql_query) - . '&id_bookmark=1'; + $goto = 'sql.php' + . PMA_URL_getCommon( + array( + 'db' => $db, + 'table' => $table, + 'sql_query' => $sql_query, + 'id_bookmark'=> 1, + ) + ) $bkm_sql_query = urlencode( isset($complete_query) ? $complete_query : $sql_query ); diff --git a/sql.php b/sql.php index 039da0366ff9..61f5b23d7db1 100644 --- a/sql.php +++ b/sql.php @@ -164,9 +164,13 @@ */ if ($goto == 'sql.php') { $is_gotofile = false; - $goto = 'sql.php?' - . PMA_URL_getCommon($db, $table) - . '&sql_query=' . urlencode($sql_query); + $goto = 'sql.php' . PMA_URL_getCommon( + array( + 'db' => $db, + 'table' => $table, + 'sql_query' => $sql_query. + ) + ); } // end if