version 1.243, 2005/08/27 19:07:58
|
version 1.244, 2005/08/29 22:57:09
|
Line 1950 sub crsenv {
|
Line 1950 sub crsenv {
|
'disablesigfigs' |
'disablesigfigs' |
); |
); |
foreach my $parameter (sort(keys(%values))) { |
foreach my $parameter (sort(keys(%values))) { |
unless ($parameter =~ m/^internal\./) { |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { |
if (! $descriptions{$parameter}) { |
if (! $descriptions{$parameter}) { |
$descriptions{$parameter}=$parameter; |
$descriptions{$parameter}=$parameter; |
push(@Display_Order,$parameter); |
push(@Display_Order,$parameter); |
Line 2728 ENDMAINFORMHEAD
|
Line 2728 ENDMAINFORMHEAD
|
sub setinstmeta { |
sub setinstmeta { |
my ($r)=@_; |
my ($r)=@_; |
my $next_meta; |
my $next_meta; |
|
my $output; |
if ($env{'form.serial'}) { |
if ($env{'form.serial'}) { |
$next_meta = $env{'form.serial'}; |
$next_meta = $env{'form.serial'}; |
} else { |
} else { |
Line 2777 sub setinstmeta {
|
Line 2778 sub setinstmeta {
|
{$name=>$value},$dom,$crs); |
{$name=>$value},$dom,$crs); |
&Apache::lonnet::coursedescription($env{'request.course.id'}); |
&Apache::lonnet::coursedescription($env{'request.course.id'}); |
} else { |
} else { |
my $found_one = 0; |
|
foreach my $key (sort keys %env) { |
foreach my $key (sort keys %env) { |
if ($key=~m/^course\.$env{'request.course.id'}\.metadata\.\d+\.title$/) { |
if ($key=~m/^course\.$env{'request.course.id'}\.metadata\.\d+\.title$/) { |
unless ($found_one eq 1) { |
|
$found_one = 1; |
|
$r->print('<strong>Existing Metadata</strong><br >'); |
|
} |
|
$r->print($env{$key}.'<br />'); |
|
$key=~m/^course\.$env{'request.course.id'}\.metadata\.(\d+)\.title/; |
$key=~m/^course\.$env{'request.course.id'}\.metadata\.(\d+)\.title/; |
|
|
if ($1 ge $next_meta) { |
if ($1 ge $next_meta) { |
$next_meta = $1 + 1; |
$next_meta = $1 + 1; |
} |
} |
|
$output.='<tr><td>'.$env{$key}.'</td>'; |
|
$output.='<td>Select one: <input type="radio" name="type" value="one" /><br />'; |
|
$output.='Select many: <input type="radio" name="type" value="many" /></td>'; |
|
$output.='<td><input type="text" value="'.$env{$key.'.values'}.'" /></td></tr>'; |
} |
} |
} |
} |
$r->print('<a href="/adm/parmset?action=setinstmeta&state=add&serial='.$next_meta.'">Add Metadata Item</a><br />'); |
$output.='<tr><td><i>Create new instructor metadata item</i><br />'; |
|
$output.='<input type="text" name="instmeta" /></td><td>Options here</td>'; |
|
$output.='<td><input type="hidden" name="serial" value="'.$next_meta.'" /></td></tr>'; |
|
$r->print(<<ENDenv); |
|
<form method="post" action="/adm/parmset?action=setinstmeta" name="form"> |
|
|
|
<p> |
|
<table border=2> |
|
<tr><th>Title</th><th>Options</th><th>Choices</th></tr> |
|
$output |
|
</table> |
|
<input type="submit" name="instmeta" value="Update Instructor Metadata"> |
|
</form> |
|
|
|
ENDenv |
|
|
} |
} |
$r->print('</body> |
$r->print('</body> |
</html>'); |
</html>'); |