--- loncom/interface/lonsearchcourse.pm 2011/01/17 22:56:27 1.3 +++ loncom/interface/lonsearchcourse.pm 2020/09/22 11:23:08 1.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Course # -# $Id: lonsearchcourse.pm,v 1.3 2011/01/17 22:56:27 www Exp $ +# $Id: lonsearchcourse.pm,v 1.5 2020/09/22 11:23:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,7 +41,7 @@ use Apache::lonlocal; use LONCAPA::lonmetadata(); use HTML::Entities(); use Apache::lonnavmaps; -use Apache::londocs(); +use Apache::lonnavdisplay(); use Apache::lonindexer(); use LONCAPA; @@ -311,6 +311,14 @@ sub handler { &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"}); @@ -320,13 +328,13 @@ sub handler { text => 'Search Results'}); } $r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Search")); - &Apache::londocs::startContentScreen($r,'coursesearch'); + &Apache::lonnavdisplay::startContentScreen($r,'coursesearch'); if ($env{'form.phase'} eq 'results') { &course_search($r); } else { $r->print(&menu()); } - &Apache::londocs::endContentScreen($r); + &Apache::lonnavdisplay::endContentScreen($r); $r->print(&Apache::loncommon::end_page()); return OK; }