--- loncom/interface/londocs.pm 2002/09/04 19:24:46 1.18
+++ loncom/interface/londocs.pm 2002/10/10 17:17:11 1.25
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.18 2002/09/04 19:24:46 www Exp $
+# $Id: londocs.pm,v 1.25 2002/10/10 17:17:11 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -211,9 +211,10 @@ END
$foldertitle;
}
if ($isfolder) { $url.='&foldername='.$foldertitle; }
- $line.='
![](/adm/lonIcons/'.
+ $line.='<td bgcolor=) ![](/adm/lonIcons/'.
$icon.'.gif) | '.
- "$title | ";
+ "$title | ";
return $line;
}
@@ -232,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_/);
@@ -246,9 +251,7 @@ sub handler {
}
} else { # got called in sequence from course
$allowed=0;
- $forcestandard=1;
- $forcesupplement=0;
- $script=&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) {
@@ -289,6 +298,20 @@ function makenewext(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;
@@ -298,12 +321,24 @@ function finishpick() {
'";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) {
+ if ($allowed) {
+ $r->print(<
+
+
+
+ENDCOURSEVERIFY
+ }
# --------------------------------------------------------- Standard documents
+ $r->print('
ENDFORM
- $r->print('
');
+ $r->print('');
}
# ----------------------------------------------------- Supplemental documents
if (!$forcestandard) {
- $r->print('Supplemental Course Documents
');
+ $r->print(
+ 'Supplemental Course Documents');
my $folder=$ENV{'form.folder'};
unless ($folder=~/supplemental/) { $folder='supplemental'; }
&editor($r,$coursenum,$coursedom,$folder,$allowed);
@@ -447,15 +499,21 @@ value="$plainname=/adm/$udom/$uname/abou
|
-
+
ENDSUPFORM
}
}
if ($allowed) {
$r->print('');
}
- $r->print('