Merge remote-tracking branch 'origin/master'

This commit is contained in:
Michal Čihař 2012-03-26 19:05:17 +02:00
commit edf3d37c1d
6 changed files with 56 additions and 1 deletions

View File

@ -12,6 +12,7 @@ phpMyAdmin - ChangeLog
+ rfe #3488640 Expand table-group in non-light navigation frame if only one
+ Patch #3509360 Contest-3: Option "Truncate table" before "insert"
+ Patch #3506552 Contest-2: Show index information in the data dictionary
+ Patch #3510656 Contest-1: Ignoring foreign keys while dropping tables
3.5.1.0 (not yet released)
- bug #3510784 [edit] Limit clause ignored when sort order is remembered

View File

@ -253,6 +253,28 @@ $(document).ready(function() {
}) // end $.post()
});
/**
* Event handler for 'Foreign Key Checks' disabling option
* in the drop table confirmation form
*/
$(".fkc_switch").click(function(event){
if ($("#fkc_checkbox").attr('checked') == 'checked') {
$("#fkc_checkbox").removeAttr('checked');
$("#fkc_status").html(PMA_messages['strForeignKeyCheckDisabled']);
return;
}
$("#fkc_checkbox").attr('checked','checked');
$("#fkc_status").html(PMA_messages['strForeignKeyCheckEnabled']);
});
$('#fkc_checkbox').change(function () {
if ($(this).attr("checked")) {
$("#fkc_status").html(PMA_messages['strForeignKeyCheckEnabled']);
return;
}
$("#fkc_status").html(PMA_messages['strForeignKeyCheckDisabled']);
}); // End of event handler for 'Foreign Key Check'
/**
* Ajax Event handler for 'Truncate Table'
*

View File

@ -247,6 +247,9 @@ $js_messages['strNo'] = __('No');
$js_messages['strInsertTable'] = __('Insert Table');
$js_messages['strHideIndexes'] = __('Hide indexes');
$js_messages['strShowIndexes'] = __('Show indexes');
$js_messages['strForeignKeyCheck'] = __('Foreign key check:');
$js_messages['strForeignKeyCheckEnabled'] = __('(Enabled)');
$js_messages['strForeignKeyCheckDisabled'] = __('(Disabled)');
/* For db_search.js */
$js_messages['strSearching'] = __('Searching');

View File

@ -294,7 +294,17 @@ if (!empty($submit_mult) && !empty($what)) {
?>:</legend>
<code><?php echo $full_query; ?></code>
</fieldset>
<fieldset class="tblFooters">
<fieldset class="tblFooters"><?php
// Display option to disable foreign key checks while dropping tables
if ($what == 'drop_tbl') { ?>
<div id="foreignkeychk">
<span class="fkc_switch"><?php echo __('Foreign key check:'); ?></span>
<span class="checkbox"><input type="checkbox" name="fk_check" value="1" id="fkc_checkbox"<?php
$default_fk_check_value = (PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'foreign_key_checks\';', 0, 1) == 'ON') ? 1 : 0;
echo ($default_fk_check_value) ? ' checked=\"checked\"' : '' ?>/></span>
<span id="fkc_status" class="fkc_switch"><?php echo ($default_fk_check_value) ? __('(Enabled)') : __('(Disabled)'); ?></span>
</div><?php
} ?>
<input type="submit" name="mult_btn" value="<?php echo __('Yes'); ?>" id="buttonYes" />
<input type="submit" name="mult_btn" value="<?php echo __('No'); ?>" id="buttonNo" />
</fieldset>
@ -464,6 +474,7 @@ if (!empty($submit_mult) && !empty($what)) {
} // end for
if ($query_type == 'drop_tbl') {
$default_fk_check_value = (PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'foreign_key_checks\';', 0, 1) == 'ON') ? 1 : 0;
if (!empty($sql_query)) {
$sql_query .= ';';
} elseif (!empty($sql_query_views)) {
@ -476,7 +487,13 @@ if (!empty($submit_mult) && !empty($what)) {
include './sql.php';
} elseif (!$run_parts) {
PMA_DBI_select_db($db);
if(!isset($_REQUEST['fk_check']) && $query_type == 'drop_tbl') { // for disabling foreign key checks while dropping tables
PMA_DBI_query('SET FOREIGN_KEY_CHECKS = 0;');
}
$result = PMA_DBI_try_query($sql_query);
if(!isset($_REQUEST['fk_check']) && $query_type == 'drop_tbl' && $default_fk_check_value) {
PMA_DBI_query('SET FOREIGN_KEY_CHECKS = 1;');
}
if ($result && !empty($sql_query_views)) {
$sql_query .= ' ' . $sql_query_views . ';';
$result = PMA_DBI_try_query($sql_query_views);

View File

@ -3041,6 +3041,12 @@ h2.active {
color: black;
font-weight: normal;
}
#foreignkeychk {
align:left;
position:absolute;
cursor:pointer;
}
input.btn {
color:#333;

View File

@ -3578,6 +3578,12 @@ h2.active {
color: black;
font-weight: normal;
}
#foreignkeychk {
align:left;
position:absolute;
cursor:pointer;
}
input.btn {
color: #333;