--- loncom/publisher/lonpublisher.pm 2007/09/24 13:59:09 1.229 +++ loncom/publisher/lonpublisher.pm 2008/05/12 23:47:49 1.234 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.229 2007/09/24 13:59:09 www Exp $ +# $Id: lonpublisher.pm,v 1.234 2008/05/12 23:47:49 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -143,6 +143,8 @@ my $cudom; my $registered_cleanup; my $modified_urls; +my $lock; + =pod =item B @@ -344,8 +346,8 @@ sub text_with_browse_field { return "\n

$title:". "


". ''. - 'Select '. - 'Search'; + ''.&mt('Select').' '. + ''.&mt('Search').''; } @@ -964,18 +966,23 @@ sub publish { $scrout.='

'.&mt('Dependencies').'

'; my $allowstr=''; - foreach (sort(keys(%allow))) { - my $thisdep=$_; + foreach my $thisdep (sort(keys(%allow))) { if ($thisdep !~ /[^\s]/) { next; } + if ($thisdep =~/\$/) { + $scrout.='
' + .&mt('The resource depends on another resource with variable filename, i.e., [_1].',''.$thisdep.'').'
' + .&mt('You likely need to explicitly allow access to all possible dependencies using the [_1]-tag.','<allow>') + .'

'; + } unless ($style eq 'rat') { $allowstr.="\n".''; } $scrout.='
'; - if ($thisdep!~/\*/ && $thisdep!~m|^/adm/|) { + if ($thisdep!~/[\*\$]/ && $thisdep!~m|^/adm/|) { $scrout.=''; } $scrout.=''.$thisdep.''; - if ($thisdep!~/\*/ && $thisdep!~m|^/adm/|) { + if ($thisdep!~/[\*\$]/ && $thisdep!~m|^/adm/|) { $scrout.=''; if ( &Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'. @@ -1739,6 +1746,7 @@ sub notify { print $logfile "\n============ Done ============\n"; $logfile->close(); } + if ($lock) { &Apache::lonnet::remove_lock($lock); } return OK; } @@ -1808,7 +1816,9 @@ sub publishdirectory { &checkbox('obsolete','make file(s) obsolete'). &checkbox('forceoverride','force directory level catalog information over existing'). '
'); + $lock=0; } else { + unless ($lock) { $lock=&Apache::lonnet::set_lock(&mt('Publishing [_1]',$fn)); } # actually publish things opendir(DIR,$fn); my @files=sort(readdir(DIR));