[LON-CAPA-cvs] cvs: loncom /interface lonsearchcourse.pm

raeburn raeburn at source.lon-capa.org
Tue Sep 22 07:23:08 EDT 2020


raeburn		Tue Sep 22 11:23:08 2020 EDT

  Modified files:              
    /loncom/interface	lonsearchcourse.pm 
  Log:
  - Content Search only in course context.
  
  
Index: loncom/interface/lonsearchcourse.pm
diff -u loncom/interface/lonsearchcourse.pm:1.4 loncom/interface/lonsearchcourse.pm:1.5
--- loncom/interface/lonsearchcourse.pm:1.4	Sun Dec 25 20:41:53 2011
+++ loncom/interface/lonsearchcourse.pm	Tue Sep 22 11:23:08 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Course
 #
-# $Id: lonsearchcourse.pm,v 1.4 2011/12/25 20:41:53 raeburn Exp $
+# $Id: lonsearchcourse.pm,v 1.5 2020/09/22 11:23:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -311,6 +311,14 @@
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['phase']);
     $r->print(&Apache::loncommon::start_page("$crstype Search"));
     &Apache::lonhtmlcommon::clear_breadcrumbs();
+    if ($env{'request.course.id'} eq '') {
+        $r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Search"));
+        $r->print(&Apache::loncommon::end_page());
+        my $requrl = $r->uri;
+        $env{'user.error.msg'} = "$requrl:bre:0:0:Course not initialized";
+        $env{'user.reinit'} = 1;
+        return HTTP_NOT_ACCEPTABLE;
+    }
     &Apache::lonhtmlcommon::add_breadcrumb(
             {   href => '/adm/searchcourse',
                 text => "$crstype Search"});




More information about the LON-CAPA-cvs mailing list