The branch, master has been updated
via 6acf4acd254e73d07c6bed2d7dd01519901a6670 (commit)
from 6adfdb3b440b9757d97f3d3c3ef49777656ba347 (commit)
- Log -----------------------------------------------------------------
commit 6acf4acd254e73d07c6bed2d7dd01519901a6670
Author: Atul Pratap Singh <atulpratapsingh05(a)gmail.com>
Date: Sun Mar 27 18:04:08 2011 +0530
auto get back to the Table Operations tab
-----------------------------------------------------------------------
Summary of changes:
sql.php | 4 +++-
tbl_move_copy.php | 15 +++++----------
tbl_operations.php | 46 ++++++++++++++++++++++++++++++++++++----------
3 files changed, 44 insertions(+), 21 deletions(-)
diff --git a/sql.php b/sql.php
index abc1ccf..eb6dc52 100644
--- a/sql.php
+++ b/sql.php
@@ -932,5 +932,7 @@ window.onload = function()
/**
* Displays the footer
*/
-require './libraries/footer.inc.php';
+if(!isset($_REQUEST['table_maintenance'])) {
+ require './libraries/footer.inc.php';
+}
?>
diff --git a/tbl_move_copy.php b/tbl_move_copy.php
index 9f0e229..330edcc 100644
--- a/tbl_move_copy.php
+++ b/tbl_move_copy.php
@@ -45,9 +45,9 @@ if (PMA_isValid($_REQUEST['new_name'])) {
} else {
$message = PMA_Message::error(__('Can\'t copy table to same one!'));
}
- $goto = './tbl_operations.php';
+ $result = false;
} else {
- PMA_Table::moveCopy($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'],
+ $result = PMA_Table::moveCopy($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'],
$_REQUEST['what'], isset($_REQUEST['submit_move']), 'one_table');
if (isset($_REQUEST['submit_move'])) {
@@ -66,23 +66,18 @@ if (PMA_isValid($_REQUEST['new_name'])) {
$table = $_REQUEST['new_name'];
}
$reload = 1;
-
- $disp_query = $sql_query;
- $disp_message = $message;
- unset($sql_query, $message);
-
- $goto = $cfg['DefaultTabTable'];
}
} else {
/**
* No new name for the table!
*/
$message = PMA_Message::error(__('The table name is empty!'));
- $goto = './tbl_operations.php';
+ $result = false;
}
/**
* Back to the calling script
*/
-require $goto;
+$_message = $message;
+unset($message);
?>
diff --git a/tbl_operations.php b/tbl_operations.php
index 8b25c8c..3c8b5dd 100644
--- a/tbl_operations.php
+++ b/tbl_operations.php
@@ -64,6 +64,20 @@ $reread_info = false;
$table_alters = array();
/**
+ * If the table has to be moved to some other database
+ */
+if(isset($_REQUEST['submit_move']) || isset($_REQUEST['submit_copy'])) {
+ $_message = '';
+ require_once './tbl_move_copy.php';
+}
+/**
+ * If the table has to be maintained
+ */
+if(isset($_REQUEST['table_maintenance'])) {
+ require_once './sql.php';
+ unset($result);
+}
+/**
* Updates table comment, type and options if required
*/
if (isset($_REQUEST['submitoptions'])) {
@@ -266,7 +280,7 @@ unset($columns);
<!-- Move table -->
<div id="div_table_rename">
-<form method="post" action="tbl_move_copy.php"
+<form method="post" action="tbl_operations.php"
onsubmit="return emptyFormElements(this, 'new_name')">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<input type="hidden" name="reload" value="1" />
@@ -505,7 +519,7 @@ if (isset($possible_row_formats[$tbl_type])) {
<!-- Copy table -->
<div id="div_table_copy">
-<form method="post" action="tbl_move_copy.php"
+<form method="post" action="tbl_operations.php"
onsubmit="return emptyFormElements(this, 'new_name')">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<input type="hidden" name="reload" value="1" />
@@ -577,9 +591,12 @@ if (isset($possible_row_formats[$tbl_type])) {
if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
if ($is_myisam_or_aria || $is_innodb) {
$this_url_params = array_merge($url_params,
- array('sql_query' => 'CHECK TABLE ' . PMA_backquote($GLOBALS['table'])));
+ array(
+ 'sql_query' => 'CHECK TABLE ' . PMA_backquote($GLOBALS['table']),
+ 'table_maintenance' => 'Go',
+ ));
?>
- <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Check table'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'CHECK_TABLE'); ?>
</li>
@@ -597,9 +614,12 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
}
if ($is_myisam_or_aria || $is_berkeleydb) {
$this_url_params = array_merge($url_params,
- array('sql_query' => 'ANALYZE TABLE ' . PMA_backquote($GLOBALS['table'])));
+ array(
+ 'sql_query' => 'ANALYZE TABLE ' . PMA_backquote($GLOBALS['table']),
+ 'table_maintenance' => 'Go',
+ ));
?>
- <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Analyze table'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'ANALYZE_TABLE');?>
</li>
@@ -607,9 +627,12 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
}
if ($is_myisam_or_aria) {
$this_url_params = array_merge($url_params,
- array('sql_query' => 'REPAIR TABLE ' . PMA_backquote($GLOBALS['table'])));
+ array(
+ 'sql_query' => 'REPAIR TABLE ' . PMA_backquote($GLOBALS['table']),
+ 'table_maintenance' => 'Go',
+ ));
?>
- <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Repair table'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'REPAIR_TABLE'); ?>
</li>
@@ -617,9 +640,12 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
}
if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
$this_url_params = array_merge($url_params,
- array('sql_query' => 'OPTIMIZE TABLE ' . PMA_backquote($GLOBALS['table'])));
+ array(
+ 'sql_query' => 'OPTIMIZE TABLE ' . PMA_backquote($GLOBALS['table']),
+ 'table_maintenance' => 'Go',
+ ));
?>
- <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Optimize table'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE'); ?>
</li>
hooks/post-receive
--
phpMyAdmin