--- loncom/interface/londocs.pm 2002/08/31 00:43:12 1.14
+++ loncom/interface/londocs.pm 2002/10/11 18:06:32 1.26
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.14 2002/08/31 00:43:12 www Exp $
+# $Id: londocs.pm,v 1.26 2002/10/11 18:06:32 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -34,6 +34,7 @@ use Apache::lonnet;
use Apache::loncommon;
use Apache::lonratedt;
use Apache::lonratsrv;
+use Apache::lonxml;
my $iconpath;
@@ -54,20 +55,28 @@ sub storemap {
my ($coursenum,$coursedom,$map)=@_;
return
&Apache::lonratedt::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
- $map);
+ $map,1);
}
sub editor {
my ($r,$coursenum,$coursedom,$folder,$allowed)=@_;
+ if ($ENV{'form.foldername'}) {
+ $r->print('
Folder: '.$ENV{'form.foldername'}.'
');
+ }
my $errtext='';
my $fatal=0;
($errtext,$fatal)=
&mapread($coursenum,$coursedom,$folder.'.sequence');
+ if ($#Apache::lonratedt::order<1) {
+ $Apache::lonratedt::order[0]=1;
+ $Apache::lonratedt::resources[1]='';
+ }
if ($fatal) {
$r->print('
'.$errtext.'
');
} else {
# ------------------------------------------------------------ Process commands
- if ($allowed) {
+# ---------------- if they are for this folder and user allowed to make changes
+ if (($allowed) && ($ENV{'form.folder'} eq $folder)) {
# upload a file, if present
if (($ENV{'form.uploaddoc.filename'}) &&
($ENV{'form.cmd'}=~/^upload_(\w+)/)) {
@@ -82,6 +91,10 @@ sub editor {
$comment=~s/\\<\;/g;
$comment=~s/\>/\>\;/g;
$comment=~s/\:/\:/g;
+ if ($folder=~/^supplemental/) {
+ $comment=time.'___&&&___'.$ENV{'user.name'}.'___&&&___'.
+ $ENV{'user.domain'}.'___&&&___'.$comment;
+ }
my $newidx=$#Apache::lonratedt::resources+1;
$Apache::lonratedt::resources[$newidx]=
$comment.':'.$url.':'.$ext.':normal:res';
@@ -134,7 +147,8 @@ sub editor {
# Store the changed version
&storemap($coursenum,$coursedom,$folder.'.sequence');
}
- }
+ }
+# ---------------------------------------------------------------- End commands
# ---------------------------------------------------------------- Print screen
my $idx=0;
$r->print('