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

www www at source.lon-capa.org
Tue Aug 14 18:16:00 EDT 2012


www		Tue Aug 14 22:16:00 2012 EDT

  Modified files:              
    /modules/gerd/harvesting	lonrecommender.pm 
  Log:
  Usability
  
  
Index: modules/gerd/harvesting/lonrecommender.pm
diff -u modules/gerd/harvesting/lonrecommender.pm:1.34 modules/gerd/harvesting/lonrecommender.pm:1.35
--- modules/gerd/harvesting/lonrecommender.pm:1.34	Sun Jul 29 20:13:10 2012
+++ modules/gerd/harvesting/lonrecommender.pm	Tue Aug 14 22:16:00 2012
@@ -5,7 +5,7 @@
 #
 # MODIFY $datapath VARIABLE FOR LOCATION OF DATA FILES
 #
-# $Id: lonrecommender.pm,v 1.34 2012/07/29 20:13:10 www Exp $
+# $Id: lonrecommender.pm,v 1.35 2012/08/14 22:16:00 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -484,6 +484,17 @@
 }
 
 # =================================================================================
+# Clear file in groupimport format
+#
+
+sub clear_groupimportfile {
+   my $diropendb =
+        "/home/httpd/perl/tmp/$env{'user.domain'}_$env{'user.name'}_sel_res.db";
+# Remove old garbage
+   unlink($diropendb);
+}
+
+# =================================================================================
 # Execute any edit commands (at the moment only add and remove)
 #
 
@@ -545,9 +556,13 @@
    my %urlids=&urlres(@urls);
    my %taxoids=&taxoids(values(%urlids));
    $r->print(&Apache::loncommon::start_data_table());
-   foreach my $url (@urls) {
-      if ($url) {
-         $r->print(&display_line($url,$taxocats,$taxoids{$urlids{$url}},$editflag));
+   if ($#urls<0) {
+      $r->print('<br />'.&mt('Nothing found.').'<br />');
+   } else {
+      foreach my $url (@urls) {
+         if ($url) {
+            $r->print(&display_line($url,$taxocats,$taxoids{$urlids{$url}},$editflag));
+         }
       }
    }
    $r->print(&Apache::loncommon::end_data_table());
@@ -665,6 +680,18 @@
 }
 
 # =================================================================================
+# A big submitting link
+# 
+
+sub big_submit_link {
+    return &Apache::loncommon::start_data_table().
+           '<tr><th><font size="+1">'.
+           &submit_link(@_).
+           '</font></th></tr>'.
+           &Apache::loncommon::end_data_table();
+}
+
+# =================================================================================
 # Get a directory listing. This is the only thing that is loaded "fresh",
 # since the other information has been compiled earlier
 # 
@@ -842,6 +869,7 @@
              push(@existingbasket,$importbasket);
           }
        }
+       &clear_groupimportfile();
     }
     my $basketcache=join(',', at existingbasket);
 # ------ Now have array @existingbasket and string $basketcache
@@ -882,7 +910,8 @@
     $searchterm=~s/[\"\']//gs;
     if ($cmd ne 'search') { $searchterm=''; }
     $r->print(&Apache::loncommon::start_data_table().'<tr>');
-    $r->print("<td><input type='text' size='40' name='searchterm' value='$searchterm'".
+    $r->print("<th>".&mt('Search by Keyword')."</th>".
+              "<td><input type='text' size='40' name='searchterm' value='$searchterm'".
               " onChange='this.form.cmd.value=\"search\";this.form.submit();'>".
               &submit_link(&mt('Search'),'search')."</td>");
     $r->print("<th rowspan='3' align='right' bgcolor='#DDDDFF'>".
@@ -890,9 +919,9 @@
               &submit_link(&mt('Your cart ([_1] item(s))',$#selectedurls+1),'showbasket').
               "</th>");
     $r->print("</tr>\n<tr>");
-    $r->print('<td>'.&list_toplevel_cats(\%taxonomy_categories).'</td>');
+    $r->print('<th>'.&mt('Browse by Topic').'</th><td>'.&list_toplevel_cats(\%taxonomy_categories).'</td>');
     $r->print("</tr>\n<tr>");
-    $r->print("<td>".&mt("Filter Lists").' '.&filter_menu($filter)."</td>");
+    $r->print("<th>".&mt("Filter Lists").'</th><td>'.&filter_menu($filter)."</td>");
     $r->print("\n</tr>".&Apache::loncommon::end_data_table());
 # ------ End header row
     if (($cmd eq 'showbasket') || ($cmd=~/^(add|rem)\:/)) {
@@ -906,13 +935,14 @@
     } elsif ($cmd=~/^taxo\:(.*)$/) {
        my $taxocat=$1;
        $r->print(&list_nextlevel_cats($taxocat,\%taxonomy_categories));
+       $r->rflush();
        &display($r,\%taxonomy_categories,\%selectedids,$filter,$lower,20,&taxonomy_members($taxocat));
     } elsif ($cmd=~/^dir\:(.*)$/) {
        &show_dir_list($r,\%taxonomy_categories,$filter,$1);
     } elsif ($cmd=~/^indiv\:/) {
        if ($cmd=~/\:(.+)$/) {
           my $url=$1;
-          $r->print('<h2>'.&Apache::lonnet::gettitle($url).'</h2>'.&submit_link(&mt('Add this resource'),'add:'.$url));
+          $r->print('<h2>'.&Apache::lonnet::gettitle($url).'</h2>'.&big_submit_link(&mt('Add this resource'),'add:'.$url));
           $r->print('<iframe src="'.$url.'?inhibitmenu=yes" width="100%" height="50%"></iframe>'."\n");
           my %urlid=&urlres($url);
           if ($urlid{$url}) {
@@ -961,6 +991,6 @@
 </p>
 </font>
 ENDCONSENT
-   $r->print(&submit_link(&mt('I agree'),'gaveconsent'));
+   $r->print(&big_submit_link(&mt('I agree'),'gaveconsent'));
 }
 1;




More information about the LON-CAPA-cvs mailing list