[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm londocs.pm lonparmset.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 29 Nov 2006 15:38:22 -0000


www		Wed Nov 29 10:38:22 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm londocs.pm lonparmset.pm 
  Log:
  Filter dialog - doesn't do anything yet, just saving my work.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.474 loncom/interface/loncommon.pm:1.475
--- loncom/interface/loncommon.pm:1.474	Wed Nov 29 02:46:39 2006
+++ loncom/interface/loncommon.pm	Wed Nov 29 10:38:22 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.474 2006/11/29 07:46:39 raeburn Exp $
+# $Id: loncommon.pm,v 1.475 2006/11/29 15:38:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1377,6 +1377,23 @@
     return $selectform;
 }
 
+# For display filters
+
+sub display_filter {
+    if (!$env{'form.show'}) { $env{'form.show'}=10; }
+    return '<nobr><label>'.&mt('Records [_1]',
+			       &Apache::lonmeta::selectbox('show',$env{'form.show'},undef,
+							   (&mt('all'),10,20,50,100,1000,10000))).
+	   '</label></nobr> <nobr><label>'.
+           &mt('Filter [_1]',
+	   &select_form(($env{'form.displayfilter'}?$env{'form.displayfilter'}:'currentfolder'),
+					'displayfilter',
+					('currentfolder' => 'Current folder',
+					 'containing' => 'Containing phrase',
+					 'none' => 'None'))).
+	   '<input type="text" name="containingphrase" size="30" /></label></nobr>';
+}
+
 sub gradeleveldescription {
     my $gradelevel=shift;
     my %gradelevels=(0 => 'Not specified',
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.258 loncom/interface/londocs.pm:1.259
--- loncom/interface/londocs.pm:1.258	Tue Nov 28 10:03:19 2006
+++ loncom/interface/londocs.pm	Wed Nov 29 10:38:22 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.258 2006/11/28 15:03:19 www Exp $
+# $Id: londocs.pm,v 1.259 2006/11/29 15:38:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1086,12 +1086,7 @@
 	    'randompick'     => 'Randomly pick',
 	    'set'            => 'set to',
 	    'del'            => 'deleted');
-
-    my $countselect =
-        &Apache::lonmeta::selectbox('show',$env{'form.show'},undef,
-                                    (&mt('all'),10,20,50,100,1000,10000));
-
-    $r->print('<nobr>'.&mt('[_1] Records',$countselect).'</nobr>'.
+    $r->print(&Apache::loncommon::display_filter().
               '<input type="submit" value="'.&mt('Display').'" /></form>');
     $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
               '<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Folder').'</th><th>'.&mt('Before').'</th><th>'.
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.347 loncom/interface/lonparmset.pm:1.348
--- loncom/interface/lonparmset.pm:1.347	Mon Nov 20 16:04:44 2006
+++ loncom/interface/lonparmset.pm	Wed Nov 29 10:38:22 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.347 2006/11/20 21:04:44 banghart Exp $
+# $Id: lonparmset.pm,v 1.348 2006/11/29 15:38:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3706,13 +3706,7 @@
                                               \%saveable_parameters);
     &Apache::loncommon::restore_course_settings('parameter_log',
                                                 \%saveable_parameters);
-    if (!$env{'form.show'}) { $env{'form.show'}=10; }
-
-    my $countselect =
-	&Apache::lonmeta::selectbox('show',$env{'form.show'},undef,
-				    (&mt('all'),10,20,50,100,1000,10000));
-
-    $r->print('<nobr>'.&mt('[_1] Records',$countselect).'</nobr>'.
+    $r->print(&Apache::loncommon::display_filter().
               '<label>'.&Apache::lonhtmlcommon::checkbox('includetypes',$env{'form.includetypes'},'1').
 	      ' '.&mt('Include parameter types').'</label>'.
 	      '<input type="submit" value="'.&mt('Display').'" /></form>');