From 3586dd6408be48b95b2ef0ce45d3b2bbe0b06444 Mon Sep 17 00:00:00 2001 From: ninadsp Date: Sun, 11 Jul 2010 03:33:04 +0530 Subject: [PATCH] Removed inline call to confirmLink() for 'Drop Primary Key/Index' --- js/functions.js | 24 ++++++++++++++++++++++++ js/messages.php | 1 + libraries/Index.class.php | 6 ++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index 3a3b7b553..aa820b5a6 100755 --- a/js/functions.js +++ b/js/functions.js @@ -2010,6 +2010,30 @@ $(document).ready(function() { }) //end Drop Tracking + //Drop Primary Key/Index + $('.drop_primary_key_index_anchor').live('click', function(event) { + event.preventDefault(); + + var curr_row = $(this).parents('tr'); + var question = $(curr_row).children('.drop_primary_key_index_msg').val(); + + $(this).PMA_confirm(question, $(this).attr('href'), function(url) { + + PMA_ajaxShowMessage(PMA_messages['strDroppingPrimaryKeyIndex']); + + $.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) { + if(data.success == true) { + PMA_ajaxShowMessage(data.message); + $(curr_row).hide("medium").remove(); + } + else { + PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error); + } + }) + }) + }) + //end Drop Primary Key/Index + }, 'top.frame_content'); //end $(document).ready() for db_structure.php /** diff --git a/js/messages.php b/js/messages.php index aa16da546..99d144764 100755 --- a/js/messages.php +++ b/js/messages.php @@ -33,6 +33,7 @@ $js_messages['strDroppingEvent'] = __('Dropping Event'); $js_messages['strDroppingProcedure'] = __('Dropping Procedure'); $js_messages['strDeleteTrackingData'] = __('Delete tracking data for this table'); $js_messages['strDeletingTrackingData'] = __('Deleting tracking data'); +$js_messages['strDroppingPrimaryKeyIndex'] = __('Dropping Primary Key/Index'); /* For blobstreaming */ $js_messages['strBLOBRepositoryDisableStrongWarning'] = __('You are about to DISABLE a BLOB Repository!'); diff --git a/libraries/Index.class.php b/libraries/Index.class.php index 66a2114ba..8d7aa9f5a 100755 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -478,10 +478,12 @@ class PMA_Index } $r .= '' - . ' ' + . ' ' . PMA_getIcon('b_drop.png', __('Drop')) . '' . '' . "\n"; + + $r .= ''; } $r .= '' . htmlspecialchars($index->getName()) . '';