[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 01 Feb 2007 02:38:07 -0000


albertel		Wed Jan 31 21:38:07 2007 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - since _ is valid in metadata tags now, need to use a different temp
    separator in the return from &metaeval, switch to using \0 for this
  
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.218 loncom/publisher/lonpublisher.pm:1.219
--- loncom/publisher/lonpublisher.pm:1.218	Fri Jan 26 17:16:33 2007
+++ loncom/publisher/lonpublisher.pm	Wed Jan 31 21:38:05 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.218 2007/01/26 22:16:33 raeburn Exp $
+# $Id: lonpublisher.pm,v 1.219 2007/02/01 02:38:05 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -183,17 +183,18 @@
 	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]->{$_};
@@ -1095,8 +1096,10 @@
 	if (($_=~/^parameter/) || ($_=~/^stores/)) {
 	    unless ($_=~/\.\w+$/) { 
 		unless ($oldparmstores{$_}) {
-		    print $logfile 'New: '.$_."\n";
-		    $chparms.=$_.' ';
+		    my $disp_key = $_;
+		    $disp_key =~ tr/\0/_/;
+		    print $logfile ('New: '.$disp_key."\n");
+		    $chparms .= $disp_key.' ';
 		}
 	    }
 	}
@@ -1111,16 +1114,18 @@
 	if (($_=~/^parameter/) || ($_=~/^stores/)) {
 	    unless (($metadatafields{$_.'.name'}) ||
 		    ($metadatafields{$_.'.package'}) || ($_=~/\.\w+$/)) {
-		print $logfile 'Obsolete: '.$_."\n";
-		$chparms.=$_.' ';
+		my $disp_key = $_;
+		$disp_key =~ tr/\0/_/;
+		print $logfile ('Obsolete: '.$disp_key."\n");
+		$chparms.=$disp_key.' ';
 	    }
 	}
     }
     if ($chparms) {
 	$scrout.='<p><b>'.&mt('Obsolete parameters or stored values').':</b> '.
-	    $chparms.'</p><h1><font color="red">'.&mt('Warning!').
-	    '</font></h1><p><font color="red" size="+1">'.
-	    &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'</font></p><hr />';
+	    $chparms.'</p><h1><span class="LC_warning">'.&mt('Warning!').
+	    '</span></h1><p><span class="LC_warning">'.
+	    &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'</span></p><hr />';
     }
 
 # ------------------------------------------------------- Now have all metadata