remove Options tab
This commit is contained in:
@@ -8,6 +8,8 @@ $Source$
|
||||
2003-06-05 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* Documentation.html: new faq 6.20 about CREATE TEMPORARY TABLES
|
||||
* libraries/sqlparser.lib.php3: bug 716679, parsing of negation operator
|
||||
* tbl_properties_links.php3, tbl_properties_operations.php3: merge
|
||||
the Options tab into Operations
|
||||
|
||||
2003-06-05 Michal Cihar <nijel@users.sourceforge.net>
|
||||
* libraries/display_export.lib.php3, libraries/functions.js: Some
|
||||
|
@@ -73,9 +73,6 @@ echo PMA_printTab($strSelect, $lnk4, $arg4);
|
||||
echo PMA_printTab($strInsert, 'tbl_change.php3', $url_query);
|
||||
echo PMA_printTab($strExport, 'tbl_properties_export.php3', $url_query);
|
||||
echo PMA_printTab($strOperations, 'tbl_properties_operations.php3', $url_query);
|
||||
if (PMA_MYSQL_INT_VERSION >= 32322) {
|
||||
echo PMA_printTab($strOptions, 'tbl_properties_options.php3', $url_query);
|
||||
}
|
||||
echo PMA_printTab($strEmpty, $lnk6, $arg6, $att6);
|
||||
echo PMA_printTab($strDrop, 'sql.php3', $arg7, $att7);
|
||||
echo "\n";
|
||||
|
@@ -17,6 +17,37 @@ $url_query .= '&goto=tbl_properties_operations.php3&back=tbl_properties_
|
||||
require('./libraries/relation.lib.php3');
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
/**
|
||||
* Updates table comment, type and options if required
|
||||
*/
|
||||
if (isset($submitcomment)) {
|
||||
if (empty($prev_comment) || urldecode($prev_comment) != $comment) {
|
||||
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' COMMENT = \'' . PMA_sqlAddslashes($comment) . '\'';
|
||||
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
|
||||
$message = $strSuccess;
|
||||
}
|
||||
}
|
||||
if (isset($submittype)) {
|
||||
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' TYPE = ' . $tbl_type;
|
||||
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
|
||||
$message = $strSuccess;
|
||||
}
|
||||
if (isset($submitoptions)) {
|
||||
$sql_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')
|
||||
. (isset($auto_increment) ? ' auto_increment=' . PMA_sqlAddslashes($auto_increment) : '');
|
||||
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
|
||||
$message = $strSuccess;
|
||||
}
|
||||
|
||||
// Displays a message if a query had been submitted
|
||||
if (isset($message)) {
|
||||
PMA_showMessage($message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reordering the table has been requested by the user
|
||||
@@ -348,9 +379,140 @@ if ($cfgRelation['relwork']) {
|
||||
<br /><br />
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Displays form controls
|
||||
*/
|
||||
if (PMA_MYSQL_INT_VERSION >= 32322) {
|
||||
?>
|
||||
<!-- Table comments -->
|
||||
<li>
|
||||
<form method="post" action="tbl_properties_operations.php3">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<?php echo $strTableComments; ?> :
|
||||
<?php $comment = ereg_replace('; InnoDB free:[^;]*$' , '', ereg_replace('^InnoDB free:[^;]*$', '', $show_comment)); ?>
|
||||
<input type="hidden" name="prev_comment" value="<?php echo urlencode($comment); ?>" />
|
||||
<input type="text" name="comment" maxlength="60" size="30" value="<?php echo htmlspecialchars($comment); ?>" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
|
||||
<input type="submit" name="submitcomment" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
|
||||
</form>
|
||||
</li>
|
||||
|
||||
<!-- Table type -->
|
||||
<?php
|
||||
// modify robbat2 code - staybyte - 11. June 2001
|
||||
$query = 'SHOW VARIABLES LIKE \'have_%\'';
|
||||
$result = PMA_mysql_query($query);
|
||||
if ($result != FALSE && mysql_num_rows($result) > 0) {
|
||||
while ($tmp = PMA_mysql_fetch_array($result)) {
|
||||
if (isset($tmp['Variable_name'])) {
|
||||
switch ($tmp['Variable_name']) {
|
||||
case 'have_bdb':
|
||||
if ($tmp['Value'] == 'YES') {
|
||||
$tbl_bdb = TRUE;
|
||||
}
|
||||
break;
|
||||
case 'have_gemini':
|
||||
if ($tmp['Value'] == 'YES') {
|
||||
$tbl_gemini = TRUE;
|
||||
}
|
||||
break;
|
||||
case 'have_innodb':
|
||||
if ($tmp['Value'] == 'YES') {
|
||||
$tbl_innodb = TRUE;
|
||||
}
|
||||
break;
|
||||
case 'have_isam':
|
||||
if ($tmp['Value'] == 'YES') {
|
||||
$tbl_isam = TRUE;
|
||||
}
|
||||
break;
|
||||
} // end switch
|
||||
} // end if isset($tmp['Variable_name'])
|
||||
} // end while
|
||||
} // end if $result
|
||||
|
||||
mysql_free_result($result);
|
||||
echo "\n";
|
||||
?>
|
||||
<li>
|
||||
<form method="post" action="tbl_properties_operations.php3">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<?php echo $strTableType; ?> :
|
||||
<select name="tbl_type" style="vertical-align: middle">
|
||||
<option value="MYISAM"<?php if ($tbl_type == 'MYISAM') echo ' selected="selected"'; ?>>MyISAM</option>
|
||||
<option value="HEAP"<?php if ($tbl_type == 'HEAP') echo ' selected="selected"'; ?>>Heap</option>
|
||||
<?php
|
||||
$tbl_types = "\n";
|
||||
if (isset($tbl_bdb)) {
|
||||
$tbl_types .= ' <option value="BDB"'
|
||||
. (($tbl_type == 'BERKELEYDB') ? ' selected="selected"' : '')
|
||||
. '>Berkeley DB</option>' . "\n";
|
||||
}
|
||||
if (isset($tbl_gemini)) {
|
||||
$tbl_types .= ' <option value="GEMINI"'
|
||||
. (($tbl_type == 'GEMINI') ? ' selected="selected"' : '')
|
||||
. '>Gemini</option>' . "\n";
|
||||
}
|
||||
if (isset($tbl_innodb)) {
|
||||
$tbl_types .= ' <option value="INNODB"'
|
||||
. (($tbl_type == 'INNODB') ? ' selected="selected"' : '')
|
||||
. '>INNO DB</option>' . "\n";
|
||||
}
|
||||
if (isset($tbl_isam)) {
|
||||
$tbl_types .= ' <option value="ISAM"'
|
||||
. (($tbl_type == 'ISAM') ? ' selected="selected"' : '')
|
||||
. '>ISAM</option>' . "\n";
|
||||
}
|
||||
|
||||
echo $tbl_types;
|
||||
?>
|
||||
<option value="MERGE"<?php if ($tbl_type == 'MRG_MYISAM') echo ' selected="selected"'; ?>>Merge</option>
|
||||
</select>
|
||||
<input type="submit" name="submittype" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
|
||||
<?php echo PMA_showMySQLDocu('Table_types', 'Table_types') . "\n"; ?>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
<!-- Table options -->
|
||||
<li style="vertical-align: top">
|
||||
<table border="0" cellspacing="0" cellpadding="0" style="vertical-align: top">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<form method="post" action="tbl_properties_operations.php3">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="1">
|
||||
<tr>
|
||||
<td align="right"><input type="checkbox" name="pack_keys" id="pack_keys_opt"
|
||||
<?php echo (isset($pack_keys) && $pack_keys == 1) ? ' checked="checked"' : ''; ?> /></td>
|
||||
<td><label for="pack_keys_opt">pack_keys</label> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><input type="checkbox" name="checksum" id="checksum_opt"
|
||||
<?php echo (isset($checksum) && $checksum == 1) ? ' checked="checked"' : ''; ?> /></td>
|
||||
<td><label for="checksum_opt">checksum</label> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><input type="checkbox" name="delay_key_write" id="delay_key_write_opt"
|
||||
<?php echo (isset($delay_key_write) && $delay_key_write == 1) ? ' checked="checked"' : ''; ?> /></td>
|
||||
<td><label for="delay_key_write_opt">delay_key_write</label> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="auto_increment" id="auto_increment_opt" class="textfield" style="width: 30px"
|
||||
<?php echo (isset($auto_increment) && !empty($auto_increment) ? ' value="' . $auto_increment . '"' : ''); ?> /></td>
|
||||
<td valign="top"><label for="auto_increment_opt">auto_increment</label> <input type="submit" name="submitoptions" value="<?php echo $strGo; ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<?php
|
||||
} // end if (PMA_MYSQL_INT_VERSION >= 32322)
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
|
@@ -1,187 +0,0 @@
|
||||
<?php
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
|
||||
/**
|
||||
* Runs common work
|
||||
*/
|
||||
require('./tbl_properties_common.php3');
|
||||
$url_query .= '&goto=tbl_properties_options.php3&back=tbl_properties_options.php3';
|
||||
|
||||
|
||||
/**
|
||||
* Updates table comment, type and options if required
|
||||
*/
|
||||
if (isset($submitcomment)) {
|
||||
if (empty($prev_comment) || urldecode($prev_comment) != $comment) {
|
||||
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' COMMENT = \'' . PMA_sqlAddslashes($comment) . '\'';
|
||||
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
|
||||
$message = $strSuccess;
|
||||
}
|
||||
}
|
||||
if (isset($submittype)) {
|
||||
$sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' TYPE = ' . $tbl_type;
|
||||
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
|
||||
$message = $strSuccess;
|
||||
}
|
||||
if (isset($submitoptions)) {
|
||||
$sql_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')
|
||||
. (isset($auto_increment) ? ' auto_increment=' . PMA_sqlAddslashes($auto_increment) : '');
|
||||
$result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
|
||||
$message = $strSuccess;
|
||||
}
|
||||
|
||||
// Displays a message if a query had been submitted
|
||||
if (isset($message)) {
|
||||
PMA_showMessage($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets tables informations and displays top links
|
||||
*/
|
||||
require('./tbl_properties_table_info.php3');
|
||||
|
||||
/**
|
||||
* Displays form controls
|
||||
*/
|
||||
if (PMA_MYSQL_INT_VERSION >= 32322) {
|
||||
?>
|
||||
<ul>
|
||||
<!-- Table comments -->
|
||||
<li>
|
||||
<form method="post" action="tbl_properties_options.php3">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<?php echo $strTableComments; ?> :
|
||||
<?php $comment = ereg_replace('; InnoDB free:[^;]*$' , '', ereg_replace('^InnoDB free:[^;]*$', '', $show_comment)); ?>
|
||||
<input type="hidden" name="prev_comment" value="<?php echo urlencode($comment); ?>" />
|
||||
<input type="text" name="comment" maxlength="60" size="30" value="<?php echo htmlspecialchars($comment); ?>" class="textfield" style="vertical-align: middle" onfocus="this.select()" />
|
||||
<input type="submit" name="submitcomment" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
|
||||
</form>
|
||||
</li>
|
||||
|
||||
<!-- Table type -->
|
||||
<?php
|
||||
// modify robbat2 code - staybyte - 11. June 2001
|
||||
$query = 'SHOW VARIABLES LIKE \'have_%\'';
|
||||
$result = PMA_mysql_query($query);
|
||||
if ($result != FALSE && mysql_num_rows($result) > 0) {
|
||||
while ($tmp = PMA_mysql_fetch_array($result)) {
|
||||
if (isset($tmp['Variable_name'])) {
|
||||
switch ($tmp['Variable_name']) {
|
||||
case 'have_bdb':
|
||||
if ($tmp['Value'] == 'YES') {
|
||||
$tbl_bdb = TRUE;
|
||||
}
|
||||
break;
|
||||
case 'have_gemini':
|
||||
if ($tmp['Value'] == 'YES') {
|
||||
$tbl_gemini = TRUE;
|
||||
}
|
||||
break;
|
||||
case 'have_innodb':
|
||||
if ($tmp['Value'] == 'YES') {
|
||||
$tbl_innodb = TRUE;
|
||||
}
|
||||
break;
|
||||
case 'have_isam':
|
||||
if ($tmp['Value'] == 'YES') {
|
||||
$tbl_isam = TRUE;
|
||||
}
|
||||
break;
|
||||
} // end switch
|
||||
} // end if isset($tmp['Variable_name'])
|
||||
} // end while
|
||||
} // end if $result
|
||||
|
||||
mysql_free_result($result);
|
||||
echo "\n";
|
||||
?>
|
||||
<li>
|
||||
<form method="post" action="tbl_properties_options.php3">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<?php echo $strTableType; ?> :
|
||||
<select name="tbl_type" style="vertical-align: middle">
|
||||
<option value="MYISAM"<?php if ($tbl_type == 'MYISAM') echo ' selected="selected"'; ?>>MyISAM</option>
|
||||
<option value="HEAP"<?php if ($tbl_type == 'HEAP') echo ' selected="selected"'; ?>>Heap</option>
|
||||
<?php
|
||||
$tbl_types = "\n";
|
||||
if (isset($tbl_bdb)) {
|
||||
$tbl_types .= ' <option value="BDB"'
|
||||
. (($tbl_type == 'BERKELEYDB') ? ' selected="selected"' : '')
|
||||
. '>Berkeley DB</option>' . "\n";
|
||||
}
|
||||
if (isset($tbl_gemini)) {
|
||||
$tbl_types .= ' <option value="GEMINI"'
|
||||
. (($tbl_type == 'GEMINI') ? ' selected="selected"' : '')
|
||||
. '>Gemini</option>' . "\n";
|
||||
}
|
||||
if (isset($tbl_innodb)) {
|
||||
$tbl_types .= ' <option value="INNODB"'
|
||||
. (($tbl_type == 'INNODB') ? ' selected="selected"' : '')
|
||||
. '>INNO DB</option>' . "\n";
|
||||
}
|
||||
if (isset($tbl_isam)) {
|
||||
$tbl_types .= ' <option value="ISAM"'
|
||||
. (($tbl_type == 'ISAM') ? ' selected="selected"' : '')
|
||||
. '>ISAM</option>' . "\n";
|
||||
}
|
||||
|
||||
echo $tbl_types;
|
||||
?>
|
||||
<option value="MERGE"<?php if ($tbl_type == 'MRG_MYISAM') echo ' selected="selected"'; ?>>Merge</option>
|
||||
</select>
|
||||
<input type="submit" name="submittype" value="<?php echo $strGo; ?>" style="vertical-align: middle" />
|
||||
<?php echo PMA_showMySQLDocu('Table_types', 'Table_types') . "\n"; ?>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
<!-- Table options -->
|
||||
<li style="vertical-align: top">
|
||||
<table border="0" cellspacing="0" cellpadding="0" style="vertical-align: top">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<form method="post" action="tbl_properties_options.php3">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="1">
|
||||
<tr>
|
||||
<td align="right"><input type="checkbox" name="pack_keys" id="pack_keys_opt"
|
||||
<?php echo (isset($pack_keys) && $pack_keys == 1) ? ' checked="checked"' : ''; ?> /></td>
|
||||
<td><label for="pack_keys_opt">pack_keys</label> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><input type="checkbox" name="checksum" id="checksum_opt"
|
||||
<?php echo (isset($checksum) && $checksum == 1) ? ' checked="checked"' : ''; ?> /></td>
|
||||
<td><label for="checksum_opt">checksum</label> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><input type="checkbox" name="delay_key_write" id="delay_key_write_opt"
|
||||
<?php echo (isset($delay_key_write) && $delay_key_write == 1) ? ' checked="checked"' : ''; ?> /></td>
|
||||
<td><label for="delay_key_write_opt">delay_key_write</label> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="auto_increment" id="auto_increment_opt" class="textfield" style="width: 30px"
|
||||
<?php echo (isset($auto_increment) && !empty($auto_increment) ? ' value="' . $auto_increment . '"' : ''); ?> /></td>
|
||||
<td valign="top"><label for="auto_increment_opt">auto_increment</label> <input type="submit" name="submitoptions" value="<?php echo $strGo; ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<?php
|
||||
} // end if (PMA_MYSQL_INT_VERSION >= 32322)
|
||||
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
echo "\n";
|
||||
require('./footer.inc.php3');
|
||||
?>
|
Reference in New Issue
Block a user