diff --git a/db_structure.php b/db_structure.php index fb2ecc0a1..dcce45bb7 100644 --- a/db_structure.php +++ b/db_structure.php @@ -266,7 +266,11 @@ foreach ($tables as $keyname => $each_table) { if (! $db_is_information_schema) { if (! empty($each_table['TABLE_ROWS'])) { - $empty_table = ' - href="sql.php?&reload=1&purge=1&sql_query=&message_to_show=" > diff --git a/db_tracking.php b/db_tracking.php index 62f855441..d9a7da35a 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -11,6 +11,7 @@ require_once './libraries/common.inc.php'; //Get some js files needed for Ajax requests $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; +$GLOBALS['js_include'][] = 'db_structure.js'; /** * If we are not in an Ajax request, then do the common work and show the links etc. @@ -129,7 +130,7 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) { - + href="" > | | diff --git a/js/db_structure.js b/js/db_structure.js index 8b529d75d..4affd75bd 100644 --- a/js/db_structure.js +++ b/js/db_structure.js @@ -57,6 +57,7 @@ $(document).ready(function() { * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() + * @see $cfg['AjaxEnable'] */ $(".truncate_table_anchor").live('click', function(event) { event.preventDefault(); @@ -105,6 +106,7 @@ $(document).ready(function() { * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() + * @see $cfg['AjaxEnable'] */ $(".drop_table_anchor").live('click', function(event) { event.preventDefault(); @@ -150,6 +152,7 @@ $(document).ready(function() { * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() + * @see $cfg['AjaxEnable'] */ $('.drop_event_anchor').live('click', function(event) { event.preventDefault(); @@ -188,6 +191,7 @@ $(document).ready(function() { * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() + * @see $cfg['AjaxEnable'] */ $('.drop_procedure_anchor').live('click', function(event) { event.preventDefault(); @@ -217,19 +221,28 @@ $(document).ready(function() { }) // end $.PMA_confirm() }) //end Drop Procedure + /** + * Ajax Event handler for 'Drop tracking' + * + * @uses $.PMA_confirm() + * @uses PMA_ajaxShowMessage() + * @see $cfg['AjaxEnable'] + */ $('.drop_tracking_anchor').live('click', function(event) { event.preventDefault(); + var $anchor = $(this); + /** * @var curr_tracking_row Object containing reference to the current tracked table's row */ - var curr_tracking_row = $(this).parents('tr'); + var curr_tracking_row = $anchor.parents('tr'); /** * @var question String containing the question to be asked for confirmation */ var question = PMA_messages['strDeleteTrackingData']; - $(this).PMA_confirm(question, $(this).attr('href'), function(url) { + $anchor.PMA_confirm(question, $anchor.attr('href'), function(url) { PMA_ajaxShowMessage(PMA_messages['strDeletingTrackingData']); diff --git a/libraries/db_events.inc.php b/libraries/db_events.inc.php index 82ef51f3e..6e93299ac 100644 --- a/libraries/db_events.inc.php +++ b/libraries/db_events.inc.php @@ -25,6 +25,11 @@ if ($events) { __('Type')); $ct=0; $delimiter = '//'; + if ($GLOBALS['cfg']['AjaxEnable']) { + $conditional_class = 'class="drop_event_anchor"'; + } else { + $conditional_class = ''; + } foreach ($events as $event) { // information_schema (at least in MySQL 5.1.22) does not return @@ -45,7 +50,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&db_query_force=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ', - '' . $titles['Drop'] . '', + '' . $titles['Drop'] . '', $event['EVENT_TYPE']); $ct++; } diff --git a/libraries/db_routines.inc.php b/libraries/db_routines.inc.php index d898d0084..648d80cee 100644 --- a/libraries/db_routines.inc.php +++ b/libraries/db_routines.inc.php @@ -37,6 +37,12 @@ if ($routines) { __('Return type')); $ct=0; $delimiter = '//'; + if ($GLOBALS['cfg']['AjaxEnable']) { + $conditional_class = 'class="drop_procedure_anchor"'; + } else { + $conditional_class = ''; + } + foreach ($routines as $routine) { // information_schema (at least in MySQL 5.0.45) @@ -64,6 +70,7 @@ if ($routines) { } else { $sqlDropProc = 'DROP FUNCTION ' . PMA_backquote($routine['SPECIFIC_NAME']); } + echo sprintf(' %s %s @@ -75,7 +82,7 @@ if ($routines) { $sqlDropProc, $routine['ROUTINE_NAME'], ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&sql_query=' . urlencode($definition) . '&show_query=1&db_query_force=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ', - '' . $titles['Drop'] . '', + '' . $titles['Drop'] . '', $routine['ROUTINE_TYPE'], $routine['DTD_IDENTIFIER']); $ct++;