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

banghart lon-capa-cvs-allow@mail.lon-capa.org
Thu, 04 Oct 2007 01:16:59 -0000


banghart		Wed Oct  3 21:16:59 2007 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  	Add routine to create URL with field/value pairs.
  	(Duplicating something existing?)
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.165 loncom/interface/lonhtmlcommon.pm:1.166
--- loncom/interface/lonhtmlcommon.pm:1.165	Mon Oct  1 14:45:40 2007
+++ loncom/interface/lonhtmlcommon.pm	Wed Oct  3 21:16:58 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.165 2007/10/01 18:45:40 banghart Exp $
+# $Id: lonhtmlcommon.pm,v 1.166 2007/10/04 01:16:58 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -481,6 +481,19 @@
     return $result;
 }
 
+
+sub build_url {
+    my ($base, $fields)=@_;
+    my $url;
+    $url = $base.'?';
+    foreach my $key(keys(%$fields)) {
+        $url.=$key.'='.$$fields{$key}.'&';
+    }
+    $url =~ s/&$//;
+    return $url;
+}
+
+
 ##############################################
 ##############################################