--- loncom/interface/coursecatalog.pm 2008/06/30 04:07:06 1.33
+++ 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.33 2008/06/30 04:07:06 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:').'
'.
'
'.
+ '');
return;
}
sub category_breadcrumbs {
- my ($dom) = @_;
- my %domconfig =
- &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom);
- 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);
+ my ($dom,@cats) = @_;
my ($currdepth,$deeper) = &get_depth_values();
my $currcat_str = '';
my $catlinks = ''.&mt('Catalog:').' | ';
@@ -383,7 +384,7 @@ sub category_breadcrumbs {
if (ref($cats[0]) eq 'ARRAY') {
if ((@{$cats[0]} == 1) && ($cats[0][0] eq 'instcode')) {
$catlinks .= &mt('Official courses (with institutional codes)').
- '';
+ '';
$env{'form.currcat_0'} = 'instcode::0';
} else {
$catlinks .= '
|