3 // Manage all uploaded files in a course file area
5 // All the Moodle-specific stuff is in this top section
6 // Configuration and access control occurs here.
7 // Must define: USER, basedir, baseweb, html_header and html_footer
8 // USER is a persistent variable using sessions
10 require("../config.php");
12 require_variable($id);
13 optional_variable($file, "");
14 optional_variable($wdir, "");
15 optional_variable($action, "");
17 if (! $course = get_record("course", "id", $id) ) {
18 error("That's an invalid course id");
21 require_login($course->id
);
23 if (! isteacheredit($course->id
) ) {
24 error("You need to be a teacher with editing privileges");
27 function html_footer() {
29 echo "</td></tr></table></body></html>";
30 print_footer($course);
33 function html_header($course, $wdir, $formfield=""){
37 if (! $site = get_site()) {
38 error("Invalid site!");
41 if ($course->id
== $site->id
) {
42 $strfiles = get_string("sitefiles");
44 $strfiles = get_string("files");
48 $fullnav = "$strfiles";
50 $dirs = explode("/", $wdir);
51 $numdirs = count($dirs);
54 for ($i=1; $i<$numdirs-1; $i++
) {
55 $navigation .= " -> ";
56 $link .= "/".urlencode($dirs[$i]);
57 $navigation .= "<a href=\"index.php?id=$course->id&wdir=$link\">".$dirs[$i]."</a>";
59 $fullnav = "<a href=\"index.php?id=$course->id&wdir=/\">$strfiles</a> $navigation -> ".$dirs[$numdirs-1];
62 if ($course->id
== $site->id
) {
63 print_header("$course->shortname: $strfiles", "$course->fullname",
64 "<a href=\"../$CFG->admin/index.php\">".get_string("administration").
65 "</a> -> $fullnav", $formfield);
67 print_heading(get_string("publicsitefileswarning"), "center", 2);
70 print_header("$course->shortname: $strfiles", "$course->fullname",
71 "<a href=\"../course/view.php?id=$course->id\">$course->shortname".
72 "</a> -> $fullnav", $formfield);
75 echo "<table border=0 align=center cellspacing=3 cellpadding=3 width=640>";
77 echo "<td colspan=\"2\">";
80 if (! $basedir = make_upload_directory("$course->id")) {
81 error("The site administrator needs to fix the file permissions");
84 $baseweb = $CFG->wwwroot
;
86 // End of configuration and access control
88 require("mimetypes.php");
91 if (ereg( $regexp, $file, $regs )|
ereg( $regexp, $wdir,$regs )) {
92 $message = "Error: Directories can not contain \"..\"";
101 if ($wdir == "/backupdata") {
102 if (! make_upload_directory("$course->id/backupdata")) { // Backup folder
103 error("Could not create backupdata folder. The site administrator needs to fix the file permissions");
111 html_header($course, $wdir);
112 if (!empty($_FILES['userfile'])) {
113 $userfile = $_FILES['userfile'];
118 if (!is_uploaded_file($userfile['tmp_name']) or $userfile['size'] == 0) {
119 notify(get_string("uploadnofilefound"));
121 $userfile_name = clean_filename($userfile['name']);
122 if ($userfile_name) {
123 $newfile = "$basedir$wdir/$userfile_name";
124 if (move_uploaded_file($userfile['tmp_name'], $newfile)) {
125 chmod($newfile, 0666);
127 $a->file
= "$userfile_name (".$userfile['type'].")";
128 $a->directory
= $wdir;
129 print_string("uploadedfileto", "", $a);
131 notify(get_string("uploadproblem", "", $userfile_name));
138 $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes
); // Restricted by site setting
139 $filesize = display_size($upload_max_filesize);
141 $struploadafile = get_string("uploadafile");
142 $struploadthisfile = get_string("uploadthisfile");
143 $strmaxsize = get_string("maxsize", "", $filesize);
144 $strcancel = get_string("cancel");
146 echo "<P>$struploadafile ($strmaxsize) --> <B>$wdir</B>";
147 echo "<TABLE><TR><TD COLSPAN=2>";
148 echo "<FORM ENCTYPE=\"multipart/form-data\" METHOD=\"post\" ACTION=index.php>";
149 echo " <INPUT TYPE=hidden NAME=MAX_FILE_SIZE value=\"$upload_max_filesize\">";
150 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
151 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
152 echo " <INPUT TYPE=hidden NAME=action VALUE=upload>";
153 echo " <INPUT NAME=\"userfile\" TYPE=\"file\" size=\"60\">";
154 echo " </TD><TR><TD WIDTH=10>";
155 echo " <INPUT TYPE=submit NAME=save VALUE=\"$struploadthisfile\">";
157 echo "</TD><TD WIDTH=100%>";
158 echo "<FORM ACTION=index.php METHOD=get>";
159 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
160 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
161 echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
162 echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
164 echo "</TD></TR></TABLE>";
170 if (!empty($confirm)) {
171 html_header($course, $wdir);
172 foreach ($USER->filelist
as $file) {
173 $fullfile = $basedir.$file;
174 if (! fulldelete($fullfile)) {
175 echo "<BR>Error: Could not delete: $fullfile";
183 html_header($course, $wdir);
184 if (setfilelist($_POST)) {
185 echo "<p align=center>".get_string("deletecheckwarning").":</p>";
186 print_simple_box_start("center");
187 printfilelist($USER->filelist
);
188 print_simple_box_end();
190 notice_yesno (get_string("deletecheckfiles"),
191 "index.php?id=$id&wdir=$wdir&action=delete&confirm=1",
192 "index.php?id=$id&wdir=$wdir&action=cancel");
201 html_header($course, $wdir);
202 if ($count = setfilelist($_POST)) {
203 $USER->fileop
= $action;
204 $USER->filesource
= $wdir;
205 echo "<p align=center>";
206 print_string("selectednowmove", "moodle", $count);
214 html_header($course, $wdir);
215 if (isset($USER->fileop
) and $USER->fileop
== "move") {
216 foreach ($USER->filelist
as $file) {
217 $shortfile = basename($file);
218 $oldfile = $basedir.$file;
219 $newfile = $basedir.$wdir."/".$shortfile;
220 if (!rename($oldfile, $newfile)) {
221 echo "<P>Error: $shortfile not moved";
232 html_header($course, $wdir);
233 $name = clean_filename($name);
234 if (file_exists($basedir.$wdir."/".$name)) {
235 echo "Error: $name already exists!";
236 } else if (!rename($basedir.$wdir."/".$oldname, $basedir.$wdir."/".$name)) {
237 echo "Error: could not rename $oldname to $name";
242 $strrename = get_string("rename");
243 $strcancel = get_string("cancel");
244 $strrenamefileto = get_string("renamefileto", "moodle", $file);
245 html_header($course, $wdir, "form.name");
246 echo "<P>$strrenamefileto:";
247 echo "<TABLE><TR><TD>";
248 echo "<FORM ACTION=index.php METHOD=post NAME=form>";
249 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
250 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
251 echo " <INPUT TYPE=hidden NAME=action VALUE=rename>";
252 echo " <INPUT TYPE=hidden NAME=oldname VALUE=\"$file\">";
253 echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"$file\">";
254 echo " <INPUT TYPE=submit VALUE=\"$strrename\">";
257 echo "<FORM ACTION=index.php METHOD=get>";
258 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
259 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
260 echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
261 echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
263 echo "</TD></TR></TABLE>";
270 html_header($course, $wdir);
271 $name = clean_filename($name);
272 if (file_exists("$basedir$wdir/$name")) {
273 echo "Error: $name already exists!";
274 } else if (! make_upload_directory("$course->id/$wdir/$name")) {
275 echo "Error: could not create $name";
280 $strcreate = get_string("create");
281 $strcancel = get_string("cancel");
282 $strcreatefolder = get_string("createfolder", "moodle", $wdir);
283 html_header($course, $wdir, "form.name");
284 echo "<P>$strcreatefolder:";
285 echo "<TABLE><TR><TD>";
286 echo "<FORM ACTION=index.php METHOD=post NAME=form>";
287 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
288 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
289 echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir>";
290 echo " <INPUT TYPE=text NAME=name SIZE=35>";
291 echo " <INPUT TYPE=submit VALUE=\"$strcreate\">";
294 echo "<FORM ACTION=index.php METHOD=get>";
295 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
296 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
297 echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
298 echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
300 echo "</TD></TR></TABLE>";
306 html_header($course, $wdir);
308 $fileptr = fopen($basedir.$file,"w");
309 fputs($fileptr, stripslashes($text));
314 $streditfile = get_string("edit", "", "<B>$file</B>");
315 $fileptr = fopen($basedir.$file, "r");
316 $contents = fread($fileptr, filesize($basedir.$file));
319 if (mimeinfo("type", $file) == "text/html") {
320 if ($usehtmleditor = can_use_richtext_editor()) {
321 $onsubmit = "onsubmit=\"copyrichtext(document.form.text);\"";
326 $usehtmleditor = false;
330 print_heading("$streditfile");
332 echo "<TABLE><TR><TD COLSPAN=2>";
333 echo "<FORM ACTION=\"index.php\" METHOD=\"post\" NAME=\"form\" $onsubmit>";
334 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
335 echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
336 echo " <INPUT TYPE=hidden NAME=file VALUE=\"$file\">";
337 echo " <INPUT TYPE=hidden NAME=action VALUE=edit>";
338 print_textarea($usehtmleditor, 25, 80, 680, 400, "text", addslashes($contents));
339 echo "</TD></TR><TR><TD>";
340 echo " <INPUT TYPE=submit VALUE=\"".get_string("savechanges")."\">";
343 echo "<FORM ACTION=index.php METHOD=get>";
344 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
345 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
346 echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
347 echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\">";
349 echo "</TD></TR></TABLE>";
351 if ($usehtmleditor) {
352 print_richedit_javascript("form", "text", "yes");
362 html_header($course, $wdir);
363 $name = clean_filename($name);
364 if (empty($CFG->zip
)) { // Use built-in php-based zip function
366 foreach ($USER->filelist
as $file) {
367 $files[] = "$basedir/$file";
369 include_once('../lib/pclzip/pclzip.lib.php');
370 $archive = new PclZip("$basedir/$wdir/$name");
371 if (($list = $archive->create($files,'',"$basedir/$wdir/")) == 0) {
372 error($archive->errorInfo(true));
374 } else { // Use external zip program
376 foreach ($USER->filelist
as $file) {
377 $files .= basename($file);
380 $command = "cd $basedir/$wdir ; $CFG->zip -r $name $files";
387 html_header($course, $wdir, "form.name");
389 if (setfilelist($_POST)) {
390 echo "<P ALIGN=CENTER>".get_string("youareabouttocreatezip").":</P>";
391 print_simple_box_start("center");
392 printfilelist($USER->filelist
);
393 print_simple_box_end();
395 echo "<P ALIGN=CENTER>".get_string("whattocallzip");
396 echo "<TABLE><TR><TD>";
397 echo "<FORM ACTION=index.php METHOD=post NAME=form>";
398 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
399 echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
400 echo " <INPUT TYPE=hidden NAME=action VALUE=zip>";
401 echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"new.zip\">";
402 echo " <INPUT TYPE=submit VALUE=\"".get_string("createziparchive")."\">";
405 echo "<FORM ACTION=index.php METHOD=get>";
406 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
407 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
408 echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
409 echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\">";
411 echo "</TD></TR></TABLE>";
421 html_header($course, $wdir);
423 $strname = get_string("name");
424 $strsize = get_string("size");
425 $strmodified = get_string("modified");
426 $strstatus = get_string("status");
427 $strok = get_string("ok");
428 $strunpacking = get_string("unpacking", "", $file);
430 echo "<P ALIGN=CENTER>$strunpacking:</P>";
432 $file = basename($file);
434 if (empty($CFG->unzip
)) { // Use built-in php-based unzip function
435 include_once('../lib/pclzip/pclzip.lib.php');
436 $archive = new PclZip("$basedir/$wdir/$file");
437 if (!$list = $archive->extract("$basedir/$wdir")) {
438 error($archive->errorInfo(true));
439 } else { // print some output
440 echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
441 echo "<tr><th align=left>$strname</th>";
442 echo "<th align=right>$strsize</th>";
443 echo "<th align=right>$strmodified</th>";
444 echo "<th align=right>$strstatus</th></tr>";
445 foreach ($list as $item) {
447 $item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']);
448 print_cell("left", $item['filename']);
449 if (! $item['folder']) {
450 print_cell("right", display_size($item['size']));
452 echo "<td> </td>";
454 $filedate = userdate($item['mtime'], get_string("strftimedatetime"));
455 print_cell("right", $filedate);
456 print_cell("right", $item['status']);
462 } else { // Use external unzip program
463 print_simple_box_start("center");
465 $command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
468 print_simple_box_end();
471 echo "<CENTER><FORM ACTION=index.php METHOD=get>";
472 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
473 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
474 echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
475 echo " <INPUT TYPE=submit VALUE=\"$strok\">";
485 html_header($course, $wdir);
487 $strname = get_string("name");
488 $strsize = get_string("size");
489 $strmodified = get_string("modified");
490 $strok = get_string("ok");
491 $strlistfiles = get_string("listfiles", "", $file);
493 echo "<P ALIGN=CENTER>$strlistfiles:</P>";
494 $file = basename($file);
496 include_once('../lib/pclzip/pclzip.lib.php');
497 $archive = new PclZip("$basedir/$wdir/$file");
498 if (!$list = $archive->listContent("$basedir/$wdir")) {
499 notify($archive->errorInfo(true));
502 echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
503 echo "<tr><th align=left>$strname</th><th align=right>$strsize</th><th align=right>$strmodified</th></tr>";
504 foreach ($list as $item) {
506 print_cell("left", $item['filename']);
507 if (! $item['folder']) {
508 print_cell("right", display_size($item['size']));
510 echo "<td> </td>";
512 $filedate = userdate($item['mtime'], get_string("strftimedatetime"));
513 print_cell("right", $filedate);
518 echo "<br><center><form action=index.php method=get>";
519 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
520 echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
521 echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
522 echo " <INPUT TYPE=submit VALUE=\"$strok\">";
532 html_header($course, $wdir);
534 echo "<p align=center>".get_string("youaregoingtorestorefrom").":</p>";
535 print_simple_box_start("center");
537 print_simple_box_end();
539 echo "<p align=center>".get_string("areyousuretorestorethisinfo")."</p>";
540 $restore_path = "../backup/restore.php";
541 notice_yesno (get_string("areyousuretorestorethis"),
542 $restore_path."?id=".$id."&file=".$id.$wdir."/".$file,
543 "index.php?id=$id&wdir=$wdir&action=cancel");
554 html_header($course, $wdir);
561 /// FILE FUNCTIONS ///////////////////////////////////////////////////////////
564 function fulldelete($location) {
565 if (is_dir($location)) {
566 $currdir = opendir($location);
567 while ($file = readdir($currdir)) {
568 if ($file <> ".." && $file <> ".") {
569 $fullfile = $location."/".$file;
570 if (is_dir($fullfile)) {
571 if (!fulldelete($fullfile)) {
575 if (!unlink($fullfile)) {
582 if (! rmdir($location)) {
587 if (!unlink($location)) {
596 function setfilelist($VARS) {
599 $USER->filelist
= array ();
603 foreach ($VARS as $key => $val) {
604 if (substr($key,0,4) == "file") {
606 $USER->filelist
[] = rawurldecode($val);
612 function clearfilelist() {
615 $USER->filelist
= array ();
620 function printfilelist($filelist) {
621 global $CFG, $basedir;
623 foreach ($filelist as $file) {
624 if (is_dir($basedir.$file)) {
625 echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=16 width=16> $file<br>";
626 $subfilelist = array();
627 $currdir = opendir($basedir.$file);
628 while ($subfile = readdir($currdir)) {
629 if ($subfile <> ".." && $subfile <> ".") {
630 $subfilelist[] = $file."/".$subfile;
633 printfilelist($subfilelist);
636 $icon = mimeinfo("icon", $file);
637 echo "<img src=\"$CFG->pixpath/f/$icon\" height=16 width=16> $file<br>";
643 function print_cell($alignment="center", $text=" ") {
644 echo "<TD ALIGN=\"$alignment\" NOWRAP>";
645 echo "<FONT SIZE=\"-1\" FACE=\"Arial, Helvetica\">";
651 function displaydir ($wdir) {
652 // $wdir == / or /a or /a/b/c/d etc
658 $fullpath = $basedir.$wdir;
660 $directory = opendir($fullpath); // Find all files
661 while ($file = readdir($directory)) {
662 if ($file == "." ||
$file == "..") {
666 if (is_dir($fullpath."/".$file)) {
672 closedir($directory);
674 $strname = get_string("name");
675 $strsize = get_string("size");
676 $strmodified = get_string("modified");
677 $straction = get_string("action");
678 $strmakeafolder = get_string("makeafolder");
679 $struploadafile = get_string("uploadafile");
680 $strwithchosenfiles = get_string("withchosenfiles");
681 $strmovetoanotherfolder = get_string("movetoanotherfolder");
682 $strmovefilestohere = get_string("movefilestohere");
683 $strdeletecompletely = get_string("deletecompletely");
684 $strcreateziparchive = get_string("createziparchive");
685 $strrename = get_string("rename");
686 $stredit = get_string("edit");
687 $strunzip = get_string("unzip");
688 $strlist = get_string("list");
689 $strrestore= get_string("restore");
692 echo "<FORM ACTION=\"index.php\" METHOD=post NAME=dirform>";
693 echo "<HR WIDTH=640 ALIGN=CENTER NOSHADE SIZE=1>";
694 echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>";
696 echo "<TH WIDTH=5></TH>";
697 echo "<TH ALIGN=left>$strname</TH>";
698 echo "<TH ALIGN=right>$strsize</TH>";
699 echo "<TH ALIGN=right>$strmodified</TH>";
700 echo "<TH ALIGN=right>$straction</TH>";
709 if (!empty($dirlist)) {
711 foreach ($dirlist as $dir) {
715 $filename = $fullpath."/".$dir;
716 $fileurl = rawurlencode($wdir."/".$dir);
717 $filesafe = rawurlencode($dir);
718 $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
722 print_cell("center", "<INPUT TYPE=checkbox NAME=\"file$count\" VALUE=\"$fileurl\">");
723 print_cell("left", "<A HREF=\"index.php?id=$id&wdir=$fileurl\"><IMG SRC=\"$CFG->pixpath/f/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\"></A> <A HREF=\"index.php?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</A>");
724 print_cell("right", "-");
725 print_cell("right", $filedate);
726 print_cell("right", "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>");
733 if (!empty($filelist)) {
735 foreach ($filelist as $file) {
737 $icon = mimeinfo("icon", $file);
740 $filename = $fullpath."/".$file;
741 $fileurl = "$wdir/$file";
742 $filesafe = rawurlencode($file);
743 $fileurlsafe = rawurlencode($fileurl);
744 $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
748 print_cell("center", "<INPUT TYPE=checkbox NAME=\"file$count\" VALUE=\"$fileurl\">");
749 echo "<td align=left nowrap>";
750 if ($CFG->slasharguments
) {
751 $ffurl = "/file.php/$id$fileurl";
753 $ffurl = "/file.php?file=/$id$fileurl";
755 link_to_popup_window ($ffurl, "display",
756 "<IMG SRC=\"$CFG->pixpath/f/$icon\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"File\">",
758 echo "<font size=\"-1\" face=\"Arial, Helvetica\">";
759 link_to_popup_window ($ffurl, "display",
760 htmlspecialchars($file),
764 $file_size = filesize($filename);
765 print_cell("right", display_size($file_size));
766 print_cell("right", $filedate);
767 if ($icon == "text.gif" ||
$icon == "html.gif") {
768 $edittext = "<a href=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=edit\">$stredit</a>";
769 } else if ($icon == "zip.gif") {
770 $edittext = "<a href=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=unzip\">$strunzip</a> ";
771 $edittext .= "<a href=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</a> ";
772 if (!empty($CFG->backup_version
) and isteacheredit($id)) {
773 $edittext .= "<a href=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=restore\">$strrestore</a> ";
778 print_cell("right", "$edittext <A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>");
784 echo "<hr width=640 align=center noshade size=1>";
790 echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>";
792 echo "<INPUT TYPE=hidden NAME=id VALUE=\"$id\">";
793 echo "<INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\"> ";
795 "move" => "$strmovetoanotherfolder",
796 "delete" => "$strdeletecompletely",
797 "zip" => "$strcreateziparchive"
799 if (!empty($count)) {
800 choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
804 echo "<TD ALIGN=center>";
805 if (!empty($USER->fileop
) and ($USER->fileop
== "move") and ($USER->filesource
<> $wdir)) {
806 echo "<FORM ACTION=index.php METHOD=get>";
807 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
808 echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
809 echo " <INPUT TYPE=hidden NAME=action VALUE=paste>";
810 echo " <INPUT TYPE=submit VALUE=\"$strmovefilestohere\">";
813 echo "<TD ALIGN=right>";
814 echo "<FORM ACTION=index.php METHOD=get>";
815 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
816 echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
817 echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir>";
818 echo " <INPUT TYPE=submit VALUE=\"$strmakeafolder\">";
821 echo "<TD ALIGN=right>";
822 echo "<FORM ACTION=index.php METHOD=get>";
823 echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
824 echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
825 echo " <INPUT TYPE=hidden NAME=action VALUE=upload>";
826 echo " <INPUT TYPE=submit VALUE=\"$struploadafile\">";
830 echo "<HR WIDTH=640 ALIGN=CENTER NOSHADE SIZE=1>";