Merge remote-tracking branch 'origin/master'

This commit is contained in:
Michal Čihař 2012-04-15 06:11:29 +02:00
commit de9c78b662
2 changed files with 20 additions and 2 deletions

View File

@ -372,6 +372,10 @@ foreach ($tables as $keyname => $each_table) {
$empty_table .= $titles['NoEmpty'];
}
$empty_table .= '</a>';
// truncating views doesn't work
if ($table_is_view) {
$empty_table = '&nbsp;';
}
$drop_query = 'DROP '
. ($table_is_view ? 'VIEW' : 'TABLE')
@ -446,7 +450,9 @@ foreach ($tables as $keyname => $each_table) {
unset($table_part);
}
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>"
<tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row;
echo $table_is_view ? ' is_view' : '';
?>"
id="row_tbl_<?php echo $i; ?>">
<td class="center">
<input type="checkbox" name="selected_tbl[]"

View File

@ -345,10 +345,22 @@ $(document).ready(function() {
* @var curr_table_name String containing the name of the table to be truncated
*/
var curr_table_name = $curr_row.children('th').children('a').text();
/**
* @var is_view Boolean telling if we have a view
*/
var is_view = $curr_row.hasClass('is_view');
/**
* @var question String containing the question to be asked for confirmation
*/
var question = 'DROP TABLE ' + curr_table_name;
var question;
if (! is_view) {
question =
PMA_messages.strDropTableStrongWarning + ' '
+ $.sprintf(PMA_messages.strDoYouReally, 'DROP TABLE ' + curr_table_name);
} else {
question =
$.sprintf(PMA_messages.strDoYouReally, 'DROP VIEW ' + curr_table_name);
}
$this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function(url) {