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

banghart lon-capa-cvs@mail.lon-capa.org
Tue, 15 Mar 2005 23:11:08 -0000


banghart		Tue Mar 15 18:11:08 2005 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  
  	change uri to direct to explict edit uploaded (portfolio) file
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.79 loncom/interface/portfolio.pm:1.80
--- loncom/interface/portfolio.pm:1.79	Thu Mar  3 00:47:22 2005
+++ loncom/interface/portfolio.pm	Tue Mar 15 18:11:08 2005
@@ -112,6 +112,7 @@
         $r->print('<form method="post" action="/adm/portfolio">');
     }
     my $href_location="/uploaded/$ENV{'user.domain'}/$ENV{'user.name'}/portfolio$current_path";
+    my $href_edit_location="/editupload/$ENV{'user.domain'}/$ENV{'user.name'}/portfolio$current_path";
     foreach my $line (sort 
 		      { 
 			  my ($afile)=split('&',$a,2);
@@ -142,11 +143,11 @@
                     $r->print('></td>');
                 } else {
                     if (exists $locked_files{$current_path.$filename}){
-                        $r->print('<td colspan="2">Locked</td>');
+                        $r->print('<td colspan="2"><a href="portfolio?lockinfo='.$current_path.$filename.'">Locked</a></td>');
                     } else {
                         $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="'.$href_location.$filename.'.meta">Meta</a>
+                            <td><a href="'.$href_edit_location.$filename.'.meta">Meta</a>
                             </td>');
                     }
                 }
@@ -443,7 +444,11 @@
         }
     }
 }
-
+sub lock_info {
+    my ($r) = @_;
+    $r->print("lock info here");
+    return 'ok';
+}
 sub createdir {
     my ($r)=@_;
     my $newdir=&Apache::lonnet::clean_filename($ENV{'form.newdir'});
@@ -491,7 +496,7 @@
 							 $ENV{'user.name'}).
 							'/userfiles/portfolio';
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-                                            ['selectfile','currentpath','meta',
+                                            ['selectfile','currentpath','meta','lockinfo',
 					     'currentfile','action','fieldname','mode','rename']);
     &Apache::loncommon::no_cache($r);
     &Apache::loncommon::content_type($r,'text/html');
@@ -539,6 +544,8 @@
 	&rename($r);
     } elsif ($ENV{'form.createdir'}) {
 	&createdir($r);
+    } elsif ($ENV{'form.lockinfo'}) {
+        &lock_info($r);
     } else {
 	my $current_path='/';
 	if ($ENV{'form.currentpath'}) {