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

banghart lon-capa-cvs@mail.lon-capa.org
Thu, 08 Dec 2005 02:17:56 -0000


banghart		Wed Dec  7 21:17:56 2005 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  	New lables for buttons if portfolio metadata (not catalog info)
  	Better message telling what course provides metadata framework
  	Don't display the courserestricting metadata field in case
  		of no course restricting metadata.
  	Minor style stuff
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.134 loncom/interface/lonmeta.pm:1.135
--- loncom/interface/lonmeta.pm:1.134	Mon Dec  5 15:30:16 2005
+++ loncom/interface/lonmeta.pm	Wed Dec  7 21:17:56 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.134 2005/12/05 20:30:16 banghart Exp $
+# $Id: lonmeta.pm,v 1.135 2005/12/08 02:17:56 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -603,6 +603,10 @@
 	    ",'rights')\">".&mt('Select').'</a>'.
             &relatedfield(0,$relatedsearchflag,$relatedsep); 
     }
+    if ($type eq 'courserestricted') {
+            return ('<input type="hidden" name="new_courserestricted" value="'.$course_key.'" />');
+    }
+
     # Dates
     if (($type eq 'creationdate') ||
 	($type eq 'lastrevisiondate')) {
@@ -1097,7 +1101,7 @@
                 'default';
         }
         if ($metacourse ne 'none') {
-             $r->print('Document metadata restricted by :<strong> '.$env{$metacourse.".description"}."</strong><br />");
+             $r->print('Using: <strong> '.$env{$metacourse.".description"}."</strong> metadata framework<br />");
         }
         foreach my $field_name(@fields) {
 
@@ -1152,7 +1156,7 @@
                              $Apache::lonpublisher::metadatakeys{$unikey})
                          ) {
                     my $value=
-                     $Apache::lonpublisher::metadatafields{$unikey.'.'.$_};
+                    $Apache::lonpublisher::metadatafields{$unikey.'.'.$_};
                     $value=~s/\"/\'\'/g;
                     $file_content.=' '.$_.'="'.$value.'"' ;
                     # print $mfh ' '.$_.'="'.$value.'"';
@@ -1166,7 +1170,7 @@
             if ($fn =~ /\/portfolio\//) {
                 $fn =~ /\/portfolio\/(.*)$/;
                 my $new_fn = '/'.$1;
-                $env{'form.'.$formname}=$file_content;
+                $env{'form.'.$formname}=$file_content."\n";
                 $env{'form.'.$formname.'.filename'}=$new_fn;
                 &Apache::lonnet::userfileupload('uploaddoc','',
 	        	 'portfolio'.$env{'form.currentpath'});
@@ -1192,8 +1196,14 @@
                 }
             }
         }
-	$r->print($output.'<br /><input type="submit" name="store" value="'.
-                  &mt('Store Catalog Information').'">');
+        my $button_label;
+        if ($fn =~ /\/portfolio\//) {
+            $button_label = 'Store Metadata';
+        } else {
+            $button_label = 'Store Catalog Information';
+        }
+	    $r->print($output.'<br /><input type="submit" name="store" value="'.
+                  &mt($button_label).'">');
     }
     $r->print('</form>');
     return;