Move to new table after copying cookiefied.

This commit is contained in:
Garvin Hicking
2003-04-02 11:29:16 +00:00
parent e455155b4b
commit 98be3e057a
3 changed files with 25 additions and 4 deletions

View File

@@ -5,6 +5,13 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2003-04-02 Garvin Hicking <me@supergarv.de>
* tbl_move_copy.php3, tbl_properties_operations.php3: Made 'move to
newly created table' depend on a selected checkbox. State of that
checkbox is saved in a cookie.
* lang/*: Added $strSwitchToTable for the above.
* lang/german-*: Translations
2003-04-02 Michal Cihar <nijel@users.sourceforge.net> 2003-04-02 Michal Cihar <nijel@users.sourceforge.net>
* tbl_move_copy.php3: Fixed copying/moving to work after some changes in * tbl_move_copy.php3: Fixed copying/moving to work after some changes in
generated SQL dump, move to newly created table also after copying. generated SQL dump, move to newly created table also after copying.

View File

@@ -381,9 +381,21 @@ if (isset($new_name) && trim($new_name) != '') {
$message = sprintf($message, $source, $target); $message = sprintf($message, $source, $target);
$reload = 1; $reload = 1;
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
/* Work on new table */ /* Check: Work on new table or on old table? */
$db = $target_db; if (isset($submit_move)) {
$table = $new_name; $db = $target_db;
$table = $new_name;
} else {
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
if (isset($switch_to_new) && $switch_to_new == 'true') {
setcookie('pma_switch_to_new', 'true', 0, substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')), '', ($pma_uri_parts['scheme'] == 'https'));
$db = $target_db;
$table = $new_name;
} else {
setcookie('pma_switch_to_new', '', 0, substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')), '', ($pma_uri_parts['scheme'] == 'https'));
// garvin:Keep original table for work.
}
}
include('./header.inc.php3'); include('./header.inc.php3');
} // end is target table name } // end is target table name

View File

@@ -175,7 +175,9 @@ for ($i = 0; $i < $num_dbs; $i++) {
<input type="radio" name="what" value="dataonly" id="radio_copy_dataonly" /> <input type="radio" name="what" value="dataonly" id="radio_copy_dataonly" />
<label for="radio_copy_dataonly"><?php echo $strDataOnly; ?></label>&nbsp;&nbsp;<br /> <label for="radio_copy_dataonly"><?php echo $strDataOnly; ?></label>&nbsp;&nbsp;<br />
<input type="checkbox" name="drop_if_exists" value="true" id="checkbox_drop" /> <input type="checkbox" name="drop_if_exists" value="true" id="checkbox_drop" />
<label for="checkbox_drop"><?php echo $strStrucDrop; ?></label>&nbsp;&nbsp; <label for="checkbox_drop"><?php echo $strStrucDrop; ?></label>&nbsp;&nbsp;<br />
<input type="checkbox" name="switch_to_new" value="true" id="checkbox_switch" <?php echo ((isset($pma_switch_to_new) && $pma_switch_to_new == 'true') ? 'checked="checked"' : ''); ?>/>
<label for="checkbox_switch"><?php echo $strSwitchToTable; ?></label>&nbsp;&nbsp;
</td> </td>
<td align="<?php echo $cell_align_right; ?>" valign="top"> <td align="<?php echo $cell_align_right; ?>" valign="top">
<input type="submit" name="submit_copy" value="<?php echo $strGo; ?>" /> <input type="submit" name="submit_copy" value="<?php echo $strGo; ?>" />