From 505884174bfcf223d111b0f24975dbb658846960 Mon Sep 17 00:00:00 2001 From: ninadsp Date: Sun, 11 Jul 2010 03:14:02 +0530 Subject: [PATCH] Removed inline call to confirmLink() for 'Delete Tracking action'. --- db_tracking.php | 14 ++++++++++++-- js/functions.js | 24 ++++++++++++++++++++++++ js/messages.php | 2 ++ libraries/db_info.inc.php | 4 +++- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/db_tracking.php b/db_tracking.php index 68faafec3..806da83be 100755 --- a/db_tracking.php +++ b/db_tracking.php @@ -11,7 +11,12 @@ require_once './libraries/common.inc.php'; require_once './libraries/Table.class.php'; -require './libraries/db_common.inc.php'; +//Get some js files needed for Ajax +$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; + +if($GLOBALS['is_ajax_request'] != true) { + require './libraries/db_common.inc.php'; +} $url_query .= '&goto=tbl_tracking.php&back=db_tracking.php'; // Get the database structure @@ -25,6 +30,11 @@ require_once './libraries/relation.lib.php'; // (here, do not use $_REQUEST['db] as it can be crafted) if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) { PMA_Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']); + + if($GLOBALS['is_ajax_request'] == true) { + $message = PMA_Message::success(); + PMA_ajaxResponse($message, true); + } } // Get tracked data about the database @@ -117,7 +127,7 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) { - + | | diff --git a/js/functions.js b/js/functions.js index e204041ed..3a3b7b553 100755 --- a/js/functions.js +++ b/js/functions.js @@ -1986,6 +1986,30 @@ $(document).ready(function() { }) //end Drop Procedure + //Drop Tracking + $('.drop_tracking_anchor').live('click', function(event) { + event.preventDefault(); + + var curr_tracking_row = $(this).parents('tr'); + var question = PMA_messages['strDeleteTrackingData']; + + $(this).PMA_confirm(question, $(this).attr('href'), function(url) { + + PMA_ajaxShowMessage(PMA_messages['strDeletingTrackingData']); + + $.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) { + if(data.success == true) { + PMA_ajaxShowMessage(data.message); + $(curr_tracking_row).hide("medium").remove(); + } + else { + PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error); + } + }) + }) + }) + //end Drop Tracking + }, 'top.frame_content'); //end $(document).ready() for db_structure.php /** diff --git a/js/messages.php b/js/messages.php index 23ae1444d..aa16da546 100755 --- a/js/messages.php +++ b/js/messages.php @@ -31,6 +31,8 @@ $js_messages['strDoYouReally'] = __('Do you really want to '); $js_messages['strDropDatabaseStrongWarning'] = __('You are about to DESTROY a complete database!'); $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'); /* For blobstreaming */ $js_messages['strBLOBRepositoryDisableStrongWarning'] = __('You are about to DISABLE a BLOB Repository!'); diff --git a/libraries/db_info.inc.php b/libraries/db_info.inc.php index 20dff36ba..4f782f9e7 100755 --- a/libraries/db_info.inc.php +++ b/libraries/db_info.inc.php @@ -272,5 +272,7 @@ unset($each_table, $tbl_group_sql, $db_info_result); /** * Displays top menu links */ -require './libraries/db_links.inc.php'; +if($GLOBALS['is_ajax_request'] != true) { + require './libraries/db_links.inc.php'; +} ?>