--- loncom/interface/coursecatalog.pm 2008/07/04 15:40:04 1.34
+++ loncom/interface/coursecatalog.pm 2008/07/06 17:59:25 1.35
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.34 2008/07/04 15:40:04 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.35 2008/07/06 17:59:25 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -71,10 +71,21 @@ sub handler {
}
my $domdesc = &Apache::lonnet::domain($codedom,'description');
&Apache::lonhtmlcommon::clear_breadcrumbs();
+
+ my %domconfig =
+ &Apache::lonnet::get_dom('configuration',['coursecategories'],$codedom);
+ my (@cats,@trails,%allitems,%idx,@jsarray,$cathash);
+ if (ref($domconfig{'coursecategories'}) eq 'HASH') {
+ $cathash = $domconfig{'coursecategories'}{'cats'};
+ } else {
+ $cathash = {};
+ }
+ &Apache::loncommon::extract_categories($cathash,\@cats,\@trails,\%allitems,
+ \%idx,\@jsarray);
if ($env{'form.coursenum'} ne '' && &user_is_known()) {
- &course_details($r,$codedom,$formname,$domdesc);
+ &course_details($r,$codedom,$formname,$domdesc,\@trails,\%allitems);
} else {
- my $catlinks = &category_breadcrumbs($codedom);
+ my $catlinks = &category_breadcrumbs($codedom,@cats);
my $catjs = <<"ENDSCRIPT";
function setCatDepth(depth) {
@@ -125,7 +136,7 @@ function setCourseId(caller) {
&mt('Display courses').'" />
');
}
if ($env{'form.state'} eq 'listing') {
- $r->print(&print_course_listing($codedom));
+ $r->print(&print_course_listing($codedom,undef,\@trails,\%allitems));
}
}
}
@@ -134,7 +145,7 @@ function setCourseId(caller) {
}
sub course_details {
- my ($r,$codedom,$formname,$domdesc) = @_;
+ my ($r,$codedom,$formname,$domdesc,$trails,$allitems) = @_;
my $output;
my %add_entries = (topmargin => "0",
marginheight => "0",);
@@ -156,7 +167,8 @@ sub course_details {
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Details'));
$r->print('
'.&mt('Detailed course information:').'
'.
'