[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonbulletin.pm lonsearchcat.pm lonsimplepage.pm lonsyllabus.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 10 Mar 2003 14:20:07 -0000


www		Mon Mar 10 09:20:07 2003 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm lonbulletin.pm lonsearchcat.pm 
                     	lonsimplepage.pm lonsyllabus.pm 
  Log:
  Make upload filetype "filter" case insensitive
  Show course search progress and check for aborted connection
  Spelling mistake
  
  
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.14 loncom/interface/lonaboutme.pm:1.15
--- loncom/interface/lonaboutme.pm:1.14	Mon Mar  3 08:03:58 2003
+++ loncom/interface/lonaboutme.pm	Mon Mar 10 09:20:07 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.14 2003/03/03 13:03:58 www Exp $
+# $Id: lonaboutme.pm,v 1.15 2003/03/10 14:20:07 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -103,7 +103,7 @@
       }
       if (($ENV{'form.uploaddoc.filename'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {
- 	  if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/) {
+ 	  if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
              $syllabus{'uploaded.photourl'}=
                  &Apache::lonnet::userfileupload('uploaddoc');
  	  }
Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.8 loncom/interface/lonbulletin.pm:1.9
--- loncom/interface/lonbulletin.pm:1.8	Mon Mar  3 08:03:58 2003
+++ loncom/interface/lonbulletin.pm	Mon Mar 10 09:20:07 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Bulletin Board Handler
 #
-# $Id: lonbulletin.pm,v 1.8 2003/03/03 13:03:58 www Exp $
+# $Id: lonbulletin.pm,v 1.9 2003/03/10 14:20:07 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -105,7 +105,7 @@
       }
       if (($ENV{'form.uploaddoc.filename'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {
- 	  if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/) {
+ 	  if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
              $syllabus{'uploaded.photourl'}=
                  &Apache::lonnet::userfileupload('uploaddoc',1);
  	  }
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.168 loncom/interface/lonsearchcat.pm:1.169
--- loncom/interface/lonsearchcat.pm:1.168	Fri Mar  7 22:24:58 2003
+++ loncom/interface/lonsearchcat.pm	Mon Mar 10 09:20:07 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.168 2003/03/08 03:24:58 www Exp $
+# $Id: lonsearchcat.pm,v 1.169 2003/03/10 14:20:07 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -142,9 +142,13 @@
 my $hidden_fields;
 my $bodytag;
 
+#
+# For course search
+#
 my %alreadyseen;
 my $hashtied;
 my %hash;
+my $totalfound;
  
 ######################################################################
 ######################################################################
@@ -418,6 +422,7 @@
     }
     my $fulltext=$ENV{'form.crsfulltext'};
     my @allwords=($search_string,@New_Words);
+    $totalfound=0;
     $r->print('<html><head><title>LON-CAPA Course Search</title></head>'.
 	      $bodytag.$pretty_search_string);
     $r->rflush();
@@ -425,13 +430,18 @@
    $hashtied=0;
    undef %alreadyseen;
    %alreadyseen=();
+    my $c=$r->connection;
    &tiehash();
    foreach (keys %hash) {
+       if ($c->aborted()) { last; }
        if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) {
            &checkonthis($r,$hash{$_},0,$hash{'title_'.$1},$fulltext,@allwords);
        }
    }
    &untiehash();
+    unless ($totalfound) {
+	$r->print('<p>No resources found.</p>');
+    }
 # =================================================== Done going through course
     $r->print('</body></html>');
 }
@@ -482,9 +492,12 @@
            $r->print('&nbsp;');
        }
        $r->print('<a href="'.$url.'" target="cat">'.
-		 ($title?$title:$url).'</a>');
-       $r->rflush();
+		 ($title?$title:$url).'</a><br />');
+       $totalfound++;
+    } elsif ($fulltext) {
+       $r->print(' .');
     }
+    $r->rflush();
 # Check also the dependencies of this one
     my $dependencies=
                 &Apache::lonnet::metadata($url,'dependencies');
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.8 loncom/interface/lonsimplepage.pm:1.9
--- loncom/interface/lonsimplepage.pm:1.8	Mon Mar  3 08:03:58 2003
+++ loncom/interface/lonsimplepage.pm	Mon Mar 10 09:20:07 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.8 2003/03/03 13:03:58 www Exp $
+# $Id: lonsimplepage.pm,v 1.9 2003/03/10 14:20:07 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,7 +104,7 @@
       }
       if (($ENV{'form.uploaddoc.filename'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {
- 	  if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/) {
+ 	  if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
              $syllabus{'uploaded.photourl'}=
                  &Apache::lonnet::userfileupload('uploaddoc',1);
  	  }
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.15 loncom/interface/lonsyllabus.pm:1.16
--- loncom/interface/lonsyllabus.pm:1.15	Mon Mar  3 08:03:58 2003
+++ loncom/interface/lonsyllabus.pm	Mon Mar 10 09:20:07 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.15 2003/03/03 13:03:58 www Exp $
+# $Id: lonsyllabus.pm,v 1.16 2003/03/10 14:20:07 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -105,7 +105,7 @@
        }
        if ($allowed) {
           $r->print('<p>'.
-&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'</p><p>This syllabus can be publically viewed at <tt>http://'.
+&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'</p><p>This syllabus can be publicly viewed at <tt>http://'.
 		    $Apache::lonnet::hostname{$homeserver}.$r->uri.'</tt>'.
                &Apache::loncommon::help_open_topic('Syllabus_ExtLink').'</p>'.
 	  '<p><a href="'.$r->uri.'?forcestudent=1">Show Student View</a>'.