[LON-CAPA-cvs] cvs: modules /gerd/harvesting recommender.pl

www www at source.lon-capa.org
Wed Nov 23 10:07:24 EST 2011


www		Wed Nov 23 15:07:24 2011 EDT

  Modified files:              
    /modules/gerd/harvesting	recommender.pl 
  Log:
  Slightly better screen output for mock-up recommender
  
  
Index: modules/gerd/harvesting/recommender.pl
diff -u modules/gerd/harvesting/recommender.pl:1.7 modules/gerd/harvesting/recommender.pl:1.8
--- modules/gerd/harvesting/recommender.pl:1.7	Mon Oct 10 14:09:28 2011
+++ modules/gerd/harvesting/recommender.pl	Wed Nov 23 15:07:24 2011
@@ -177,16 +177,16 @@
 #
 # This is the focus on one resource
 #
-  print "<h3>Focus</h3>\n";
-  &outputlink($url[$env{'form.focus'}],'view',$env{'form.focus'});
+  &outputlink($url[$env{'form.focus'}],'focus',$env{'form.focus'});
   print "<br /><a href='/cgi-bin/recommender.pl' target='_top'>Back to Basket</a>";
+  print "<table border='0'><tr><td bgcolor='yellow'>\n";
   print("<h3>Resource Recommendations</h3>"); 
   for (my $i=0;$i<=15; $i++) {
       if ($basketresults[$i]) {
          &outputlink($url[$basketresults[$i]],'view',$basketresults[$i]);
       }
   }
-
+  print "</td></tr></table>\n";
 } else {
   print "\n<hr />\n";
   foreach my $thissub (sort(keys(%subs))) {
@@ -209,13 +209,14 @@
 #
 # List basket
 #
+   print("<table border='0'><tr><td bgcolor='lightgreen'>");
    print("\n<h3>Current Basket</h3>\n");
    my %baskettaxos=();
    foreach my $key (sort(keys(%basket))) {
       &outputlink($url[$key],'edit',$key);
       $baskettaxos{$taxo[$key]}++;
    }
-
+   print("</td></tr></table>");
 # Show taxonomies
    print "<hr />Basket taxonomies:";
    my $last='';
@@ -232,13 +233,14 @@
 #
 # Basket association display
 #
-
+   print "<table border='0'><tr><td bgcolor='yellow'>";
    print "<h3>Basket Recommendations</h3>";
    for (my $i=0;$i<=15; $i++) {
       if ($basketresults[$i]) {
          &outputlink($url[$basketresults[$i]],'view',$basketresults[$i]);
       }
    }
+   print "</td></tr></table>";
 
 # Search results
    if (($env{'form.search'}) || ($env{'form.taxsearch'})) {
@@ -270,7 +272,7 @@
 
       for (my $i=0; $i<=20; $i++) {
          if ($results[$i]) {
-            &outputlink($url[$results[$i]],'view',$i);
+            &outputlink($url[$results[$i]],'view',$results[$i]);
          }
       }
    }
@@ -297,6 +299,7 @@
    my (@parts)=split(/\//,$path);
    my $build='/';
    print("<br /><tt>");
+   if ($mode eq 'focus') { print "<h1>Focus: "; }
    for (my $j=1;$j<=$#parts-($dirflag?0:1);$j++) {
        $build.=$parts[$j].'/';
        print("/<a href='/cgi-bin/recommender.pl?browse=".&escape($build)."' target='_top'>$parts[$j]</a>");
@@ -304,13 +307,14 @@
    print("</tt>");
    unless ($dirflag) {
       print("/<a href='/cgi-bin/recommender.pl?preview=".$i.':'.&escape($path)."' target='_top'>$parts[-1]</a>");
-      if ($mode eq 'view') {
+      if (($mode eq 'view') || ($mode eq 'focus')) {
          print("&nbsp<a href='/cgi-bin/recommender.pl?add=$i' target='_top'>Add</a>");
       }
       if ($mode eq 'edit') {
          print("&nbsp<a href='/cgi-bin/recommender.pl?del=$i' target='_top'>Remove</a>");
       }
    }
+   if ($mode eq 'focus') { print "</h1>"; }
 } 
 
 sub taxolink {




More information about the LON-CAPA-cvs mailing list