[LON-CAPA-cvs] cvs: loncom /homework edit.pm

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 06 Mar 2002 20:15:35 -0000


matthew		Wed Mar  6 15:15:35 2002 EDT

  Modified files:              
    /loncom/homework	edit.pm 
  Log:
  Added browse($tagname) to allow addition of file browser link to problems.
  
  
Index: loncom/homework/edit.pm
diff -u loncom/homework/edit.pm:1.28 loncom/homework/edit.pm:1.29
--- loncom/homework/edit.pm:1.28	Mon Jan 21 11:40:57 2002
+++ loncom/homework/edit.pm	Wed Mar  6 15:15:35 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # edit mode helpers
 #
-# $Id: edit.pm,v 1.28 2002/01/21 16:40:57 matthew Exp $
+# $Id: edit.pm,v 1.29 2002/03/06 20:15:35 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -27,6 +27,7 @@
 #
 # 3/20 Guy
 # 01/10/02 Matthew
+# 03/06/02 Matthew
 package Apache::edit; 
 
 use strict;
@@ -416,6 +417,18 @@
   }
   return $result;
 }
+
+#----------------------------------------------------- browse
+sub browse {
+    # insert a link to call up the filesystem browser (lonindexer)
+    my $form    = 'lonhomework';
+    my $element = &Apache::lonnet::escape("$Apache::lonxml::curdepth.bgimg");
+    my $result = <<"ENDBUTTON";
+<a href=\"javascript:openbrowser('$form','$element')\"\>Browse</a>
+ENDBUTTON
+    return $result;
+}
+
 1;
 __END__
 
@@ -514,6 +527,11 @@
 
 get_insert_list($token) : provide an insertion list based on possibilities
 from lonxml; return a scalar string
+
+=item *
+browse($elementname) : provide a link which will open up the filesystem
+browser (lonindexer) and, once a file is selected, place the result in
+the form element $elementname.
 
 =back