Localised the JavaScript messages. Hooked in checkAddUser() function to
validate the user form. Edit User ajax call is still a work in progress
This commit is contained in:
@@ -128,18 +128,18 @@ $(document).ready(function() {
|
|||||||
.find("#addUsersForm").append('<input type="hidden" name="ajax_request" value="true" />')
|
.find("#addUsersForm").append('<input type="hidden" name="ajax_request" value="true" />')
|
||||||
.end()
|
.end()
|
||||||
.dialog({
|
.dialog({
|
||||||
title: 'Add a New User',
|
title: PMA_messages['strAddNewUser'],
|
||||||
width: 800,
|
width: 800,
|
||||||
modal: true,
|
modal: true,
|
||||||
buttons: {"Create User": function() {
|
buttons: { "Create User" : function() {
|
||||||
|
|
||||||
|
|
||||||
var the_form = $(this).find("#addUsersForm");
|
var the_form = $(this).find("#addUsersForm");
|
||||||
|
|
||||||
/*if(!checkAddUser(the_form)) {
|
if(!checkAddUser($(the_form).get(0))) {
|
||||||
PMA_ajaxShowMessage("Check the form!");
|
PMA_ajaxShowMessage(PMA_messages['strFormIncomplete']);
|
||||||
return false;
|
return false;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
//We also need to post the value of the submit button in order to get this to work correctly
|
//We also need to post the value of the submit button in order to get this to work correctly
|
||||||
$.post($(the_form).attr('action'), $(the_form).serialize() + "&adduser_submit=" + $(this).find("input[name=adduser_submit]").attr('value'), function(data) {
|
$.post($(the_form).attr('action'), $(the_form).serialize() + "&adduser_submit=" + $(this).find("input[name=adduser_submit]").attr('value'), function(data) {
|
||||||
@@ -148,11 +148,11 @@ $(document).ready(function() {
|
|||||||
PMA_ajaxShowMessage(data.message);
|
PMA_ajaxShowMessage(data.message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PMA_ajaxShowMessage("Error in processing request :"+data.error, "7000");
|
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : "+data.error, "7000");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
"Cancel": function() {$(this).dialog("close")}
|
"Cancel" : function() {$(this).dialog("close")}
|
||||||
} //buttons end
|
} //buttons end
|
||||||
}); //dialog options end
|
}); //dialog options end
|
||||||
});
|
});
|
||||||
@@ -166,7 +166,7 @@ $(document).ready(function() {
|
|||||||
$("#reload_privileges_anchor").live("click", function(event) {
|
$("#reload_privileges_anchor").live("click", function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
PMA_ajaxShowMessage("Reloading Privileges");
|
PMA_ajaxShowMessage(PMA_messages['strReloadingPrivileges']);
|
||||||
$.get($(this).attr("href"), {'ajax_request': true}, function(data) {
|
$.get($(this).attr("href"), {'ajax_request': true}, function(data) {
|
||||||
if(data.success == true) {
|
if(data.success == true) {
|
||||||
PMA_ajaxShowMessage(data.message);
|
PMA_ajaxShowMessage(data.message);
|
||||||
@@ -181,7 +181,7 @@ $(document).ready(function() {
|
|||||||
$("#fieldset_delete_user_footer #buttonGo").live('click', function(event) {
|
$("#fieldset_delete_user_footer #buttonGo").live('click', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
PMA_ajaxShowMessage("Removing Selected Users");
|
PMA_ajaxShowMessage(PMA_messages['strRemovingSelectedUsers']);
|
||||||
|
|
||||||
$.post($("#usersForm").attr('action'), $("#usersForm").serialize() + "&delete=" + $(this).attr('value') + "&ajax_request=true", function(data) {
|
$.post($("#usersForm").attr('action'), $("#usersForm").serialize() + "&delete=" + $(this).attr('value') + "&ajax_request=true", function(data) {
|
||||||
if(data.success == true) {
|
if(data.success == true) {
|
||||||
@@ -196,6 +196,24 @@ $(document).ready(function() {
|
|||||||
})
|
})
|
||||||
}) // end Revoke User
|
}) // end Revoke User
|
||||||
|
|
||||||
|
//Edit User
|
||||||
|
$(".edit_user_anchor").live('click', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
PMA_ajaxShowMessage();
|
||||||
|
|
||||||
|
$(this).append('<div id="edit_user_dialog"></div>');
|
||||||
|
$.get($(this).attr('href'), {'ajax_request':true}, function(data) {
|
||||||
|
$("#edit_user_dialog")
|
||||||
|
.append(data)
|
||||||
|
.dialog({
|
||||||
|
width: 900
|
||||||
|
//buttons: { }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
//end Edit user
|
||||||
|
|
||||||
//Export Privileges
|
//Export Privileges
|
||||||
$(".export_user_anchor").live('click', function(event) {
|
$(".export_user_anchor").live('click', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -207,7 +225,7 @@ $(document).ready(function() {
|
|||||||
.prepend(data)
|
.prepend(data)
|
||||||
.dialog({
|
.dialog({
|
||||||
width : 500,
|
width : 500,
|
||||||
buttons: { "Close" : function() {
|
buttons: {"Close" : function() {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}}
|
}}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user