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

banghart lon-capa-cvs@mail.lon-capa.org
Tue, 18 Jan 2005 01:27:09 -0000


banghart		Mon Jan 17 20:27:09 2005 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Sneaking up on portfolio file meta data. Not there yet.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.69 loncom/interface/portfolio.pm:1.70
--- loncom/interface/portfolio.pm:1.69	Tue Dec 21 17:34:07 2004
+++ loncom/interface/portfolio.pm	Mon Jan 17 20:27:09 2005
@@ -96,7 +96,7 @@
 	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 @@
     	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?meta='.$filename.'&amp;currentpath='.$current_path.'">Meta</a>
                         </td>');
                 }
                 $r->print('<td><img src="'.$iconpath.'unknown.gif"></td>');
@@ -511,13 +512,21 @@
               &Apache::loncommon::bodytag('Portfolio Manager'));
     $r->rflush();
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-                                            ['selectfile','currentpath',
+                                            ['selectfile','currentpath','meta',
 					     '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 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'}) {