--- loncom/interface/coursecatalog.pm 2006/08/31 12:30:30 1.3
+++ loncom/interface/coursecatalog.pm 2006/09/25 00:16:56 1.5
@@ -60,6 +60,7 @@ sub handler {
my $totcodes = 0;
my $jscript = '';
my $formname = 'coursecatalog';
+ my $domdesc = $Apache::lonnet::domaindescription{$codedom};
$totcodes = &Apache::lonsupportreq::retrieve_instcodes(\%coursecodes,$codedom,$totcodes);
if ($totcodes > 0) {
if ($ccode eq '') {
@@ -108,7 +109,6 @@ function changeSort(caller) {
$r->print($start_page);
my $numtitles = @codetitles;
- my $domdesc = $Apache::lonnet::domaindescription{$codedom};
$r->print('
'.&mt('Display information about official [_1] classes for which LON-CAPA courses have been created:',$domdesc).'
');
$r->print(&mt('Choose which course(s) to list.
'));
$r->print('');
+ } else {
+ $r->print(&Apache::loncommon::start_page('Course Catalog','',
+ {
+ 'no_inline_link' => 1,}));
+ $r->print('
'.&mt('No official courses to display for [_1].',$domdesc));
}
if ($env{'form.state'} eq 'listing') {
- $r->print('
'.&print_course_listing($codedom));
+ $r->print('
'.&print_course_listing($codedom));
}
$r->print(&Apache::loncommon::end_page());
+ return OK;
}
sub print_course_listing {
@@ -220,7 +226,7 @@ sub print_course_listing {
$cleandesc=~s/'/\\'/g;
my ($cdom,$cnum)=split(/\_/,$course);
- my ($desc,$instcode,$owner,$ttype) = split/:/,$courses{$course};
+ my ($desc,$instcode,$owner,$ttype) = split(/:/,$courses{$course});
$owner = &unescape($owner);
my ($ownername,$ownerdom);
if ($owner =~ /:/) {
@@ -290,7 +296,7 @@ sub courseinfo_row {
my @classids;
my @crosslistings;
$idx{'status'} = &Apache::loncoursedata::CL_STATUS();
- my %status_title = &Apache::lonlocal::texthash (
+ my %status_title = &Apache::lonlocal::texthash(
Expired => 'Previous access',
Active => 'Current access',
Future => 'Future access',
@@ -300,7 +306,7 @@ sub courseinfo_row {
Active => 0,
Future => 0,
);
- while (my ($student,$data) = each %$classlist) {
+ while (my ($student,$data) = each(%$classlist)) {
$student_count{$data->[$idx{'status'}]} ++;
}
my $seclist = &identify_sections($coursehash{'internal.sectionnums'});
@@ -387,7 +393,7 @@ sub identify_sections {
my ($seclist) = @_;
my @secnums;
if ($seclist =~ /,/) {
- my @sections = split/,/,$seclist;
+ my @sections = split(/,/,$seclist);
foreach my $sec (@sections) {
$sec =~ s/:[^:]*$//;
push(@secnums,$sec);
@@ -395,8 +401,8 @@ sub identify_sections {
} else {
if ($seclist =~ m/^([^:]+):/) {
my $sec = $1;
- if (!grep/^$sec$/,@secnums) {
- push (@secnums,$sec);
+ if (!grep(/^\Q$sec\E$/,@secnums)) {
+ push(@secnums,$sec);
}
}
}
@@ -418,7 +424,7 @@ sub get_valid_classes {
if (&Apache::lonnet::auto_validate_class_sec($cdom,$cnum,$owner,
$class) eq 'ok') {
if (!grep(/^\Q$sec$\E/,@{$validations{'sections'}})) {
- push (@{$validations{'sections'}},$sec);
+ push(@{$validations{'sections'}},$sec);
$totalitems ++;
}
}
@@ -429,7 +435,7 @@ sub get_valid_classes {
if (&Apache::lonnet::auto_validate_class_sec($cdom,$cnum,$owner,
$item) eq 'ok') {
if (!grep(/^\Q$item$\E/,@{$validations{'xlists'}})) {
- push (@{$validations{'xlists'}},$item);
+ push(@{$validations{'xlists'}},$item);
$totalitems ++;
}
}