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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Fri, 16 May 2003 20:44:43 -0000


bowersj2		Fri May 16 16:44:43 2003 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
  Fix #1447, show actual title on files screen.
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.31 loncom/interface/lonhelper.pm:1.32
--- loncom/interface/lonhelper.pm:1.31	Fri May 16 13:20:51 2003
+++ loncom/interface/lonhelper.pm	Fri May 16 16:44:43 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.31 2003/05/16 17:20:51 bowersj2 Exp $
+# $Id: lonhelper.pm,v 1.32 2003/05/16 20:44:43 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -636,7 +636,6 @@
 
     # Handle writing out the vars to the file
     my $file = Apache::File->new('>'.$self->{FILENAME});
-    print $file $self->_varsInFile();
 
     return $result;
 }
@@ -1922,6 +1921,8 @@
 @ISA = ("Apache::lonhelper::element");
 use strict;
 
+use Apache::lonpubdir; # for getTitleString
+
 BEGIN {
     &Apache::lonhelper::register('Apache::lonhelper::files',
                                  ('files', 'filechoice', 'filefilter'));
@@ -2078,6 +2079,9 @@
 		$color = '';
 	    }
 
+            # Get the title
+            my $title = Apache::lonpubdir::getTitleString($fileName);
+
             # Netscape 4 is stupid and there's nowhere to put the
             # information on the input tag that the file is Published,
             # Unpublished, etc. In *real* browsers we can just say
@@ -2104,8 +2108,9 @@
             if (!$self->{'multichoice'} && $choices == 0) {
                 $result .= ' checked';
             }
-            $result .= "/></td><td bgcolor='$color'>" . $file .
-                 "</td><td bgcolor='$color'>$status</td></tr>\n";
+            $result .= "/></td><td bgcolor='$color'>" . $file . "</td>" .
+                "<td bgcolor='$color'>$title</td>" .
+                "<td bgcolor='$color'>$status</td>" . "</tr>\n";
             $choices++;
         }
     }