?
Path : /home/admin/public_html/old/media/system/js/ |
Current File : /home/admin/public_html/old/media/system/js/permissions.min.js |
function sendPermissions(e){var t=document.getElementById("icon_"+this.id);t.removeAttribute("class"),t.setAttribute("style","background: url(../media/system/images/modal/spinner.gif); display: inline-block; width: 16px; height: 16px");var a=this.id.split("_"),r="not",l=getUrlParam("component"),s=getUrlParam("extension"),o=getUrlParam("option"),i=getUrlParam("view"),n=l,m=this.value;"com_config"==o&&0==l&&0==s?r="root.1":0==s&&"component"==i?r=l:0!=s&&0!=i?(r=s+"."+i+"."+getUrlParam("id"),n=document.getElementById("jform_title").value):0==s&&0!=i&&(r=o+"."+i+"."+getUrlParam("id"),n=document.getElementById("jform_title").value);var c="&comp="+r+"&action="+a[2]+"&rule="+a[3]+"&value="+m+"&title="+n,u="index.php?option=com_config&task=config.store&format=raw"+c;jQuery.ajax({type:"GET",url:u,datatype:"JSON"}).success(function(a){var r=e.target,l=JSON.parse(a);if("true"==l.data)t.removeAttribute("style"),t.setAttribute("class","icon-save"),"1"==m?jQuery(r).parents().next("td").find("span").removeClass("label label-important").addClass("label label-success").html("Allowed"):jQuery(r).parents().next("td").find("span").removeClass("label label-success").addClass("label label-important").html("Not Allowed.");else{var s={error:[Joomla.JText._("JLIB_RULES_DATABASE_FAILURE ")]};Joomla.renderMessages(s),t.removeAttribute("style"),t.setAttribute("class","icon-cancel")}if(0==l.message){var s={error:[Joomla.JText._("JLIB_RULES_SAVE_BEFORE_CHANGE_PERMISSIONS")]};Joomla.renderMessages(s),t.removeAttribute("style"),t.setAttribute("class","icon-cancel")}}).fail(function(){var e={error:[Joomla.JText._("JLIB_RULES_REQUEST_FAILURE")]};Joomla.renderMessages(e),t.removeAttribute("style"),t.setAttribute("class","icon-cancel")})}function getUrlParam(e){for(var t=window.location.search.substring(1),a=t.split("&"),r=0;r<a.length;r++){var l=a[r].split("=");if(l[0]==e)return l[1]}return!1}