Diff for /loncom/interface/lonpickcourse.pm between versions 1.38 and 1.44

version 1.38, 2006/02/01 22:46:09 version 1.44, 2006/05/09 14:38:10
Line 42  sub handler { Line 42  sub handler {
     return OK if $r->header_only;      return OK if $r->header_only;
   
 # ------------------------------------------------------------ Print the screen  # ------------------------------------------------------------ Print the screen
     my $html=&Apache::lonxml::xmlbegin();  
     $r->print(<<ENDDOCUMENT);  
 $html  
 <head>  
 <title>The LearningOnline Network with CAPA</title>  
 </head>  
 ENDDOCUMENT  
 # Get parameters from query string  # Get parameters from query string
     &Apache::loncommon::get_unprocessed_cgi      &Apache::loncommon::get_unprocessed_cgi
         ($ENV{'QUERY_STRING'},['domainfilter','descriptfilter',          ($ENV{'QUERY_STRING'},['domainfilter','descriptfilter',
Line 102  ENDDOCUMENT Line 96  ENDDOCUMENT
                       ['-1','86400','604800','2592000','7776000',                        ['-1','86400','604800','2592000','7776000',
       '15552000','31104000']));        '15552000','31104000']));
 # if called from loncreateuser, report sections, then close  # if called from loncreateuser, report sections, then close
     my ($loaditem,$seclist);      my (%loaditem,$seclist,$groupslist);
     my $num_sections = 0;      my $num_sections = 0;
     if ($env{'form.form'} eq 'cu' && $env{'form.pickedcourse'}) {      if ($env{'form.form'} eq 'cu' && $env{'form.pickedcourse'}) {
         $loaditem = 'onLoad="setSections()"';          $loaditem{'onload'} ="setSections()";
         my ($cdom,$cnum) = split/_/,$env{'form.pickedcourse'};          my ($cdom,$cnum) = split/_/,$env{'form.pickedcourse'};
         my %sections_count = ();          my %sections_count = ();
         $num_sections = &Apache::loncommon::get_sections($cdom,$cnum,\%sections_count);          $num_sections = &Apache::loncommon::get_sections($cdom,$cnum,\%sections_count);
Line 114  ENDDOCUMENT Line 108  ENDDOCUMENT
             @sections = (sort {$a <=> $b} keys(%sections_count));              @sections = (sort {$a <=> $b} keys(%sections_count));
             $seclist = join('","',@sections);              $seclist = join('","',@sections);
         }          }
           my %curr_groups = &Apache::loncommon::coursegroups($cdom,$cnum);
    $groupslist = join(',',sort(keys(%curr_groups)));
     }      }
     my $jscript;      my $jscript;
     my $title = 'Selecting a course';      my $title = 'Selecting a course';
Line 125  ENDDOCUMENT Line 121  ENDDOCUMENT
         $jscript = &Apache::loncommon::check_uncheck_jscript();          $jscript = &Apache::loncommon::check_uncheck_jscript();
         $multelement = '<input type="hidden" name="multiple" value="'.$multiple.'" />';          $multelement = '<input type="hidden" name="multiple" value="'.$multiple.'" />';
     }      }
     $r->print(&Apache::loncommon::bodytag($title,undef,$loaditem,undef,undef,undef,undef,1));      $r->print(&Apache::loncommon::start_page($title,undef,
        {'add_entries' => \%loaditem,
         'no_nav_bar'  => 1, }));
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
        'cac' => 'Course Activity',         'cac' => 'Course Activity',
        'cde' => 'Course Description',         'cde' => 'Course Description',
Line 240  function setSections() { Line 238  function setSections() {
             opener.document.$env{"form.form"}.currsec.options[0].selected = false              opener.document.$env{"form.form"}.currsec.options[0].selected = false
         }          }
     }      }
       opener.document.$env{"form.form"}.groups.value='$groupslist';
     self.close()      self.close()
 }  }
   
Line 301  ENDSCRIPT Line 300  ENDSCRIPT
                     onclick="javascript:uncheckAll(document.courselist.course_id)" />                      onclick="javascript:uncheckAll(document.courselist.course_id)" />
                     <br /><br />');                      <br /><br />');
         }          }
  foreach my $description (sort(keys(%by_descrip))) {   foreach my $description (sort 
    { lc($a) cmp lc($b) } (keys(%by_descrip))) {
             foreach my $course (@{$by_descrip{$description}}) {              foreach my $course (@{$by_descrip{$description}}) {
         my $cleandesc=&HTML::Entities::encode($description,'<>&"');          my $cleandesc=&HTML::Entities::encode($description,'<>&"');
         $cleandesc=~s/'/\\'/g;          $cleandesc=~s/'/\\'/g;
Line 335  ENDSCRIPT Line 335  ENDSCRIPT
         }          }
         $r->print("</form>\n");          $r->print("</form>\n");
     }      }
     $r->print('</body></html>');      $r->print(&Apache::loncommon::end_page());
     return OK;      return OK;
 }  }
   

Removed from v.1.38  
changed lines
  Added in v.1.44


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>