bug #2473127 [display] Deleting rows displays tbl structure, not contents

This commit is contained in:
Marc Delisle
2009-01-01 21:39:21 +00:00
parent 66abeeec2b
commit 3850f6cea8
7 changed files with 16 additions and 17 deletions

View File

@@ -22,6 +22,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug #2461735 [operations] Table operations adds "row_format"
- bug #2445213 [export] Commas for CSV Excel 2008 for Mac
- bug #2397877 [core] ForceSSL and http auth_type
- bug #2473127 [display] Deleting rows displays tbl structure, not contents
3.1.1.0 (2008-12-09)
- patch #2242765 [core] Navi panel server links wrong,

View File

@@ -1500,10 +1500,11 @@ function PMA_localisedDate($timestamp = -1, $format = '')
* @uses array_merge()
* @uses basename()
* @param array $tab array with all options
* @param array $url_params
* @return string html code for one tab, a link if valid otherwise a span
* @access public
*/
function PMA_getTab($tab)
function PMA_getTab($tab, $url_params = array())
{
// default values
$defaults = array(
@@ -1543,9 +1544,7 @@ function PMA_getTab($tab)
// build the link
if (!empty($tab['link'])) {
$tab['link'] = htmlentities($tab['link']);
$tab['link'] = $tab['link'] . $tab['sep']
.(empty($GLOBALS['url_query']) ?
PMA_generate_common_url() : $GLOBALS['url_query']);
$tab['link'] = $tab['link'] . PMA_generate_common_url($url_params);
if (! empty($tab['args'])) {
foreach ($tab['args'] as $param => $value) {
$tab['link'] .= PMA_get_arg_separator('html') . urlencode($param) . '='
@@ -1596,17 +1595,18 @@ function PMA_getTab($tab)
* @uses PMA_getTab()
* @uses htmlentities()
* @param array $tabs one element per tab
* @param string $tag_id id used for the html-tag
* @param array $url_params
* @return string html-code for tab-navigation
*/
function PMA_getTabs($tabs, $tag_id = 'topmenu')
function PMA_getTabs($tabs, $url_params)
{
$tag_id = 'topmenu';
$tab_navigation =
'<div id="' . htmlentities($tag_id) . 'container">' . "\n"
.'<ul id="' . htmlentities($tag_id) . '">' . "\n";
foreach ($tabs as $tab) {
$tab_navigation .= PMA_getTab($tab) . "\n";
$tab_navigation .= PMA_getTab($tab, $url_params) . "\n";
}
$tab_navigation .=

View File

@@ -128,7 +128,8 @@ if (! $db_is_information_schema) {
}
}
echo PMA_getTabs($tabs);
$url_params['db'] = $db;
echo PMA_getTabs($tabs, $url_params);
unset($tabs);
/**

View File

@@ -82,7 +82,7 @@ $tabs['import']['icon'] = 'b_import.png';
$tabs['import']['link'] = 'server_import.php';
$tabs['import']['text'] = $strImport;
echo PMA_getTabs($tabs);
echo PMA_getTabs($tabs, array());
unset($tabs);

View File

@@ -24,10 +24,7 @@ require_once './libraries/bookmark.lib.php';
/**
* Set parameters for links
*/
if (empty($url_query)
|| (isset($_POST['table']) && isset($_POST['new_name']) && $_POST['table'] != $_POST['new_name'])) {
$url_query = PMA_generate_common_url($db, $table);
}
$url_params = array();
$url_params['db'] = $db;
$url_params['table'] = $table;
@@ -126,7 +123,7 @@ if ($table_info_num_rows == 0 && !$tbl_is_view) {
$tabs['search']['warning'] = $strTableIsEmpty;
}
echo PMA_getTabs($tabs);
echo PMA_getTabs($tabs, $url_params);
unset($tabs);
/**

View File

@@ -466,7 +466,7 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
} // end else "didn't ask to see php code"
// No rows returned -> move back to the calling page
if ($num_rows < 1 || $is_affected) {
if (0 == $num_rows || $is_affected) {
if ($is_delete) {
$message = PMA_Message::success('strRowsDeleted');
$message->addParam($num_rows);
@@ -552,7 +552,7 @@ if ($num_rows < 1 || $is_affected) {
require './' . $goto;
} else {
// avoid a redirect loop when last record was deleted
if ('sql.php' == $cfg['DefaultTabTable']) {
if (0 == $num_rows && 'sql.php' == $cfg['DefaultTabTable']) {
$goto = str_replace('sql.php','tbl_structure.php',$goto);
}
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . str_replace('&amp;', '&', $goto) . '&message=' . urlencode($message));

View File

@@ -137,7 +137,7 @@ $tabs['import']['link'] = 'server_import.php';
$tabs['import']['text'] = 'active';
$tabs['import']['class'] = 'active';
echo PMA_getTabs($tabs);
echo PMA_getTabs($tabs, array());
unset($tabs);
if (@file_exists($pmaThemeImage . 'logo_right.png')) {