--- loncom/interface/lonpickcourse.pm 2008/01/20 00:15:02 1.70 +++ loncom/interface/lonpickcourse.pm 2008/05/19 21:40:26 1.71 @@ -1,7 +1,7 @@ # The LearningOnline Network # Pick a course # -# $Id: lonpickcourse.pm,v 1.70 2008/01/20 00:15:02 raeburn Exp $ +# $Id: lonpickcourse.pm,v 1.71 2008/05/19 21:40:26 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -251,6 +251,7 @@ sub display_matched_courses { my $description = $descr; push (@{$by_descrip{$description}}, $course); } + if ($numcourses > 1 && $multiple) { $r->print(' @@ -258,7 +259,21 @@ sub display_matched_courses { onclick="javascript:uncheckAll(document.courselist.course_id)" />

'); } + + if (%courses) { + $r->print(&Apache::loncommon::start_data_table()); + $r->print(&Apache::loncommon::start_data_table_header_row()); + $r->print(''.&mt('Select').'' + .''.&mt('Course Description').'' + .''.&mt('Domain').'' + .''.&mt('Course Code').'' + .''.&mt('Owner:Domain').'' + .''.&mt('Type').'' + ); + $r->print(&Apache::loncommon::end_data_table_header_row()); + } foreach my $description (sort { lc($a) cmp lc($b) } (keys(%by_descrip))) { + $r->print(&Apache::loncommon::start_data_table_row()); foreach my $course (@{$by_descrip{$description}}) { my $cleandesc=&HTML::Entities::encode($description,'<>&"'); $cleandesc=~s/'/\\'/g; @@ -280,25 +295,42 @@ sub display_matched_courses { push(@owners,&unescape($singleowner)); } my $owner = join(', ',@owners); - $r->print(&course_chooser($multiple,$cdom,$cnum,$cleandesc)); - $r->print($description.' ('. - (&Apache::lonnet::domain($cdom,'description')? - &Apache::lonnet::domain($cdom,'description'):$cdom).")"); + $r->print(''.&course_chooser($multiple,$cdom,$cnum,$cleandesc).''); + $r->print(''.$description.''); + $r->print(''); + $r->print(&Apache::lonnet::domain($cdom,'description')? + $cdom.' ('.&Apache::lonnet::domain($cdom,'description').')':$cdom); + $r->print(''); + $r->print(''); if ($instcode ne '') { - $r->print(" - ".&unescape($instcode)); + $r->print(&unescape($instcode)); + } else { + $r->print(' '); } + $r->print(''); + $r->print(''); if (@owners > 1) { - $r->print(', '.&mt('owners').' - ',join(', ',@owners)); +# $r->print(', '.&mt('owners').' - ',join(', ',@owners)); + $r->print(join(', ',@owners)); } elsif (@owners == 1) { - $r->print(', '.&mt('owner').' - '.$owner); +# $r->print(', '.&mt('owner').' - '.$owner); + $r->print($owner); } + $r->print(''); + $r->print(''); if ($ttype ne '') { - $r->print(' ('.&unescape($ttype).')'); + $r->print(&mt(&unescape($ttype))); + } else { + $r->print(' '); } + $r->print(''); if ($multiple) { $r->print("\n"); } - $r->print("
\n"); + # $r->print("
\n"); } + $r->print(&Apache::loncommon::end_data_table_row()); } + $r->print(&Apache::loncommon::end_data_table()); + if (!%courses) { $r->print(&mt('None found')); } elsif ($multiple) { @@ -483,7 +515,7 @@ sub search_courses { my ($r,$type,$onlyown,$filter) = @_; my %courses; if (!$onlyown) { - $r->print(&mt('Searching').' ...
 
'); + $r->print(&mt('Searching ...').'
 
'); $r->rflush(); if (($filter->{'ownerfilter'} ne '') || ($filter->{'ownerdomfilter'} ne '')) { @@ -523,7 +555,7 @@ sub course_chooser { if ($multiple) { $output = '