- md5
- 61a3e9e6ed8ff50ec6a862cd22b78133
- sha1
- 6542e4d036206594c1f02ffea7e62ee75148888d
- sha256
- 76a6e341d74f6c1d7567cb0c71cb0a12cb26c962df4ef3cc0f93654e08ae61a7
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
/**
* Function to send Permissions via Ajax to Com-Config Application Controller
*/
function sendPermissions(event) {
// set the icon while storing the values
var icon = document.getElementById('icon_' + this.id);
icon.removeAttribute('class');
icon.setAttribute('style', 'background: url(../media/system/images/modal/spinner.gif); display: inline-block; width: 16px; height: 16px');
//get values and prepare GET-Parameter
var id = this.id.split('_');
var asset = 'not';
var component = getUrlParam('component');
var extension = getUrlParam('extension');
var option = getUrlParam('option');
var view = getUrlParam('view');
var title = component;
var value = this.value;
if (option == 'com_config' && component == false && extension == false)
{
asset = 'com_config';
}
else if (extension == false && view == 'component'){
asset = component;
}
else if (extension != false && view != false){
asset = extension + '.' + view + '.' + getUrlParam('id');
title = document.getElementById('jform_title').value;
}
else if (extension == false && view != false){
asset = option + '.' + view + '.' + getUrlParam('id');
title = document.getElementById('jform_title').value;
}
var data = '&comp=' + asset + '&action=' + id[2] + '&rule=' + id[3] + '&value=' + value + '&title=' + title;
var url = 'index.php?option=com_config&task=config.store&format=raw' + data;
// doing ajax request
jQuery.ajax({
type: 'GET',
url: url,
datatype: 'JSON'
}).success(function (response) {
var element = event.target;
var resp = JSON.parse(response);
if (resp.data == 'true')
{
icon.removeAttribute('style');
icon.setAttribute('class', 'icon-save');
if (value == '1')
{
jQuery(element).parents().next('td').find('span')
.removeClass('label label-important').addClass('label label-success')
.html('Allowed');
}
else
{
jQuery(element).parents().next('td').find('span')
.removeClass('label label-success').addClass('label label-important')
.html('Not Allowed.');
}
}
else
{
var msg = { error: [Joomla.JText._('JLIB_RULES_DATABASE_FAILURE ')] };
Joomla.renderMessages(msg);
icon.removeAttribute('style');
icon.setAttribute('class', 'icon-cancel');
}
if (resp.message == 0)
{
var msg = { error: [Joomla.JText._('JLIB_RULES_SAVE_BEFORE_CHANGE_PERMISSIONS')] };
Joomla.renderMessages(msg);
icon.removeAttribute('style');
icon.setAttribute('class', 'icon-cancel');
}
}).fail(function() {
//set cancel icon on http failure
var msg = { error: [Joomla.JText._('JLIB_RULES_REQUEST_FAILURE')] };
Joomla.renderMessages(msg);
icon.removeAttribute('style');
icon.setAttribute('class', 'icon-cancel');
})
}
/**
* Function to get parameters out of the url
*/
function getUrlParam(variable) {
var query = window.location.search.substring(1);
var vars = query.split('&');
for (var i=0;i<vars.length;i++)
{
var pair = vars[i].split('=');
if (pair[0] == variable)
{
return pair[1];
}
}
return false;
}
No other release has this exact content. See every version of this file.