Annotation of loncom/interface/londocs.pm, revision 1.28
1.1 www 1: # The LearningOnline Network
1.2 www 2: # Documents
1.1 www 3: #
1.28 ! www 4: # $Id: londocs.pm,v 1.27 2002/10/15 20:50:19 www Exp $
1.1 www 5: #
1.3 www 6: # Copyright Michigan State University Board of Trustees
1.1 www 7: #
1.3 www 8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
1.1 www 9: #
1.3 www 10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
1.1 www 14: #
1.3 www 15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
28:
1.2 www 29: package Apache::londocs;
1.1 www 30:
31: use strict;
1.28 ! www 32: use Apache::Constants qw(:common :http);
1.4 www 33: use Apache::lonnet;
34: use Apache::loncommon;
1.7 www 35: use Apache::lonratedt;
36: use Apache::lonratsrv;
1.15 www 37: use Apache::lonxml;
1.27 www 38: use GDBM_File;
1.7 www 39:
1.8 www 40: my $iconpath;
1.7 www 41:
1.27 www 42: my %hash;
43:
44: my $hashtied;
45:
1.7 www 46: # Mapread read maps into lonratedt::global arrays
1.10 www 47: # @order and @resources, determines status
1.7 www 48: # sets @order - pointer to resources in right order
49: # sets @resources - array with the resources with correct idx
50: #
51:
52: sub mapread {
53: my ($coursenum,$coursedom,$map)=@_;
54: return
55: &Apache::lonratedt::mapread('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
56: $map);
57: }
58:
59: sub storemap {
60: my ($coursenum,$coursedom,$map)=@_;
61: return
62: &Apache::lonratedt::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
1.15 www 63: $map,1);
1.7 www 64: }
65:
66: sub editor {
67: my ($r,$coursenum,$coursedom,$folder,$allowed)=@_;
1.17 www 68: if ($ENV{'form.foldername'}) {
69: $r->print('<h3>Folder: '.$ENV{'form.foldername'}.'</h3>');
70: }
1.10 www 71: my $errtext='';
72: my $fatal=0;
73: ($errtext,$fatal)=
1.7 www 74: &mapread($coursenum,$coursedom,$folder.'.sequence');
1.17 www 75: if ($#Apache::lonratedt::order<1) {
76: $Apache::lonratedt::order[0]=1;
77: $Apache::lonratedt::resources[1]='';
78: }
1.7 www 79: if ($fatal) {
80: $r->print('<p><font color="red">'.$errtext.'</font></p>');
81: } else {
82: # ------------------------------------------------------------ Process commands
1.16 www 83: # ---------------- if they are for this folder and user allowed to make changes
84: if (($allowed) && ($ENV{'form.folder'} eq $folder)) {
1.10 www 85: # upload a file, if present
86: if (($ENV{'form.uploaddoc.filename'}) &&
87: ($ENV{'form.cmd'}=~/^upload_(\w+)/)) {
88: if ($folder=~/^$1/) {
89: # this is for a course, not a user, so set coursedoc flag
90: # probably the only place in the system where this should be "1"
91: my $url=&Apache::lonnet::userfileupload('uploaddoc',1);
92: my $ext='false';
93: if ($url=~/^http\:\/\//) { $ext='true'; }
94: $url=~s/\:/\:/g;
95: my $comment=$ENV{'form.comment'};
96: $comment=~s/\</\<\;/g;
97: $comment=~s/\>/\>\;/g;
98: $comment=~s/\:/\:/g;
1.17 www 99: if ($folder=~/^supplemental/) {
100: $comment=time.'___&&&___'.$ENV{'user.name'}.'___&&&___'.
101: $ENV{'user.domain'}.'___&&&___'.$comment;
102: }
1.10 www 103: my $newidx=$#Apache::lonratedt::resources+1;
104: $Apache::lonratedt::resources[$newidx]=
105: $comment.':'.$url.':'.$ext.':normal:res';
106: $Apache::lonratedt::order[$#Apache::lonratedt::order+1]=
107: $newidx;
108: &storemap($coursenum,$coursedom,$folder.'.sequence');
109: }
110: }
1.8 www 111: if ($ENV{'form.cmd'}) {
1.10 www 112: my ($cmd,$idx)=split(/\_/,$ENV{'form.cmd'});
113: if ($cmd eq 'del') {
114: for (my $i=$idx;$i<$#Apache::lonratedt::order;$i++) {
115: $Apache::lonratedt::order[$i]=
116: $Apache::lonratedt::order[$i+1];
117: }
118: $#Apache::lonratedt::order--;
119: } elsif ($cmd eq 'up') {
120: my $i=$Apache::lonratedt::order[$idx-1];
121: $Apache::lonratedt::order[$idx-1]=
122: $Apache::lonratedt::order[$idx];
123: $Apache::lonratedt::order[$idx]=$i;
124: } elsif ($cmd eq 'down') {
125: my $i=$Apache::lonratedt::order[$idx+1];
126: $Apache::lonratedt::order[$idx+1]=
127: $Apache::lonratedt::order[$idx];
128: $Apache::lonratedt::order[$idx]=$i;
129: }
130: # Store the changed version
131: &storemap($coursenum,$coursedom,$folder.'.sequence');
1.8 www 132: }
1.11 www 133: # Group import/search
134: if ($ENV{'form.importdetail'}) {
135: foreach (split(/\&/,$ENV{'form.importdetail'})) {
136: if (defined($_)) {
137: my ($name,$url)=split(/\=/,$_);
138: $name=&Apache::lonnet::unescape($name);
139: $url=&Apache::lonnet::unescape($url);
140: if ($url) {
141: my $idx=$#Apache::lonratedt::resources+1;
142: $Apache::lonratedt::order
143: [$#Apache::lonratedt::order+1]=$idx;
144: my $ext='false';
145: if ($url=~/^http\:\/\//) { $ext='true'; }
146: $url=~s/\:/\:/g;
147: $Apache::lonratedt::resources[$idx]=
148: $name.':'.$url.':'.$ext.':normal:res';
149: }
150: }
151: }
152: # Store the changed version
153: &storemap($coursenum,$coursedom,$folder.'.sequence');
154: }
1.16 www 155: }
156: # ---------------------------------------------------------------- End commands
1.7 www 157: # ---------------------------------------------------------------- Print screen
1.10 www 158: my $idx=0;
159: $r->print('<table>');
160: foreach (@Apache::lonratedt::order) {
161: my ($name,$url)=split(/\:/,$Apache::lonratedt::resources[$_]);
162: unless ($name) { $name=(split(/\//,$url))[-1]; }
163: unless ($name) { $name='EMPTY'; }
164: $r->print(&entryline($idx,$name,$url,$folder,$allowed));
165: $idx++;
166: }
167: $r->print('</table>');
1.7 www 168: }
169: }
1.1 www 170:
1.8 www 171: # --------------------------------------------------------------- An entry line
172:
173: sub entryline {
174: my ($index,$title,$url,$folder,$allowed)=@_;
175: my $line='<tr>';
176: # Edit commands
177: if ($allowed) {
178: $line.=(<<END);
179: <td><table border='0' cellspacing='0' cellpadding='0'>
180: <tr><td><a href='/adm/coursedocs?folder=$folder&cmd=up_$index'>
181: <img src="${iconpath}move_up.gif" alt='UP' border='0' /></a></td></tr>
182: <tr><td><a href='/adm/coursedocs?folder=$folder&cmd=down_$index'>
183: <img src="${iconpath}move_down.gif" alt='DOWN' border='0' /></a></td></tr>
184: </table></td><td>
185: <a href='/adm/coursedocs?folder=$folder&cmd=del_$index'>Remove</td>
186: END
187: }
1.16 www 188: # Figure out what kind of a resource this is
189: my ($extension)=($url=~/\.(\w+)$/);
190: my $uploaded=($url=~/^\/*uploaded\//);
191: my $icon='unknown';
192: if (-e "/home/httpd/html/adm/lonIcons/$extension.gif") {
193: $icon=$extension;
1.10 www 194: }
1.17 www 195: my $isfolder=0;
1.16 www 196: if ($uploaded) {
197: if ($extension eq 'sequence') {
198: $icon='folder_closed';
199: $url=~/\/(\w+)\.sequence/;
200: $url='/adm/coursedocs?folder='.$1;
1.17 www 201: $isfolder=1;
1.16 www 202: } else {
203: $url=&Apache::lonnet::tokenwrapper($url);
204: }
205: }
1.18 www 206: $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//;
1.8 www 207: # Title
208: $title=&Apache::lonnet::unescape($title);
1.17 www 209: my $foldertitle=$title;
1.8 www 210: if ($title=~
211: /^(\d+)\_\_\_\&\&\&\_\_\_(\w+)\_\_\_\&\&\&\_\_\_(\w+)\_\_\_\&\&\&\_\_\_(.*)$/
1.17 www 212: ) {
213: $foldertitle=&Apache::lontexconvert::msgtexconverted($4);
214: $title='<i>'.localtime($1).'</i> '.
215: &Apache::loncommon::plainname($2,$3).': <br>'.
216: $foldertitle;
1.8 www 217: }
1.17 www 218: if ($isfolder) { $url.='&foldername='.$foldertitle; }
1.23 www 219: $line.='<td bgcolor="#FFFFBB"><a href="'.$url.'" target="cat_'.$folder.
220: '"><img src="/adm/lonIcons/'.
1.17 www 221: $icon.'.gif" border="0"></a></td>'.
1.23 www 222: "<td bgcolor='#FFFFBB'><a href='$url' target='cat_$folder'>$title</a></td></tr>";
1.8 www 223: return $line;
224: }
225:
1.27 www 226: # ---------------------------------------------------------------- tie the hash
227:
228: sub tiehash {
229: $hashtied=0;
230: if ($ENV{'request.course.fn'}) {
231: if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
232: &GDBM_READER(),0640)) {
233: $hashtied=1;
234: }
235: }
236: }
237:
238: sub untiehash {
239: if ($hashtied) { untie %hash; }
240: $hashtied=0;
241: }
242:
1.8 www 243: # ================================================================ Main Handler
1.1 www 244: sub handler {
245: my $r = shift;
246: $r->content_type('text/html');
247: $r->send_http_header;
248: return OK if $r->header_only;
249:
1.27 www 250:
1.26 www 251: if ($ENV{'form.verify'}) {
252:
253: my $loaderror=&Apache::lonnet::overloaderror($r);
254: if ($loaderror) { return $loaderror; }
255:
256: $r->print('<html><head><title>Verify Content</title></head>'.
257: &Apache::loncommon::bodytag('Verify Course Documents'));
1.27 www 258: $hashtied=0;
1.28 ! www 259: my %alreadyseen=();
1.27 www 260: &tiehash();
261: foreach (keys %hash) {
1.28 ! www 262: if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) {
! 263: $alreadyseen{$hash{$_}}=1;
1.27 www 264: my $resid=$1;
265: $r->rflush();
266: if ($hash{$_}) {
267: my $fn=$hash{$_};
268: $r->print('<br /><a href="'.$fn.'" target="cat">'.
269: ($hash{'title_'.$resid}?$hash{'title_'.$resid}:$fn).'</a> ');
270: if ($fn=~/^\/res\//) {
1.28 ! www 271: my $result=&Apache::lonnet::repcopy(
! 272: &Apache::lonnet::filelocation('',$fn));
! 273: if ($result==OK) {
1.27 www 274: $r->print('<font color="green">ok</font>');
275: $r->rflush();
276: my $dependencies=
1.28 ! www 277: &Apache::lonnet::metadata($hash{$_},'dependencies');
! 278: $r->print('Dependencies: '.$dependencies.'<br />');
! 279: } elsif ($result==HTTP_SERVICE_UNAVAILABLE) {
1.27 www 280: $r->print(
281: '<font color="red"><b>connection down</b></font>');
1.28 ! www 282: } elsif ($result==HTTP_NOT_FOUND) {
1.27 www 283: $r->print('<font color="red"><b>not found</b></font>');
284: } else {
285: $r->print(
286: '<font color="red"><b>access denied</b></font>');
287: }
288: }
289: }
290: }
291: }
292: &untiehash();
1.26 www 293: } elsif ($ENV{'form.versions'}) {
294: $r->print('<html><head><title>Check Versions</title></head>'.
295: &Apache::loncommon::bodytag('Check Course Document Versions'));
1.27 www 296: $hashtied=0;
297: &tiehash();
1.26 www 298:
1.27 www 299: &untiehash();
1.26 www 300: } else {
1.7 www 301: # is this a standard course?
302:
303: my $standard=($ENV{'request.course.uri'}=~/^\/uploaded\//);
1.15 www 304: my $forcestandard;
305: my $forcesupplement;
306: my $script='';
307: my $allowed;
308: my $events='';
1.19 www 309: my $showdoc=0;
1.15 www 310: &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
1.21 www 311: ['folder','foldername']);
312: if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
313: $showdoc=$1;
314: }
315: unless ($showdoc) { # got called from remote
1.15 www 316: $forcestandard=($ENV{'form.folder'}=~/^default_/);
317: $forcesupplement=($ENV{'form.folder'}=~/^supplemental_/);
1.7 www 318:
1.4 www 319: # does this user have privileges to post, etc?
1.15 www 320: $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'});
321: if ($allowed) {
322: &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);
323: $script=&Apache::lonratedt::editscript('simple');
324: }
325: } else { # got called in sequence from course
326: $allowed=0;
1.21 www 327: $script='</script>'.&Apache::lonxml::registerurl(1,undef).'<script>';
1.15 www 328: $events='onLoad="'.&Apache::lonxml::loadevents.
329: '" onUnload="'.&Apache::lonxml::unloadevents.'"';
1.3 www 330: }
1.4 www 331:
332: # get course data
333: my $coursenum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
334: my $coursedom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
335:
1.14 www 336: # get personal data
337:
338: my $uname=$ENV{'user.name'};
339: my $udom=$ENV{'user.domain'};
340: my $plainname=&Apache::lonnet::escape(
341: &Apache::loncommon::plainname($uname,$udom));
342:
1.8 www 343: # graphics settings
1.4 www 344:
1.8 www 345: $iconpath = $r->dir_config('lonIconsURL') . "/";
346:
1.22 www 347: my $now=time;
348:
1.4 www 349: # print screen
1.1 www 350: $r->print(<<ENDDOCUMENT);
351: <html>
352: <head>
353: <title>The LearningOnline Network with CAPA</title>
1.16 www 354: <script>
355: $script
1.20 www 356: </script>
1.19 www 357: ENDDOCUMENT
358: if ($allowed) {
359: $r->print(<<ENDNEWSCRIPT);
1.20 www 360: <script>
1.16 www 361: function makenewfolder(targetform,folderseq) {
362: var foldername=prompt('Name of New Folder','New Folder');
363: if (foldername) {
364: targetform.importdetail.value=foldername+"="+folderseq;
365: targetform.submit();
366: }
367: }
368:
1.18 www 369: function makenewext(targetname) {
370: this.document.forms.extimport.useform.value=targetname;
371: window.open('/adm/rat/extpickframe.html');
372: }
373:
1.22 www 374: function makesmppage() {
375: var title=prompt('Listed Title for the Page');
376: this.document.forms.newsmppg.importdetail.value=
377: title+'=/adm/$udom/$uname/$now/smppg';
378: this.document.forms.newsmppg.submit();
379: }
380:
381: function makebulboard() {
382: var title=prompt('Listed Title for the Bulletin Board');
383: this.document.forms.newbul.importdetail.value=
384: title+'=/adm/$udom/$uname/$now/bulletinboard';
385: this.document.forms.newbul.submit();
386: }
387:
1.18 www 388: function finishpick() {
389: var title=this.document.forms.extimport.title.value;
390: var url=this.document.forms.extimport.url.value;
391: var form=this.document.forms.extimport.useform.value;
392: eval
393: ('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+
394: '";this.document.forms.'+form+'.submit();');
1.16 www 395: }
396: </script>
1.19 www 397: ENDNEWSCRIPT
398: }
399: # -------------------------------------------------------------------- Body tag
1.20 www 400: $r->print('</head>'.
401: &Apache::loncommon::bodytag('Course Documents','',$events));
1.19 www 402: unless ($showdoc) {
1.25 www 403: if ($allowed) {
404: $r->print(<<ENDCOURSEVERIFY);
1.26 www 405: <form action="/adm/coursedocs" method="post" name="courseverify">
1.25 www 406: <input type="submit" name="verify" value="Verify Content" />
407: <input type="submit" name="versions" value="Check Resource Versions" />
408: </form>
409: ENDCOURSEVERIFY
410: }
1.17 www 411: # --------------------------------------------------------- Standard documents
1.24 www 412: $r->print('<table>');
1.7 www 413: if (($standard) && ($allowed) && (!$forcesupplement)) {
1.24 www 414: $r->print('<tr><td bgcolor="#FFFFBB"><h2>Main Course Documents</h2>');
1.7 www 415: my $folder=$ENV{'form.folder'};
1.10 www 416: unless ($folder=~/^default/) { $folder='default'; }
1.7 www 417: &editor($r,$coursenum,$coursedom,$folder,$allowed);
1.16 www 418: my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
419: '.sequence';
1.8 www 420: $r->print(<<ENDFORM);
1.16 www 421: <table cellspacing=2><tr>
422: <th bgcolor="#DDDDDD">Upload a new main course document</th>
423: <th bgcolor="#DDDDDD">Import a published document</th>
424: <th bgcolor="#DDDDDD">Special documents</th>
1.11 www 425: </tr>
1.16 www 426: <tr><td bgcolor="#DDDDDD">
1.11 www 427: File:<br />
1.10 www 428: <form action="/adm/coursedocs" method="post" enctype="multipart/form-data">
1.8 www 429: <input type="file" name="uploaddoc" size="50">
430: <br />
1.11 www 431: Title:<br />
432: <input type="text" size="50" name="comment">
1.8 www 433: <input type="hidden" name="folder" value="$folder">
1.17 www 434: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
1.10 www 435: <input type="hidden" name="cmd" value="upload_default">
1.8 www 436: <input type="submit" value="Upload Document">
437: </form>
1.11 www 438: </td>
1.16 www 439: <td bgcolor="#DDDDDD">
1.11 www 440: <form action="/adm/coursedocs" method="post" name="simpleedit">
1.16 www 441: <input type="hidden" name="folder" value="$folder">
1.11 www 442: <input type=hidden name="importdetail" value="">
443: <input type=button onClick=
1.16 www 444: "javascript:groupsearch()" value="Search">
1.11 www 445: <input type=button onClick=
1.16 www 446: "javascript:groupimport();" value="Import">
1.11 www 447: </form>
1.16 www 448: </td><td bgcolor="#DDDDDD">
1.11 www 449: <form action="/adm/coursedocs" method="post" name="newfolder">
1.16 www 450: <input type="hidden" name="folder" value="$folder">
1.17 www 451: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
1.13 www 452: <input type=hidden name="importdetail" value="">
1.16 www 453: <input name="newfolder" type="button"
454: onClick="javascript:makenewfolder(this.form,'$folderseq');"
1.11 www 455: value="New Folder" />
456: </form>
457: <form action="/adm/coursedocs" method="post" name="newext">
1.16 www 458: <input type="hidden" name="folder" value="$folder">
1.17 www 459: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
1.13 www 460: <input type=hidden name="importdetail" value="">
1.18 www 461: <input name="newext" type="button" onClick="javascript:makenewext('newext');"
1.11 www 462: value="External Resource" />
463: </form>
464: <form action="/adm/coursedocs" method="post" name="newsyl">
1.16 www 465: <input type="hidden" name="folder" value="$folder">
1.17 www 466: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
1.14 www 467: <input type=hidden name="importdetail"
468: value="Syllabus=/public/$coursedom/$coursenum/syllabus">
469: <input name="newsyl" type="submit" value="Syllabus" />
1.15 www 470: </form>
1.17 www 471: <form action="/adm/coursedocs" method="post" name="newnav">
1.20 www 472: <input type="hidden" name="folder" value="$folder">
473: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
1.15 www 474: <input type=hidden name="importdetail"
475: value="Navigate Content=/adm/navmaps">
1.20 www 476: <input name="newnav" type="submit" value="Navigate Content" />
1.22 www 477: </form>
478: <form action="/adm/coursedocs" method="post" name="newsmppg">
479: <input type="hidden" name="folder" value="$folder">
480: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
481: <input type=hidden name="importdetail" value="">
482: <input name="newsmppg" type="button" value="Simple Page"
483: onClick="javascript:makesmppage();" />
484: </form>
485: <form action="/adm/coursedocs" method="post" name="newbul">
486: <input type="hidden" name="folder" value="$folder">
487: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
488: <input type=hidden name="importdetail" value="">
489: <input name="newbulletin" type="button" value="Bulletin Board"
490: onClick="javascript:makebulboard();" />
1.12 www 491: </form>
492: <form action="/adm/coursedocs" method="post" name="newaboutme">
1.16 www 493: <input type="hidden" name="folder" value="$folder">
1.17 www 494: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
1.14 www 495: <input type=hidden name="importdetail"
496: value="$plainname=/adm/$udom/$uname/aboutme">
1.16 www 497: <input name="newaboutme" type="submit" value="My Personal Info" />
1.11 www 498: </form>
499: </td></tr>
500: </table>
1.8 www 501: ENDFORM
1.24 www 502: $r->print('</td></tr>');
1.7 www 503: }
504: # ----------------------------------------------------- Supplemental documents
505: if (!$forcestandard) {
1.24 www 506: $r->print(
507: '<tr><td bgcolor="#BBFFFF"><h2>Supplemental Course Documents</h2>');
1.7 www 508: my $folder=$ENV{'form.folder'};
1.10 www 509: unless ($folder=~/supplemental/) { $folder='supplemental'; }
1.7 www 510: &editor($r,$coursenum,$coursedom,$folder,$allowed);
1.8 www 511: if ($allowed) {
1.17 www 512: my $folderseq=
513: '/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time.
514: '.sequence';
515:
1.8 www 516: $r->print(<<ENDSUPFORM);
1.17 www 517: <table cellspacing=2><tr>
518: <th bgcolor="#DDDDDD">Upload a new supplemental course document</th>
519: <th bgcolor="#DDDDDD">Import a published document</th>
520: <th bgcolor="#DDDDDD">Special documents</th>
521: </tr>
522: <tr><td bgcolor="#DDDDDD">
1.10 www 523: <form action="/adm/coursedocs" method="post" enctype="multipart/form-data">
1.4 www 524: <input type="file" name="uploaddoc" size="50">
525: <br />Comment:<br />
526: <textarea cols=50 rows=4 name='comment'>
527: </textarea>
1.8 www 528: <input type="hidden" name="folder" value="$folder">
1.17 www 529: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
1.10 www 530: <input type="hidden" name="cmd" value="upload_supplemental">
1.3 www 531: <input type="submit" value="Upload Document">
532: </form>
1.17 www 533: </td>
534: <td bgcolor="#DDDDDD">
535: <form action="/adm/coursedocs" method="post" name="simpleedit">
536: <input type="hidden" name="folder" value="$folder">
537: <input type=hidden name="importdetail" value="">
538: <input type=button onClick=
539: "javascript:groupsearch()" value="Search">
540: <input type=button onClick=
541: "javascript:groupimport();" value="Import">
542: </form>
543: </td><td bgcolor="#DDDDDD">
1.18 www 544: <form action="/adm/coursedocs" method="post" name="supnewfolder">
1.17 www 545: <input type="hidden" name="folder" value="$folder">
546: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
547: <input type=hidden name="importdetail" value="">
548: <input name="newfolder" type="button"
549: onClick="javascript:makenewfolder(this.form,'$folderseq');"
550: value="New Folder" />
551: </form>
1.18 www 552: <form action="/adm/coursedocs" method="post" name="supnewext">
1.17 www 553: <input type="hidden" name="folder" value="$folder">
554: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
555: <input type=hidden name="importdetail" value="">
1.18 www 556: <input name="newext" type="button"
557: onClick="javascript:makenewext('supnewext');"
1.17 www 558: value="External Resource" />
559: </form>
1.18 www 560: <form action="/adm/coursedocs" method="post" name="supnewsyl">
1.17 www 561: <input type="hidden" name="folder" value="$folder">
562: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
563: <input type=hidden name="importdetail"
564: value="Syllabus=/public/$coursedom/$coursenum/syllabus">
565: <input name="newsyl" type="submit" value="Syllabus" />
566: </form>
1.18 www 567: <form action="/adm/coursedocs" method="post" name="subnewaboutme">
1.17 www 568: <input type="hidden" name="folder" value="$folder">
569: <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
570: <input type=hidden name="importdetail"
571: value="$plainname=/adm/$udom/$uname/aboutme">
572: <input name="newaboutme" type="submit" value="My Personal Info" />
573: </form>
574: </td></tr>
1.24 www 575: </table></td></tr>
1.8 www 576: ENDSUPFORM
577: }
1.7 www 578: }
1.18 www 579: if ($allowed) {
580: $r->print('<form name="extimport"><input type="hidden" name="title"><input type="hidden" name="url"><input type="hidden" name="useform"></form>');
581: }
1.24 www 582: $r->print('</table>');
1.19 www 583: } else {
584: # -------------------------------------------------------- This is showdoc mode
585: $r->print("<h1>Uploaded Document</h1><p>It is recommended that you use an up-to-date virus scanner before handling this file.</p><p><table>".
1.21 www 586: &entryline(0,"Click to download or use your browser's Save Link function",$showdoc).'</table></p>');
1.19 www 587: }
1.26 www 588: }
589: $r->print('</body></html>');
590: return OK;
1.1 www 591: }
592:
593: 1;
594: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>