Skip to content

Commit

Permalink
Clearer confirmation of query
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Mar 14, 2012
1 parent ee4bf16 commit a5b5c2e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
14 changes: 7 additions & 7 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function confirmLink(theLink, theSqlQuery)
return true;
}

var is_confirmed = confirm(PMA_messages['strDoYouReally'] + ' :\n' + theSqlQuery);
var is_confirmed = confirm(PMA_messages['strDoYouReally'] + '\n' + theSqlQuery);
if (is_confirmed) {
if ( $(theLink).hasClass('formLinkSubmit') ) {
var name = 'is_js_confirmed';
Expand Down Expand Up @@ -311,7 +311,7 @@ function confirmQuery(theForm1, sqlQuery1)
var message = (sqlQuery1.value.length > 100)
? sqlQuery1.value.substr(0, 100) + '\n ...'
: sqlQuery1.value;
var is_confirmed = confirm(PMA_messages['strDoYouReally'] + ' :\n' + message);
var is_confirmed = confirm(PMA_messages['strDoYouReally'] + '\n' + message);
// statement is confirmed -> update the
// "is_js_confirmed" form field so the confirm test won't be
// run on the server side and allows to submit the form
Expand Down Expand Up @@ -2268,7 +2268,7 @@ $(document).ready(function() {
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'DROP DATABASE ' + escapeHtml(window.parent.db);
var question = PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + '\n' + 'DROP DATABASE ' + escapeHtml(window.parent.db);

$(this).PMA_confirm(question, $(this).attr('href') ,function(url) {

Expand Down Expand Up @@ -2348,7 +2348,7 @@ $(document).ready(function() {
*/
var button_options = {};
button_options[PMA_messages['strGo']] = function() {

event.preventDefault();

/**
Expand Down Expand Up @@ -2378,7 +2378,7 @@ $(document).ready(function() {
PMA_ajaxShowMessage(data.error, false);
}
}) // end $.post()

}
button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove();}
$.get($(this).attr('href'), {'ajax_request': true}, function(data) {
Expand Down Expand Up @@ -3332,7 +3332,7 @@ $(document).ready(function() {
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDropTableStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'DROP TABLE ' + window.parent.table;
var question = PMA_messages['strDropTableStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + '\n' + 'DROP TABLE ' + window.parent.table;

$(this).PMA_confirm(question, $(this).attr('href') ,function(url) {

Expand Down Expand Up @@ -3363,7 +3363,7 @@ $(document).ready(function() {
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strTruncateTableStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'TRUNCATE TABLE ' + window.parent.table;
var question = PMA_messages['strTruncateTableStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + '\n' + 'TRUNCATE TABLE ' + window.parent.table;

$(this).PMA_confirm(question, $(this).attr('href') ,function(url) {

Expand Down
2 changes: 1 addition & 1 deletion js/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$js_messages['strNoDropDatabases'] = $cfg['AllowUserDropDatabase'] ? '' : __('"DROP DATABASE" statements are disabled.');

/* For confirmations */
$js_messages['strDoYouReally'] = __('Do you really want to ');
$js_messages['strDoYouReally'] = __('Do you really want to execute following query?');
$js_messages['strDropDatabaseStrongWarning'] = __('You are about to DESTROY a complete database!');
$js_messages['strDropTableStrongWarning'] = __('You are about to DESTROY a complete table!');
$js_messages['strTruncateTableStrongWarning'] = __('You are about to TRUNCATE a complete table!');
Expand Down
2 changes: 1 addition & 1 deletion js/server_privileges.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ $(document).ready(function() {
$('#checkbox_drop_users_db').click(function() {
$this_checkbox = $(this);
if ($this_checkbox.is(':checked')) {
var is_confirmed = confirm(PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\nDROP DATABASE');
var is_confirmed = confirm(PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + '\nDROP DATABASE');
if (! is_confirmed) {
$this_checkbox.attr('checked', false);
}
Expand Down
4 changes: 2 additions & 2 deletions js/tbl_structure.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $(document).ready(function() {
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + escapeHtml(curr_table_name) + '` DROP `' + escapeHtml(curr_column_name) + '`';
var question = PMA_messages['strDoYouReally'] + '\n ALTER TABLE `' + escapeHtml(curr_table_name) + '` DROP `' + escapeHtml(curr_column_name) + '`';

$(this).PMA_confirm(question, $(this).attr('href'), function(url) {

Expand Down Expand Up @@ -95,7 +95,7 @@ $(document).ready(function() {
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + escapeHtml(curr_table_name) + '` ADD PRIMARY KEY(`' + escapeHtml(curr_column_name) + '`)';
var question = PMA_messages['strDoYouReally'] + '\n ALTER TABLE `' + escapeHtml(curr_table_name) + '` ADD PRIMARY KEY(`' + escapeHtml(curr_column_name) + '`)';

$(this).PMA_confirm(question, $(this).attr('href'), function(url) {

Expand Down
7 changes: 6 additions & 1 deletion libraries/mult_submits.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@
<?php
} else { ?>
<fieldset class="confirmation">
<legend><?php echo ($what == 'drop_db' ? __('You are about to DESTROY a complete database!') . '&nbsp;' : '') . __('Do you really want to '); ?>:</legend>
<legend><?php
if ($what == 'drop_db') {
echo __('You are about to DESTROY a complete database!') . '&nbsp;';
}
echo __('Do you really want to execute following query?');
?>:</legend>
<tt><?php echo $full_query; ?></tt>
</fieldset>
<fieldset class="tblFooters">
Expand Down
2 changes: 1 addition & 1 deletion sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
<input type="hidden" name="show_query" value="<?php echo isset($show_query) ? PMA_sanitize($show_query, true) : ''; ?>" />
<?php
echo '<fieldset class="confirmation">' . "\n"
.' <legend>' . __('Do you really want to ') . '</legend>'
.' <legend>' . __('Do you really want to execute following query?') . '</legend>'
.' <tt>' . htmlspecialchars($stripped_sql_query) . '</tt>' . "\n"
.'</fieldset>' . "\n"
.'<fieldset class="tblFooters">' . "\n";
Expand Down

0 comments on commit a5b5c2e

Please sign in to comment.