--- loncom/publisher/lonpublisher.pm 2005/06/23 22:46:00 1.198 +++ loncom/publisher/lonpublisher.pm 2008/06/30 18:10:24 1.239 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.198 2005/06/23 22:46:00 www Exp $ +# $Id: lonpublisher.pm,v 1.239 2008/06/30 18:10:24 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -129,6 +129,8 @@ use Apache::loncfile; use LONCAPA::lonmetadata; use Apache::lonmsg; use vars qw(%metadatafields %metadatakeys); +use LONCAPA qw(:DEFAULT :match); + my %addid; my %nokey; @@ -141,6 +143,8 @@ my $cudom; my $registered_cleanup; my $modified_urls; +my $lock; + =pod =item B @@ -181,17 +185,18 @@ sub metaeval { if ($token->[0] eq 'S') { my $entry=$token->[1]; my $unikey=$entry; + next if ($entry =~ m/^(?:parameter|stores)_/); if (defined($token->[2]->{'package'})) { - $unikey.='_package_'.$token->[2]->{'package'}; + $unikey.="\0package\0".$token->[2]->{'package'}; } if (defined($token->[2]->{'part'})) { - $unikey.='_'.$token->[2]->{'part'}; + $unikey.="\0".$token->[2]->{'part'}; } if (defined($token->[2]->{'id'})) { - $unikey.='_'.$token->[2]->{'id'}; + $unikey.="\0".$token->[2]->{'id'}; } if (defined($token->[2]->{'name'})) { - $unikey.='_'.$token->[2]->{'name'}; + $unikey.="\0".$token->[2]->{'name'}; } foreach (@{$token->[3]}) { $metadatafields{$unikey.'.'.$_}=$token->[2]->{$_}; @@ -269,7 +274,7 @@ sub metaread { } &metaeval($metastring,$prefix); return '
'.&mt('Processed file').': '. - &Apache::loncfile::display($fn).''; + &Apache::loncfile::display($fn).'
'; } ######################################### @@ -278,9 +283,8 @@ sub metaread { sub coursedependencies { my $url=&Apache::lonnet::declutter(shift); $url=~s/\.meta$//; - my ($adomain,$aauthor)=($url=~/^(\w+)\/(\w+)\//); - my $regexp=$url; - $regexp=~s/(\W)/\\$1/g; + my ($adomain,$aauthor)=($url=~ m{^($match_domain)/($match_username)/}); + my $regexp=quotemeta($url); $regexp='___'.$regexp.'___course'; my %evaldata=&Apache::lonnet::dump('nohist_resevaldata',$adomain, $aauthor,$regexp); @@ -327,9 +331,9 @@ sub textfield { $value=~s/\s+/ /gs; $title=&mt($title); $env{'form.'.$name}=$value; - return "\n

$title:". - "


". - ''; + return "\n".&Apache::lonhtmlcommon::row_title($title) + .'' + .&Apache::lonhtmlcommon::row_closure(); } sub text_with_browse_field { @@ -339,12 +343,16 @@ sub text_with_browse_field { $value=~s/\s+/ /gs; $title=&mt($title); $env{'form.'.$name}=$value; - return "\n

$title:". - "


". - ''. - 'Select '. - 'Search'; - + return "\n".&Apache::lonhtmlcommon::row_title($title) + .'' + .'
' + .'' + .&mt('Select') + .' ' + .'' + .&mt('Search') + .'' + .&Apache::lonhtmlcommon::row_closure(); } sub hiddenfield { @@ -355,7 +363,8 @@ sub hiddenfield { sub checkbox { my ($name,$text)=@_; - return "\n
".&mt($text); + return "\n
"; } sub selectbox { @@ -367,8 +376,8 @@ sub selectbox { } else { $env{'form.'.$name}=$idlist[0]; } - my $selout="\n

$title:". - '


'; foreach (@idlist) { $selout.='