--- loncom/publisher/lonpublisher.pm 2006/01/24 22:09:36 1.207 +++ loncom/publisher/lonpublisher.pm 2008/06/27 18:52:35 1.238 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.207 2006/01/24 22:09:36 albertel Exp $ +# $Id: lonpublisher.pm,v 1.238 2008/06/27 18:52:35 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]->{$_}; @@ -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 { @@ -368,8 +376,8 @@ sub selectbox { } else { $env{'form.'.$name}=$idlist[0]; } - my $selout="\n

$title:". - '


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