--- loncom/interface/coursecatalog.pm 2007/01/12 23:37:22 1.18
+++ loncom/interface/coursecatalog.pm 2007/01/14 01:59:37 1.19
@@ -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.19 2007/01/14 01:59:37 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -59,7 +59,14 @@ 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};
@@ -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('
');
}