[+] BO : AdminModules Preferences

This commit is contained in:
fSerny
2012-01-24 15:39:10 +00:00
parent ecc56133d2
commit 44389bb4c3
14 changed files with 243 additions and 40 deletions
@@ -36,6 +36,7 @@
var ajaxCurrentIndex = '{$ajaxCurrentIndex}';
var by = '{l s='by'}';
var errorLogin = '{l s='Could not login to Addons'}';
var confirmPreferencesSaved = '{l s='Preferences saved'}';
{if isset($smarty.get.anchor)}var anchor = '{$smarty.get.anchor|htmlentities|replace:'(':''|replace:')':''|replace:'{':''|replace:'}':''}';{else}var anchor = '';{/if}
@@ -279,6 +280,48 @@
// Method to save favorites preferences
$('.moduleFavorite').change(function()
{
var value_pref = $(this).val();
var module_pref = $(this).attr('name');
var action_pref = module_pref.substring(0, 1);
module_pref = module_pref.substring(2, module_pref.length);
try
{
resAjax = $.ajax({
type:"POST",
url : ajaxCurrentIndex,
async: true,
data : {
ajax : "1",
token : token,
controller : "AdminModules",
action : "saveFavoritePreferences",
action_pref : action_pref,
module_pref : module_pref,
value_pref : value_pref
},
success : function(data)
{
// res.status = cache or refresh
if (data == 'OK')
$('#r_' + module_pref).html(confirmPreferencesSaved);
},
error: function(res,textStatus,jqXHR)
{
//jAlert("TECHNICAL ERROR"+res);
}
});
}
catch(e){}
return false;
});
});
{/literal}
</script>