diff --git a/admin-dev/ajax.php b/admin-dev/ajax.php index ed22a4566..95a11d3c1 100644 --- a/admin-dev/ajax.php +++ b/admin-dev/ajax.php @@ -1022,7 +1022,7 @@ if (Tools::isSubmit('submitAddAccess')) AND `id_profile` = '.(int)$id_profile ); $res = $res?'ok':'error'; - die(Tools::jsonEncode($res)); + die($res); } /* Update Access Modules */ @@ -1056,6 +1056,6 @@ if (Tools::isSubmit('changeModuleAccess')) } $res = $res?'ok':'error'; - die(Tools::jsonEncode($res)); + die($res); } diff --git a/admin-dev/themes/template/access/form.tpl b/admin-dev/themes/template/access/form.tpl index 60d9764a5..66c859480 100644 --- a/admin-dev/themes/template/access/form.tpl +++ b/admin-dev/themes/template/access/form.tpl @@ -65,11 +65,10 @@ { try { - res = $.parseJSON(res); - if (res.result == 'ok') - showSuccessMessage(res.msg); + if (res == 'ok') + showSuccessMessage("{l s='Update successful'}"); else - showErrorMessage(res.msg); + showErrorMessage("{l s='Update error'}"); } catch(e) { @@ -111,11 +110,10 @@ { try { - res = $.parseJSON(res); - if (res.result == "ok") - showSuccessMessage(res.msg); + if (res == 'ok') + showSuccessMessage("{l s='Update successful'}"); else - showErrorMessage(res.msg); + showErrorMessage("{l s='Update error'}"); } catch(e) { diff --git a/css/admin.css b/css/admin.css index 9faff3ae1..cb596552b 100644 --- a/css/admin.css +++ b/css/admin.css @@ -471,6 +471,28 @@ select optgroup option { border-radius:3px; } +#ajax_confirmation .error { + background: #FFBABA url(../img/admin/icon-cancel.png) no-repeat scroll 6px 6px; + border: 1px solid #CC0000; + color:#D8000C; + padding:20px; + position:fixed; + bottom:0; + width:100%; + left:0; +} + +#ajax_confirmation .conf { + background: #DFF2BF url(../img/admin/icon-valid.png) no-repeat scroll 6px 6px; + border: 1px solid #4F8A10; + color:#4F8A10; + padding:20px; + position:fixed; + bottom:0; + width:100%; + left:0; +} + #content .warn { background: #FEEFB3 url(../img/admin/icon-attention.png) no-repeat scroll 6px 6px; border: 1px solid #9e6014; diff --git a/js/admin.js b/js/admin.js index d92756385..29994cafe 100644 --- a/js/admin.js +++ b/js/admin.js @@ -948,7 +948,8 @@ function refreshImagePositions(imageTable) */ function showSuccessMessage(msg) { - $("#ajax_confirmation").show().html("
"+msg+"
").delay(3000).fadeOut("slow"); + $("#ajax_confirmation").show() + .html("
"+msg+"
").delay(3000).fadeOut("slow"); } /** display a warning message in a #ajax_confirmation container @@ -957,7 +958,7 @@ function showSuccessMessage(msg) function showErrorMessage(msg) { $("#ajax_confirmation").show() - .html("
\"ERROR\""+msg+"
"); + .html("
"+msg+"
").delay(3000).fadeOut("slow"); } $(document).ready(function(){