--- loncom/publisher/lonpublisher.pm 2016/06/19 01:08:01 1.296 +++ loncom/publisher/lonpublisher.pm 2023/07/14 20:16:04 1.302 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.296 2016/06/19 01:08:01 raeburn Exp $ +# $Id: lonpublisher.pm,v 1.302 2023/07/14 20:16:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -329,7 +329,7 @@ string which presents the form field (fo ######################################### ######################################### sub textfield { - my ($title,$name,$value,$noline)=@_; + my ($title,$name,$value,$noline,$readonly)=@_; $value=~s/^\s+//gs; $value=~s/\s+$//gs; $value=~s/\s+/ /gs; @@ -341,22 +341,31 @@ sub textfield { } sub text_with_browse_field { - my ($title,$name,$value,$restriction,$noline)=@_; + my ($title,$name,$value,$restriction,$noline,$readonly)=@_; $value=~s/^\s+//gs; $value=~s/\s+$//gs; $value=~s/\s+/ /gs; $title=&mt($title); $env{'form.'.$name}=$value; - return "\n".&Apache::lonhtmlcommon::row_title($title) - .'' - .'
' + my $disabled; + if ($readonly) { + $disabled = ' disabled="disabled"'; + } + my $output = + "\n".&Apache::lonhtmlcommon::row_title($title) + .''; + unless ($readonly) { + $output .= + '
' .'' .&mt('Select') .' ' .'' .&mt('Search') - .'' - .&Apache::lonhtmlcommon::row_closure($noline); + .''; + } + $output .= &Apache::lonhtmlcommon::row_closure($noline); + return $output; } sub hiddenfield { @@ -367,12 +376,12 @@ sub hiddenfield { sub checkbox { my ($name,$text)=@_; - return "\n