--- loncom/interface/londocs.pm 2002/09/04 14:50:53 1.17
+++ loncom/interface/londocs.pm 2002/09/13 20:01:04 1.23
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.17 2002/09/04 14:50:53 www Exp $
+# $Id: londocs.pm,v 1.23 2002/09/13 20:01:04 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -198,6 +198,7 @@ END
$url=&Apache::lonnet::tokenwrapper($url);
}
}
+ $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//;
# Title
$title=&Apache::lonnet::unescape($title);
my $foldertitle=$title;
@@ -210,9 +211,10 @@ END
$foldertitle;
}
if ($isfolder) { $url.='&foldername='.$foldertitle; }
- $line.='
  | '.
- "$title | ";
+ "$title | ";
return $line;
}
@@ -231,9 +233,13 @@ sub handler {
my $script='';
my $allowed;
my $events='';
+ my $showdoc=0;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['folder','foldername','showdoc']);
- unless ($ENV{'form.showdoc'}) { # got called from remote
+ ['folder','foldername']);
+ if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
+ $showdoc=$1;
+ }
+ unless ($showdoc) { # got called from remote
$forcestandard=($ENV{'form.folder'}=~/^default_/);
$forcesupplement=($ENV{'form.folder'}=~/^supplemental_/);
@@ -245,9 +251,7 @@ sub handler {
}
} else { # got called in sequence from course
$allowed=0;
- $forcestandard=1;
- $forcesupplement=0;
- $script=&Apache::&Apache::lonxml::registerurl(1,undef);
+ $script=''.&Apache::lonxml::registerurl(1,undef).'
+ENDDOCUMENT
+ if ($allowed) {
+ $r->print(<
function makenewfolder(targetform,folderseq) {
var foldername=prompt('Name of New Folder','New Folder');
if (foldername) {
@@ -283,12 +293,40 @@ function makenewfolder(targetform,folder
}
}
-function makenewext(targetform) {
+function makenewext(targetname) {
+ this.document.forms.extimport.useform.value=targetname;
+ window.open('/adm/rat/extpickframe.html');
+}
+
+function makesmppage() {
+ var title=prompt('Listed Title for the Page');
+ this.document.forms.newsmppg.importdetail.value=
+ title+'=/adm/$udom/$uname/$now/smppg';
+ this.document.forms.newsmppg.submit();
+}
+
+function makebulboard() {
+ var title=prompt('Listed Title for the Bulletin Board');
+ this.document.forms.newbul.importdetail.value=
+ title+'=/adm/$udom/$uname/$now/bulletinboard';
+ this.document.forms.newbul.submit();
+}
+
+function finishpick() {
+ var title=this.document.forms.extimport.title.value;
+ var url=this.document.forms.extimport.url.value;
+ var form=this.document.forms.extimport.useform.value;
+ eval
+ ('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+
+ '";this.document.forms.'+form+'.submit();');
}
-
-ENDDOCUMENT
-$r->print(&Apache::loncommon::bodytag('Course Documents','',$events));
+ENDNEWSCRIPT
+ }
+# -------------------------------------------------------------------- Body tag
+ $r->print(''.
+ &Apache::loncommon::bodytag('Course Documents','',$events));
+ unless ($showdoc) {
# --------------------------------------------------------- Standard documents
if (($standard) && ($allowed) && (!$forcesupplement)) {
$r->print('Main Course Documents
');
@@ -338,7 +376,7 @@ value="New Folder" />
-
+
+
-
-
-
-');
+ }
+ } else {
+# -------------------------------------------------------- This is showdoc mode
+ $r->print("Uploaded DocumentIt is recommended that you use an up-to-date virus scanner before handling this file. ".
+ &entryline(0,"Click to download or use your browser's Save Link function",$showdoc).' ');
+ }
+ $r->print(' |