[LON-CAPA-cvs] cvs: modules /gerd/harvesting lonrecommender.pm

www www at source.lon-capa.org
Thu Jul 19 09:10:47 EDT 2012


www		Thu Jul 19 13:10:47 2012 EDT

  Modified files:              
    /modules/gerd/harvesting	lonrecommender.pm 
  Log:
  Previous and Next buttons
  
  
Index: modules/gerd/harvesting/lonrecommender.pm
diff -u modules/gerd/harvesting/lonrecommender.pm:1.27 modules/gerd/harvesting/lonrecommender.pm:1.28
--- modules/gerd/harvesting/lonrecommender.pm:1.27	Thu Jul 19 01:37:06 2012
+++ modules/gerd/harvesting/lonrecommender.pm	Thu Jul 19 13:10:47 2012
@@ -5,7 +5,7 @@
 #
 # MODIFY $datapath VARIABLE FOR LOCATION OF DATA FILES
 #
-# $Id: lonrecommender.pm,v 1.27 2012/07/19 01:37:06 www Exp $
+# $Id: lonrecommender.pm,v 1.28 2012/07/19 13:10:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -457,12 +457,30 @@
 }
 
 # =================================================================================
+# Previous and Next buttons
+
+sub prevnext {
+   my ($r,$lower,$interval)=@_;
+   my $currentcmd=&unescape($env{'form.cmd'});
+   $currentcmd=~s/\#\d+$//;
+   my $thislower;
+   if ($lower>=$interval) {
+      $thislower=$lower-$interval;
+      $r->print(&submit_link(&mt('Previous'),$currentcmd.'#'.$thislower).' ');
+   }
+   $thislower=$lower+$interval;
+   $r->print(&submit_link(&mt('Next'),$currentcmd.'#'.$thislower));
+}
+
+# =================================================================================
 # Display a filtered, sorted, list
 
 sub display {
    my ($r,$taxonomy_categories,$selectedids,$filter,$lower,$interval,$idhash)=@_;
    &filter($filter,$selectedids,$idhash);
+   &prevnext($r,$lower,$interval);
    &display_list($r,0,$taxonomy_categories,&urlres_array((&sorted_list($selectedids,keys(%$idhash)))[$lower..$lower+$interval-1]));
+   &prevnext($r,$lower,$interval);
 }
 
 # =================================================================================




More information about the LON-CAPA-cvs mailing list