diff --git a/js/functions.js b/js/functions.js index caacf54d1..9bc7b6f7e 100755 --- a/js/functions.js +++ b/js/functions.js @@ -1804,11 +1804,11 @@ jQuery.fn.PMA_confirm = function(question, url, callbackFn) { callbackFn.call(this, url); } }; - button_options[PMA_messages['strCancel']] = function() { $(this).dialog("close").remove(); } + button_options[PMA_messages['strCancel']] = function() {$(this).dialog("close").remove();} $('
') .prepend(question) - .dialog({ buttons: button_options }); + .dialog({buttons: button_options}); }; /** @@ -1935,7 +1935,32 @@ $(document).ready(function() { } }) }) + })//end Add Primary Key + + //Drop Event + $('.drop_event_anchor').live('click', function(event) { + event.preventDefault(); + + var curr_event_row = $(this).parents('tr'); + var curr_event_name = $(curr_event_row).children('td:first').text(); + var question = 'DROP EVENT ' + curr_event_name; + + $(this).PMA_confirm(question, $(this).attr('href') , function(url) { + + PMA_ajaxShowMessage(PMA_messages['strDroppingEvent']); + + $.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) { + if(data.success == true) { + PMA_ajaxShowMessage(data.message); + $(curr_event_row).hide("medium").remove(); + } + else { + PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error); + } + }) + }) }) + //end Drop Event }, 'top.frame_content'); //end $(document).ready() for db_structure.php @@ -1953,7 +1978,7 @@ $(document).ready(function() { /* @todo Validate this form! */ var button_options = {}; - button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove(); } + button_options[PMA_messages['strCancel']] = function() {$(this).dialog('close').remove();} PMA_ajaxShowMessage(); $(this).append(''); diff --git a/js/messages.php b/js/messages.php index 687e02826..7f0ea8810 100755 --- a/js/messages.php +++ b/js/messages.php @@ -29,6 +29,7 @@ $js_messages['strNoDropDatabases'] = __('"DROP DATABASE" statements are disabled /* For confirmations */ $js_messages['strDoYouReally'] = __('Do you really want to '); $js_messages['strDropDatabaseStrongWarning'] = __('You are about to DESTROY a complete database!'); +$js_messages['strDroppingEvent'] = __('Dropping Event'); /* For blobstreaming */ $js_messages['strBLOBRepositoryDisableStrongWarning'] = __('You are about to DISABLE a BLOB Repository!'); diff --git a/libraries/db_events.inc.php b/libraries/db_events.inc.php index 33c5d1798..2d0990226 100755 --- a/libraries/db_events.inc.php +++ b/libraries/db_events.inc.php @@ -51,7 +51,7 @@ if ($events) { ($ct%2 == 0) ? 'even' : 'odd', $event['EVENT_NAME'], ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&sql_query=' . urlencode($definition) . '&show_query=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ', - '' . $titles['Drop'] . '', + '' . $titles['Drop'] . '', $event['EVENT_TYPE']); $ct++; }