--- loncom/interface/coursecatalog.pm 2010/03/22 20:11:22 1.59 +++ loncom/interface/coursecatalog.pm 2010/06/08 16:37:20 1.62 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.59 2010/03/22 20:11:22 droeschl Exp $ +# $Id: coursecatalog.pm,v 1.62 2010/06/08 16:37:20 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -188,17 +188,34 @@ sub course_details { ({href=>"/adm/coursecatalog", 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:').'

'. + $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). '

'); $r->print('
'. - ''. - &mt('Back to course listing').''. + ''); + if ($env{'form.currcat_0'} eq 'communities::0') { + $r->print(&mt('Back to community listing')); + } else { + $r->print(&mt('Back to course listing')); + } + $r->print(''. &Apache::lonhtmlcommon::echo_form_input(['coursenum','catalogfilter', 'showdetails','courseid']).'
'); return; @@ -290,15 +307,19 @@ sub cat_header { &Apache::loncommon::start_page('Other',$js, { 'add_entries' => $add_entries, }); $r->print($start_page); + my $brtext = 'Course listing'; + if ($env{'form.currcat_0'} eq 'communities::0') { + $brtext = 'Community listing'; + } if ($env{'form.state'} eq 'listing') { if ($numtitles > 0) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"/adm/coursecatalog", text=>"Course/Community Catalog"}, - {text=>"Course listing"}); + {text=>$brtext}); } else { &Apache::lonhtmlcommon::add_breadcrumb - ({text=>"Course listing"}); + ({text=>$brtext}); } } else { &Apache::lonhtmlcommon::add_breadcrumb @@ -306,10 +327,7 @@ sub cat_header { text=>"Course/Community Catalog"}); } $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course/Community Catalog')); - my $onchange; - unless ($env{'form.interface'} eq 'textual') { - $onchange = 'this.form.submit()'; - } + my $onchange = 'this.form.submit()'; $r->print('
'. ''. - ''. - ''; + if ($env{'form.currcat_0'} eq 'communities::0') { + $output .= ''; + } else { + $output .= + ''. + ''. + ''; + } } else { $output .= ''; } @@ -971,10 +997,14 @@ sub courseinfo_row { ''; if ($knownuser) { if ($details) { - $output .= - ''. - ''. - ''; + if ($env{'form.currcat_0'} eq 'communities::0') { + $output .= ''; + } else { + $output .= + ''. + ''. + ''; + } } else { $output .= "'; }
'.&mt('Domain:').''. &Apache::loncommon::select_dom_form($codedom,'showdom','',1,$onchange)); @@ -630,7 +648,11 @@ sub print_course_listing { $env{'form.coursenum'}, undef,undef,'.',1); if (keys(%courses) == 0) { - $output .= &mt('The courseID provided does not match a course in this domain.'); + if ($env{'form.currcat_0'} eq 'communities::0') { + $output .= &mt('The courseID provided does not match a community in this domain.'); + } else { + $output .= &mt('The courseID provided does not match a course in this domain.'); + } return $output; } } else { @@ -699,10 +721,14 @@ sub construct_data_table { } if ($knownuser) { if ($details) { - $output .= - ''.&mt('Default Access Dates for Students').''.&mt('Student Counts').''.&mt('Auto-enrollment of[_1]registered students','
').'
'.&mt('Default Access Dates for Members').''.&mt('Default Access Dates for Students').''.&mt('Student Counts').''.&mt('Auto-enrollment of[_1]registered students','
').'
'.&mt('Details').''.$ownerlast.''.$accessdates.''.$counts.''.$autoenrollment.''.$accessdates.''.$accessdates.''.$counts.''.$autoenrollment.'".&mt('Show more details').'