[+] BO : AdminModules Preferences
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12645 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user