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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 08 Nov 2005 03:08:15 -0000


albertel		Mon Nov  7 22:08:15 2005 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm loncommon.pm 
  Log:
  - convert to hash ref
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.123 loncom/interface/lonmeta.pm:1.124
--- loncom/interface/lonmeta.pm:1.123	Mon Nov  7 18:03:17 2005
+++ loncom/interface/lonmeta.pm	Mon Nov  7 22:08:15 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.123 2005/11/07 23:03:17 banghart Exp $
+# $Id: lonmeta.pm,v 1.124 2005/11/08 03:08:15 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -519,7 +519,7 @@
             if ($only_one) {
                 return(&Apache::loncommon::select_form($def,'new_keywords',%hash));
             } else {
-                return(&Apache::loncommon::multiple_select_form('new_keywords',\@cur_values,undef,%hash));
+                return(&Apache::loncommon::multiple_select_form('new_keywords',\@cur_values,undef,\%hash));
             }
         }
         if ($type eq  'notes') {
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.282 loncom/interface/loncommon.pm:1.283
--- loncom/interface/loncommon.pm:1.282	Mon Nov  7 21:12:24 2005
+++ loncom/interface/loncommon.pm	Mon Nov  7 22:08:15 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.282 2005/11/08 02:12:24 albertel Exp $
+# $Id: loncommon.pm,v 1.283 2005/11/08 03:08:15 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1168,26 +1168,27 @@
   $name - name of the <select> element
   $value - sclara or array ref of values that should already be selected
   $size - number of rows long the select element is
-  %hash - the elements should be 'option' => 'shown text'
+  $hash - the elements should be 'option' => 'shown text'
           (shown text should already have been &mt())
+
 =cut
 
 #-------------------------------------------
 sub multiple_select_form {
-    my ($name,$value,$size,%hash)=@_;
+    my ($name,$value,$size,$hash)=@_;
     my %selected = map { $_ => 1 } ref($value)?@{$value}:($value);
     my $output='';
     if (! defined($size)) {
         $size = 4;
-        if (scalar(keys(%hash))<4) {
-            $size = scalar(keys(%hash));
+        if (scalar(keys(%$hash))<4) {
+            $size = scalar(keys(%$hash));
         }
     }
     $output.="\n<select name='$name' size='$size' multiple='1'>";
-    foreach (sort(keys(%hash))) {
+    foreach (sort(keys(%$hash))) {
         $output.='<option value="'.$_.'" ';
         $output.='selected="selected" ' if ($selected{$_});
-        $output.='>'.$hash{$_}."</option>\n";
+        $output.='>'.$hash->{$_}."</option>\n";
     }
     $output.="</select>\n";
     return $output;
@@ -2529,7 +2530,7 @@
 Inputs: $text $uname $udom $symb $target
 
 Returns: A link to parmset.pm such as to see the PPRM view of a
-student andn resource
+student and a specific resource
 
 =cut