Diff for /loncom/interface/coursecatalog.pm between versions 1.28 and 1.30

version 1.28, 2008/05/29 04:29:33 version 1.30, 2008/05/29 19:58:32
Line 154  sub instcode_course_selector { Line 154  sub instcode_course_selector {
     my $totcodes = 0;      my $totcodes = 0;
     my $jscript = '';      my $jscript = '';
     my ($numtitles,$lasttitle);      my ($numtitles,$lasttitle);
       my %add_entries = (topmargin    => "0",
                          marginheight => "0",);
       my $js;
     $totcodes = &Apache::courseclassifier::retrieve_instcodes(\%coursecodes,$codedom);      $totcodes = &Apache::courseclassifier::retrieve_instcodes(\%coursecodes,$codedom);
     if ($totcodes > 0) {      if ($totcodes > 0) {
         $format_reply = &Apache::lonnet::auto_instcode_format($caller,$codedom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order);          $format_reply = &Apache::lonnet::auto_instcode_format($caller,$codedom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order);
Line 221  function setCourseId(caller) { Line 224  function setCourseId(caller) {
 }\n|;  }\n|;
             }              }
         }          }
         my $js = '<script type"text/javascript">'."\n$jscript\n$catjs\n".          $js = '<script type"text/javascript">'."\n$jscript\n$catjs\n".
                  '</script>';                '</script>';
         my %add_entries = (topmargin    => "0",  
                            marginheight => "0",);  
         if (($env{'form.state'} eq 'listing') && ($numtitles > 0)) {          if (($env{'form.state'} eq 'listing') && ($numtitles > 0)) {
             $add_entries{'onLoad'} = 'setElements()';              $add_entries{'onLoad'} = 'setElements()';
         }          }
Line 298  function setCourseId(caller) { Line 299  function setCourseId(caller) {
             $r->print('<br />');              $r->print('<br />');
         }          }
     } else {      } else {
         $r->print('<br />'.&mt('No official courses to display for [_1].',$domdesc));          &cat_header($r,$codedom,$js,\%add_entries,$catlinks,$numtitles);
           my $cat_maxdepth = $env{'form.catalog_maxdepth'};
           $r->print('<form name="'.$formname.'" method="post" action="/adm/coursecatalog">'.
                     '<input type="hidden" name="catalog_maxdepth" value="'.$cat_maxdepth.'" />'.
                     '<input type="hidden" name="showdom" value="'.$env{'form.showdom'}.'" />'.
                     '<input type="hidden" name="currcat_0" value="instcode::0" />');
           $r->print('<br />'.&mt('No official courses to display for [_1].',$domdesc).'</form>');
     }      }
     return $numtitles;      return $numtitles;
 }  }
Line 350  sub category_breadcrumbs { Line 357  sub category_breadcrumbs {
     my $currcat_str;      my $currcat_str;
     if ($env{'form.catalog_maxdepth'} ne '') {      if ($env{'form.catalog_maxdepth'} ne '') {
         $currdepth = $env{'form.catalog_maxdepth'};          $currdepth = $env{'form.catalog_maxdepth'};
         $deeper = $currdepth + 1;          if ($env{'form.currcat_'.$currdepth} eq '') {
               $deeper = $currdepth;
           } else {
               $deeper = $currdepth + 1;
           }
     }      }
     $currcat_str = '<input type="hidden" name="catalog_maxdepth" value="'.$deeper.'" /><input type="hidden" name="showdom" value="'.$dom.'" />';      $currcat_str = '<input type="hidden" name="catalog_maxdepth" value="'.$deeper.'" /><input type="hidden" name="showdom" value="'.$dom.'" />';
     my $catlinks = '<td valign="top"><b>'.&mt('Catalog:').'</b></td><td><table><tr>';      my $catlinks = '<td valign="top"><b>'.&mt('Catalog:').'</b></td><td><table><tr>';
Line 406  sub category_breadcrumbs { Line 417  sub category_breadcrumbs {
             $env{'form.currcat_0'} = 'instcode::0';              $env{'form.currcat_0'} = 'instcode::0';
         }          }
     } else {      } else {
         my ($cat,$container,$depth) = map { &unescape($_); } split(/:/,$env{'form.currcat_'.$currdepth});          my ($cat,$container,$depth);
           if ($env{'form.currcat_'.$currdepth} eq '') {
               my $shallower = $currdepth - 1;
               ($cat,$container,$depth) = map { &unescape($_); } split(/:/,$env{'form.currcat_'.$shallower});
           } else {
               ($cat,$container,$depth) = map { &unescape($_); } split(/:/,$env{'form.currcat_'.$currdepth});
           }
         my $deeper = $depth +1;          my $deeper = $depth +1;
         my $currcat = $cat;          my $currcat = $cat;
         if ($cat eq 'instcode') {          if ($cat eq 'instcode') {
Line 559  sub search_courselist { Line 576  sub search_courselist {
     my ($domain) = @_;      my ($domain) = @_;
     my $cat_maxdepth = $env{'form.catalog_maxdepth'};      my $cat_maxdepth = $env{'form.catalog_maxdepth'};
     my $filter = $env{'form.currcat_'.$cat_maxdepth};      my $filter = $env{'form.currcat_'.$cat_maxdepth};
       if (($filter eq '') && ($cat_maxdepth > 0)) {
           my $shallower = $cat_maxdepth - 1;
           $filter = $env{'form.currcat_'.$shallower};
       }
     my %courses;      my %courses;
     if ($filter ne '') {      if ($filter ne '') {
         %courses = &Apache::lonnet::courseiddump($domain,'.',1,'.','.','.',          %courses = &Apache::lonnet::courseiddump($domain,'.',1,'.','.','.',

Removed from v.1.28  
changed lines
  Added in v.1.30


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