Admin settings updated with add new setting feature

This commit is contained in:
2011-08-28 13:03:31 +01:00
parent 25449d4d3d
commit aec18cb810
7 changed files with 97 additions and 11 deletions

View File

@@ -36,6 +36,7 @@ var rc = {
success: function(d, s, x) {
rc.page.update(d);
rc.dialog.prepare(d);
rc.trigger_all(d);
},
failure: function(x, s, e) {
@@ -93,9 +94,16 @@ var rc = {
},
close: function() {
// Hide the dialog
$("#dialog").hide();
$(".dialogfooterbuttonset").hide();
// Remove the dialog content
$("#dialogcontent").html();
// Hide all buttons
$(".dialogfooterbuttonset").hide();
// Strip all event handlers
$(".dialogfooterbuttonset input[type='button']").unbind('click');
}
},
@@ -136,8 +144,11 @@ var rc = {
},
'add-setting': function(params) {
// TODO
console.log('todo');
rc.ajax.post(base_url + 'ajax/admin/add-setting/name/' + $('#'+params.name).val() + '/type/' + $('#'+params.type).val() + '/');
},
'add_setting_row': function(params) {
$("#settings tbody").append(params.content);
}
},
@@ -159,6 +170,14 @@ var rc = {
}
},
trigger_all: function(params) {
if (params.actions) {
for (var action in params.actions) {
rc.trigger(action, params.actions[action]);
}
}
},
settings: {
init: function() {