3 '#Form_EditForm_Type input':{
5 var requiredlogin = $('Form_EditForm_RequiredLogin');
6 var usersTab = $('Form_EditForm').getElementsByTagName('ul')[0].getElementsByTagName('li')[2];
7 if(this.value == 'consultation'){
8 if(requiredlogin.checked != 'checked')
9 requiredlogin.checked = 'checked';
10 usersTab.style.display = 'block';
12 this.recoverGroupID();
13 Element.disable(requiredlogin);
14 }else{ // this.value == 'open'
15 usersTab.style.display = 'none';
16 this.treatGroupIDAs0();
17 Element.enable(requiredlogin);
21 treatGroupIDAs0:function(){
22 var groupIDDiv = $('GroupID');
23 var groupIDs = groupIDDiv.getElementsByTagName('option');
24 for(var i=0; i<groupIDs.length; i++){
25 if(groupIDs[i].selected == true){
26 groupIDs[i].selected = false;
30 _GroupID = groupIDs[i].value;
31 groupIDs[0].selected = true;
34 recoverGroupID:function(){
35 var groupIDDiv = $('GroupID');
36 var groupIDs = groupIDDiv.getElementsByTagName('option');
37 groupIDs[0].selected = false;
38 for(var i=0; i<groupIDs.length; i++){
39 if(groupIDs[i].value == _GroupID){
40 groupIDs[i].selected = true;
48 '#Root_Users #GroupID select':{
50 var source = this.getElementsByTagName('option');
52 for(var i=0; i<source.length; i++){
53 if(source[i].selected == true){
58 var action=getAjaxURL('getMembersByGroup', source[i].value, 'ajax=1');
60 {success: 'MemberList'},
64 onFailure: function(response) {errorMessage("Error getting data", response);},
65 onComplete: function() {Behaviour.apply($('MemberList'));}
74 function getAjaxURL(action, param, getvars) {
75 var base = document.getElementsByTagName('base')[0].href;
76 var url = window.location.href.substr(base.length);
77 if(url.match(/^([^?]+)(\?.*)/)){
80 if(!url.match(/^([^\/]+\/)$/)){
84 if(getvars) getvars = "?" + getvars;
86 return base + url.replace(/^([^\/]+\/).*/, '$1' + action + '/' + param + getvars);
89 Element.disable = function(el){
93 Element.enable = function(el){
97 initialiseCMSIfAForumLoaded = function(){
98 if($('Form_EditForm_Type')) {
99 var types=($('Form_EditForm_Type').getElementsByTagName('input'));
100 for(var i=0; i<types.length; i++){
104 if(types[i].onclick) types[i].onclick();
110 Behaviour.addLoader(function(){
111 if($('Form_EditForm').observeMethod) {
112 $('Form_EditForm').observeMethod('PageLoaded', initialiseCMSIfAForumLoaded());