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

jms jms@source.lon-capa.org
Thu, 19 Mar 2009 15:01:24 -0000


jms		Thu Mar 19 15:01:24 2009 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Added "Standards" field
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.194 loncom/interface/lonindexer.pm:1.195
--- loncom/interface/lonindexer.pm:1.194	Thu Mar 19 14:24:50 2009
+++ loncom/interface/lonindexer.pm	Thu Mar 19 15:01:24 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.194 2009/03/19 14:24:50 jms Exp $
+# $Id: lonindexer.pm,v 1.195 2009/03/19 15:01:24 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -420,7 +420,7 @@
 
 # ---------------------------------- get state of file attributes to be showing
 	if ($env{'form.attrs'}) {
-	    for (my $i=0; $i<=15; $i++) {
+	    for (my $i=0; $i<=16; $i++) {
 		delete $hash{'display_attrs_'.$i};
 		if ($env{'form.attr'.$i} == 1) {
 		    $attrchk[$i] = 'checked';
@@ -428,7 +428,7 @@
 		}
 	    }
 	} else {
-	    for (my $i=0; $i<=15; $i++) {
+	    for (my $i=0; $i<=16; $i++) {
 		$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
 	    }
 	}
@@ -449,6 +449,7 @@
 					   'ab' => 'Abstract',
 					   'ln' => 'Language',
 					   'gl' => 'Grade Level',
+					   'sd' => 'Standards',
 					   'sa' => 'Source Available',
 					   'sr' => 'Show resource',
 					   'li' => 'Linked/Related Resources',
@@ -472,6 +473,7 @@
 <td><label><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</label></td>
 <td><label><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</label></td>
 <td><label><input type="checkbox" name="attr13" value="1" $attrchk[13] onClick="this.form.submit();" /> $lt{'nt'}</label></td>
+<td><label><input type="checkbox" name="attr16" value="1" $attrchk[16] onClick="this.form.submit();" /> $lt{'sd'}</label></td>
 </tr>
 <tr>
 <td><label><input type="checkbox" name="attr1" value="1" $attrchk[1] onClick="this.form.submit();" /> $lt{'si'}</label></td>
@@ -479,6 +481,7 @@
 <td><label><input type="checkbox" name="attr3" value="1" $attrchk[3] onClick="this.form.submit();" /> $lt{'lm'}</label></td>
 <td><label><input type="checkbox" name="attr10" value="1" $attrchk[10] onClick="this.form.submit();" /> $lt{'sa'}</label></td>
 <td><label><input type="checkbox" name="attr14" value="1" $attrchk[14] onClick="this.form.submit();" /> $lt{'ab'}</label></td>
+<td>&nbsp;</td>
 </tr>
 <tr>
 <td><label><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</label></td>
@@ -585,6 +588,8 @@
 	    if ($hash{'display_attrs_14'} == 1);
 	$r->print("<th>".&mt("Grade Level")."</th>\n")
 	    if ($hash{'display_attrs_15'} == 1);
+	$r->print("<th>".&mt("Standards")."</th>\n")
+	    if ($hash{'display_attrs_16'} == 1);
 	    
     $r->print(&Apache::loncommon::end_data_table_header_row());
     
@@ -854,7 +859,7 @@
 
     my $tabtag='</td>';
     my $i=0;
-    while ($i<=15) {
+    while ($i<=16) {
 	$tabtag=join('',$tabtag,"<td>&nbsp;</td>")
 	    if ($i != 9 &&
 		$hash{'display_attrs_'.$i} == 1);
@@ -1159,6 +1164,12 @@
 		      " </td>\n");
 	}
 	
+	if ($hash{'display_attrs_16'} == 1) {
+	    my $standards = &Apache::lonnet::metadata($filelink,'standards');
+	    $r->print('<td> '.($standards eq '' ? '&nbsp;' : $standards).
+		      " </td>\n");
+	}
+	
 	$r->print(&Apache::loncommon::end_data_table_row());
 }
     
@@ -1268,6 +1279,13 @@
 		      " </td>\n");
 	}
 	
+	if ($hash{'display_attrs_16'} == 1) {
+	    my $standards = &Apache::lonnet::metadata($filelink,'standards');
+	    $r->print('<td> '.($standards eq '' ? '&nbsp;' : $standards).
+		      " </td>\n");
+	}
+	
+	
 	$r->print(&Apache::loncommon::end_data_table_row());
     }