[LON-CAPA-cvs] cvs: loncom /homework edit.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Fri, 08 Mar 2002 18:30:33 -0000
matthew Fri Mar 8 13:30:33 2002 EDT
Modified files:
/loncom/homework edit.pm
Log:
Added search(), which inserts a link to the search page. Fixed hard-coded
information in browse().
Index: loncom/homework/edit.pm
diff -u loncom/homework/edit.pm:1.29 loncom/homework/edit.pm:1.30
--- loncom/homework/edit.pm:1.29 Wed Mar 6 15:15:35 2002
+++ loncom/homework/edit.pm Fri Mar 8 13:30:33 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.29 2002/03/06 20:15:35 matthew Exp $
+# $Id: edit.pm,v 1.30 2002/03/08 18:30:33 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -421,14 +421,28 @@
#----------------------------------------------------- browse
sub browse {
# insert a link to call up the filesystem browser (lonindexer)
+ $_ = shift;
my $form = 'lonhomework';
- my $element = &Apache::lonnet::escape("$Apache::lonxml::curdepth.bgimg");
+ my $element = &Apache::lonnet::escape("$Apache::lonxml::curdepth.$_");
my $result = <<"ENDBUTTON";
<a href=\"javascript:openbrowser('$form','$element')\"\>Browse</a>
ENDBUTTON
return $result;
}
+#----------------------------------------------------- browse
+sub search {
+ # insert a link to call up the filesystem browser (lonindexer)
+ $_ = shift;
+ my $form = 'lonhomework';
+ my $element = &Apache::lonnet::escape("$Apache::lonxml::curdepth.$_");
+ my $result = <<"ENDBUTTON";
+<a href=\"javascript:opensearcher('$form','$element')\"\>Search</a>
+ENDBUTTON
+ return $result;
+}
+
+
1;
__END__
@@ -531,6 +545,11 @@
=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.
+
+=item *
+search($elementname) : provide a link which will open up the filesystem
+searcher (lonsearchcat) and, once a file is selected, place the result in
the form element $elementname.
=back