Diff for /loncom/interface/coursecatalog.pm between versions 1.46 and 1.50

version 1.46, 2009/02/07 18:15:44 version 1.50, 2009/03/18 20:58:02
Line 123  ENDSCRIPT Line 123  ENDSCRIPT
             }              }
         } else {          } else {
             my (%add_entries);              my (%add_entries);
               my ($currdepth,$deeper) = &get_depth_values();
             if ($selitem) {              if ($selitem) {
                   my $alert = &mt('Choose a subcategory to display');
                   if (!$deeper) {
                       $alert = &mt('Choose a category to display');
                   }
                 $catjs .= <<ENDJS;                  $catjs .= <<ENDJS;
 function check_selected() {  function check_selected() {
     if (document.coursecats.$selitem.options[document.coursecats.$selitem.selectedIndex].value == "") {      if (document.coursecats.$selitem.options[document.coursecats.$selitem.selectedIndex].value == "") {
         alert('Choose a subcategory to display');          alert('$alert');
         return false;          return false;
     }      }
 }  }
Line 139  ENDJS Line 144  ENDJS
                 $r->print('<form name="'.$formname.                  $r->print('<form name="'.$formname.
                           '" method="post" action="/adm/coursecatalog">'.                            '" method="post" action="/adm/coursecatalog">'.
                           &additional_filters($codedom,$has_subcats)."\n");                            &additional_filters($codedom,$has_subcats)."\n");
                 my ($currdepth,$deeper) = &get_depth_values();  
                 $r->print('<input type="hidden" name="catalog_maxdepth" value="'.                  $r->print('<input type="hidden" name="catalog_maxdepth" value="'.
                           $deeper.'" />'."\n");                            $deeper.'" />'."\n");
                 for (my $i=0; $i<$deeper; $i++) {                  for (my $i=0; $i<$deeper; $i++) {
Line 376  function setElements() { Line 380  function setElements() {
 sub cat_header {  sub cat_header {
     my ($r,$codedom,$js,$add_entries,$catlinks,$numtitles) = @_;      my ($r,$codedom,$js,$add_entries,$catlinks,$numtitles) = @_;
     my $start_page =      my $start_page =
         &Apache::loncommon::start_page('Course Catalog',$js,          &Apache::loncommon::start_page('Other',$js,
                                        {                                         {
                                          'add_entries' => $add_entries,                                           'add_entries' => $add_entries,
                                          'no_inline_link'   => 1,});                                           'no_inline_link'   => 1,});
Line 398  sub cat_header { Line 402  sub cat_header {
           text=>"Select courses"});            text=>"Select courses"});
         $r->print(&Apache::lonhtmlcommon::breadcrumbs('Select courses'));          $r->print(&Apache::lonhtmlcommon::breadcrumbs('Select courses'));
     }      }
       my $onchange;
       unless (($env{'browser.interface'} eq 'textual') || ($env{'form.interface'} eq 'textual')) {
           $onchange = 1;
       }
     $r->print('<form name="coursecatdom" method="post" action="/adm/coursecatalog">'.      $r->print('<form name="coursecatdom" method="post" action="/adm/coursecatalog">'.
               '<table border="0"><tr><td><b>'.&mt('Domain:').'</b></td><td>'.                '<table border="0"><tr><td><b>'.&mt('Domain:').'</b></td><td>'.
               &Apache::loncommon::select_dom_form($codedom,'showdom','',1).                &Apache::loncommon::select_dom_form($codedom,'showdom','',1,$onchange));
       '&nbsp;<input type="submit" name="godom" value="'.&mt('Change').'" /></td></tr></table></form>'.      if (!$onchange) {
      $r->print('&nbsp;<input type="submit" name="godom" value="'.&mt('Change').'" />');
       }
       $r->print('</td></tr></table></form>'.
       '<form name="coursecats" method="post" action="/adm/coursecatalog"'.        '<form name="coursecats" method="post" action="/adm/coursecatalog"'.
               ' onsubmit="check_selected()">'.                ' onsubmit="return check_selected();">'.
               '<table border="0"><tr>'.$catlinks.'</tr></table></form>');                '<table border="0"><tr>'.$catlinks.'</tr></table></form>');
     return;      return;
 }  }

Removed from v.1.46  
changed lines
  Added in v.1.50


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