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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 13 Jul 2007 19:23:33 -0000


This is a MIME encoded message

--albertel1184354613
Content-Type: text/plain

albertel		Fri Jul 13 15:23:33 2007 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - some css
  
  
--albertel1184354613
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20070713152333.txt"

Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.225 loncom/publisher/lonpublisher.pm:1.226
--- loncom/publisher/lonpublisher.pm:1.225	Mon Jun 18 16:30:32 2007
+++ loncom/publisher/lonpublisher.pm	Fri Jul 13 15:23:33 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.225 2007/06/18 20:30:32 albertel Exp $
+# $Id: lonpublisher.pm,v 1.226 2007/07/13 19:23:33 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -654,7 +654,7 @@
 			   join(', ',@duplicatedids));
     if ($duplicateids) {
 	print $logfile "Duplicate ID(s) exist, ".join(', ',@duplicatedids)."\n";
-	my $outstring='<font color="red">'.&mt('Unable to publish file, it contains duplicated ID(s), ID(s) need to be unique. The duplicated ID(s) are').': '.join(', ',@duplicatedids).'</font>';
+	my $outstring='<span class="LC_error">'.&mt('Unable to publish file, it contains duplicated ID(s), ID(s) need to be unique. The duplicated ID(s) are').': '.join(', ',@duplicatedids).'</span>';
 	return ($outstring,1);
     }
     if ($needsfixup) {
@@ -825,15 +825,15 @@
     # Determine if the table exists
     my $status = &Apache::lonmysql::check_table('metadata');
     if (! defined($status)) {
-        $error='<font color="red">WARNING: Cannot connect to '.
-            'database!</font>';
+        $error='<span class="LC_error">WARNING: Cannot connect to '.
+            'database!</span>';
         &Apache::lonnet::logthis($error);
         return ($error,undef);
     }
     if ($status == 0) {
         # It would be nice to actually create the table....
-        $error ='<font color="red">WARNING: The metadata table does not '.
-            'exist in the LON-CAPA database.</font>';
+        $error ='<span class="LC_error">WARNING: The metadata table does not '.
+            'exist in the LON-CAPA database.</span>';
         &Apache::lonnet::logthis($error);
         return ($error,undef);
     }
@@ -848,8 +848,8 @@
                                                          \%metadata);
     }
     if (defined($status) && $status ne '') {
-        $error='<font color="red">Error occured saving new values in '.
-            'metadata table in LON-CAPA database</font>';
+        $error='<span class="LC_error">Error occured saving new values in '.
+            'metadata table in LON-CAPA database</span>';
         &Apache::lonnet::logthis($error);
         &Apache::lonnet::logthis($status);
         return ($error,undef);
@@ -871,9 +871,9 @@
     if (($errorcount) || ($warningcount)) {
         $r->print('<br /><tt>'.$uri.'</tt>: ');
 	if ($errorcount) {
-	    $r->print('<img src="/adm/lonMisc/bomb.gif" /><font color="red"><b>'.
+	    $r->print('<img src="/adm/lonMisc/bomb.gif" /><span class="LC_error"><b>'.
 		      $errorcount.' '.
-		      &mt('error(s)').'</b></font> ');
+		      &mt('error(s)').'</b></span> ');
 	}
 	if ($warningcount) {
 	    $r->print('<font color="blue">'.
@@ -937,7 +937,7 @@
     my %allow=();
 
     unless ($logfile=Apache::File->new('>>'.$source.'.log')) {
-	return ('<font color="red">'.&mt('No write permission to user directory, FAIL').'</font>',1);
+	return ('<span class="LC_error">'.&mt('No write permission to user directory, FAIL').'</span>',1);
     }
     print $logfile 
 "\n\n================= Publish ".localtime()." Phase One  ================\n".$env{'user.name'}.':'.$env{'user.domain'}."\n";
@@ -951,7 +951,7 @@
 	    print $logfile "Copied original file to ".$copyfile."\n";
         } else {
 	    print $logfile "Unable to write backup ".$copyfile.':'.$!."\n";
-	    return ("<font color=\"red\">Failed to write backup copy, $!,FAIL</font>",1);
+	    return ("<span class=\"LC_error\">Failed to write backup copy, $!,FAIL</span>",1);
         }
 # ------------------------------------------------------------- IDs and indices
 	
@@ -979,8 +979,8 @@
                if (
        &Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'.
                                             $thisdep.'.meta') eq '-1') {
-		   $scrout.= ' - <font color="red">'.&mt('Currently not available').
-		       '</font>';
+		   $scrout.= ' - <span class="LC_error">'.&mt('Currently not available').
+		       '</span>';
                } else {
                    my %temphash=(&Apache::lonnet::declutter($target).'___'.
                              &Apache::lonnet::declutter($thisdep).'___usage'
@@ -1001,9 +1001,9 @@
           my $org;
           unless ($org=Apache::File->new('>'.$source)) {
              print $logfile "No write permit to $source\n";
-             return ('<font color="red">'.&mt('No write permission to').
+             return ('<span class="LC_error">'.&mt('No write permission to').
 		     ' '.$source.
-		     ', '.&mt('FAIL').'</font>',1);
+		     ', '.&mt('FAIL').'</span>',1);
 	  }
           print($org $outstring);
         }
@@ -1414,17 +1414,17 @@
 #
     unless ($env{'form.obsolete'}) {
 	if ($target=~/(\_\_\_|\&\&\&|\:\:\:)/) {
-	    $r->print(
-		      '<font color="red">'.&mt('Unsupported character combination').
-		      ' "<tt>'.$1.'</tt>" '.&mt('in filename, FAIL').'</font>');
+	    $r->print('<span class="LC_error">'.
+		      &mt('Unsupported character combination [_1] in filename, FAIL.',"<tt>'.$1.'</tt>").
+		      '</span>');
 	    return 0;
 	}
 	unless ($target=~/\.(\w+)$/) {
-	    $r->print('<font color="red">'.&mt('No valid extension found in filename, FAIL').'</font>');
+	    $r->print('<span class="LC_error">'.&mt('No valid extension found in filename, FAIL').'</span>');
 	    return 0;
 	}
 	if ($target=~/\.(\d+)\.(\w+)$/) {
-	    $r->print('<font color="red">'.&mt('Cannot publish versioned resource, FAIL').'</font>');
+	    $r->print('<span class="LC_error">'.&mt('Cannot publish versioned resource, FAIL').'</span>');
 	    return 0;
 	}
     }
@@ -1436,8 +1436,8 @@
     my $logfile;
     unless ($logfile=Apache::File->new('>>'.$source.'.log')) {
 	$r->print(
-        '<font color="red">'.
-		&mt('No write permission to user directory, FAIL').'</font>');
+        '<span class="LC_error">'.
+		&mt('No write permission to user directory, FAIL').'</span>');
         return 0;
     }
     print $logfile 
@@ -1494,8 +1494,8 @@
 	my $file=$metadatafields{'customdistributionfile'};
 	unless ($file=~/\.rights$/) {
             $r->print(
-                '<font color="red">'.&mt('No valid custom distribution rights file specified, FAIL').
-		'</font>');
+                '<span class="LC_error">'.&mt('No valid custom distribution rights file specified, FAIL').
+		'</span>');
 	    return 0;
         }
     }
@@ -1504,8 +1504,8 @@
         my $mfh;
         unless ($mfh=Apache::File->new('>'.$source.'.meta')) {
             $r->print( 
-                '<font color="red">'.&mt('Could not write metadata, FAIL').
-		'</font>');
+                '<span class="LC_error">'.&mt('Could not write metadata, FAIL').
+		'</span>');
 	    return 0;
         }
         foreach (sort keys %metadatafields) {
@@ -1558,7 +1558,7 @@
         unless ($srcd=~/^\/home\/httpd\/html\/res/) {
             print $logfile "\nPANIC: Target dir is ".$srcd;
             $r->print(
-	 "<font color=\"red\">Invalid target directory, FAIL</font>");
+	 "<span class=\"LC_error\">Invalid target directory, FAIL</span>");
 	    return 0;
         }
         opendir(DIR,$srcd);
@@ -1584,8 +1584,8 @@
             $r->print('<p>'.&mt('Copied old target file').'</p>');
         } else {
 	    print $logfile "Unable to write ".$copyfile.':'.$!."\n";
-            $r->print("<font color=\"red\">".&mt('Failed to copy old target').
-		", $!, ".&mt('FAIL')."</font>");
+            $r->print("<span class=\"LC_error\">".&mt('Failed to copy old target').
+		", $!, ".&mt('FAIL')."</span>");
 	    return 0;
         }
         
@@ -1600,8 +1600,8 @@
 	    print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n";
             if (-e $target.'.meta') {
                 $r->print( 
-                    "<font color=\"red\">".
-&mt('Failed to write old metadata copy').", $!, ".&mt('FAIL')."</font>");
+                    "<span class=\"LC_error\">".
+&mt('Failed to write old metadata copy').", $!, ".&mt('FAIL')."</span>");
 		return 0;
 	    }
         }
@@ -1633,8 +1633,8 @@
         $r->print('<p>'.&mt('Copied source file').'</p>');
     } else {
         print $logfile "\nUnable to write ".$copyfile.':'.$!."\n";
-        $r->print("<font color=\"red\">".
-	    &mt('Failed to copy source').", $!, ".&mt('FAIL')."</font>");
+        $r->print("<span class=\"LC_error\">".
+	    &mt('Failed to copy source').", $!, ".&mt('FAIL')."</span>");
 	return 0;
     }
     
@@ -1648,7 +1648,7 @@
     } else {
         print $logfile "\nUnable to write metadata ".$copyfile.':'.$!."\n";
         $r->print(
-            "<font color=\"red\">".&mt('Failed to write metadata copy').", $!, ".&mt('FAIL')."</font>");
+            "<span class=\"LC_error\">".&mt('Failed to write metadata copy').", $!, ".&mt('FAIL')."</span>");
 	return 0;
     }
     $r->rflush;
@@ -1881,8 +1881,8 @@
     if (copy($fn,$copyfile)) {
         $r->print('<p>'.&mt('Copied source file').'</p>');
     } else {
-        return "<font color=\"red\">".
-	    &mt('Failed to copy source').", $!, ".&mt('FAIL')."</font>";
+        return "<span class=\"LC_error\">".
+	    &mt('Failed to copy source').", $!, ".&mt('FAIL')."</span>";
     }
 
 # --------------------------------------------------- Send update notifications

--albertel1184354613--