[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm

banghart lon-capa-cvs-allow@mail.lon-capa.org
Fri, 17 Aug 2007 18:14:37 -0000


banghart		Fri Aug 17 14:14:37 2007 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  	Bug 2633. Use filecategories.tab to populate select.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.175 loncom/interface/lonindexer.pm:1.176
--- loncom/interface/lonindexer.pm:1.175	Wed Aug  1 20:10:59 2007
+++ loncom/interface/lonindexer.pm	Fri Aug 17 14:14:37 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.175 2007/08/02 00:10:59 banghart Exp $
+# $Id: lonindexer.pm,v 1.176 2007/08/17 18:14:37 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,7 +106,7 @@
 
     my $fileclr='#ffffe6';
     my $line;
-    my (@attrchk,@openpath,%typechk);
+    my (@attrchk,@openpath,$typeselect);
     my $uri=$r->uri;
 
 # -------------------------------------- see if called from an interactive mode
@@ -411,16 +411,11 @@
 						 {'domain' => $headerdom,}));
 # ---------------------------------- get state of file types to be showing
 	if ($env{'form.only'}) {
-	    if ($env{'form.only'} eq 'problem' ) {
-	        $typechk{'problem'} = 'selected';
-	    } elsif ($env{'form.only'} eq 'gif,jpg,jpeg' ) {
-	        $typechk{'graphic'} = 'selected';
-	    } 
+	    $typeselect = $env{'form.only'};
 	} else {
-	    $typechk{'all'} = 'selected';
+	    $typeselect = '';
 	}
 
-
 # ---------------------------------- get state of file attributes to be showing
 	if ($env{'form.attrs'}) {
 	    for (my $i=0; $i<=11; $i++) {
@@ -482,11 +477,11 @@
 </tr>
 </table>
 <input type="hidden" name="attrs" value="1" />
-<label><select name="only" onClick="this.form.submit()">
-<option value='problem' $typechk{'problem'}>Problems</option>
-<option value='gif,jpg,jpeg' $typechk{'graphic'}>Graphics</option>
-<option value='' $typechk{'all'}>All</option>
-</select>File Types Displayed</label>
+<label>
+END
+$r->print(&Apache::loncommon::filecategoryselect('only',$typeselect));
+$r->print(<<END);
+File Type Displayed</label>
 <br />
 <input type="submit" name="updatedisplay" value="$lt{'ud'}" />
 <input type="hidden" name="acts" value="" />