$(function(){
    
    $.extend({
        //Funktion zum überprüfen der Dateirechte 
        checkUserRights : function(options,callbackFnc){
            //Standard Variablen
            defaults = {
                'dataIds' : '0',    
                'action' : 'delete'    
            };
            
            if(typeof options == 'object'){
                opt = $.extend(true, defaults, options);    
            }else{
                opt = defaults; 
            }
             
             
            $.ajax({
			    url : '/ajax/checkUserRights.php',
                type : 'POST',
                data : 'action='+ opt['action'] +'&ids=' + opt['dataIds'],
                dataType : 'json',
                success : function(data){
                    boxyMSG = '';
                    
                    //nicht erlaubte Dateien
                    if(typeof data['notAllowedFiles'] != 'undefined' && data['notAllowedFiles'] != ''){
                        boxyMSG += '<b>'+ _trans['js_categories_notAllowed_files_included'] +'</b><br />' + data['notAllowedFiles'] + '<br /><br />';    
                    }
                    
                    //auf der Website verwendete Dateien
                    if(typeof data['websiteFiles'] != 'undefined' && data['websiteFiles'] != ''){
                        boxyMSG += '<b>'+ _trans['js_categories_websilte_files_included'] +'</b><br />' + data['websiteFiles'] + '<br /><br />';    
                    }
                    
                    //auf der Website verwendete Dateien
                    if(typeof data['protectedFiles'] != 'undefined' && data['protectedFiles'] != ''){
                        boxyMSG += '<b>'+ _trans['js_categories_intern_files_included'] +'</b><br />' + data['protectedFiles'] + '<br /><br />';
                    }
                    
                    data['msg'] = boxyMSG; 
                    
                    if(typeof callbackFnc == 'function'){
                        callbackFnc.call(this, data);
                    }
                }     
			});
        }
    })
            
})
