[LON-CAPA-cvs] cvs: loncom /interface londocs.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 15 Sep 2003 15:24:18 -0000


www		Mon Sep 15 11:24:18 2003 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Continued work on Bug #1022: Dump Course
  
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.77 loncom/interface/londocs.pm:1.78
--- loncom/interface/londocs.pm:1.77	Tue Sep  9 15:39:04 2003
+++ loncom/interface/londocs.pm	Mon Sep 15 11:24:18 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.77 2003/09/09 19:39:04 www Exp $
+# $Id: londocs.pm,v 1.78 2003/09/15 15:24:18 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -162,15 +162,25 @@
 	$title=~s/\W//gs;
 	$r->print('<h3>Folder in Construction Space</h3><input type="text" size="50" name="authorfolder" value="'.$title.'" /><br />');
 	&tiehash();
+	$r->print('<h3>Filenames in Construction Space</h3><table border="2"><tr><th>Internal Filename</th><th>Title</th><th>Save as ...</th></tr>');
 	foreach (&Apache::loncreatecourse::crsdirlist($origcrsid,'userfiles')) {
-	    $r->print("\n<br />".$_.' '.
-  $hash{'title_'.$hash{
-'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}}
-		      );
+	    $r->print('<tr><td>'.$_.'</td>');
+	    my ($ext)=($_=~/\.(\w+)$/);
+	    my $title=$hash{'title_'.$hash{
+		'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}};
+	    $r->print('<td>'.($title?$title:'&nbsp;').'</td>');
+	    unless ($title) {
+		$title=$_;
+	    }
+	    $title=~s/\.(\w+)$//;
+	    $title=~s/\W+/\_/gs;
+	    $title.='.'.$ext;
+	    $r->print("\n<td><input type='text' size='60' name='".$_."' value='".$title."' /></td></tr>\n");
 	}
+	$r->print("</table>\n");
 	&untiehash();
 	$r->print(
-  '<input type="submit" name="dumpcourse" value="Dump Course DOCS" /></form>');
+  '<p><input type="submit" name="dumpcourse" value="Dump Course DOCS" /></p></form>');
     }
 }