--- loncom/interface/portfolio.pm	2004/12/21 22:34:07	1.69
+++ loncom/interface/portfolio.pm	2005/02/17 08:29:43	1.75
@@ -96,7 +96,7 @@ sub display_directory {
 	return;
     }
     $r->print('<table border="0" cellspacing="2" cellpadding="2">'.
-            '<tr><th>Actions</th><th>&nbsp;</th><th>Name</th><th>Size</th><th>Last Modified</th></tr>');
+            '<tr><th colspan="2">Actions</th><th>&nbsp;</th><th>Name</th><th>Size</th><th>Last Modified</th></tr>');
     my $href_location="/uploaded/$ENV{'user.domain'}/$ENV{'user.name'}/portfolio$current_path";
     $r->print('<form method="post" action="/adm/portfolio">');
     foreach my $line (sort 
@@ -110,17 +110,18 @@ sub display_directory {
     	my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); 
     	if (($filename ne '.') && ($filename ne '..')) {
             if ($dirptr&$testdir) {
-                $r->print('<tr bgcolor="#FFAA99"><td><img src="'.$iconpath.'folder_closed.gif"></td>');
+                $r->print('<tr bgcolor="#FFAA99"><td colspan="2"><img src="'.$iconpath.'folder_closed.gif"></td>');
                 $r->print('<td>Go to ...</td>');
                 $r->print('<td>'.&make_anchor($filename.'/',$current_path.$filename.'/',$ENV{'form.mode'},$ENV{"form.fieldname"}).'</td>'); 
                 $r->print('</tr>'); 
             } else {
                 $r->print('<tr bgcolor="#CCCCFF">');
                 if (exists $locked_files{$current_path.$filename}){
-                    $r->print('<td>Locked</td>');
+                    $r->print('<td colspan="2">Locked</td>');
                 } else {
-                    $r->print('<td>Delete<input type="checkbox" name="selectfile" value="'.$filename.'" />
-                        <a href="/adm/portfolio?rename='.$filename.'&amp;currentpath='.$current_path.'">Rename</a>                        
+                    $r->print('<td><input type="checkbox" name="selectfile" value="'.$filename.'" />
+                        <a href="/adm/portfolio?rename='.$filename.'&amp;currentpath='.$current_path.'">Rename</a></td>
+                        <td><a href="/adm/portfolio'.$current_path.$filename.'.meta">Meta</a>
                         </td>');
                 }
                 $r->print('<td><img src="'.$iconpath.'unknown.gif"></td>');
@@ -501,23 +502,37 @@ sub handler {
     my $portfolio_root = &Apache::loncommon::propath($ENV{'user.domain'},
 							 $ENV{'user.name'}).
 							'/userfiles/portfolio';
+    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+                                            ['selectfile','currentpath','meta',
+					     'currentfile','action','fieldname','mode','rename']);
     &Apache::loncommon::no_cache($r);
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
     # Give the LON-CAPA page header
-    $r->print('<html><head><title>'.
+    my $html=&Apache::lonxml::xmlbegin();
+    $r->print($html.'<head><title>'.
               &mt('Portfolio Manager').
-              "</title></head>\n".
-              &Apache::loncommon::bodytag('Portfolio Manager'));
+              "</title></head>\n");
+    if ($ENV{"form.mode"} eq 'selectfile'){
+        $r->print(&Apache::loncommon::bodytag('Portfolio Manager',undef,undef,1));
+    } else {
+        $r->print(&Apache::loncommon::bodytag('Portfolio Manager'));
+    }
     $r->rflush();
-    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-                                            ['selectfile','currentpath',
-					     'currentfile','action','fieldname','mode','rename']);
 	if (($ENV{'form.storeupl'} eq 'Upload') & (!$ENV{'form.uploaddoc.filename'})){
    	    $r->print('<font color="red"> No file was selected to upload.'.
    	            'To upload a file, click <strong>Browse...</strong>'.
    	            ', select a file, then click <strong>Upload</strong>,</font>');
 	}
+    if ($ENV{'form.meta'}) {
+        &open_form($r);
+#        $r->print(&edit_meta_data($r, $ENV{'form.currentpath'}.$ENV{'form.selectfile'}));
+        $r->print('Edit the meta data<br />');
+        &close_form($r);
+    }
+    if ($ENV{'form.store'}) {
+    }
+
     if ($ENV{'form.uploaddoc.filename'}) {
 	&upload($r);
     } elsif ($ENV{'form.action'} eq 'delete' && $ENV{'form.confirmed'}) {