version 1.127, 2005/11/15 19:20:12
|
version 1.130, 2005/11/19 00:16:01
|
Line 240 sub fieldnames {
|
Line 240 sub fieldnames {
|
my %fields = |
my %fields = |
('title' => 'Title', |
('title' => 'Title', |
'author' =>'Author(s)', |
'author' =>'Author(s)', |
'authorspace' => 'Author Space', |
|
'modifyinguser' => 'Last Modifying User', |
|
'subject' => 'Subject', |
'subject' => 'Subject', |
'keywords' => 'Keyword(s)', |
'keywords' => 'Keyword(s)', |
'notes' => 'Notes', |
'notes' => 'Notes', |
Line 483 sub prettyinput {
|
Line 481 sub prettyinput {
|
if (! defined($size)) { |
if (! defined($size)) { |
$size = 80; |
$size = 80; |
} |
} |
|
my $output; |
if (defined($course_key)) { |
if (defined($course_key)) { |
my $stu_add; |
my $stu_add; |
my $only_one; |
my $only_one; |
|
my %meta_options; |
|
my @cur_values_inst; |
|
my $cur_values_stu; |
my $values = $env{$course_key.'.metadata.'.$_.'.values'}; |
my $values = $env{$course_key.'.metadata.'.$_.'.values'}; |
if ($env{$course_key.'.metadata.'.$_.'.options'} =~ m/stuadd/) { |
if ($env{$course_key.'.metadata.'.$_.'.options'} =~ m/stuadd/) { |
$stu_add = 'true'; |
$stu_add = 'true'; |
Line 493 sub prettyinput {
|
Line 495 sub prettyinput {
|
if ($env{$course_key.'.metadata.'.$_.'.options'} =~ m/onlyone/) { |
if ($env{$course_key.'.metadata.'.$_.'.options'} =~ m/onlyone/) { |
$only_one = 'true'; |
$only_one = 'true'; |
} |
} |
if ($type eq 'author') { |
# need to take instructor values out of list where instructor and student |
return |
# values may be mixed. |
'<input type="text" name="'.$fieldname.'" size="'.$size.'" '. |
if ($values && $stu_add) { |
'value="'.$value.'" />'. |
foreach (split(/,/,$values)) { |
&relatedfield(1,$relatedsearchflag,$relatedsep,$fieldname, |
$_ =~ s/^\s+//; |
$relatedvalue); |
$meta_options{$_} = $_; |
|
} |
|
foreach (split(/,/,$value)) { |
|
$_ =~ s/^\s+//; |
|
if ($meta_options{$_}) { |
|
push(@cur_values_inst,$_); |
|
} else { |
|
$cur_values_stu .= $_.','; |
|
} |
|
} |
|
} else { |
|
$cur_values_stu = $value; |
} |
} |
if ($type eq 'courserestricted') { |
if ($type eq 'courserestricted') { |
return ('<input type="hidden" name="new_courserestricted" value="'.$course_key.'" />'); |
return ('<input type="hidden" name="new_courserestricted" value="'.$course_key.'" />'); |
} |
} |
if ($type eq 'authorspace') { |
if (($type eq 'keywords') || ($type eq 'subject') |
} |
|| ($type eq 'author')||($type eq 'notes') |
if ($type eq 'modifyinguser') { |
|| ($type eq 'abstract')|| ($type eq 'title')) { |
} |
if ($values) { |
if ($type eq 'subject') { |
if ($only_one) { |
} |
$output .= (&Apache::loncommon::select_form($value,'new_'.$type,%meta_options)); |
if ($type eq 'keywords') { |
} else { |
my %hash; |
$output .= (&Apache::loncommon::multiple_select_form('new_'.$type,\@cur_values_inst,undef,\%meta_options)); |
my @cur_values; |
} |
foreach (split(/,/,$value)) { |
|
$_ =~ s/^\s+//; |
|
push(@cur_values,$_); |
|
} |
|
foreach (split(/,/,$values)) { |
|
$_ =~ s/^\s+//; |
|
$hash{$_} = $_; |
|
} |
} |
if ($only_one) { |
if ($stu_add) { |
return(&Apache::loncommon::select_form($value,'new_keywords',%hash)); |
$output .= '<input type="text" name="'.$fieldname.'" size="'.$size.'" '. |
} else { |
'value="'.$cur_values_stu.'" />'. |
return (&Apache::loncommon::multiple_select_form('new_keywords',\@cur_values,undef,\%hash)); |
&relatedfield(1,$relatedsearchflag,$relatedsep,$fieldname, |
|
$relatedvalue); |
} |
} |
|
return ($output); |
} |
} |
if ($type eq 'notes') { |
|
} |
|
if ($type eq 'abstract') { |
|
} |
|
|
|
if (($type eq 'lowestgradelevel') || |
if (($type eq 'lowestgradelevel') || |
($type eq 'highestgradelevel')) { |
($type eq 'highestgradelevel')) { |
return &Apache::loncommon::select_level_form($value,$fieldname). |
return &Apache::loncommon::select_level_form($value,$fieldname). |