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

www www at source.lon-capa.org
Wed Jul 18 15:24:05 EDT 2012


www		Wed Jul 18 19:24:05 2012 EDT

  Modified files:              
    /modules/gerd/harvesting	lonrecommender.pm 
  Log:
  Allow for ">> Next" link in table display
  
  
Index: modules/gerd/harvesting/lonrecommender.pm
diff -u modules/gerd/harvesting/lonrecommender.pm:1.23 modules/gerd/harvesting/lonrecommender.pm:1.24
--- modules/gerd/harvesting/lonrecommender.pm:1.23	Wed Jul 18 17:24:47 2012
+++ modules/gerd/harvesting/lonrecommender.pm	Wed Jul 18 19:24:05 2012
@@ -5,7 +5,7 @@
 #
 # MODIFY $datapath VARIABLE FOR LOCATION OF DATA FILES
 #
-# $Id: lonrecommender.pm,v 1.23 2012/07/18 17:24:47 www Exp $
+# $Id: lonrecommender.pm,v 1.24 2012/07/18 19:24:05 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -713,6 +713,9 @@
     my @selectedurls=&read_groupimportfile();
 # ------ Pick up commands
     my $cmd=&unescape($env{'form.cmd'});
+    $cmd=~s/\#(\d+)$//;
+    my $lower=$1;
+    unless ($lower) { $lower=0; }
 # ------ ... and execute any editing commands
     if ($cmd=~/^(add|rem)\:/) {
        @selectedurls=&edit_commands($cmd, at selectedurls);
@@ -739,8 +742,8 @@
     my $searchterm=$env{'form.searchterm'};
     $searchterm=~s/[\"\']//gs;
     $r->print("<table width='100%'><tr>\n");
-    $r->print("<td><input type='text' size='40' name='searchterm' value='$searchterm' /><input type='submit' name='search' value='".
-              &mt('Search')."' /></td>");
+    $r->print("<td><input type='text' size='40' name='searchterm' value='$searchterm' />".
+              &submit_link(&mt('Search'),'search')."</td>");
     $r->print("<td rowspan='2' align='right' bgcolor='#DDDDFF'>".
               "<font size='+1'><a href='/adm/groupsort?inhibitmenu=yes'>".&mt("Checkout")."</a></font><br /> <br />".
               &submit_link(&mt('Your cart ([_1] item(s))',$#selectedurls+1),'showbasket').
@@ -752,12 +755,12 @@
     if (($cmd eq 'showbasket') || ($cmd=~/^rem\:/)) {
        $r->print("\n<h1>".&mt("Current Cart")."</h1>\n");
        &display_list($r,1,\%taxonomy_categories, at selectedurls);
-    } elsif ($env{'form.search'}) {
-       my %list=&urlres((&keyword_search($filter,\@baseids,$env{'form.searchterm'}))[0..9]);
+    } elsif ($cmd eq 'search') {
+       my %list=&urlres((&keyword_search($filter,\@baseids,$env{'form.searchterm'}))[$lower..$lower+19]);
        &display_list($r,0,\%taxonomy_categories,values(%list));
     } elsif ($cmd=~/^taxo\:/) {
        $r->print(&list_nextlevel_cats($cmd,\%taxonomy_categories));
-       my %list=&urlres((&taxonomy_list($cmd,\%taxonomy_categories,$filter, at baseids))[0..9]);
+       my %list=&urlres((&taxonomy_list($cmd,\%taxonomy_categories,$filter, at baseids))[$lower..$lower+19]);
        &display_list($r,0,\%taxonomy_categories,values(%list));
     } elsif ($cmd=~/^dir\:(.*)$/) {
        &show_dir_list($r,\%taxonomy_categories,$filter,$1);




More information about the LON-CAPA-cvs mailing list