simplify logic and rename parameter
This commit is contained in:
10
sql.php
10
sql.php
@@ -178,8 +178,7 @@ if ($do_confirm) {
|
|||||||
<input type="hidden" name="back" value="<?php echo isset($back) ? PMA_sanitize($back, true) : ''; ?>" />
|
<input type="hidden" name="back" value="<?php echo isset($back) ? PMA_sanitize($back, true) : ''; ?>" />
|
||||||
<input type="hidden" name="reload" value="<?php echo isset($reload) ? PMA_sanitize($reload, true) : 0; ?>" />
|
<input type="hidden" name="reload" value="<?php echo isset($reload) ? PMA_sanitize($reload, true) : 0; ?>" />
|
||||||
<input type="hidden" name="purge" value="<?php echo isset($purge) ? PMA_sanitize($purge, true) : ''; ?>" />
|
<input type="hidden" name="purge" value="<?php echo isset($purge) ? PMA_sanitize($purge, true) : ''; ?>" />
|
||||||
<input type="hidden" name="cpurge" value="<?php echo isset($cpurge) ? PMA_sanitize($cpurge, true) : ''; ?>" />
|
<input type="hidden" name="dropped_column" value="<?php echo isset($dropped_column) ? PMA_sanitize($dropped_column, true) : ''; ?>" />
|
||||||
<input type="hidden" name="purgekey" value="<?php echo isset($purgekey) ? PMA_sanitize($purgekey, true) : ''; ?>" />
|
|
||||||
<input type="hidden" name="show_query" value="<?php echo isset($show_query) ? PMA_sanitize($show_query, true) : ''; ?>" />
|
<input type="hidden" name="show_query" value="<?php echo isset($show_query) ? PMA_sanitize($show_query, true) : ''; ?>" />
|
||||||
<?php
|
<?php
|
||||||
echo '<fieldset class="confirmation">' . "\n"
|
echo '<fieldset class="confirmation">' . "\n"
|
||||||
@@ -465,12 +464,11 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
|
|||||||
} // end if ($purge)
|
} // end if ($purge)
|
||||||
|
|
||||||
// If a column gets dropped, do relation magic.
|
// If a column gets dropped, do relation magic.
|
||||||
if (isset($cpurge) && $cpurge == '1' && isset($purgekey)
|
if (isset($dropped_column) && strlen($db) && strlen($table) && !empty($dropped_column)) {
|
||||||
&& strlen($db) && strlen($table) && !empty($purgekey)) {
|
|
||||||
require_once './libraries/relation_cleanup.lib.php';
|
require_once './libraries/relation_cleanup.lib.php';
|
||||||
PMA_relationsCleanupColumn($db, $table, $purgekey);
|
PMA_relationsCleanupColumn($db, $table, $dropped_column);
|
||||||
|
|
||||||
} // end if column PMA_* purge
|
} // end if column was dropped
|
||||||
} // end else "didn't ask to see php code"
|
} // end else "didn't ask to see php code"
|
||||||
|
|
||||||
// No rows returned -> move back to the calling page
|
// No rows returned -> move back to the calling page
|
||||||
|
@@ -392,7 +392,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
|||||||
<?php echo $titles['Change']; ?></a>
|
<?php echo $titles['Change']; ?></a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center" class="drop">
|
<td align="center" class="drop">
|
||||||
<a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&cpurge=1&purgekey=<?php echo urlencode($row['Field']); ?>&zero_rows=<?php echo urlencode(sprintf(__('Column %s has been dropped'), htmlspecialchars($row['Field']))); ?>"
|
<a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&dropped_column=<?php echo urlencode($row['Field']); ?>&zero_rows=<?php echo urlencode(sprintf(__('Column %s has been dropped'), htmlspecialchars($row['Field']))); ?>"
|
||||||
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
|
onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')">
|
||||||
<?php echo $titles['Drop']; ?></a>
|
<?php echo $titles['Drop']; ?></a>
|
||||||
</td>
|
</td>
|
||||||
|
Reference in New Issue
Block a user