Conditional Ajax for DROP DATABASE
Remove duplicate logic for confirmations
This commit is contained in:
@@ -110,31 +110,6 @@ function selectContent( element, lock, only_once ) {
|
||||
element.select();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a confirmation box before submitting a "DROP DATABASE" query.
|
||||
* This function is called while clicking links
|
||||
*
|
||||
* @param object the link
|
||||
* @param object the sql query to submit
|
||||
*
|
||||
* @return boolean whether to run the query or not
|
||||
*/
|
||||
function confirmLinkDropDB(theLink, theSqlQuery)
|
||||
{
|
||||
// Confirmation is not required in the configuration file
|
||||
// or browser is Opera (crappy js implementation)
|
||||
if (PMA_messages['strDoYouReally'] == '' || typeof(window.opera) != 'undefined') {
|
||||
return true;
|
||||
}
|
||||
|
||||
var is_confirmed = confirm(PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + theSqlQuery);
|
||||
if (is_confirmed) {
|
||||
theLink.href += '&is_js_confirmed=1';
|
||||
}
|
||||
|
||||
return is_confirmed;
|
||||
} // end of the 'confirmLinkDropDB()' function
|
||||
|
||||
/**
|
||||
* Displays a confirmation box before to submit a "DROP/DELETE/ALTER" query.
|
||||
* This function is called while clicking links
|
||||
|
Reference in New Issue
Block a user