--- loncom/interface/coursecatalog.pm 2007/01/12 23:37:22 1.18 +++ loncom/interface/coursecatalog.pm 2007/03/08 01:58:44 1.20 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.18 2007/01/12 23:37:22 raeburn Exp $ +# $Id: coursecatalog.pm,v 1.20 2007/03/08 01:58:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,9 +59,16 @@ sub handler { &Apache::lonacc::get_posted_cgi($r); &Apache::lonlocal::get_language_handle($r); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sortby']); - my $codedom = $Apache::lonnet::perlvar{'lonDefDomain'}; + my $codedom = &Apache::lonnet::default_login_domain(); + + if (($env{'user.domain'} ne '') && ($env{'user.domain'} ne 'public')) { + $codedom = $env{'user.domain'}; + if ($env{'request.role.domain'} ne '') { + $codedom = $env{'request.role.domain'}; + } + } my $formname = 'coursecatalog'; - my $domdesc = $Apache::lonnet::domaindescription{$codedom}; + my $domdesc = &Apache::lonnet::domain($codedom,'description'); &Apache::lonhtmlcommon::clear_breadcrumbs(); if ($env{'form.coursenum'} ne '' && &user_is_known()) { @@ -87,10 +94,13 @@ sub course_details { 'add_entries' => \%add_entries, 'no_inline_link' => 1,}); $r->print($start_page); + if ($env{'form.numtitles'} > 0) { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>"/adm/coursecatalog", + text=>"Select courses"}); + } &Apache::lonhtmlcommon::add_breadcrumb - ({href=>"/adm/coursecatalog", - text=>"Select courses"}, - {href=>"javascript:document.$formname.submit()", + ({href=>"javascript:document.$formname.submit()", text=>"Course listing"}, {text=>"Course details"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Details')); @@ -204,11 +214,16 @@ function setCourseId(caller) { 'no_inline_link' => 1,}); $r->print($start_page); if ($env{'form.state'} eq 'listing') { - &Apache::lonhtmlcommon::add_breadcrumb - ({href=>"/adm/coursecatalog", - text=>"Select courses"}, - {text=>"Course listing"}); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Listing')); + if ($numtitles > 0) { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>"/adm/coursecatalog", + text=>"Select courses"}, + {text=>"Course listing"}); + } else { + &Apache::lonhtmlcommon::add_breadcrumb + ({text=>"Course listing"}); + } + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Listing')); } else { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"/adm/coursecatalog", @@ -267,7 +282,8 @@ function setCourseId(caller) { if ($numtitles > 0) { $r->print(''); } - $r->print(''); + $r->print(''); if (($numtitles > 0) && ($env{'form.state'} eq 'listing')) { $r->print('

'); }