--- loncom/interface/lonpickcourse.pm 2008/01/20 00:15:02 1.70
+++ loncom/interface/lonpickcourse.pm 2008/08/06 10:45:36 1.74
@@ -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.74 2008/08/06 10:45:36 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -228,14 +228,23 @@ sub display_matched_courses {
$menuchk = ' checked="checked" ';
}
$r->print(
+ &Apache::lonhtmlcommon::start_pick_box().
+ '
'.
+ ''.&mt('Action').' '.
+ ''.
''.
' '.
' '.&mt('Enter the course with the role of [_1].',$cctitle).
- ' '.(' 'x3).' '.
+ ''.(' 'x3).''.
+ ' '.
+ ''.
+ ''.
''.
' '.
&mt('View or modify course settings which only a [_1] may modify.',$dctitle).
- ' ');
+ ''.
+ ' '.&Apache::lonhtmlcommon::end_pick_box().
+ ' ');
}
}
my %by_descrip;
@@ -251,6 +260,7 @@ sub display_matched_courses {
my $description = $descr;
push (@{$by_descrip{$description}}, $course);
}
+
if ($numcourses > 1 && $multiple) {
$r->print('
@@ -258,8 +268,22 @@ 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/Co-owner(s)').' '
+ .''.&mt('Type').' '
+ );
+ $r->print(&Apache::loncommon::end_data_table_header_row());
+ }
foreach my $description (sort { lc($a) cmp lc($b) } (keys(%by_descrip))) {
foreach my $course (@{$by_descrip{$description}}) {
+ $r->print(&Apache::loncommon::start_data_table_row());
my $cleandesc=&HTML::Entities::encode($description,'<>&"');
$cleandesc=~s/'/\\'/g;
my ($cdom,$cnum)=split(/\_/,$course);
@@ -279,26 +303,37 @@ sub display_matched_courses {
($descr,$instcode,$singleowner,$ttype)=split(/:/,$courses{$course});
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).")");
+ my $ownerstr = join(', ',@owners);
+ $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));
- }
- if (@owners > 1) {
- $r->print(', '.&mt('owners').' - ',join(', ',@owners));
- } elsif (@owners == 1) {
- $r->print(', '.&mt('owner').' - '.$owner);
+ $r->print(&unescape($instcode));
+ } else {
+ $r->print(' ');
}
+ $r->print(' ');
+ $r->print(''.$ownerstr.' ');
+ $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(&Apache::loncommon::end_data_table_row());
+ # $r->print(" \n");
}
}
+ if (%courses) {
+ $r->print(&Apache::loncommon::end_data_table());
+ }
+
if (!%courses) {
$r->print(&mt('None found'));
} elsif ($multiple) {
@@ -401,12 +436,12 @@ sub build_filters {
'15552000','31104000']));
my %lt = (
- 'cac' => &mt('[_1] Activity',$type),
- 'cde' => &mt('[_1] Description',$type),
- 'cdo' => &mt('[_1] Domain',$type),
+ 'cac' => &mt("$type Activity"),
+ 'cde' => &mt("$type Description"),
+ 'cdo' => &mt("$type Domain"),
'cin' => &mt('Course Institutional Code'),
- 'cow' => &mt("[_1] Owner's Username",$type),
- 'cod' => &mt("[_1] Owner's Domain", $type),
+ 'cow' => &mt("$type Owner's Username"),
+ 'cod' => &mt("$type Owner's Domain"),
'cog' => &mt('Course Type')
);
@@ -417,8 +452,8 @@ sub build_filters {
$list->{'instcodefilter'}.'" />';
}
foreach my $posstype ('Course','Non-standard Course') {
- $typeselectform.='$posstype \n";
+ $typeselectform.='".&mt($posstype)." \n";
}
$typeselectform.="";
my $output = qq|
@@ -446,34 +481,50 @@ $multelement
$output .= ' ';
}
}
+
+ $output .= " \n".&Apache::lonhtmlcommon::start_pick_box();
if ($sincefilterform) {
- $output .= $lt{'cac'}.': '.$sincefilterform.' '."\n";
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'cac'})
+ .$sincefilterform
+ .&Apache::lonhtmlcommon::row_closure();
}
if ($domainselectform) {
- $output .= $lt{'cdo'}.': '.$domainselectform.' '."\n";
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'cdo'})
+ .$domainselectform
+ .&Apache::lonhtmlcommon::row_closure();
}
if ($typeselectform) {
- $output .= $lt{'cog'}.': '.$typeselectform.' '."\n";
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'cog'})
+ .$typeselectform
+ .&Apache::lonhtmlcommon::row_closure();
}
if ($instcodeform) {
- $output .= $lt{'cin'}.': '.$instcodeform.' '."\n";
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'cin'})
+ .$instcodeform
+ .&Apache::lonhtmlcommon::row_closure();
}
if (exists($filter->{'ownerfilter'})) {
- $output .= $lt{'cow'}.': '.
- ' '."\n".
- $lt{'cod'}.': '.$ownerdomselectform.' '."\n";
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'cow'})
+ .' '
+ .&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title($lt{'cod'})
+ .$ownerdomselectform
+ .&Apache::lonhtmlcommon::row_closure();
}
if (exists($filter->{'coursefilter'})) {
- $output .= &mt('LON-CAPA course ID').': '.
- ' ';
+ $output .= &Apache::lonhtmlcommon::row_title(&mt('LON-CAPA course ID'))
+ .' '
+ .&Apache::lonhtmlcommon::row_closure();
}
if (exists($filter->{'descriptfilter'})) {
- $output .=$lt{'cde'}.': '.
- ' '."\n";
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'cde'})
+ .' '
+ .&Apache::lonhtmlcommon::row_closure(1);
}
+ $output .= &Apache::lonhtmlcommon::end_pick_box();
$output .= '
'."\n".''."\n".' '."\n";
return $output;
@@ -483,7 +534,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 +574,7 @@ sub course_chooser {
if ($multiple) {
$output = ' '."\n";
} else {
- $output = ' '."\n";
}
return $output;