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

www lon-capa-cvs@mail.lon-capa.org
Mon, 18 Nov 2002 15:26:10 -0000


www		Mon Nov 18 10:26:10 2002 EDT

  Modified files:              
    /loncom/publisher	lonpubdir.pm 
  Log:
  Bug #952 - shows "Confirm" dialog before publishing directories.
  
  
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.28 loncom/publisher/lonpubdir.pm:1.29
--- loncom/publisher/lonpubdir.pm:1.28	Fri Oct 25 10:02:44 2002
+++ loncom/publisher/lonpubdir.pm	Mon Nov 18 10:26:10 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonpubdir.pm,v 1.28 2002/10/25 14:02:44 www Exp $
+# $Id: lonpubdir.pm,v 1.29 2002/11/18 15:26:10 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -186,14 +186,30 @@
     $r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
     
     $r->print(&Apache::loncommon::bodytag(undef,undef,undef,1));
-    
+    my $pubdirscript=(<<ENDPUBDIRSCRIPT);
+<script>
+    function pubdir(theform) {
+	if (confirm('Publish complete directory?')) {
+	    theform.submit();
+        }
+    }
+   function pubrecdir(theform) {
+	if (confirm('Publish directory and all subdirectories?')) {
+            theform.pubrec.value='1';
+	    theform.submit();
+        }
+    }
+</script>
+ENDPUBDIRSCRIPT
+
     $r->print('<h1>Construction Space Directory <tt>'.
-	      $thisdisfn.'/</tt></h1>'.
+	      $thisdisfn.'/</tt></h1>'.$pubdirscript.
               '<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" />'.
+              '<input type="button" onClick="pubdir(this.form);" value="Publish Directory" />'.
+              '<input type="hidden" name="pubrec" value="" />'.
+              '<input type="button" onClick="pubrecdir(this.form);" value="Publish Directory and Sub Directories" />'.
 '<input type="button" onClick="window.location='."'/~".
                $uname.$thisdisfn."/default.meta'".'" value="Directory Catalog Information" /></form>');