--- loncom/publisher/lonpublisher.pm 2004/10/05 13:41:36 1.179 +++ loncom/publisher/lonpublisher.pm 2004/10/11 17:40:46 1.180 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.179 2004/10/05 13:41:36 matthew Exp $ +# $Id: lonpublisher.pm,v 1.180 2004/10/11 17:40:46 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -329,6 +329,21 @@ sub textfield { ''; } +sub text_with_browse_field { + my ($title,$name,$value,$restriction)=@_; + $value=~s/^\s+//gs; + $value=~s/\s+$//gs; + $value=~s/\s+/ /gs; + $title=&mt($title); + $ENV{'form.'.$name}=$value; + return "\n

$title:". + "


". + ''. + 'Select '. + 'Search'; + +} + sub hiddenfield { my ($name,$value)=@_; $ENV{'form.'.$name}=$value; @@ -1238,15 +1253,12 @@ END my $copyright_help = Apache::loncommon::help_open_topic('Publishing_Copyright'); $intr_scrout =~ s/DISTRIBUTION:/'DISTRIBUTION: ' . $copyright_help/ge; - $intr_scrout.=&textfield('Custom Distribution File','customdistributionfile', - $metadatafields{'customdistributionfile'}). - $copyright_help; + $intr_scrout.=&text_with_browse_field('Custom Distribution File','customdistributionfile',$metadatafields{'customdistributionfile'},'rights').$copyright_help; $intr_scrout.=&selectbox('Source Distribution','sourceavail', $defaultsourceoption, \&Apache::loncommon::source_copyrightdescription, (&Apache::loncommon::source_copyrightids)); - $intr_scrout.=&textfield('Source Custom Distribution File','sourcerights', - $metadatafields{'sourcerights'}); + $intr_scrout.=&text_with_browse_field('Source Custom Distribution File','sourcerights',$metadatafields{'sourcerights'},'rights'); my $uctitle=&mt('Obsolete'); $intr_scrout.= "\n

$uctitle:". @@ -1255,9 +1267,9 @@ END $intr_scrout.=' checked="1" '; } $intr_scrout.='/ >

'. - &textfield('Suggested Replacement for Obsolete File', - 'obsoletereplacement', - $metadatafields{'obsoletereplacement'}); + &text_with_browse_field('Suggested Replacement for Obsolete File', + 'obsoletereplacement', + $metadatafields{'obsoletereplacement'}); } else { $intr_scrout.=&hiddenfield('copyright','private'); } @@ -1891,8 +1903,11 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - - $r->print('LON-CAPA Publishing'); + + my $js=&Apache::loncommon::browser_and_searcher_javascript(); + $r->print('LON-CAPA Publishing + '); $r->print(&Apache::loncommon::bodytag('Resource Publication'));