[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
www
lon-capa-cvs@mail.lon-capa.org
Sat, 12 Apr 2003 15:56:42 -0000
www Sat Apr 12 11:56:42 2003 EDT
Modified files:
/loncom/interface londocs.pm
Log:
When "re-initializing course", it is done in the root window, and separate
folder windows are closed.
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.50 loncom/interface/londocs.pm:1.51
--- loncom/interface/londocs.pm:1.50 Tue Feb 25 14:30:51 2003
+++ loncom/interface/londocs.pm Sat Apr 12 11:56:42 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.50 2003/02/25 19:30:51 www Exp $
+# $Id: londocs.pm,v 1.51 2003/04/12 15:56:42 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -620,12 +620,20 @@
($allowed?' '.$help{'Main_Course_Documents'}:'').'</h2>');
my $folder=$ENV{'form.folder'};
unless ($folder=~/^default/) { $folder='default'; }
+ my $postexec='';
+ if ($folder eq 'default') {
+ $r->print('<script>this.window.name="loncapaclient";</script>');
+ } else {
+ $postexec='self.close();';
+ }
$hadchanges=0;
&editor($r,$coursenum,$coursedom,$folder,$allowed);
if ($hadchanges) {
- $r->print('<form method="post" action="/adm/roles">'.
-'<input type=hidden name=orgurl value="/adm/coursedocs" /><input type=hidden name=selectrole value=1 /><h3><font color="red">Changes will become active for your current session after <input type="submit" name="'.
-$ENV{'request.role'}.'" value="re-initializing course" />, or the next time you log in.</font></h3></form>');
+ $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" /><input type="hidden" name="selectrole" value="1" /><h3><font color="red">Changes will become active for your current session after <input type="hidden" name="'.
+$ENV{'request.role'}.'" value="1" /><input type="button" value="re-initializing course" onClick="reinit(this.form)"/>, or the next time you log in.</font></h3></form>');
}
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
'.sequence';