[LON-CAPA-cvs] cvs: loncom /interface lonpickstudent.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Sat, 21 Jul 2007 00:48:55 -0000
albertel Fri Jul 20 20:48:55 2007 EDT
Modified files:
/loncom/interface lonpickstudent.pm
Log:
- BUG#4152, improve the pickstudent filter interface (so you can modify it or clear it out.)
Index: loncom/interface/lonpickstudent.pm
diff -u loncom/interface/lonpickstudent.pm:1.20 loncom/interface/lonpickstudent.pm:1.21
--- loncom/interface/lonpickstudent.pm:1.20 Wed Dec 6 15:54:13 2006
+++ loncom/interface/lonpickstudent.pm Fri Jul 20 20:48:55 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a student from the classlist
#
-# $Id: lonpickstudent.pm,v 1.20 2006/12/06 20:54:13 albertel Exp $
+# $Id: lonpickstudent.pm,v 1.21 2007/07/21 00:48:55 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -70,11 +70,25 @@
# See if filter present
my $filter=$env{'form.filter'};
my $filtermsg;
- if ($filter ne '') {
- $filtermsg = '<br />'.&mt('Name starting with').' "'.$filter.'"<br />';
- $filter = quotemeta($filter);
- } else {
+ if ($filter eq '') {
$filter = '.'
+ } else {
+ my $encoded_filter = &HTML::Entities::encode($filter,'<>&"');
+ $filter = quotemeta($filter);
+ my $change = &mt('Change');
+ my $filterbutton =<<FILTER;
+ <input type="text" name="filter" value="$encoded_filter" />
+ <input type="submit" name="Change" value="$change" />
+FILTER
+ foreach my $name ('form','unameelement','udomelement','roles') {
+ my $value = &HTML::Entities::encode($env{"form.$name"},'<>&"');
+ $filterbutton .= <<HIDDEN;
+ <input type="hidden" name="$name" value="$value" />
+HIDDEN
+ }
+ $filtermsg = '<br />'.
+ &mt('Showing users with a name starting with [_1]',
+ $filterbutton).'<br />';
}
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};