Skip to content

Commit

Permalink
Use PMA_URL_getCommon for generating all params
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Aug 7, 2013
1 parent ae14690 commit b2e1f81
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 21 deletions.
42 changes: 31 additions & 11 deletions libraries/ServerStatusData.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand All @@ -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';
Expand All @@ -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';


Expand Down
11 changes: 8 additions & 3 deletions libraries/insert_edit.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,14 @@ function PMA_getForeignLink($column, $backup_field, $column_name_appendix,
$html_output .= '<a class="foreign_values_anchor" target="_blank" '
. 'onclick="window.open(this.href,\'foreigners\', \'width=640,height=240,'
. 'scrollbars=yes,resizable=yes\'); return false;" '
. 'href="browse_foreigners.php?'
. PMA_URL_getCommon($db, $table) . '&amp;field='
. PMA_escapeJsString(urlencode($column['Field']) . $rownumber_param) . '">'
. 'href="browse_foreigners.php'
. PMA_URL_getCommon(
array(
'db' => $db,
'table' => $table,
'field' => $column['Field'] . $rownumber_param
)
) . '">'
. str_replace("'", "\'", $titles['Browse']) . '</a>';
return $html_output;
}
Expand Down
13 changes: 9 additions & 4 deletions libraries/sql.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. '&amp;sql_query=' . urlencode($sql_query)
. '&amp;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
);
Expand Down
10 changes: 7 additions & 3 deletions sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,13 @@
*/
if ($goto == 'sql.php') {
$is_gotofile = false;
$goto = 'sql.php?'
. PMA_URL_getCommon($db, $table)
. '&amp;sql_query=' . urlencode($sql_query);
$goto = 'sql.php' . PMA_URL_getCommon(
array(
'db' => $db,
'table' => $table,
'sql_query' => $sql_query.
)
);
} // end if


Expand Down

0 comments on commit b2e1f81

Please sign in to comment.