version 1.4, 2001/07/01 02:21:18
|
version 1.6, 2001/07/03 22:37:37
|
Line 13
|
Line 13
|
# |
# |
# 3/1 Gerd Kortemeyer) |
# 3/1 Gerd Kortemeyer) |
# |
# |
# 03/03/01,06/15,06/25,06/26,06/30 Gerd Kortemeyer |
# 03/03/01,06/15,06/25,06/26,06/30,07/02,07/03 Gerd Kortemeyer |
# |
# |
package Apache::lonratparms; |
package Apache::lonratparms; |
|
|
Line 47 sub handler {
|
Line 47 sub handler {
|
|
|
my %content; |
my %content; |
my %type; |
my %type; |
|
my %display; |
my %value; |
my %value; |
|
|
map { |
map { |
if ($_=~/^parameter\_/) { |
if ($_=~/^parameter\_/) { |
$content{$_}=&Apache::lonnet::metadata($uri,$_); |
$content{$_}=&Apache::lonnet::metadata($uri,$_); |
|
$type{$_}=&Apache::lonnet::metadata($uri,$_.'.type'); |
|
$display{$_}=&Apache::lonnet::metadata($uri,$_.'.display'); |
} |
} |
} split(/\,/,&Apache::lonnet::metadata($uri,'keys')); |
} split(/\,/,&Apache::lonnet::metadata($uri,'keys')); |
|
|
Line 59 sub handler {
|
Line 62 sub handler {
|
|
|
map { |
map { |
my ($ptype,$pname,$pvalue)=split(/\_\_\_/,$_); |
my ($ptype,$pname,$pvalue)=split(/\_\_\_/,$_); |
$type{$pname}=$ptype; |
unless ($type{$pname}) { $type{$pname}=$ptype; } |
$value{$pname}=$pvalue; |
$value{$pname}=$pvalue; |
} split(/\:/,$ENV{'form.params'}); |
} split(/\:/,$ENV{'form.parms'}); |
|
|
# --------------------------------------------------- Print input screen header |
# --------------------------------------------------- Print input screen header |
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
Line 71 sub handler {
|
Line 74 sub handler {
|
<script language="JavaScript"> |
<script language="JavaScript"> |
function setparms() { |
function setparms() { |
ENDHEADER |
ENDHEADER |
$r->print('opener.objparms['.$ENV{'form.resid'}.']="";'); |
$r->print('var colon=""; opener.objparms['.$ENV{'form.resid'}.']="";'); |
map { |
map { |
$r->print("\nif (document.parameters.def_".$_. |
$r->print("\nif (document.parameters.def_".$_. |
'.value=="on") { opener.objparms['.$ENV{'form.resid'}. |
'.checked) { opener.objparms['.$ENV{'form.resid'}. |
']+="'.$type{$_}.'___'.$_.'___"+document.parameters.'.$_.'.value; }'); |
']+=colon+"'.$type{$_}. |
|
'___'.$_.'___"+document.parameters.'.$_.'.value; colon=":"; }'); |
} keys %content; |
} keys %content; |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
|
opener.save(); |
window.close(); |
window.close(); |
} |
} |
</script> |
</script> |
Line 88 ENDHEADER
|
Line 93 ENDHEADER
|
<table border=2> |
<table border=2> |
<tr><th>Parameter</th><th>Default</th><th>Value</th><th>Set?</th></tr> |
<tr><th>Parameter</th><th>Default</th><th>Value</th><th>Set?</th></tr> |
ENDDOCUMENT |
ENDDOCUMENT |
my $cur=$content{$_}; |
|
if (defined($value{$_})) { $cur=$value{$_}; } |
|
map { |
map { |
$r->print('<tr><td>'.$_.'</td><td> '.$content{$_}. |
my $cur=$content{$_}; |
|
if (defined($value{$_})) { $cur=$value{$_}; }; |
|
$r->print('<tr><td><b>'.$display{$_}.'</b><br><tt>'.$_. |
|
'</tt></td><td> '.$content{$_}. |
'</td><td><input type="text" name="'.$_.'" value="'.$cur. |
'</td><td><input type="text" name="'.$_.'" value="'.$cur. |
'"></td><td><input type="checkbox" name="def_'.$_. |
'"></td><td><input type="checkbox" name="def_'.$_. |
'" value="off"></td></tr>'); |
'""'); |
|
if ($value{$_}) { $r->print(' checked'); } |
|
$r->print('></td></tr>'); |
} keys %content; |
} keys %content; |
$r->print( |
$r->print( |
'</table><br><input type="submit" value="Set"></form></body></html>'); |
'</table><br><input type="submit" value="Set"></form></body></html>'); |