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

banghart lon-capa-cvs@mail.lon-capa.org
Thu, 25 Aug 2005 20:46:34 -0000


banghart		Thu Aug 25 16:46:34 2005 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  	Change multi pulldown to checkboxes for instructor metadata.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.106 loncom/interface/lonmeta.pm:1.107
--- loncom/interface/lonmeta.pm:1.106	Mon Aug 15 17:16:22 2005
+++ loncom/interface/lonmeta.pm	Thu Aug 25 16:46:32 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.106 2005/08/15 21:16:22 banghart Exp $
+# $Id: lonmeta.pm,v 1.107 2005/08/25 20:46:32 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1026,11 +1026,15 @@
     my @keywords = sort(split /, /,$env{$env{'form.metacourse'}.'.metadata.keywords'});
     $r->print($env{'form.metacourse'}.'<br />');
     $r->print('<form method="post" action="" size="3" >');
-    $r->print('<select name="keywords" size="3" multiple>');
     foreach my $word (@keywords) {
-        $r->print('<option>'.$word.'</option>');
+        my $checked;
+        if ($Apache::lonpublisher::metadatafields{'coursekeyword'}=~ m/$word/) {
+            $checked = 1;
+        } else {
+            undef($checked);
+        }
+        $r->print(&Apache::lonhtmlcommon::checkbox('keywords',$checked,$word).$word.'<br />');
     }
-    $r->print('</select>');
     $r->print('<br /><input type="submit" name="store" value="Assign Meta-data" />');
     $r->print('</form>');
     return 'ok';
@@ -1038,7 +1042,7 @@
         }
         if ($env{'form.store'}) {
             my $mfh;
-            my $formname='store';
+            my $formname='store'; 
             my $file_content;
             if (&Apache::loncommon::get_env_multiple('form.keywords')) {
             $Apache::lonpublisher::metadatafields{'coursekeyword'} = 
@@ -1069,8 +1073,6 @@
             if ($fn =~ /\/portfolio\//) {
                 $fn =~ /\/portfolio\/(.*)$/;
                 my $new_fn = '/'.$1;
-                
-                $r->print('<br />Just checking<br />');
                 $env{'form.'.$formname}=$file_content;
                 $env{'form.'.$formname.'.filename'}=$new_fn;
                 &Apache::lonnet::userfileupload('uploaddoc','',