--- loncom/interface/coursecatalog.pm 2008/03/08 04:00:53 1.27
+++ loncom/interface/coursecatalog.pm 2008/05/29 04:29:33 1.28
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.27 2008/03/08 04:00:53 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.28 2008/05/29 04:29:33 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -54,7 +54,8 @@ 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::default_login_domain();
+
+ my $codedom = &Apache::lonnet::default_login_domain();
if (($env{'user.domain'} ne '') && ($env{'user.domain'} ne 'public')) {
$codedom = $env{'user.domain'};
@@ -63,15 +64,40 @@ sub handler {
}
}
my $formname = 'coursecatalog';
+ if ($env{'form.showdom'} ne '') {
+ if (&Apache::lonnet::domain($env{'form.showdom'}) ne '') {
+ $codedom = $env{'form.showdom'};
+ }
+ }
my $domdesc = &Apache::lonnet::domain($codedom,'description');
-
&Apache::lonhtmlcommon::clear_breadcrumbs();
if ($env{'form.coursenum'} ne '' && &user_is_known()) {
&course_details($r,$codedom,$formname,$domdesc);
} else {
- my $numtitles = &course_selector($r,$codedom,$formname,$domdesc);
- if ($env{'form.state'} eq 'listing') {
- $r->print(&print_course_listing($codedom,$numtitles).'
');
+ my $catlinks = &category_breadcrumbs($codedom);
+ my $catjs = <<"ENDSCRIPT";
+
+function setCatDepth(depth) {
+ document.coursecats.catalog_maxdepth.value = depth;
+ document.coursecats.submit();
+ return;
+}
+
+ENDSCRIPT
+ my $numtitles;
+ if ($env{'form.currcat_0'} eq 'instcode::0') {
+ $numtitles = &instcode_course_selector($r,$codedom,$formname,$domdesc,
+ $catlinks,$catjs);
+ if ($env{'form.state'} eq 'listing') {
+ $r->print(&print_course_listing($codedom,$numtitles));
+ }
+ } else {
+ my (%add_entries);
+ $catjs = '';
+ &cat_header($r,$codedom,$catjs,\%add_entries,$catlinks);
+ if ($env{'form.currcat_0'} ne '') {
+ $r->print(&print_course_listing($codedom));
+ }
}
}
$r->print(&Apache::loncommon::end_page());
@@ -100,7 +126,7 @@ sub course_details {
{text=>"Course details"});
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Details'));
$r->print('
'.&mt('Detailed course information:').'
'.
- '