[LON-CAPA-cvs] cvs: loncom /interface coursecatalog.pm

raeburn raeburn@source.lon-capa.org
Wed, 18 Mar 2009 20:58:02 -0000


raeburn		Wed Mar 18 20:58:02 2009 EDT

  Modified files:              
    /loncom/interface	coursecatalog.pm 
  Log:
  - Missing &mt() on text displayed by JS alert.
  - Alert to display depends on current depth in category hierarchy. 
  
  
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.49 loncom/interface/coursecatalog.pm:1.50
--- loncom/interface/coursecatalog.pm:1.49	Thu Feb 26 16:17:30 2009
+++ loncom/interface/coursecatalog.pm	Wed Mar 18 20:58:02 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for displaying the course catalog interface
 #
-# $Id: coursecatalog.pm,v 1.49 2009/02/26 16:17:30 schafran Exp $
+# $Id: coursecatalog.pm,v 1.50 2009/03/18 20:58:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -123,11 +123,16 @@
             }
         } else {
             my (%add_entries);
+            my ($currdepth,$deeper) = &get_depth_values();
             if ($selitem) {
+                my $alert = &mt('Choose a subcategory to display');
+                if (!$deeper) {
+                    $alert = &mt('Choose a category to display');
+                }
                 $catjs .= <<ENDJS;
 function check_selected() {
     if (document.coursecats.$selitem.options[document.coursecats.$selitem.selectedIndex].value == "") {
-        alert('Choose a subcategory to display');
+        alert('$alert');
         return false;
     }
 }
@@ -139,7 +144,6 @@
                 $r->print('<form name="'.$formname.
                           '" method="post" action="/adm/coursecatalog">'.
                           &additional_filters($codedom,$has_subcats)."\n");
-                my ($currdepth,$deeper) = &get_depth_values();
                 $r->print('<input type="hidden" name="catalog_maxdepth" value="'.
                           $deeper.'" />'."\n");
                 for (my $i=0; $i<$deeper; $i++) {