[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Fri, 19 Sep 2008 17:14:31 -0000


raeburn		Fri Sep 19 13:14:31 2008 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - Reverse change in 1.427 to avoid breaking backwards compatibility for servers running older versions of LON-CAPA.
  - Add additional attribute "other" to <lang> tag which will include a comma-separated list of alternative languages for which the block should be used.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.430 loncom/homework/structuretags.pm:1.431
--- loncom/homework/structuretags.pm:1.430	Thu Sep 11 10:47:17 2008
+++ loncom/homework/structuretags.pm	Fri Sep 19 13:14:31 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.430 2008/09/11 14:47:17 bisitz Exp $
+# $Id: structuretags.pm,v 1.431 2008/09/19 17:14:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1392,9 +1392,15 @@
 	    my $result = &Apache::lonxml::endredirection();
 	    my $which = &Apache::lonxml::get_param('which',$parstack,
 						   $safeeval);
-            foreach my $language (split(/\s*\,\s*/,$which)) {
-               unless ($language=~/\w/) { next; }
-               $available_texts{$language} = $result;
+            if ($which=~/\w/) {
+                $available_texts{$which} = $result;
+            }
+            my $otherlangs = &Apache::lonxml::get_param('other',$parstack,
+                                                        $safeeval);
+            foreach my $language (split(/\s*\,\s*/,$otherlangs)) {
+                if ($language=~/\w/) {
+                    $available_texts{$language} = $result;
+                }
             }
 
 	}