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);
+ my ($descr,$instcode,$ttype,@owners);
+ if (ref($courses{$course}) eq 'HASH') {
+ $descr = $courses{$course}{'description'};
+ $instcode = $courses{$course}{'inst_code'};
+ $ttype = $courses{$course}{'type'};
+ push(@owners,&unescape($courses{$course}{'owner'}));
+ if (ref($courses{$course}{'co-owners'}) eq 'ARRAY') {
+ foreach my $item (@{$courses{$course}{'co-owners'}}) {
+ push(@owners,&unescape($item));
+ }
+ }
+ } else {
+ my $singleowner;
+ ($descr,$instcode,$singleowner,$ttype)=split(/:/,$courses{$course});
+ push(@owners,&unescape($singleowner));
+ }
+ 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));
+ } else {
+ $r->print(' ');
+ }
+ $r->print(' | ');
+ $r->print(''.$ownerstr.' | ');
+ $r->print('');
+ if ($ttype ne '') {
+ $r->print(&mt(&unescape($ttype)));
+ } else {
+ $r->print(' ');
}
+ $r->print(' | ');
+ if ($showroles) {
+ $r->print('');
+ my $rolestr;
+ if (ref($courses{$course}{'roles'}) eq 'ARRAY') {
+ my @roles = sort(@{$courses{$course}{'roles'}});
+ foreach my $role (@roles) {
+ if ($role =~ /^cr/) {
+ my (undef,$crdom,$crname,$crtitle) = split('/',$role);
+ $rolestr .= $crtitle.', ';
+ } else {
+ $rolestr .= &Apache::lonnet::plaintext($role,$ttype).', ';
+ }
+ }
+ $rolestr =~ s/\, $//;
+ }
+ $r->print($rolestr.' | ');
+ }
+ if ($multiple) { $r->print("\n"); }
+ $r->print(&Apache::loncommon::end_data_table_row());
+ # $r->print("
\n");
}
}
- $autosubmit
- $lastaction
-}
+ if (%courses) {
+ $r->print(&Apache::loncommon::end_data_table());
+ }
-function setSections() {
- var numSections = $num_sections
- var sectionsArray = new Array("$seclist")
- opener.document.$env{"form.form"}.$sec_element.length = 0
- if (numSections == 0) {
- opener.document.$env{"form.form"}.$sec_element.multiple=false
- opener.document.$env{"form.form"}.$sec_element.size=1;
- opener.document.$env{"form.form"}.$sec_element.options[0] = new Option('No existing sections','',false,false)
+ if (!%courses) {
+ $r->print(&mt('None found'));
+ } elsif ($multiple) {
+ $r->print('');
+ }
+ $r->print(''.
+ "\n".''."\n".
+ ''."\n");
+ if ((exists($env{'form.roleelement'})) && ($env{'form.form'} eq 'rolechoice')) {
+ $r->print(''."\n");
+ }
+ if ($env{'form.form'} eq 'portform') {
+ $r->print('');
+ $r->print('');
+ $r->print('');
+ $r->print('');
+ } elsif ($env{'form.form'} eq 'modifycourse') {
+ $r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','pickedcourse','type','form','numtitles','state']));
} else {
- if (numSections == 1) {
- opener.document.$env{"form.form"}.$sec_element.multiple=false;
- opener.document.$env{"form.form"}.$sec_element.size=1;
- opener.document.$env{"form.form"}.$sec_element.options[0] = new Option('Select','',true,true);
- opener.document.$env{"form.form"}.$sec_element.options[1] = new Option('No section','',false,false)
- opener.document.$env{"form.form"}.$sec_element.options[2] = new Option(sectionsArray[0],sectionsArray[0],false,false);
- } else {
- for (var i=0; iprint(''."\n".
+ ''."\n");
+ }
+ if ((exists($env{'form.fixeddom'})) && ($env{'form.form'} eq 'rules')) {
+ $r->print('');
+ }
+ if ($env{'form.numtitles'}) {
+ $r->print('');
+ }
+ $r->print("