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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 19 Dec 2005 21:33:54 -0000


albertel		Mon Dec 19 16:33:54 2005 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  - add a cancel button so users can escape
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.144 loncom/interface/lonmeta.pm:1.145
--- loncom/interface/lonmeta.pm:1.144	Mon Dec 19 16:17:25 2005
+++ loncom/interface/lonmeta.pm	Mon Dec 19 16:33:54 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.144 2005/12/19 21:17:25 albertel Exp $
+# $Id: lonmeta.pm,v 1.145 2005/12/19 21:33:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -300,14 +300,17 @@
     } else {
 	$meta_uri .= '.meta';
     }
-    return ($res_uri,$meta_uri);
+    
+    my ($path) = ($res_uri =~ m|(.*)/[^/]*$|);
+    
+    return ($res_uri,$meta_uri,$path);
 }
 
 sub pre_select_course {
     my ($r,$uri) = @_;
     my $output;
     my $fn=&Apache::lonnet::filelocation('',$uri);
-    my ($res_uri,$meta_uri) = &portfolio_display_uri($uri);
+    my ($res_uri,$meta_uri,$path) = &portfolio_display_uri($uri);
     %Apache::lonpublisher::metadatafields=();
     %Apache::lonpublisher::metadatakeys=();
     my $result=&Apache::lonnet::getfile($fn);
@@ -322,6 +325,12 @@
     $r->print($output.'<br /><input type="submit" name="store" value="'.
                   &mt('Associate Resource With Selected Course').'">');
     $r->print('</form>');
+    
+    $r->print('<br /><br /><form method="POST" action="/adm/portfolio">'.
+              '<input type="hidden" name="currentpath" value="'.$path.'" />'.
+	      '<input type="submit" name="cancel" value="'.&mt('Cancel').'">'.
+	      '</form>');
+
     return;
 }
 sub select_course {