Start "stay on the sub-pages" work for table properties
This commit is contained in:
@@ -4,15 +4,6 @@
|
|||||||
|
|
||||||
require('./tbl_properties_common.php3');
|
require('./tbl_properties_common.php3');
|
||||||
|
|
||||||
/**
|
|
||||||
* Drop multiple fields if required
|
|
||||||
*/
|
|
||||||
if ((!empty($submit_mult) && isset($selected_fld))
|
|
||||||
|| isset($mult_btn)) {
|
|
||||||
$action = 'tbl_properties.php3';
|
|
||||||
include('./mult_submits.inc.php3');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the query to be displayed in the query textarea
|
* Defines the query to be displayed in the query textarea
|
||||||
@@ -35,39 +26,6 @@ if (isset($show_query) && $show_query == 'y') {
|
|||||||
unset($sql_query);
|
unset($sql_query);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates table type, comment and order if required
|
|
||||||
*/
|
|
||||||
if (isset($submitcomment)) {
|
|
||||||
if (get_magic_quotes_gpc()) {
|
|
||||||
$comment = stripslashes($comment);
|
|
||||||
}
|
|
||||||
if (empty($prev_comment) || urldecode($prev_comment) != $comment) {
|
|
||||||
$local_query = 'ALTER TABLE ' . PMA_backquote($table) . ' COMMENT = \'' . PMA_sqlAddslashes($comment) . '\'';
|
|
||||||
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($submittype)) {
|
|
||||||
$local_query = 'ALTER TABLE ' . PMA_backquote($table) . ' TYPE = ' . $tbl_type;
|
|
||||||
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
|
||||||
}
|
|
||||||
if (isset($submitorderby) && !empty($order_field)) {
|
|
||||||
$order_field = PMA_backquote(urldecode($order_field));
|
|
||||||
$local_query = 'ALTER TABLE ' . PMA_backquote($table) . 'ORDER BY ' . $order_field;
|
|
||||||
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update table options
|
|
||||||
*/
|
|
||||||
if (isset($submitoptions)) {
|
|
||||||
$local_query = 'ALTER TABLE ' . PMA_backquote($table)
|
|
||||||
. (isset($pack_keys) ? ' pack_keys=1': ' pack_keys=0')
|
|
||||||
. (isset($checksum) ? ' checksum=1': ' checksum=0')
|
|
||||||
. (isset($delay_key_write) ? ' delay_key_write=1': ' delay_key_write=0');
|
|
||||||
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Work on the table
|
* Work on the table
|
||||||
*/
|
*/
|
||||||
@@ -161,6 +119,8 @@ echo "\n";
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the footer
|
* Displays the footer
|
||||||
*/
|
*/
|
||||||
|
@@ -52,7 +52,7 @@ if ($num_rows > 0) {
|
|||||||
<b><?php echo $strOptions; ?></b></a>
|
<b><?php echo $strOptions; ?></b></a>
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
<a href="sql.php3?<?php echo ereg_replace('tbl_properties.php3$', 'db_details.php3', $url_query); ?>&back=tbl_properties.php3&reload=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
|
<a href="sql.php3?<?php echo ereg_replace('tbl_properties.php3$', 'db_details.php3', $url_query); ?>&back=tbl_properties' . $sub_part . '.php3&reload=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
|
||||||
class="drop" onclick="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
|
class="drop" onclick="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
|
||||||
<b><?php echo $strDrop; ?></b></a>
|
<b><?php echo $strDrop; ?></b></a>
|
||||||
]
|
]
|
||||||
|
@@ -3,15 +3,35 @@
|
|||||||
|
|
||||||
|
|
||||||
require('./tbl_properties_common.php3');
|
require('./tbl_properties_common.php3');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reordering the table has been requested by the user
|
||||||
|
*/
|
||||||
|
if (isset($submitorderby) && !empty($order_field)) {
|
||||||
|
$order_field = PMA_backquote(urldecode($order_field));
|
||||||
|
$local_query = 'ALTER TABLE ' . PMA_backquote($table) . 'ORDER BY ' . $order_field;
|
||||||
|
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
||||||
|
} // end if
|
||||||
|
|
||||||
|
|
||||||
require('./tbl_properties_table_info.php3');
|
require('./tbl_properties_table_info.php3');
|
||||||
|
|
||||||
// Get columns names
|
|
||||||
|
/**
|
||||||
|
* Get columns names
|
||||||
|
*/
|
||||||
$local_query = 'SHOW COLUMNS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
|
$local_query = 'SHOW COLUMNS FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
|
||||||
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
|
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
|
||||||
for ($i = 0; $row = mysql_fetch_array($result); $i++) {
|
for ($i = 0; $row = mysql_fetch_array($result); $i++) {
|
||||||
$columns[$i] = $row['Field'];
|
$columns[$i] = $row['Field'];
|
||||||
}
|
}
|
||||||
mysql_free_result($result);
|
mysql_free_result($result);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays the page
|
||||||
|
*/
|
||||||
?>
|
?>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
@@ -20,7 +40,7 @@ if (PMA_MYSQL_INT_VERSION >= 32334) {
|
|||||||
?>
|
?>
|
||||||
<!-- Order the table -->
|
<!-- Order the table -->
|
||||||
<li>
|
<li>
|
||||||
<form method="post" action="tbl_properties.php3">
|
<form method="post" action="tbl_properties_operations.php3">
|
||||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||||
@@ -302,13 +322,6 @@ if (!empty($cfg['Server']['relation'])) {
|
|||||||
<br /><br />
|
<br /><br />
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Deletes the table -->
|
|
||||||
<li>
|
|
||||||
<a href="sql.php3?<?php echo ereg_replace('tbl_properties.php3$', 'db_details.php3', $url_query); ?>&back=tbl_properties.php3&reload=1&sql_query=<?php echo urlencode('DROP TABLE ' . PMA_backquote($table)); ?>&zero_rows=<?php echo urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); ?>"
|
|
||||||
onclick="return confirmLink(this, 'DROP TABLE <?php echo PMA_jsFormat($table); ?>')">
|
|
||||||
<?php echo $strDropTable; ?></a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@@ -6,6 +6,33 @@
|
|||||||
* Gets tables informations and displays top links
|
* Gets tables informations and displays top links
|
||||||
*/
|
*/
|
||||||
require('./tbl_properties_common.php3');
|
require('./tbl_properties_common.php3');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates table comment, type and options if required
|
||||||
|
*/
|
||||||
|
if (isset($submitcomment)) {
|
||||||
|
if (get_magic_quotes_gpc()) {
|
||||||
|
$comment = stripslashes($comment);
|
||||||
|
}
|
||||||
|
if (empty($prev_comment) || urldecode($prev_comment) != $comment) {
|
||||||
|
$local_query = 'ALTER TABLE ' . PMA_backquote($table) . ' COMMENT = \'' . PMA_sqlAddslashes($comment) . '\'';
|
||||||
|
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isset($submittype)) {
|
||||||
|
$local_query = 'ALTER TABLE ' . PMA_backquote($table) . ' TYPE = ' . $tbl_type;
|
||||||
|
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
||||||
|
}
|
||||||
|
if (isset($submitoptions)) {
|
||||||
|
$local_query = 'ALTER TABLE ' . PMA_backquote($table)
|
||||||
|
. (isset($pack_keys) ? ' pack_keys=1': ' pack_keys=0')
|
||||||
|
. (isset($checksum) ? ' checksum=1': ' checksum=0')
|
||||||
|
. (isset($delay_key_write) ? ' delay_key_write=1': ' delay_key_write=0');
|
||||||
|
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
require('./tbl_properties_table_info.php3');
|
require('./tbl_properties_table_info.php3');
|
||||||
|
|
||||||
|
|
||||||
@@ -17,7 +44,7 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
|
|||||||
<ul>
|
<ul>
|
||||||
<!-- Table comments -->
|
<!-- Table comments -->
|
||||||
<li>
|
<li>
|
||||||
<form method="post" action="tbl_properties.php3">
|
<form method="post" action="tbl_properties_options.php3">
|
||||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||||
@@ -67,7 +94,7 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
|
|||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<form method="post" action="tbl_properties.php3">
|
<form method="post" action="tbl_properties_options.php3">
|
||||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||||
@@ -92,7 +119,7 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
|
|||||||
<table border="0" cellspacing="0" cellpadding="0">
|
<table border="0" cellspacing="0" cellpadding="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<form method="post" action="tbl_properties.php3">
|
<form method="post" action="tbl_properties_options.php3">
|
||||||
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||||
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
<input type="hidden" name="db" value="<?php echo $db; ?>" />
|
||||||
|
@@ -9,7 +9,7 @@ require('./tbl_properties_common.php3');
|
|||||||
*/
|
*/
|
||||||
if ((!empty($submit_mult) && isset($selected_fld))
|
if ((!empty($submit_mult) && isset($selected_fld))
|
||||||
|| isset($mult_btn)) {
|
|| isset($mult_btn)) {
|
||||||
$action = 'tbl_properties.php3';
|
$action = 'tbl_properties_structure.php3';
|
||||||
include('./mult_submits.inc.php3');
|
include('./mult_submits.inc.php3');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,6 +257,7 @@ if ($fields_cnt > 20) {
|
|||||||
<!-- Browse links -->
|
<!-- Browse links -->
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
$sub_part = '_structure';
|
||||||
include('./tbl_properties_links.php3');
|
include('./tbl_properties_links.php3');
|
||||||
} // end if ($fields_cnt > 20)
|
} // end if ($fields_cnt > 20)
|
||||||
echo "\n\n";
|
echo "\n\n";
|
||||||
@@ -480,7 +481,6 @@ echo "\n";
|
|||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Work on the table
|
* Work on the table
|
||||||
@@ -521,17 +521,17 @@ unset($aryFields);
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($cfg['Server']['relation']) {
|
if ($cfg['Server']['relation']) {
|
||||||
?>
|
?>
|
||||||
<!-- Work on Relations -->
|
<!-- Work on Relations -->
|
||||||
<li>
|
<li>
|
||||||
<div style="margin-bottom: 10px"><a href="tbl_relation.php3?<?php
|
<div style="margin-bottom: 10px">
|
||||||
echo $url_query; ?>"><?php echo $strRelationView; ?></a></div>
|
<a href="tbl_relation.php3?<?php echo $url_query; ?>"><?php echo $strRelationView; ?></a>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<?php
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@@ -39,6 +39,7 @@ mysql_free_result($result);
|
|||||||
* Displays top menu links
|
* Displays top menu links
|
||||||
*/
|
*/
|
||||||
echo '<!-- first browse links -->' . "\n";
|
echo '<!-- first browse links -->' . "\n";
|
||||||
|
$sub_part = '_table_info';
|
||||||
require('./tbl_properties_links.php3');
|
require('./tbl_properties_links.php3');
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user