--- loncom/homework/edit.pm 2002/03/06 20:15:35 1.29
+++ loncom/homework/edit.pm 2002/03/22 20:05:19 1.32
@@ -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.32 2002/03/22 20:05:19 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,7 +31,8 @@
package Apache::edit;
use strict;
-use Apache::lonnet;
+use Apache::lonnet();
+use HTML::Entities();
# Global Vars
# default list of colors to use in editing
@@ -301,6 +302,18 @@ sub textarea_sizes {
return ($rows,$cols);
}
+sub editline {
+ my ($tag,$data,$description,$size)=@_;
+ $data=&HTML::Entities::encode($data);
+ if ($description) { $description=" ".$description." "; }
+ my $result = <<"END";
+$description
+
+END
+ return $result;
+}
+
sub editfield {
my ($tag,$data,$description,$minwidth,$minheight)=@_;
@@ -309,7 +322,9 @@ sub editfield {
if ($cols < $minwidth ) { $cols = $minwidth; }
if ($rows < $minheight) { $rows = $minheight; }
if ($description) { $description=" ".$description." "; }
- return "$description\n \n";
+ return $description."\n".' '."\n";
}
sub modifiedfield {
@@ -421,14 +436,28 @@ sub select_or_text_arg {
#----------------------------------------------------- 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";
Browse
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";
+Search
+ENDBUTTON
+ return $result;
+}
+
+
1;
__END__
@@ -533,6 +562,16 @@ browse($elementname) : provide a link wh
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.
+
+= item *
+editline(tag,data,description,size): Provide a for
+single-line text entry. This is to be used for text enclosed by tags, not
+arguements/parameters associated with a tag.
+
=back
incomplete...