make use of PMA_Message
return to tbl_operations.php in case of error and do not display empty error page
This commit is contained in:
@@ -26,49 +26,54 @@ $err_url = 'tbl_sql.php?' . PMA_generate_common_url($db, $table);
|
|||||||
*/
|
*/
|
||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
|
|
||||||
|
$goto = $cfg['DefaultTabTable'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A target table name has been sent to this script -> do the work
|
* A target table name has been sent to this script -> do the work
|
||||||
*/
|
*/
|
||||||
if (isset($new_name) && trim($new_name) != '') {
|
if (PMA_isValid($_REQUEST['new_name'])) {
|
||||||
if ($db == $target_db && $table == $new_name) {
|
if ($db == $_REQUEST['target_db'] && $table == $_REQUEST['new_name']) {
|
||||||
$message = (isset($submit_move) ? $strMoveTableSameNames : $strCopyTableSameNames);
|
if (isset($_REQUEST['submit_move'])) {
|
||||||
|
$message = PMA_Message::error('strMoveTableSameNames');
|
||||||
} else {
|
} else {
|
||||||
PMA_Table::moveCopy($db, $table, $target_db, $new_name, $what, isset($submit_move), 'one_table');
|
$message = PMA_Message::error('strCopyTableSameNames');
|
||||||
$GLOBALS['js_include'][] = 'functions.js';
|
}
|
||||||
$message = (isset($submit_move) ? $strMoveTableOK : $strCopyTableOK);
|
$goto = './tbl_operations.php';
|
||||||
$message = sprintf($message, htmlspecialchars($table), htmlspecialchars($new_name));
|
} else {
|
||||||
$reload = 1;
|
PMA_Table::moveCopy($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'],
|
||||||
|
$_REQUEST['what'], isset($_REQUEST['submit_move']), 'one_table');
|
||||||
|
|
||||||
|
if (isset($_REQUEST['submit_move'])) {
|
||||||
|
$message = PMA_Message::success('strMoveTableOK');
|
||||||
|
} else {
|
||||||
|
$message = PMA_Message::success('strCopyTableOK');
|
||||||
|
}
|
||||||
|
$message->addParam(htmlspecialchars($table));
|
||||||
|
$message->addParam(htmlspecialchars($_REQUEST['new_name']));
|
||||||
|
|
||||||
/* Check: Work on new table or on old table? */
|
/* Check: Work on new table or on old table? */
|
||||||
if (isset($submit_move)) {
|
if (isset($_REQUEST['submit_move']) || PMA_isValid($_REQUEST['switch_to_new'])) {
|
||||||
$db = $target_db;
|
$db = $_REQUEST['target_db'];
|
||||||
$table = $new_name;
|
$table = $_REQUEST['new_name'];
|
||||||
} else {
|
|
||||||
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
|
|
||||||
if (isset($switch_to_new) && $switch_to_new == 'true') {
|
|
||||||
PMA_setCookie('pma_switch_to_new', 'true');
|
|
||||||
$db = $target_db;
|
|
||||||
$table = $new_name;
|
|
||||||
} else {
|
|
||||||
PMA_removeCookie('pma_switch_to_new');
|
|
||||||
}
|
}
|
||||||
}
|
$reload = 1;
|
||||||
}
|
|
||||||
require_once './libraries/header.inc.php';
|
|
||||||
} // end is target table name
|
|
||||||
|
|
||||||
|
$disp_query = $sql_query;
|
||||||
|
$disp_message = $message;
|
||||||
|
unset($sql_query, $message);
|
||||||
|
|
||||||
/**
|
$goto = $cfg['DefaultTabTable'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
* No new name for the table!
|
* No new name for the table!
|
||||||
*/
|
*/
|
||||||
else {
|
$message = PMA_Message::error('strTableEmpty');
|
||||||
require_once './libraries/header.inc.php';
|
$goto = './tbl_operations.php';
|
||||||
PMA_mysqlDie($strTableEmpty, '', '', $err_url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Back to the calling script
|
* Back to the calling script
|
||||||
*/
|
*/
|
||||||
|
require $goto;
|
||||||
require './tbl_sql.php';
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user