--- loncom/publisher/lonpublisher.pm 2021/06/03 13:59:44 1.298
+++ loncom/publisher/lonpublisher.pm 2024/12/27 04:01:41 1.306
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.298 2021/06/03 13:59:44 raeburn Exp $
+# $Id: lonpublisher.pm,v 1.306 2024/12/27 04:01:41 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