version 1.121, 2005/10/31 21:11:45
|
version 1.126, 2005/11/11 22:46:56
|
Line 304 sub select_course {
|
Line 304 sub select_course {
|
} |
} |
$r->print('<h3>Course Related Meta-Data</h3><br />'); |
$r->print('<h3>Course Related Meta-Data</h3><br />'); |
$r->print('<form action="" method="post">'); |
$r->print('<form action="" method="post">'); |
$r->print('Select your test course<br />'); |
$r->print('Select course restrictions<br />'); |
$r->print('<select name="metacourse" >'); |
$r->print('<select name="metacourse" >'); |
my $meta_not_found = 1; |
my $meta_not_found = 1; |
foreach my $key (keys (%courses)) { |
foreach my $key (keys (%courses)) { |
Line 494 sub prettyinput {
|
Line 494 sub prettyinput {
|
$only_one = 'true'; |
$only_one = 'true'; |
} |
} |
if ($type eq 'author') { |
if ($type eq 'author') { |
|
return |
|
'<input type="text" name="'.$fieldname.'" size="'.$size.'" '. |
|
'value="'.$value.'" />'. |
|
&relatedfield(1,$relatedsearchflag,$relatedsep,$fieldname, |
|
$relatedvalue); |
|
|
} |
} |
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.'" />'); |
Line 506 sub prettyinput {
|
Line 512 sub prettyinput {
|
} |
} |
if ($type eq 'keywords') { |
if ($type eq 'keywords') { |
my %hash; |
my %hash; |
my $def; |
my @cur_values; |
|
foreach (split(/,/,$value)) { |
|
$_ =~ s/^\s+//; |
|
push(@cur_values,$_); |
|
} |
foreach (split(/,/,$values)) { |
foreach (split(/,/,$values)) { |
|
$_ =~ s/^\s+//; |
$hash{$_} = $_; |
$hash{$_} = $_; |
} |
} |
if ($only_one) { |
if ($only_one) { |
return(&Apache::loncommon::select_form($def,'new_keywords',%hash)); |
return(&Apache::loncommon::select_form($value,'new_keywords',%hash)); |
} else { |
} else { |
return(&Apache::loncommon::multiple_select_form('new_keywords',undef,undef,%hash)); |
return (&Apache::loncommon::multiple_select_form('new_keywords',\@cur_values,undef,\%hash)); |
} |
} |
} |
} |
if ($type eq 'notes') { |
if ($type eq 'notes') { |
Line 1081 ENDEDIT
|
Line 1092 ENDEDIT
|
$Apache::lonpublisher::metadatafields{'copyright'}= |
$Apache::lonpublisher::metadatafields{'copyright'}= |
'default'; |
'default'; |
} |
} |
&Apache::lonnet::logthis($metacourse.' is the restriction'); |
if ($metacourse ne 'none') { |
|
$r->print('Document metadata restricted by :<strong> '.$env{$metacourse.".description"}."</strong><br />"); |
|
} |
|
|
foreach (@fields) { |
foreach (@fields) { |
if (defined($env{'form.new_'.$_})) { |
if (defined($env{'form.new_'.$_})) { |
$Apache::lonpublisher::metadatafields{$_}= |
$Apache::lonpublisher::metadatafields{$_}= |
$env{'form.new_'.$_}; |
join(',',&Apache::loncommon::get_env_multiple('form.new_'.$_)); |
} |
} |
if ($metacourse ne 'none') { |
if ($metacourse ne 'none') { |
# handle restrictions here |
# handle restrictions here |
Line 1108 ENDEDIT
|
Line 1122 ENDEDIT
|
my $formname='store'; |
my $formname='store'; |
my $file_content; |
my $file_content; |
foreach my $meta_field (keys %env) { |
foreach my $meta_field (keys %env) { |
if (&Apache::loncommon::get_env_multiple('form.keywords')) { |
if (&Apache::loncommon::get_env_multiple('form.new_keywords')) { |
$Apache::lonpublisher::metadatafields{'coursekeyword'} = |
$Apache::lonpublisher::metadatafields{'keywords'} = |
join (', ', &Apache::loncommon::get_env_multiple('form.keywords')); |
join (',', &Apache::loncommon::get_env_multiple('form.new_keywords')); |
} |
} |
} |
} |
foreach (sort keys %Apache::lonpublisher::metadatafields) { |
foreach (sort keys %Apache::lonpublisher::metadatafields) { |