[LON-CAPA-cvs] cvs: loncom /interface filetypes.tab /publisher lonconstruct.pm londiff.pm lonpubdir.pm lonpublisher.pm lonretrieve.pm publisher.html

www lon-capa-cvs@mail.lon-capa.org
Mon, 16 Sep 2002 13:05:50 -0000


This is a MIME encoded message

--www1032181550
Content-Type: text/plain

www		Mon Sep 16 09:05:50 2002 EDT

  Modified files:              
    /loncom/interface	filetypes.tab 
    /loncom/publisher	lonconstruct.pm londiff.pm lonpubdir.pm 
                     	lonpublisher.pm lonretrieve.pm publisher.html 
  Log:
  Toward bug 482
  
  
--www1032181550
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20020916090550.txt"

Index: loncom/interface/filetypes.tab
diff -u loncom/interface/filetypes.tab:1.17 loncom/interface/filetypes.tab:1.18
--- loncom/interface/filetypes.tab:1.17	Tue Apr  9 13:25:14 2002
+++ loncom/interface/filetypes.tab	Mon Sep 16 09:05:49 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # file extension description file
 #
-# $Id: filetypes.tab,v 1.17 2002/04/09 17:25:14 matthew Exp $
+# $Id: filetypes.tab,v 1.18 2002/09/16 13:05:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2693,6 +2693,7 @@
 tmc             unk     DCI TradeManager Catalog Archive
 tmf             unk     WordPerfect Tagged Font Metric File
 tmo             unk     Zortech C++ Global Optimizer Output File
+tmp		hdn	LON-CAPA Temporary File
 tms             unk     Telemate Script
 toc             unk     Eudora Table Of Contents
 tol             unk     Kodak Photoenhancer
Index: loncom/publisher/lonconstruct.pm
diff -u loncom/publisher/lonconstruct.pm:1.8 loncom/publisher/lonconstruct.pm:1.9
--- loncom/publisher/lonconstruct.pm:1.8	Mon Sep  9 22:31:26 2002
+++ loncom/publisher/lonconstruct.pm	Mon Sep 16 09:05:49 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Page Wrapper for Construction
 #
-# $Id: lonconstruct.pm,v 1.8 2002/09/10 02:31:26 foxr Exp $
+# $Id: lonconstruct.pm,v 1.9 2002/09/16 13:05:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -109,7 +109,7 @@
    $r->print(<<ENDPAGE);
 <html>
 <head><title>LON-CAPA Construction Space</title></head>
-<frameset rows="110,*">
+<frameset rows="110,*" border="0">
 <frame src='/adm/publisher.html'>
 <frame src="$lowerframe" name="LONCAPAToBePublished">
 </frameset>
Index: loncom/publisher/londiff.pm
diff -u loncom/publisher/londiff.pm:1.8 loncom/publisher/londiff.pm:1.9
--- loncom/publisher/londiff.pm:1.8	Wed May 29 14:23:58 2002
+++ loncom/publisher/londiff.pm	Mon Sep 16 09:05:49 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to show differences between file versions
 #
-# $Id: londiff.pm,v 1.8 2002/05/29 18:23:58 stredwic Exp $
+# $Id: londiff.pm,v 1.9 2002/09/16 13:05:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -91,7 +91,7 @@
 
   $r->print('<html><head><title>LON-CAPA Construction Diffs</title></head>');
 
-  $r->print('<body bgcolor="#FFFFFF">');
+  $r->print(&Apache::loncommon::bodytag('Resource Differences'));
 
   
   $r->print('<h1>Compare versions of <tt>'.$efn.'</tt></h1>');
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.25 loncom/publisher/lonpubdir.pm:1.26
--- loncom/publisher/lonpubdir.pm:1.25	Tue Jun  4 09:13:38 2002
+++ loncom/publisher/lonpubdir.pm	Mon Sep 16 09:05:49 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonpubdir.pm,v 1.25 2002/06/04 13:13:38 www Exp $
+# $Id: lonpubdir.pm,v 1.26 2002/09/16 13:05:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -99,7 +99,7 @@
 
 
 
-  startpage($r, $uname, $udom, $thisdisfn);	# Put out the start of page.
+  &startpage($r, $uname, $udom, $thisdisfn);   # Put out the start of page.
   
   # Start off the diretory table.
 
@@ -176,6 +176,7 @@
 #      $uname - User name.
 #      $udom  - Domain name the user is logged in under.
 #      $thisdisfn - Displayable version of the filename.
+
 sub startpage {
     my ($r, $uname, $udom, $thisdisfn) = @_;
     
@@ -184,11 +185,15 @@
     
     $r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
     
-    $r->print('<body bgcolor="#FFFFFF"><img align=right '.
-	      'src=/adm/lonIcons/lonlogos.gif>');
+    $r->print(&Apache::loncommon::bodytag(undef,undef,undef,1));
     
     $r->print('<h1>Construction Space Directory <tt>'.
-	      $thisdisfn.'/</tt></h1>');
+	      $thisdisfn.'/</tt></h1>'.
+              '<form method="post" action="/adm/publish" target="_parent">'.
+              '<input type="hidden" name="filename" value="/~'.
+               $uname.$thisdisfn.'/" />'.
+              '<input type="submit" value="Publish Directory" />'.
+              '<input type="submit" name="pubrec" value="Publish Directory and Sub Directories" /></form>');
     
     if (($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) {
 	$r->print('<h3>Co-Author: '.$uname.' at '.$udom.
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.94 loncom/publisher/lonpublisher.pm:1.95
--- loncom/publisher/lonpublisher.pm:1.94	Tue Sep 10 10:52:35 2002
+++ loncom/publisher/lonpublisher.pm	Mon Sep 16 09:05:50 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.94 2002/09/10 14:52:35 harris41 Exp $
+# $Id: lonpublisher.pm,v 1.95 2002/09/16 13:05:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1388,8 +1388,46 @@
 
 }
 
+#########################################
+
+sub batchpublish {
+    my ($r,$srcfile)=@_;
+    my $thisdisfn=$srcfile;
+    $thisdisfn=~s/\/home\/korte\/public_html\///;
+    $srcfile=~s/\/+/\//g;
+    $r->print('<h2>Publishing <tt>'.$thisdisfn.'</tt></h2>');
+}
 
 #########################################
+
+sub publishdirectory {
+    my ($r,$fn,$thisdisfn)=@_;
+      $r->print('<h1>Directory <tt>'.$thisdisfn.'/</tt></h1>');
+
+      my $dirptr=16384;		# Mask indicating a directory in stat.cmode.
+
+      opendir(DIR,$fn);
+      my @files=sort(readdir(DIR));
+      foreach my $filename (@files) {
+         my ($cdev,$cino,$cmode,$cnlink,
+            $cuid,$cgid,$crdev,$csize,
+            $catime,$cmtime,$cctime,
+            $cblksize,$cblocks)=stat($fn.'/'.$filename);
+
+         my $extension='';
+         if ($filename=~/\.(\w+)$/) { $extension=$1; }
+         if ($cmode&$dirptr) {
+	   if (($filename!~/^\./) && ($ENV{'form.pubrec'})) {
+	      &publishdirectory($r,$fn.'/'.$filename,$thisdisfn.'/'.$filename);
+	   }
+         } elsif ((&Apache::loncommon::fileembstyle($extension) ne 'hdn') &&
+                  ($filename!~/^[\#\.]/) && ($filename!~/\~$/)) {
+             &batchpublish($r,$fn.'/'.$filename);
+             $r->rflush();
+         }
+      }
+      closedir(DIR);
+}
 #########################################
 
 =pod
@@ -1531,31 +1569,34 @@
   $r->send_http_header;
 
   $r->print('<html><head><title>LON-CAPA Publishing</title></head>');
-  $r->print(
-	    '<body bgcolor="#FFFFFF"><img align="right" '.
-	    'src="/adm/lonIcons/lonlogos.gif" />');
+  $r->print(&Apache::loncommon::bodytag('Resource Publication'));
   my $thisfn=$fn;
-   
-# ---------------------- Evaluate individual file, and then output information.
-  {
-      $thisfn=~/\.(\w+)$/;
-      my $thistype=$1;
-      my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
 
-      my $thistarget=$thisfn;
+  my $thistarget=$thisfn;
       
-      $thistarget=~s/^\/home/$targetdir/;
-      $thistarget=~s/\/public\_html//;
+  $thistarget=~s/^\/home/$targetdir/;
+  $thistarget=~s/\/public\_html//;
+
+  my $thisdistarget=$thistarget;
+  $thisdistarget=~s/^$docroot//;
+
+  my $thisdisfn=$thisfn;
+  $thisdisfn=~s/^\/home\/$cuname\/public_html\///;
 
-      my $thisdistarget=$thistarget;
-      $thisdistarget=~s/^$docroot//;
+  if ($fn=~/\/$/) {
+# -------------------------------------------------------- This is a directory
+      &publishdirectory($r,$fn,$thisdisfn);
 
-      my $thisdisfn=$thisfn;
-      $thisdisfn=~s/^\/home\/$cuname\/public_html\///;
+  } else {
+# ---------------------- Evaluate individual file, and then output information.
+      $thisfn=~/\.(\w+)$/;
+      my $thistype=$1;
+      my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
 
       $r->print('<h2>Publishing '.
         &Apache::loncommon::filedescription($thistype).' <tt>'.
-        $thisdisfn.'</tt></h2><b>Target:</b> <tt>'.$thisdistarget.'</tt><p>');
+        '<a href="/~'.$cuname.'/'.$thisdisfn.'" target="cat">'.$thisdisfn.
+        '</a></tt></h2><b>Target:</b> <tt>'.$thisdistarget.'</tt><p>');
    
       if (($cuname ne $ENV{'user.name'}) || ($cudom ne $ENV{'user.domain'})) {
           $r->print('<h3><font color="red">Co-Author: '.$cuname.' at '.$cudom.
Index: loncom/publisher/lonretrieve.pm
diff -u loncom/publisher/lonretrieve.pm:1.18 loncom/publisher/lonretrieve.pm:1.19
--- loncom/publisher/lonretrieve.pm:1.18	Thu May 30 10:08:42 2002
+++ loncom/publisher/lonretrieve.pm	Mon Sep 16 09:05:50 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to retrieve an old version of a file
 #
-# $Id: lonretrieve.pm,v 1.18 2002/05/30 14:08:42 www Exp $
+# $Id: lonretrieve.pm,v 1.19 2002/09/16 13:05:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -215,8 +215,7 @@
 
   $r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
 
-  $r->print(
-   '<body bgcolor="#FFFFFF"><img align=right src=/adm/lonIcons/lonlogos.gif>');
+  $r->print(&Apache::loncommon::bodytag('Retrieve Published Resources'));
 
   
   $r->print('<h1>Retrieve previous versions of <tt>'.$fn.'</tt></h1>');
Index: loncom/publisher/publisher.html
diff -u loncom/publisher/publisher.html:1.20 loncom/publisher/publisher.html:1.21
--- loncom/publisher/publisher.html:1.20	Tue Jul 16 16:30:54 2002
+++ loncom/publisher/publisher.html	Mon Sep 16 09:05:50 2002
@@ -75,9 +75,9 @@
 }
 </script>
 </head>
-<body bgcolor="#99ff99">
+<body bgcolor="#ccffff" text='#004400' link='#003333' vlink='#006666'>
 <font size="-2">
-<table border=0><tr><th bgcolor="#aaaaaa" height=20>
+<table border=0><tr><th bgcolor="#004400" height=20>
 <table border=0><tr valign="middle">
 <form name="publisher" action="/adm/publish" target="_parent" method="post">
 <td bgcolor="#ccffcc">

--www1032181550--