--- loncom/interface/coursecatalog.pm 2009/10/17 01:42:07 1.55
+++ loncom/interface/coursecatalog.pm 2010/09/07 03:00:38 1.64
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.55 2009/10/17 01:42:07 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.64 2010/09/07 03:00:38 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -87,8 +87,9 @@ sub handler {
}
&Apache::loncommon::extract_categories($cathash,\@cats,\@trails,\%allitems,
\%idx,\@jsarray,$subcats);
+ my ($numtitles,@codetitles);
if ($env{'form.coursenum'} ne '' && &user_is_known()) {
- &course_details($r,$codedom,$formname,$domdesc,\@trails,\%allitems);
+ &course_details($r,$codedom,$formname,$domdesc,\@trails,\%allitems,\@codetitles);
} else {
my ($catlinks,$has_subcats,$selitem) = &category_breadcrumbs($codedom,@cats);
my $catjs = <<"ENDSCRIPT";
@@ -114,12 +115,12 @@ function setCourseId(caller) {
ENDSCRIPT
$catjs .= &courselink_javascript();
- my $numtitles;
if ($env{'form.currcat_0'} eq 'instcode::0') {
$numtitles = &instcode_course_selector($r,$codedom,$formname,$domdesc,
- $catlinks,$catjs);
+ $catlinks,$catjs,\@codetitles);
if ($env{'form.state'} eq 'listing') {
- $r->print(&print_course_listing($codedom,$numtitles));
+ $r->print(&print_course_listing($codedom,$numtitles,undef,undef,undef,
+ \@codetitles));
}
} else {
my (%add_entries);
@@ -149,16 +150,22 @@ ENDJS
for (my $i=0; $i<$deeper; $i++) {
$r->print(''."\n");
}
+ my $display_button;
+ if ($env{'form.currcat_0'} eq 'communities::0') {
+ $display_button = &mt('Display communities');
+ } else {
+ $display_button = &mt('Display courses');
+ }
$r->print(''."\n".
''."\n".
''."\n".
''.
'
');
+ $display_button.'" />
');
}
if ($env{'form.state'} eq 'listing') {
- $r->print(&print_course_listing($codedom,undef,\@trails,\%allitems,$subcats));
+ $r->print(&print_course_listing($codedom,undef,\@trails,\%allitems,$subcats,\@codetitles));
}
}
}
@@ -167,34 +174,49 @@ ENDJS
}
sub course_details {
- my ($r,$codedom,$formname,$domdesc,$trails,$allitems) = @_;
+ my ($r,$codedom,$formname,$domdesc,$trails,$allitems,$codetitles) = @_;
my $output;
my %add_entries = (topmargin => "0",
marginheight => "0",);
my $js = ''."\n";
my $start_page =
- &Apache::loncommon::start_page('Course Catalog',$js,
- {
- 'add_entries' => \%add_entries,
- 'no_inline_link' => 1,});
+ &Apache::loncommon::start_page('Course/Community Catalog',$js,
+ {'add_entries' => \%add_entries, });
$r->print($start_page);
if ($env{'form.numtitles'} > 0) {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"/adm/coursecatalog",
- text=>"Select courses"});
+ text=>"Course/Community Catalog"});
+ }
+ my $brtextone = 'Course listing';
+ my $brtexttwo = 'Course details';
+ if ($env{'form.currcat_0'} eq 'communities::0') {
+ $brtextone = 'Community listing';
+ $brtexttwo = 'Community details';
}
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:document.$formname.submit()",
- text=>"Course listing"},
- {text=>"Course details"});
+ text=>$brtextone},
+ {text=>$brtexttwo});
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Course/Community Catalog'));
- $r->print('
'.&mt('Detailed course information:').'
'.
- &print_course_listing($codedom,undef,$trails,$allitems).
+ $r->print('
');
+ if ($env{'form.currcat_0'} eq 'communities::0') {
+ $r->print(&mt('Detailed community information:'));
+ } else {
+ $r->print(&mt('Detailed course information:'));
+ }
+ $r->print('
'.
+ &print_course_listing($codedom,undef,$trails,$allitems,undef,$codetitles).
'
');
$r->print('