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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 10 Dec 2004 19:21:21 -0000


albertel		Fri Dec 10 14:21:21 2004 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - reinit inside of a .page was throwing you bak to the top
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.149 loncom/interface/londocs.pm:1.150
--- loncom/interface/londocs.pm:1.149	Thu Nov 11 17:47:55 2004
+++ loncom/interface/londocs.pm	Fri Dec 10 14:21:21 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.149 2004/11/11 22:47:55 albertel Exp $
+# $Id: londocs.pm,v 1.150 2004/12/10 19:21:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1623,11 +1623,17 @@
 sub changewarning {
     my ($r,$postexec)=@_;
     if (!&is_hash_old()) { return; }
+    my $pathvar='folderpath';
+    my $path=&Apache::lonnet::escape($ENV{'form.folderpath'});
+    if (defined($ENV{'form.pagepath'})) {
+	$pathvar='pagepath';
+	$path=&Apache::lonnet::escape($ENV{'form.pagepath'});
+    }
     $r->print(
 '<script>function reinit(tf) { tf.submit();'.$postexec.' }</script>'. 
 '<form method="post" action="/adm/roles" target="loncapaclient">'.
-'<input type="hidden" name="orgurl" value="/adm/coursedocs?folderpath='.
-&Apache::lonnet::escape($ENV{'form.folderpath'}).
+'<input type="hidden" name="orgurl" value="/adm/coursedocs?'.
+$pathvar.'='.$path.
 '" /><input type="hidden" name="selectrole" value="1" /><h3><font color="red">'.
 &mt('Changes will become active for your current session after').
 ' <input type="hidden" name="'.