includes/clientside/static/acl.js
changeset 335 67bd3121a12e
parent 327 c2f4c900c507
child 336 bfa2e9c23f03
equal deleted inserted replaced
334:c72b545f1304 335:67bd3121a12e
    47           return false;
    47           return false;
    48         }
    48         }
    49         aclDataCache = groups;
    49         aclDataCache = groups;
    50         __aclBuildSelector(groups);
    50         __aclBuildSelector(groups);
    51       }
    51       }
    52     });
    52     }, true);
    53   return false;
    53   return false;
    54 }
    54 }
    55 
    55 
    56 function ajaxACLSwitchToSelector()
    56 function ajaxACLSwitchToSelector()
    57 {
    57 {
    82         thispage = strToPageID(title);
    82         thispage = strToPageID(title);
    83         groups.page_id = thispage[0];
    83         groups.page_id = thispage[0];
    84         groups.namespace = thispage[1];
    84         groups.namespace = thispage[1];
    85         __aclBuildSelector(groups);
    85         __aclBuildSelector(groups);
    86       }
    86       }
    87     });
    87     }, true);
    88 }
    88 }
    89 
    89 
    90 function __aclBuildSelector(groups)
    90 function __aclBuildSelector(groups)
    91 {
    91 {
    92   thispage = strToPageID(title);
    92   thispage = strToPageID(title);
   424             note.appendChild(b);
   424             note.appendChild(b);
   425             note.appendChild(document.createElement('br'));
   425             note.appendChild(document.createElement('br'));
   426             note.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_body', { target_name: data.target_name })));
   426             note.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_body', { target_name: data.target_name })));
   427             note.appendChild(document.createElement('br'));
   427             note.appendChild(document.createElement('br'));
   428             var a = document.createElement('a');
   428             var a = document.createElement('a');
   429             a.href = 'javascript:void(0);';
   429             a.href = '#';
   430             a.onclick = function() { this.parentNode.parentNode.removeChild(this.parentNode); return false; };
   430             a.onclick = function(e) { alert('ONCLICK'); return false; };
   431             a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
   431             a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
   432             note.appendChild(a);
   432             note.appendChild(a);
   433             var a2 = document.createElement('a');
   433             var a2 = document.createElement('a');
   434             a2.href = 'javascript:void(0);';
   434             a2.href = '#';
   435             a2.onclick = function() { killACLManager(); return false; };
   435             a2.onclick = function(e) { alert('ONCLICK'); return false; };
   436             a2.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
   436             a2.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
   437             note.appendChild(a2);
   437             note.appendChild(a2);
   438             document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
   438             document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
   439             if(!document.getElementById(aclManagerID+'_deletelnk'))
   439             if(!document.getElementById(aclManagerID+'_deletelnk'))
   440               document.getElementById(aclManagerID + '_main').innerHTML += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'' + $lang.get('acl_msg_deleterule_confirm') + '\')) __aclDeleteRule(); return false;" style="color: red;">' + $lang.get('acl_lbl_deleterule') + '</a></p>';
   440               document.getElementById(aclManagerID + '_main').innerHTML += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'' + $lang.get('acl_msg_deleterule_confirm') + '\')) __aclDeleteRule(); return false;" style="color: red;">' + $lang.get('acl_lbl_deleterule') + '</a></p>';
   485                 note.appendChild(a);
   485                 note.appendChild(a);
   486                 document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
   486                 document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
   487                 //fadeInfoBoxes();
   487                 //fadeInfoBoxes();
   488                 
   488                 
   489               }
   489               }
   490             });
   490             }, true);
   491             
   491             
   492             break;
   492             break;
   493           case 'error':
   493           case 'error':
   494             alert("Server side processing error:\n"+data.error);
   494             alert("Server side processing error:\n"+data.error);
   495             break;
   495             break;
   499           default:
   499           default:
   500             handle_invalid_json(ajax.responseText);
   500             handle_invalid_json(ajax.responseText);
   501             break;
   501             break;
   502         }
   502         }
   503       }
   503       }
   504     });
   504     }, true);
   505 }
   505 }
   506 
   506 
   507 function __aclBuildGroupsHTML(groups)
   507 function __aclBuildGroupsHTML(groups)
   508 {
   508 {
   509   groups = groups.groups;
   509   groups = groups.groups;