[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn raeburn@source.lon-capa.org
Mon, 20 Jul 2009 23:33:12 -0000


raeburn		Mon Jul 20 23:33:12 2009 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - &auto_possible_instcodes()  - Split strings with = to get key,value 
  pairs for cat_titles and cat_orders.
    - Use &thaw_unescape() as freeze_escape() was used on lond side.  - 
  New name for hashref in args ($cat_orders) to avoid overlap with 
  string name - $cat_order
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1004 loncom/lonnet/perl/lonnet.pm:1.1005
--- loncom/lonnet/perl/lonnet.pm:1.1004	Fri Jul 17 13:55:10 2009
+++ loncom/lonnet/perl/lonnet.pm	Mon Jul 20 23:33:11 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1004 2009/07/17 13:55:10 droeschl Exp $
+# $Id: lonnet.pm,v 1.1005 2009/07/20 23:33:11 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5703,7 +5703,7 @@
 }
 
 sub auto_possible_instcodes {
-    my ($domain,$codetitles,$cat_titles,$cat_order) = @_;
+    my ($domain,$codetitles,$cat_titles,$cat_orders) = @_;
     my (@homeservers,$uhome);
     if (defined(&domain($domain,'primary'))) {
         $uhome=&domain($domain,'primary');
@@ -5723,12 +5723,12 @@
         my ($codetitlestr,$cat_title,$cat_order) = split(':',$response);
         @{$codetitles} = map { &unescape($_); } (split('&',$codetitlestr));  
         foreach my $item (split('&',$cat_title)) {   
-            my ($name,$value)=split('&',$item);
-            $cat_titles->{&unescape($name)}=&unescape($value);
+            my ($name,$value)=split('=',$item);
+            $cat_titles->{&unescape($name)}=&thaw_unescape($value);
         }
         foreach my $item (split('&',$cat_order)) {
-            my ($name,$value)=split('&',$item);
-            $cat_order->{&unescape($name)}=&unescape($value);
+            my ($name,$value)=split('=',$item);
+            $cat_orders->{&unescape($name)}=&thaw_unescape($value);
         }
         return 'ok';
     }