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

www lon-capa-cvs@mail.lon-capa.org
Wed, 16 Jun 2004 23:39:01 -0000


www		Wed Jun 16 19:39:01 2004 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  New column for links, remove statistics garbage code.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.110 loncom/interface/lonindexer.pm:1.111
--- loncom/interface/lonindexer.pm:1.110	Sat Jun 12 00:44:31 2004
+++ loncom/interface/lonindexer.pm	Wed Jun 16 19:39:01 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.110 2004/06/12 04:44:31 albertel Exp $
+# $Id: lonindexer.pm,v 1.111 2004/06/16 23:39:01 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -53,12 +53,14 @@
 use Apache::File;
 use Apache::lonlocal;
 use Apache::lonsource();
+use LONCAPA::lonmetadata();
 use GDBM_File;
 
 # ---------------------------------------- variables used throughout the module
 my %hash; # global user-specific gdbm file
 my %dirs; # keys are directories, values are the open/close status
 my %language; # has the reference information present in language.tab
+my %dynhash; # hash of hashes for dynamic metadata
 
 # ----- Values which are set by the handler subroutine and are accessible to
 # -----     other methods.
@@ -407,7 +409,7 @@
 	
 # ---------------------------------- get state of file attributes to be showing
 	if ($ENV{'form.attrs'}) {
-	    for (my $i=0; $i<=10; $i++) {
+	    for (my $i=0; $i<=11; $i++) {
 		delete $hash{'display_attrs_'.$i};
 		if ($ENV{'form.attr'.$i} == 1) {
 		    $attrchk[$i] = 'checked';
@@ -415,7 +417,7 @@
 		}
 	    }
 	} else {
-	    for (my $i=0; $i<=10; $i++) {
+	    for (my $i=0; $i<=11; $i++) {
 		$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
 	    }
 	}
@@ -434,6 +436,7 @@
 					   'ln' => 'Language',
 					   'sa' => 'Source Available',
 					   'sr' => 'Show resource',
+					   'li' => 'Linked/Related Resources',
 					   'av' => 'All versions',
 					   'ud' => 'Update Display'
 					   );
@@ -455,7 +458,7 @@
 <td><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</td>
 <td><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</td>
 <td><input type="checkbox" name="attr9" value="1" $attrchk[9] onClick="this.form.submit();" /> $lt{'av'}</td>
-<td>&nbsp;</td>
+<td><input type="checkbox" name="attr11" value="1" $attrchk[11] onClick="this.form.submit();" /> $lt{'li'}</td>
 </tr></table>
 <input type="hidden" name="attrs" value="1" />
 <input type="submit" name="updatedisplay" value="$lt{'ud'}" />
@@ -516,6 +519,8 @@
 	    if ($hash{'display_attrs_8'} == 1);
 	$r->print("<td><b>".&mt("Source Available")."</b></td>\n")
 	    if ($hash{'display_attrs_10'} == 1);
+	$r->print("<td><b>".&mt("Linked/Related Resources")."</b></td>\n")
+	    if ($hash{'display_attrs_11'} == 1);
 	$r->print('</tr>');
 
 # ----------------- read in what directories have previously been set to "open"
@@ -1001,12 +1006,9 @@
 		      " </td>\n");
         }
 	if ($hash{'display_attrs_8'} == 1) {
-	    my (%stat) = &Apache::lonmeta::dynamicmeta($filelink);
-	    my $stat = (exists($stat{'course'}) ? $stat{'course'} : '').
-		((exists($stat{'course'}) || exists($stat{'count'})) ? '/' : '').
-		(exists($stat{'count'}) ? $stat{'count'} : '');
-	    $r->print('<td align=center> '.($stat eq '' ? '&nbsp;' : $stat).
-		      ' </td>'."\n");
+# statistics
+	    $r->print("<td>&nbsp;</td>\n");
+
 	}
 	if ($hash{'display_attrs_10'} == 1) {
 	    my $source = &Apache::lonnet::metadata($filelink,'sourceavail');
@@ -1016,9 +1018,13 @@
 			  "', 'previewsource', '700', '700', 'no', 'yes','yes')\";".
 			  " TARGET=_self>Yes</a> "."</td>\n");
 	    } else { #A cuddled else. :P
-		$r->print('<td>'."</td>\n");
+		$r->print("<td>&nbsp;</td>\n");
 	    }
 	}
+	if ($hash{'display_attrs_11'} == 1) {
+# links
+	    $r->print("<td>&nbsp;</td>\n");
+	}
 	$r->print("</tr>\n");
     }
 
@@ -1098,6 +1104,9 @@
 	if ($hash{'display_attrs_10'} == 1) {
 	   $r->print('<td>&nbsp;</td>');
 	}
+	if ($hash{'display_attrs_11'} == 1) {
+	   $r->print('<td>&nbsp;</td>');
+	}
 	$r->print('</form></tr>');
     }