48 |
// **************************************************** |
// **************************************************** |
49 |
var doc; |
var doc; |
50 |
|
|
51 |
function getObjById(id) { |
function getObjById_unsecure(id) { |
52 |
if (document.all) /* MSIE, Konqueror, Opera: --- */ |
if (document.all) /* MSIE, Konqueror, Opera: --- */ |
53 |
return eval("document.all."+id); |
return eval("document.all."+id); |
54 |
else |
else |
59 |
return val; |
return val; |
60 |
} |
} |
61 |
|
|
62 |
|
function getObjById(id) { |
63 |
|
val= getObjById_unsecure(id); |
64 |
|
if (val==undefined) { |
65 |
|
alert("Couldn't access object '"+id+"'! Probably the forms file has errors."); |
66 |
|
}; |
67 |
|
return val; |
68 |
|
} |
69 |
|
|
70 |
function GTypecastF() { |
function GTypecastF() { |
71 |
this.text = function(obj,field,value) { |
this.text = function(obj,field,value) { |
72 |
obj[field]=value; |
obj[field]=value; |
654 |
} |
} |
655 |
this._toHTML=function () { |
this._toHTML=function () { |
656 |
this._init(); |
this._init(); |
657 |
r ='<input type="text" id="'+this.name+'_field"'; |
r ='<input type="text" id="'+this.block+"_"+this.field+'_field"'; |
658 |
r+='" onfocus="form.gotoBlock('+"'"+this._block.name+"');"+'"' |
r+='" onfocus="form.gotoBlock('+"'"+this.block+"');"+'"' |
659 |
r+='>'; |
r+='>'; |
660 |
return r; |
return r; |
661 |
} |
} |
669 |
} |
} |
670 |
this._toHTML=function () { |
this._toHTML=function () { |
671 |
this._init(); |
this._init(); |
672 |
r ='<input type="text" id="'+this.name+'_field"'; |
return ''; |
|
r+='" onfocus="form.gotoBlock('+"'"+this._block.name+"');"+'"' |
|
|
r+='>'; |
|
|
return r; |
|
673 |
} |
} |
674 |
} |
} |
675 |
GFLabel.prototype=new GObj(); |
GFLabel.prototype=new GObj(); |
780 |
return false; |
return false; |
781 |
} |
} |
782 |
// hide login dialog |
// hide login dialog |
783 |
ld=getObjById("loginForm"); |
ld=getObjById_unsecure("loginForm"); |
784 |
if (ld != undefined) { |
if (ld != undefined) { |
785 |
ld.style.visibility = "hidden"; |
ld.style.visibility = "hidden"; |
786 |
} |
} |
933 |
} |
} |
934 |
this.sess.close(this.sessid,0); |
this.sess.close(this.sessid,0); |
935 |
getObjById("status").innerHTML="Logged Out"; |
getObjById("status").innerHTML="Logged Out"; |
936 |
ld=getObjById("loginForm"); |
ld=getObjById_unsecure("loginForm"); |
937 |
if (ld != undefined) { |
if (ld != undefined) { |
938 |
ld.style.visibility = "visible"; |
ld.style.visibility = "visible"; |
939 |
} |
} |
1062 |
|
|
1063 |
// get the corresponding entry element to a field |
// get the corresponding entry element to a field |
1064 |
this.getEntryElem = function(fname) { |
this.getEntryElem = function(fname) { |
1065 |
return getObjById(this.fields[fname]+"_field"); |
return getObjById(this.name+"_"+this.fields[fname]+"_field"); |
1066 |
} |
} |
1067 |
// get the corresponding entry element to a field |
// get the corresponding entry element to a field |
1068 |
this.getEntryName = function(fname) { |
this.getEntryName = function(fname) { |
1070 |
} |
} |
1071 |
// fetch entry value |
// fetch entry value |
1072 |
this.getEntry = function(fname) { |
this.getEntry = function(fname) { |
1073 |
e=getObjById(this.fields[fname]+"_field"); |
e=getObjById_unsecure(this.name+"_"+this.fields[fname]+"_field"); |
1074 |
if (e!=undefined) { |
if (e!=undefined) { |
1075 |
return e.value; |
return e.value; |
1076 |
} else { |
} else { |
1079 |
} |
} |
1080 |
} |
} |
1081 |
this.setEntry = function(fname,newval) { |
this.setEntry = function(fname,newval) { |
1082 |
getObjById(this.fields[fname]+"_field").value=newval; |
getObjById(this.name+"_"+this.fields[fname]+"_field").value=newval; |
1083 |
} |
} |
1084 |
this.init = function() { |
this.init = function() { |
1085 |
// build list of field out of children |
// build list of field out of children |
1173 |
// 2. Update Statusbar / this should possibly moved into |
// 2. Update Statusbar / this should possibly moved into |
1174 |
// the GFForm object |
// the GFForm object |
1175 |
|
|
1176 |
pos=getObjById("pos"); |
pos=getObjById_unsecure("pos"); |
1177 |
|
|
1178 |
// first check if statusbar exists |
// first check if statusbar exists |
1179 |
if (pos==undefined) { |
if (pos==undefined) { |
1330 |
child=this._children[i]; |
child=this._children[i]; |
1331 |
// alert(child._type+" : "+child.name) |
// alert(child._type+" : "+child.name) |
1332 |
if (child._type=='GFEntry') { |
if (child._type=='GFEntry') { |
1333 |
getObjById(child.field+"_field").style.visibility=value; |
getObjById(child.block+"_"+child.field+"_field").style.visibility=value; |
1334 |
}; |
}; |
1335 |
if (child._type=='GFLabel') { |
if (child._type=='GFLabel') { |
1336 |
getObjById(child.name+"_label").style.visibility=value; |
getObjById(child.name+"_label").style.visibility=value; |